Path: blob/main/src/resources/formats/pdf/pdfjs/web/viewer.js
12923 views
/**1* @licstart The following is the entire license notice for the2* Javascript code in this page3*4* Copyright 2021 Mozilla Foundation5*6* Licensed under the Apache License, Version 2.0 (the "License");7* you may not use this file except in compliance with the License.8* You may obtain a copy of the License at9*10* http://www.apache.org/licenses/LICENSE-2.011*12* Unless required by applicable law or agreed to in writing, software13* distributed under the License is distributed on an "AS IS" BASIS,14* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.15* See the License for the specific language governing permissions and16* limitations under the License.17*18* @licend The above is the entire license notice for the19* Javascript code in this page20*/2122/******/ (() => { // webpackBootstrap23/******/ "use strict";24/******/ var __webpack_modules__ = ([25/* 0 */,26/* 1 */27/***/ ((__unused_webpack_module, exports, __webpack_require__) => {28293031Object.defineProperty(exports, "__esModule", ({32value: true33}));34exports.OptionKind = exports.AppOptions = void 0;3536var _viewer_compatibility = __webpack_require__(2);3738function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }3940function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }4142function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }4344function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }4546var OptionKind = {47VIEWER: 0x02,48API: 0x04,49WORKER: 0x08,50PREFERENCE: 0x8051};52exports.OptionKind = OptionKind;53var defaultOptions = {54cursorToolOnLoad: {55value: 0,56kind: OptionKind.VIEWER + OptionKind.PREFERENCE57},58defaultUrl: {59value: "compressed.tracemonkey-pldi-09.pdf",60kind: OptionKind.VIEWER61},62defaultZoomValue: {63value: "",64kind: OptionKind.VIEWER + OptionKind.PREFERENCE65},66disableHistory: {67value: false,68kind: OptionKind.VIEWER69},70disablePageLabels: {71value: false,72kind: OptionKind.VIEWER + OptionKind.PREFERENCE73},74enablePermissions: {75value: false,76kind: OptionKind.VIEWER + OptionKind.PREFERENCE77},78enablePrintAutoRotate: {79value: true,80kind: OptionKind.VIEWER + OptionKind.PREFERENCE81},82enableScripting: {83value: true,84kind: OptionKind.VIEWER + OptionKind.PREFERENCE85},86enableWebGL: {87value: false,88kind: OptionKind.VIEWER + OptionKind.PREFERENCE89},90externalLinkRel: {91value: "noopener noreferrer nofollow",92kind: OptionKind.VIEWER93},94externalLinkTarget: {95value: 0,96kind: OptionKind.VIEWER + OptionKind.PREFERENCE97},98historyUpdateUrl: {99value: false,100kind: OptionKind.VIEWER + OptionKind.PREFERENCE101},102ignoreDestinationZoom: {103value: false,104kind: OptionKind.VIEWER + OptionKind.PREFERENCE105},106imageResourcesPath: {107value: "./images/",108kind: OptionKind.VIEWER109},110maxCanvasPixels: {111value: 16777216,112compatibility: _viewer_compatibility.viewerCompatibilityParams.maxCanvasPixels,113kind: OptionKind.VIEWER114},115pdfBugEnabled: {116value: false,117kind: OptionKind.VIEWER + OptionKind.PREFERENCE118},119printResolution: {120value: 150,121kind: OptionKind.VIEWER122},123renderer: {124value: "canvas",125kind: OptionKind.VIEWER + OptionKind.PREFERENCE126},127renderInteractiveForms: {128value: true,129kind: OptionKind.VIEWER + OptionKind.PREFERENCE130},131sidebarViewOnLoad: {132value: -1,133kind: OptionKind.VIEWER + OptionKind.PREFERENCE134},135scrollModeOnLoad: {136value: -1,137kind: OptionKind.VIEWER + OptionKind.PREFERENCE138},139spreadModeOnLoad: {140value: -1,141kind: OptionKind.VIEWER + OptionKind.PREFERENCE142},143textLayerMode: {144value: 1,145kind: OptionKind.VIEWER + OptionKind.PREFERENCE146},147useOnlyCssZoom: {148value: false,149kind: OptionKind.VIEWER + OptionKind.PREFERENCE150},151viewerCssTheme: {152value: 0,153kind: OptionKind.VIEWER + OptionKind.PREFERENCE154},155viewOnLoad: {156value: 0,157kind: OptionKind.VIEWER + OptionKind.PREFERENCE158},159cMapPacked: {160value: true,161kind: OptionKind.API162},163cMapUrl: {164value: "../web/cmaps/",165kind: OptionKind.API166},167disableAutoFetch: {168value: false,169kind: OptionKind.API + OptionKind.PREFERENCE170},171disableFontFace: {172value: false,173kind: OptionKind.API + OptionKind.PREFERENCE174},175disableRange: {176value: false,177kind: OptionKind.API + OptionKind.PREFERENCE178},179disableStream: {180value: false,181kind: OptionKind.API + OptionKind.PREFERENCE182},183docBaseUrl: {184value: "",185kind: OptionKind.API186},187enableXfa: {188value: false,189kind: OptionKind.API190},191fontExtraProperties: {192value: false,193kind: OptionKind.API194},195isEvalSupported: {196value: true,197kind: OptionKind.API198},199maxImageSize: {200value: -1,201kind: OptionKind.API202},203pdfBug: {204value: false,205kind: OptionKind.API206},207verbosity: {208value: 1,209kind: OptionKind.API210},211workerPort: {212value: null,213kind: OptionKind.WORKER214},215workerSrc: {216value: "../build/pdf.worker.js",217kind: OptionKind.WORKER218}219};220{221defaultOptions.disablePreferences = {222value: false,223kind: OptionKind.VIEWER224};225defaultOptions.locale = {226value: typeof navigator !== "undefined" ? navigator.language : "en-US",227kind: OptionKind.VIEWER228};229defaultOptions.sandboxBundleSrc = {230value: "../build/pdf.sandbox.js",231kind: OptionKind.VIEWER232};233}234var userOptions = Object.create(null);235236var AppOptions = /*#__PURE__*/function () {237function AppOptions() {238_classCallCheck(this, AppOptions);239240throw new Error("Cannot initialize AppOptions.");241}242243_createClass(AppOptions, null, [{244key: "get",245value: function get(name) {246var userOption = userOptions[name];247248if (userOption !== undefined) {249return userOption;250}251252var defaultOption = defaultOptions[name];253254if (defaultOption !== undefined) {255var _defaultOption$compat;256257return (_defaultOption$compat = defaultOption.compatibility) !== null && _defaultOption$compat !== void 0 ? _defaultOption$compat : defaultOption.value;258}259260return undefined;261}262}, {263key: "getAll",264value: function getAll() {265var kind = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;266var options = Object.create(null);267268for (var name in defaultOptions) {269var _defaultOption$compat2;270271var defaultOption = defaultOptions[name];272273if (kind) {274if ((kind & defaultOption.kind) === 0) {275continue;276}277278if (kind === OptionKind.PREFERENCE) {279var value = defaultOption.value,280valueType = _typeof(value);281282if (valueType === "boolean" || valueType === "string" || valueType === "number" && Number.isInteger(value)) {283options[name] = value;284continue;285}286287throw new Error("Invalid type for preference: ".concat(name));288}289}290291var userOption = userOptions[name];292options[name] = userOption !== undefined ? userOption : (_defaultOption$compat2 = defaultOption.compatibility) !== null && _defaultOption$compat2 !== void 0 ? _defaultOption$compat2 : defaultOption.value;293}294295return options;296}297}, {298key: "set",299value: function set(name, value) {300userOptions[name] = value;301}302}, {303key: "setAll",304value: function setAll(options) {305for (var name in options) {306userOptions[name] = options[name];307}308}309}, {310key: "remove",311value: function remove(name) {312delete userOptions[name];313}314}]);315316return AppOptions;317}();318319exports.AppOptions = AppOptions;320321/***/ }),322/* 2 */323/***/ ((__unused_webpack_module, exports) => {324325326327Object.defineProperty(exports, "__esModule", ({328value: true329}));330exports.viewerCompatibilityParams = void 0;331var compatibilityParams = Object.create(null);332{333var userAgent = typeof navigator !== "undefined" && navigator.userAgent || "";334var platform = typeof navigator !== "undefined" && navigator.platform || "";335var maxTouchPoints = typeof navigator !== "undefined" && navigator.maxTouchPoints || 1;336var isAndroid = /Android/.test(userAgent);337var isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) || platform === "MacIntel" && maxTouchPoints > 1;338var isIOSChrome = /CriOS/.test(userAgent);339340(function checkOnBlobSupport() {341if (isIOSChrome) {342compatibilityParams.disableCreateObjectURL = true;343}344})();345346(function checkCanvasSizeLimitation() {347if (isIOS || isAndroid) {348compatibilityParams.maxCanvasPixels = 5242880;349}350})();351}352var viewerCompatibilityParams = Object.freeze(compatibilityParams);353exports.viewerCompatibilityParams = viewerCompatibilityParams;354355/***/ }),356/* 3 */357/***/ ((__unused_webpack_module, exports, __webpack_require__) => {358359360361Object.defineProperty(exports, "__esModule", ({362value: true363}));364exports.PDFViewerApplication = exports.PDFPrintServiceFactory = exports.DefaultExternalServices = void 0;365366var _regenerator = _interopRequireDefault(__webpack_require__(4));367368var _ui_utils = __webpack_require__(6);369370var _app_options = __webpack_require__(1);371372var _pdfjsLib = __webpack_require__(7);373374var _pdf_cursor_tools = __webpack_require__(8);375376var _pdf_rendering_queue = __webpack_require__(10);377378var _overlay_manager = __webpack_require__(11);379380var _password_prompt = __webpack_require__(12);381382var _pdf_attachment_viewer = __webpack_require__(13);383384var _pdf_document_properties = __webpack_require__(15);385386var _pdf_find_bar = __webpack_require__(16);387388var _pdf_find_controller = __webpack_require__(17);389390var _pdf_history = __webpack_require__(19);391392var _pdf_layer_viewer = __webpack_require__(20);393394var _pdf_link_service = __webpack_require__(21);395396var _pdf_outline_viewer = __webpack_require__(22);397398var _pdf_presentation_mode = __webpack_require__(23);399400var _pdf_scripting_manager = __webpack_require__(24);401402var _pdf_sidebar = __webpack_require__(25);403404var _pdf_sidebar_resizer = __webpack_require__(26);405406var _pdf_thumbnail_viewer = __webpack_require__(27);407408var _pdf_viewer = __webpack_require__(29);409410var _secondary_toolbar = __webpack_require__(36);411412var _toolbar = __webpack_require__(38);413414var _viewer_compatibility = __webpack_require__(2);415416var _view_history = __webpack_require__(39);417418function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }419420function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }421422function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }423424function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }425426function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }427428function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }429430function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }431432function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }433434function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }435436function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }437438function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }439440function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }441442function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }443444function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }445446function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }447448function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }449450var DEFAULT_SCALE_DELTA = 1.1;451var DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT = 5000;452var FORCE_PAGES_LOADED_TIMEOUT = 10000;453var WHEEL_ZOOM_DISABLED_TIMEOUT = 1000;454var ENABLE_PERMISSIONS_CLASS = "enablePermissions";455var ViewOnLoad = {456UNKNOWN: -1,457PREVIOUS: 0,458INITIAL: 1459};460var ViewerCssTheme = {461AUTOMATIC: 0,462LIGHT: 1,463DARK: 2464};465var KNOWN_VERSIONS = ["1.0", "1.1", "1.2", "1.3", "1.4", "1.5", "1.6", "1.7", "1.8", "1.9", "2.0", "2.1", "2.2", "2.3"];466var KNOWN_GENERATORS = ["acrobat distiller", "acrobat pdfwriter", "adobe livecycle", "adobe pdf library", "adobe photoshop", "ghostscript", "tcpdf", "cairo", "dvipdfm", "dvips", "pdftex", "pdfkit", "itext", "prince", "quarkxpress", "mac os x", "microsoft", "openoffice", "oracle", "luradocument", "pdf-xchange", "antenna house", "aspose.cells", "fpdf"];467468var DefaultExternalServices = /*#__PURE__*/function () {469function DefaultExternalServices() {470_classCallCheck(this, DefaultExternalServices);471472throw new Error("Cannot initialize DefaultExternalServices.");473}474475_createClass(DefaultExternalServices, null, [{476key: "updateFindControlState",477value: function updateFindControlState(data) {}478}, {479key: "updateFindMatchesCount",480value: function updateFindMatchesCount(data) {}481}, {482key: "initPassiveLoading",483value: function initPassiveLoading(callbacks) {}484}, {485key: "fallback",486value: function () {487var _fallback = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee(data) {488return _regenerator["default"].wrap(function _callee$(_context) {489while (1) {490switch (_context.prev = _context.next) {491case 0:492case "end":493return _context.stop();494}495}496}, _callee);497}));498499function fallback(_x) {500return _fallback.apply(this, arguments);501}502503return fallback;504}()505}, {506key: "reportTelemetry",507value: function reportTelemetry(data) {}508}, {509key: "createDownloadManager",510value: function createDownloadManager(options) {511throw new Error("Not implemented: createDownloadManager");512}513}, {514key: "createPreferences",515value: function createPreferences() {516throw new Error("Not implemented: createPreferences");517}518}, {519key: "createL10n",520value: function createL10n(options) {521throw new Error("Not implemented: createL10n");522}523}, {524key: "createScripting",525value: function createScripting(options) {526throw new Error("Not implemented: createScripting");527}528}, {529key: "supportsIntegratedFind",530get: function get() {531return (0, _pdfjsLib.shadow)(this, "supportsIntegratedFind", false);532}533}, {534key: "supportsDocumentFonts",535get: function get() {536return (0, _pdfjsLib.shadow)(this, "supportsDocumentFonts", true);537}538}, {539key: "supportedMouseWheelZoomModifierKeys",540get: function get() {541return (0, _pdfjsLib.shadow)(this, "supportedMouseWheelZoomModifierKeys", {542ctrlKey: true,543metaKey: true544});545}546}, {547key: "isInAutomation",548get: function get() {549return (0, _pdfjsLib.shadow)(this, "isInAutomation", false);550}551}]);552553return DefaultExternalServices;554}();555556exports.DefaultExternalServices = DefaultExternalServices;557var PDFViewerApplication = {558initialBookmark: document.location.hash.substring(1),559_initializedCapability: (0, _pdfjsLib.createPromiseCapability)(),560fellback: false,561appConfig: null,562pdfDocument: null,563pdfLoadingTask: null,564printService: null,565pdfViewer: null,566pdfThumbnailViewer: null,567pdfRenderingQueue: null,568pdfPresentationMode: null,569pdfDocumentProperties: null,570pdfLinkService: null,571pdfHistory: null,572pdfSidebar: null,573pdfSidebarResizer: null,574pdfOutlineViewer: null,575pdfAttachmentViewer: null,576pdfLayerViewer: null,577pdfCursorTools: null,578pdfScriptingManager: null,579store: null,580downloadManager: null,581overlayManager: null,582preferences: null,583toolbar: null,584secondaryToolbar: null,585eventBus: null,586l10n: null,587isInitialViewSet: false,588downloadComplete: false,589isViewerEmbedded: window.parent !== window,590url: "",591baseUrl: "",592externalServices: DefaultExternalServices,593_boundEvents: Object.create(null),594documentInfo: null,595metadata: null,596_contentDispositionFilename: null,597_contentLength: null,598triggerDelayedFallback: null,599_saveInProgress: false,600_wheelUnusedTicks: 0,601_idleCallbacks: new Set(),602initialize: function initialize(appConfig) {603var _this = this;604605return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {606var appContainer;607return _regenerator["default"].wrap(function _callee2$(_context2) {608while (1) {609switch (_context2.prev = _context2.next) {610case 0:611_this.preferences = _this.externalServices.createPreferences();612_this.appConfig = appConfig;613_context2.next = 4;614return _this._readPreferences();615616case 4:617_context2.next = 6;618return _this._parseHashParameters();619620case 6:621_this._forceCssTheme();622623_context2.next = 9;624return _this._initializeL10n();625626case 9:627if (_this.isViewerEmbedded && _app_options.AppOptions.get("externalLinkTarget") === _pdfjsLib.LinkTarget.NONE) {628_app_options.AppOptions.set("externalLinkTarget", _pdfjsLib.LinkTarget.TOP);629}630631_context2.next = 12;632return _this._initializeViewerComponents();633634case 12:635_this.bindEvents();636637_this.bindWindowEvents();638639appContainer = appConfig.appContainer || document.documentElement;640641_this.l10n.translate(appContainer).then(function () {642_this.eventBus.dispatch("localized", {643source: _this644});645});646647_this._initializedCapability.resolve();648649case 17:650case "end":651return _context2.stop();652}653}654}, _callee2);655}))();656},657_readPreferences: function _readPreferences() {658var _this2 = this;659660return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {661return _regenerator["default"].wrap(function _callee3$(_context3) {662while (1) {663switch (_context3.prev = _context3.next) {664case 0:665if (!_app_options.AppOptions.get("disablePreferences")) {666_context3.next = 2;667break;668}669670return _context3.abrupt("return");671672case 2:673_context3.prev = 2;674_context3.t0 = _app_options.AppOptions;675_context3.next = 6;676return _this2.preferences.getAll();677678case 6:679_context3.t1 = _context3.sent;680681_context3.t0.setAll.call(_context3.t0, _context3.t1);682683_context3.next = 13;684break;685686case 10:687_context3.prev = 10;688_context3.t2 = _context3["catch"](2);689console.error("_readPreferences: \"".concat(_context3.t2 === null || _context3.t2 === void 0 ? void 0 : _context3.t2.message, "\"."));690691case 13:692case "end":693return _context3.stop();694}695}696}, _callee3, null, [[2, 10]]);697}))();698},699_parseHashParameters: function _parseHashParameters() {700var _this3 = this;701702return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {703var hash, hashParams, waitOn, viewer, enabled;704return _regenerator["default"].wrap(function _callee4$(_context4) {705while (1) {706switch (_context4.prev = _context4.next) {707case 0:708if (_app_options.AppOptions.get("pdfBugEnabled")) {709_context4.next = 2;710break;711}712713return _context4.abrupt("return", undefined);714715case 2:716hash = document.location.hash.substring(1);717718if (hash) {719_context4.next = 5;720break;721}722723return _context4.abrupt("return", undefined);724725case 5:726hashParams = (0, _ui_utils.parseQueryString)(hash), waitOn = [];727728if ("disableworker" in hashParams && hashParams.disableworker === "true") {729waitOn.push(loadFakeWorker());730}731732if ("disablerange" in hashParams) {733_app_options.AppOptions.set("disableRange", hashParams.disablerange === "true");734}735736if ("disablestream" in hashParams) {737_app_options.AppOptions.set("disableStream", hashParams.disablestream === "true");738}739740if ("disableautofetch" in hashParams) {741_app_options.AppOptions.set("disableAutoFetch", hashParams.disableautofetch === "true");742}743744if ("disablefontface" in hashParams) {745_app_options.AppOptions.set("disableFontFace", hashParams.disablefontface === "true");746}747748if ("disablehistory" in hashParams) {749_app_options.AppOptions.set("disableHistory", hashParams.disablehistory === "true");750}751752if ("webgl" in hashParams) {753_app_options.AppOptions.set("enableWebGL", hashParams.webgl === "true");754}755756if ("verbosity" in hashParams) {757_app_options.AppOptions.set("verbosity", hashParams.verbosity | 0);758}759760if (!("textlayer" in hashParams)) {761_context4.next = 23;762break;763}764765_context4.t0 = hashParams.textlayer;766_context4.next = _context4.t0 === "off" ? 18 : _context4.t0 === "visible" ? 20 : _context4.t0 === "shadow" ? 20 : _context4.t0 === "hover" ? 20 : 23;767break;768769case 18:770_app_options.AppOptions.set("textLayerMode", _ui_utils.TextLayerMode.DISABLE);771772return _context4.abrupt("break", 23);773774case 20:775viewer = _this3.appConfig.viewerContainer;776viewer.classList.add("textLayer-" + hashParams.textlayer);777return _context4.abrupt("break", 23);778779case 23:780if ("pdfbug" in hashParams) {781_app_options.AppOptions.set("pdfBug", true);782783_app_options.AppOptions.set("fontExtraProperties", true);784785enabled = hashParams.pdfbug.split(",");786waitOn.push(loadAndEnablePDFBug(enabled));787}788789if ("locale" in hashParams) {790_app_options.AppOptions.set("locale", hashParams.locale);791}792793if (!(waitOn.length === 0)) {794_context4.next = 27;795break;796}797798return _context4.abrupt("return", undefined);799800case 27:801return _context4.abrupt("return", Promise.all(waitOn)["catch"](function (reason) {802console.error("_parseHashParameters: \"".concat(reason.message, "\"."));803}));804805case 28:806case "end":807return _context4.stop();808}809}810}, _callee4);811}))();812},813_initializeL10n: function _initializeL10n() {814var _this4 = this;815816return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee5() {817var dir;818return _regenerator["default"].wrap(function _callee5$(_context5) {819while (1) {820switch (_context5.prev = _context5.next) {821case 0:822_this4.l10n = _this4.externalServices.createL10n({823locale: _app_options.AppOptions.get("locale")824});825_context5.next = 3;826return _this4.l10n.getDirection();827828case 3:829dir = _context5.sent;830document.getElementsByTagName("html")[0].dir = dir;831832case 5:833case "end":834return _context5.stop();835}836}837}, _callee5);838}))();839},840_forceCssTheme: function _forceCssTheme() {841var cssTheme = _app_options.AppOptions.get("viewerCssTheme");842843if (cssTheme === ViewerCssTheme.AUTOMATIC || !Object.values(ViewerCssTheme).includes(cssTheme)) {844return;845}846847try {848var styleSheet = document.styleSheets[0];849var cssRules = (styleSheet === null || styleSheet === void 0 ? void 0 : styleSheet.cssRules) || [];850851for (var i = 0, ii = cssRules.length; i < ii; i++) {852var _rule$media;853854var rule = cssRules[i];855856if (rule instanceof CSSMediaRule && ((_rule$media = rule.media) === null || _rule$media === void 0 ? void 0 : _rule$media[0]) === "(prefers-color-scheme: dark)") {857if (cssTheme === ViewerCssTheme.LIGHT) {858styleSheet.deleteRule(i);859return;860}861862var darkRules = /^@media \(prefers-color-scheme: dark\) {\n\s*([\w\s-.,:;/\\{}()]+)\n}$/.exec(rule.cssText);863864if (darkRules !== null && darkRules !== void 0 && darkRules[1]) {865styleSheet.deleteRule(i);866styleSheet.insertRule(darkRules[1], i);867}868869return;870}871}872} catch (reason) {873console.error("_forceCssTheme: \"".concat(reason === null || reason === void 0 ? void 0 : reason.message, "\"."));874}875},876_initializeViewerComponents: function _initializeViewerComponents() {877var _this5 = this;878879return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {880var appConfig, eventBus, pdfRenderingQueue, pdfLinkService, downloadManager, findController, pdfScriptingManager, container, viewer;881return _regenerator["default"].wrap(function _callee6$(_context6) {882while (1) {883switch (_context6.prev = _context6.next) {884case 0:885appConfig = _this5.appConfig;886eventBus = appConfig.eventBus || new _ui_utils.EventBus({887isInAutomation: _this5.externalServices.isInAutomation888});889_this5.eventBus = eventBus;890_this5.overlayManager = new _overlay_manager.OverlayManager();891pdfRenderingQueue = new _pdf_rendering_queue.PDFRenderingQueue();892pdfRenderingQueue.onIdle = _this5._cleanup.bind(_this5);893_this5.pdfRenderingQueue = pdfRenderingQueue;894pdfLinkService = new _pdf_link_service.PDFLinkService({895eventBus: eventBus,896externalLinkTarget: _app_options.AppOptions.get("externalLinkTarget"),897externalLinkRel: _app_options.AppOptions.get("externalLinkRel"),898ignoreDestinationZoom: _app_options.AppOptions.get("ignoreDestinationZoom")899});900_this5.pdfLinkService = pdfLinkService;901downloadManager = _this5.externalServices.createDownloadManager();902_this5.downloadManager = downloadManager;903findController = new _pdf_find_controller.PDFFindController({904linkService: pdfLinkService,905eventBus: eventBus906});907_this5.findController = findController;908pdfScriptingManager = new _pdf_scripting_manager.PDFScriptingManager({909eventBus: eventBus,910sandboxBundleSrc: _app_options.AppOptions.get("sandboxBundleSrc"),911scriptingFactory: _this5.externalServices,912docPropertiesLookup: _this5._scriptingDocProperties.bind(_this5)913});914_this5.pdfScriptingManager = pdfScriptingManager;915container = appConfig.mainContainer;916viewer = appConfig.viewerContainer;917_this5.pdfViewer = new _pdf_viewer.PDFViewer({918container: container,919viewer: viewer,920eventBus: eventBus,921renderingQueue: pdfRenderingQueue,922linkService: pdfLinkService,923downloadManager: downloadManager,924findController: findController,925scriptingManager: pdfScriptingManager,926renderer: _app_options.AppOptions.get("renderer"),927enableWebGL: _app_options.AppOptions.get("enableWebGL"),928l10n: _this5.l10n,929textLayerMode: _app_options.AppOptions.get("textLayerMode"),930imageResourcesPath: _app_options.AppOptions.get("imageResourcesPath"),931renderInteractiveForms: _app_options.AppOptions.get("renderInteractiveForms"),932enablePrintAutoRotate: _app_options.AppOptions.get("enablePrintAutoRotate"),933useOnlyCssZoom: _app_options.AppOptions.get("useOnlyCssZoom"),934maxCanvasPixels: _app_options.AppOptions.get("maxCanvasPixels"),935enableScripting: _app_options.AppOptions.get("enableScripting")936});937pdfRenderingQueue.setViewer(_this5.pdfViewer);938pdfLinkService.setViewer(_this5.pdfViewer);939pdfScriptingManager.setViewer(_this5.pdfViewer);940_this5.pdfThumbnailViewer = new _pdf_thumbnail_viewer.PDFThumbnailViewer({941container: appConfig.sidebar.thumbnailView,942eventBus: eventBus,943renderingQueue: pdfRenderingQueue,944linkService: pdfLinkService,945l10n: _this5.l10n946});947pdfRenderingQueue.setThumbnailViewer(_this5.pdfThumbnailViewer);948_this5.pdfHistory = new _pdf_history.PDFHistory({949linkService: pdfLinkService,950eventBus: eventBus951});952pdfLinkService.setHistory(_this5.pdfHistory);953954if (!_this5.supportsIntegratedFind) {955_this5.findBar = new _pdf_find_bar.PDFFindBar(appConfig.findBar, eventBus, _this5.l10n);956}957958_this5.pdfDocumentProperties = new _pdf_document_properties.PDFDocumentProperties(appConfig.documentProperties, _this5.overlayManager, eventBus, _this5.l10n);959_this5.pdfCursorTools = new _pdf_cursor_tools.PDFCursorTools({960container: container,961eventBus: eventBus,962cursorToolOnLoad: _app_options.AppOptions.get("cursorToolOnLoad")963});964_this5.toolbar = new _toolbar.Toolbar(appConfig.toolbar, eventBus, _this5.l10n);965_this5.secondaryToolbar = new _secondary_toolbar.SecondaryToolbar(appConfig.secondaryToolbar, container, eventBus);966967if (_this5.supportsFullscreen) {968_this5.pdfPresentationMode = new _pdf_presentation_mode.PDFPresentationMode({969container: container,970pdfViewer: _this5.pdfViewer,971eventBus: eventBus972});973}974975_this5.passwordPrompt = new _password_prompt.PasswordPrompt(appConfig.passwordOverlay, _this5.overlayManager, _this5.l10n, _this5.isViewerEmbedded);976_this5.pdfOutlineViewer = new _pdf_outline_viewer.PDFOutlineViewer({977container: appConfig.sidebar.outlineView,978eventBus: eventBus,979linkService: pdfLinkService980});981_this5.pdfAttachmentViewer = new _pdf_attachment_viewer.PDFAttachmentViewer({982container: appConfig.sidebar.attachmentsView,983eventBus: eventBus,984downloadManager: downloadManager985});986_this5.pdfLayerViewer = new _pdf_layer_viewer.PDFLayerViewer({987container: appConfig.sidebar.layersView,988eventBus: eventBus,989l10n: _this5.l10n990});991_this5.pdfSidebar = new _pdf_sidebar.PDFSidebar({992elements: appConfig.sidebar,993pdfViewer: _this5.pdfViewer,994pdfThumbnailViewer: _this5.pdfThumbnailViewer,995eventBus: eventBus,996l10n: _this5.l10n997});998_this5.pdfSidebar.onToggled = _this5.forceRendering.bind(_this5);999_this5.pdfSidebarResizer = new _pdf_sidebar_resizer.PDFSidebarResizer(appConfig.sidebarResizer, eventBus, _this5.l10n);10001001case 38:1002case "end":1003return _context6.stop();1004}1005}1006}, _callee6);1007}))();1008},1009run: function run(config) {1010this.initialize(config).then(webViewerInitialized);1011},10121013get initialized() {1014return this._initializedCapability.settled;1015},10161017get initializedPromise() {1018return this._initializedCapability.promise;1019},10201021zoomIn: function zoomIn(ticks) {1022if (this.pdfViewer.isInPresentationMode) {1023return;1024}10251026var newScale = this.pdfViewer.currentScale;10271028do {1029newScale = (newScale * DEFAULT_SCALE_DELTA).toFixed(2);1030newScale = Math.ceil(newScale * 10) / 10;1031newScale = Math.min(_ui_utils.MAX_SCALE, newScale);1032} while (--ticks > 0 && newScale < _ui_utils.MAX_SCALE);10331034this.pdfViewer.currentScaleValue = newScale;1035},1036zoomOut: function zoomOut(ticks) {1037if (this.pdfViewer.isInPresentationMode) {1038return;1039}10401041var newScale = this.pdfViewer.currentScale;10421043do {1044newScale = (newScale / DEFAULT_SCALE_DELTA).toFixed(2);1045newScale = Math.floor(newScale * 10) / 10;1046newScale = Math.max(_ui_utils.MIN_SCALE, newScale);1047} while (--ticks > 0 && newScale > _ui_utils.MIN_SCALE);10481049this.pdfViewer.currentScaleValue = newScale;1050},1051zoomReset: function zoomReset() {1052if (this.pdfViewer.isInPresentationMode) {1053return;1054}10551056this.pdfViewer.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE;1057},10581059get pagesCount() {1060return this.pdfDocument ? this.pdfDocument.numPages : 0;1061},10621063get page() {1064return this.pdfViewer.currentPageNumber;1065},10661067set page(val) {1068this.pdfViewer.currentPageNumber = val;1069},10701071get supportsPrinting() {1072return PDFPrintServiceFactory.instance.supportsPrinting;1073},10741075get supportsFullscreen() {1076var doc = document.documentElement;1077var support = !!(doc.requestFullscreen || doc.mozRequestFullScreen || doc.webkitRequestFullScreen);10781079if (document.fullscreenEnabled === false || document.mozFullScreenEnabled === false || document.webkitFullscreenEnabled === false) {1080support = false;1081}10821083return (0, _pdfjsLib.shadow)(this, "supportsFullscreen", support);1084},10851086get supportsIntegratedFind() {1087return this.externalServices.supportsIntegratedFind;1088},10891090get supportsDocumentFonts() {1091return this.externalServices.supportsDocumentFonts;1092},10931094get loadingBar() {1095var bar = new _ui_utils.ProgressBar("#loadingBar");1096return (0, _pdfjsLib.shadow)(this, "loadingBar", bar);1097},10981099get supportedMouseWheelZoomModifierKeys() {1100return this.externalServices.supportedMouseWheelZoomModifierKeys;1101},11021103initPassiveLoading: function initPassiveLoading() {1104throw new Error("Not implemented: initPassiveLoading");1105},1106setTitleUsingUrl: function setTitleUsingUrl() {1107var url = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "";1108this.url = url;1109this.baseUrl = url.split("#")[0];1110var title = (0, _pdfjsLib.getPdfFilenameFromUrl)(url, "");11111112if (!title) {1113try {1114title = decodeURIComponent((0, _pdfjsLib.getFilenameFromUrl)(url)) || url;1115} catch (ex) {1116title = url;1117}1118}11191120this.setTitle(title);1121},1122setTitle: function setTitle(title) {1123if (this.isViewerEmbedded) {1124return;1125}11261127document.title = title;1128},11291130get _docFilename() {1131return this._contentDispositionFilename || (0, _pdfjsLib.getPdfFilenameFromUrl)(this.url);1132},11331134_cancelIdleCallbacks: function _cancelIdleCallbacks() {1135if (!this._idleCallbacks.size) {1136return;1137}11381139var _iterator = _createForOfIteratorHelper(this._idleCallbacks),1140_step;11411142try {1143for (_iterator.s(); !(_step = _iterator.n()).done;) {1144var callback = _step.value;1145window.cancelIdleCallback(callback);1146}1147} catch (err) {1148_iterator.e(err);1149} finally {1150_iterator.f();1151}11521153this._idleCallbacks.clear();1154},1155close: function close() {1156var _this6 = this;11571158return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee7() {1159var _this6$pdfDocument;11601161var container, promises;1162return _regenerator["default"].wrap(function _callee7$(_context7) {1163while (1) {1164switch (_context7.prev = _context7.next) {1165case 0:1166_this6._unblockDocumentLoadEvent();11671168container = _this6.appConfig.errorWrapper.container;1169container.hidden = true;11701171if (_this6.pdfLoadingTask) {1172_context7.next = 5;1173break;1174}11751176return _context7.abrupt("return");11771178case 5:1179if (!(((_this6$pdfDocument = _this6.pdfDocument) === null || _this6$pdfDocument === void 0 ? void 0 : _this6$pdfDocument.annotationStorage.size) > 0 && _this6._annotationStorageModified)) {1180_context7.next = 13;1181break;1182}11831184_context7.prev = 6;1185_context7.next = 9;1186return _this6.save({1187sourceEventType: "save"1188});11891190case 9:1191_context7.next = 13;1192break;11931194case 11:1195_context7.prev = 11;1196_context7.t0 = _context7["catch"](6);11971198case 13:1199promises = [];1200promises.push(_this6.pdfLoadingTask.destroy());1201_this6.pdfLoadingTask = null;12021203if (_this6.pdfDocument) {1204_this6.pdfDocument = null;12051206_this6.pdfThumbnailViewer.setDocument(null);12071208_this6.pdfViewer.setDocument(null);12091210_this6.pdfLinkService.setDocument(null);12111212_this6.pdfDocumentProperties.setDocument(null);1213}12141215webViewerResetPermissions();1216_this6.store = null;1217_this6.isInitialViewSet = false;1218_this6.downloadComplete = false;1219_this6.url = "";1220_this6.baseUrl = "";1221_this6.documentInfo = null;1222_this6.metadata = null;1223_this6._contentDispositionFilename = null;1224_this6._contentLength = null;1225_this6.triggerDelayedFallback = null;1226_this6._saveInProgress = false;12271228_this6._cancelIdleCallbacks();12291230promises.push(_this6.pdfScriptingManager.destroyPromise);12311232_this6.pdfSidebar.reset();12331234_this6.pdfOutlineViewer.reset();12351236_this6.pdfAttachmentViewer.reset();12371238_this6.pdfLayerViewer.reset();12391240if (_this6.pdfHistory) {1241_this6.pdfHistory.reset();1242}12431244if (_this6.findBar) {1245_this6.findBar.reset();1246}12471248_this6.toolbar.reset();12491250_this6.secondaryToolbar.reset();12511252if (typeof PDFBug !== "undefined") {1253PDFBug.cleanup();1254}12551256_context7.next = 42;1257return Promise.all(promises);12581259case 42:1260case "end":1261return _context7.stop();1262}1263}1264}, _callee7, null, [[6, 11]]);1265}))();1266},1267open: function open(file, args) {1268var _this7 = this;12691270return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {1271var workerParameters, key, parameters, apiParameters, _key, value, _key2, loadingTask;12721273return _regenerator["default"].wrap(function _callee8$(_context8) {1274while (1) {1275switch (_context8.prev = _context8.next) {1276case 0:1277if (!_this7.pdfLoadingTask) {1278_context8.next = 3;1279break;1280}12811282_context8.next = 3;1283return _this7.close();12841285case 3:1286workerParameters = _app_options.AppOptions.getAll(_app_options.OptionKind.WORKER);12871288for (key in workerParameters) {1289_pdfjsLib.GlobalWorkerOptions[key] = workerParameters[key];1290}12911292parameters = Object.create(null);12931294if (typeof file === "string") {1295_this7.setTitleUsingUrl(file);12961297parameters.url = file;1298} else if (file && "byteLength" in file) {1299parameters.data = file;1300} else if (file.url && file.originalUrl) {1301_this7.setTitleUsingUrl(file.originalUrl);13021303parameters.url = file.url;1304}13051306apiParameters = _app_options.AppOptions.getAll(_app_options.OptionKind.API);13071308for (_key in apiParameters) {1309value = apiParameters[_key];13101311if (_key === "docBaseUrl" && !value) {}13121313parameters[_key] = value;1314}13151316if (args) {1317for (_key2 in args) {1318parameters[_key2] = args[_key2];1319}1320}13211322loadingTask = (0, _pdfjsLib.getDocument)(parameters);1323_this7.pdfLoadingTask = loadingTask;13241325loadingTask.onPassword = function (updateCallback, reason) {1326_this7.pdfLinkService.externalLinkEnabled = false;13271328_this7.passwordPrompt.setUpdateCallback(updateCallback, reason);13291330_this7.passwordPrompt.open();1331};13321333loadingTask.onProgress = function (_ref) {1334var loaded = _ref.loaded,1335total = _ref.total;13361337_this7.progress(loaded / total);1338};13391340loadingTask.onUnsupportedFeature = _this7.fallback.bind(_this7);1341return _context8.abrupt("return", loadingTask.promise.then(function (pdfDocument) {1342_this7.load(pdfDocument);1343}, function (exception) {1344if (loadingTask !== _this7.pdfLoadingTask) {1345return undefined;1346}13471348var key = "loading_error";13491350if (exception instanceof _pdfjsLib.InvalidPDFException) {1351key = "invalid_file_error";1352} else if (exception instanceof _pdfjsLib.MissingPDFException) {1353key = "missing_file_error";1354} else if (exception instanceof _pdfjsLib.UnexpectedResponseException) {1355key = "unexpected_response_error";1356}13571358return _this7.l10n.get(key).then(function (msg) {1359_this7._documentError(msg, {1360message: exception === null || exception === void 0 ? void 0 : exception.message1361});13621363throw exception;1364});1365}));13661367case 16:1368case "end":1369return _context8.stop();1370}1371}1372}, _callee8);1373}))();1374},1375_ensureDownloadComplete: function _ensureDownloadComplete() {1376if (this.pdfDocument && this.downloadComplete) {1377return;1378}13791380throw new Error("PDF document not downloaded.");1381},1382download: function download() {1383var _arguments = arguments,1384_this8 = this;13851386return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee9() {1387var _ref2, _ref2$sourceEventType, sourceEventType, url, filename, data, blob;13881389return _regenerator["default"].wrap(function _callee9$(_context9) {1390while (1) {1391switch (_context9.prev = _context9.next) {1392case 0:1393_ref2 = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : {}, _ref2$sourceEventType = _ref2.sourceEventType, sourceEventType = _ref2$sourceEventType === void 0 ? "download" : _ref2$sourceEventType;1394url = _this8.baseUrl, filename = _this8._docFilename;1395_context9.prev = 2;13961397_this8._ensureDownloadComplete();13981399_context9.next = 6;1400return _this8.pdfDocument.getData();14011402case 6:1403data = _context9.sent;1404blob = new Blob([data], {1405type: "application/pdf"1406});1407_context9.next = 10;1408return _this8.downloadManager.download(blob, url, filename, sourceEventType);14091410case 10:1411_context9.next = 16;1412break;14131414case 12:1415_context9.prev = 12;1416_context9.t0 = _context9["catch"](2);1417_context9.next = 16;1418return _this8.downloadManager.downloadUrl(url, filename);14191420case 16:1421case "end":1422return _context9.stop();1423}1424}1425}, _callee9, null, [[2, 12]]);1426}))();1427},1428save: function save() {1429var _arguments2 = arguments,1430_this9 = this;14311432return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee10() {1433var _ref3, _ref3$sourceEventType, sourceEventType, url, filename, data, blob;14341435return _regenerator["default"].wrap(function _callee10$(_context10) {1436while (1) {1437switch (_context10.prev = _context10.next) {1438case 0:1439_ref3 = _arguments2.length > 0 && _arguments2[0] !== undefined ? _arguments2[0] : {}, _ref3$sourceEventType = _ref3.sourceEventType, sourceEventType = _ref3$sourceEventType === void 0 ? "download" : _ref3$sourceEventType;14401441if (!_this9._saveInProgress) {1442_context10.next = 3;1443break;1444}14451446return _context10.abrupt("return");14471448case 3:1449_this9._saveInProgress = true;1450_context10.next = 6;1451return _this9.pdfScriptingManager.dispatchWillSave();14521453case 6:1454url = _this9.baseUrl, filename = _this9._docFilename;1455_context10.prev = 7;14561457_this9._ensureDownloadComplete();14581459_context10.next = 11;1460return _this9.pdfDocument.saveDocument(_this9.pdfDocument.annotationStorage);14611462case 11:1463data = _context10.sent;1464blob = new Blob([data], {1465type: "application/pdf"1466});1467_context10.next = 15;1468return _this9.downloadManager.download(blob, url, filename, sourceEventType);14691470case 15:1471_context10.next = 21;1472break;14731474case 17:1475_context10.prev = 17;1476_context10.t0 = _context10["catch"](7);1477_context10.next = 21;1478return _this9.download({1479sourceEventType: sourceEventType1480});14811482case 21:1483_context10.prev = 21;1484_context10.next = 24;1485return _this9.pdfScriptingManager.dispatchDidSave();14861487case 24:1488_this9._saveInProgress = false;1489return _context10.finish(21);14901491case 26:1492case "end":1493return _context10.stop();1494}1495}1496}, _callee10, null, [[7, 17, 21, 26]]);1497}))();1498},1499downloadOrSave: function downloadOrSave(options) {1500var _this$pdfDocument;15011502if (((_this$pdfDocument = this.pdfDocument) === null || _this$pdfDocument === void 0 ? void 0 : _this$pdfDocument.annotationStorage.size) > 0) {1503this.save(options);1504} else {1505this.download(options);1506}1507},1508_delayedFallback: function _delayedFallback(featureId) {1509var _this10 = this;15101511this.externalServices.reportTelemetry({1512type: "unsupportedFeature",1513featureId: featureId1514});15151516if (!this.triggerDelayedFallback) {1517this.triggerDelayedFallback = function () {1518_this10.fallback(featureId);15191520_this10.triggerDelayedFallback = null;1521};1522}1523},1524fallback: function fallback(featureId) {1525var _this11 = this;15261527this.externalServices.reportTelemetry({1528type: "unsupportedFeature",1529featureId: featureId1530});15311532switch (featureId) {1533case _pdfjsLib.UNSUPPORTED_FEATURES.errorFontLoadNative:1534case _pdfjsLib.UNSUPPORTED_FEATURES.errorFontMissing:1535return;1536}15371538if (this.fellback) {1539return;1540}15411542this.fellback = true;1543this.externalServices.fallback({1544featureId: featureId,1545url: this.baseUrl1546}).then(function (download) {1547if (!download) {1548return;1549}15501551_this11.download({1552sourceEventType: "download"1553});1554});1555},1556_documentError: function _documentError(message) {1557var moreInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;15581559this._unblockDocumentLoadEvent();15601561this._otherError(message, moreInfo);1562},1563_otherError: function _otherError(message) {1564var moreInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;1565var moreInfoText = [this.l10n.get("error_version_info", {1566version: _pdfjsLib.version || "?",1567build: _pdfjsLib.build || "?"1568})];15691570if (moreInfo) {1571moreInfoText.push(this.l10n.get("error_message", {1572message: moreInfo.message1573}));15741575if (moreInfo.stack) {1576moreInfoText.push(this.l10n.get("error_stack", {1577stack: moreInfo.stack1578}));1579} else {1580if (moreInfo.filename) {1581moreInfoText.push(this.l10n.get("error_file", {1582file: moreInfo.filename1583}));1584}15851586if (moreInfo.lineNumber) {1587moreInfoText.push(this.l10n.get("error_line", {1588line: moreInfo.lineNumber1589}));1590}1591}1592}15931594var errorWrapperConfig = this.appConfig.errorWrapper;1595var errorWrapper = errorWrapperConfig.container;1596errorWrapper.hidden = false;1597var errorMessage = errorWrapperConfig.errorMessage;1598errorMessage.textContent = message;1599var closeButton = errorWrapperConfig.closeButton;16001601closeButton.onclick = function () {1602errorWrapper.hidden = true;1603};16041605var errorMoreInfo = errorWrapperConfig.errorMoreInfo;1606var moreInfoButton = errorWrapperConfig.moreInfoButton;1607var lessInfoButton = errorWrapperConfig.lessInfoButton;16081609moreInfoButton.onclick = function () {1610errorMoreInfo.hidden = false;1611moreInfoButton.hidden = true;1612lessInfoButton.hidden = false;1613errorMoreInfo.style.height = errorMoreInfo.scrollHeight + "px";1614};16151616lessInfoButton.onclick = function () {1617errorMoreInfo.hidden = true;1618moreInfoButton.hidden = false;1619lessInfoButton.hidden = true;1620};16211622moreInfoButton.oncontextmenu = _ui_utils.noContextMenuHandler;1623lessInfoButton.oncontextmenu = _ui_utils.noContextMenuHandler;1624closeButton.oncontextmenu = _ui_utils.noContextMenuHandler;1625moreInfoButton.hidden = false;1626lessInfoButton.hidden = true;1627Promise.all(moreInfoText).then(function (parts) {1628errorMoreInfo.value = parts.join("\n");1629});1630},1631progress: function progress(level) {1632var _this12 = this;16331634if (this.downloadComplete) {1635return;1636}16371638var percent = Math.round(level * 100);16391640if (percent > this.loadingBar.percent || isNaN(percent)) {1641this.loadingBar.percent = percent;1642var disableAutoFetch = this.pdfDocument ? this.pdfDocument.loadingParams.disableAutoFetch : _app_options.AppOptions.get("disableAutoFetch");16431644if (disableAutoFetch && percent) {1645if (this.disableAutoFetchLoadingBarTimeout) {1646clearTimeout(this.disableAutoFetchLoadingBarTimeout);1647this.disableAutoFetchLoadingBarTimeout = null;1648}16491650this.loadingBar.show();1651this.disableAutoFetchLoadingBarTimeout = setTimeout(function () {1652_this12.loadingBar.hide();16531654_this12.disableAutoFetchLoadingBarTimeout = null;1655}, DISABLE_AUTO_FETCH_LOADING_BAR_TIMEOUT);1656}1657}1658},1659load: function load(pdfDocument) {1660var _this13 = this;16611662this.pdfDocument = pdfDocument;1663pdfDocument.getDownloadInfo().then(function (_ref4) {1664var length = _ref4.length;1665_this13._contentLength = length;1666_this13.downloadComplete = true;16671668_this13.loadingBar.hide();16691670firstPagePromise.then(function () {1671_this13.eventBus.dispatch("documentloaded", {1672source: _this131673});1674});1675});1676var pageLayoutPromise = pdfDocument.getPageLayout()["catch"](function () {});1677var pageModePromise = pdfDocument.getPageMode()["catch"](function () {});1678var openActionPromise = pdfDocument.getOpenAction()["catch"](function () {});1679this.toolbar.setPagesCount(pdfDocument.numPages, false);1680this.secondaryToolbar.setPagesCount(pdfDocument.numPages);1681var baseDocumentUrl;1682baseDocumentUrl = null;1683this.pdfLinkService.setDocument(pdfDocument, baseDocumentUrl);1684this.pdfDocumentProperties.setDocument(pdfDocument, this.url);1685var pdfViewer = this.pdfViewer;1686pdfViewer.setDocument(pdfDocument);1687var firstPagePromise = pdfViewer.firstPagePromise,1688onePageRendered = pdfViewer.onePageRendered,1689pagesPromise = pdfViewer.pagesPromise;1690var pdfThumbnailViewer = this.pdfThumbnailViewer;1691pdfThumbnailViewer.setDocument(pdfDocument);1692var storedPromise = (this.store = new _view_history.ViewHistory(pdfDocument.fingerprint)).getMultiple({1693page: null,1694zoom: _ui_utils.DEFAULT_SCALE_VALUE,1695scrollLeft: "0",1696scrollTop: "0",1697rotation: null,1698sidebarView: _ui_utils.SidebarView.UNKNOWN,1699scrollMode: _ui_utils.ScrollMode.UNKNOWN,1700spreadMode: _ui_utils.SpreadMode.UNKNOWN1701})["catch"](function () {1702return Object.create(null);1703});1704firstPagePromise.then(function (pdfPage) {1705_this13.loadingBar.setWidth(_this13.appConfig.viewerContainer);17061707_this13._initializeAnnotationStorageCallbacks(pdfDocument);17081709Promise.all([_ui_utils.animationStarted, storedPromise, pageLayoutPromise, pageModePromise, openActionPromise]).then( /*#__PURE__*/function () {1710var _ref6 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee11(_ref5) {1711var _ref7, timeStamp, stored, pageLayout, pageMode, openAction, viewOnLoad, initialBookmark, zoom, hash, rotation, sidebarView, scrollMode, spreadMode;17121713return _regenerator["default"].wrap(function _callee11$(_context11) {1714while (1) {1715switch (_context11.prev = _context11.next) {1716case 0:1717_ref7 = _slicedToArray(_ref5, 5), timeStamp = _ref7[0], stored = _ref7[1], pageLayout = _ref7[2], pageMode = _ref7[3], openAction = _ref7[4];1718viewOnLoad = _app_options.AppOptions.get("viewOnLoad");17191720_this13._initializePdfHistory({1721fingerprint: pdfDocument.fingerprint,1722viewOnLoad: viewOnLoad,1723initialDest: openAction === null || openAction === void 0 ? void 0 : openAction.dest1724});17251726initialBookmark = _this13.initialBookmark;1727zoom = _app_options.AppOptions.get("defaultZoomValue");1728hash = zoom ? "zoom=".concat(zoom) : null;1729rotation = null;1730sidebarView = _app_options.AppOptions.get("sidebarViewOnLoad");1731scrollMode = _app_options.AppOptions.get("scrollModeOnLoad");1732spreadMode = _app_options.AppOptions.get("spreadModeOnLoad");17331734if (stored.page && viewOnLoad !== ViewOnLoad.INITIAL) {1735hash = "page=".concat(stored.page, "&zoom=").concat(zoom || stored.zoom, ",") + "".concat(stored.scrollLeft, ",").concat(stored.scrollTop);1736rotation = parseInt(stored.rotation, 10);17371738if (sidebarView === _ui_utils.SidebarView.UNKNOWN) {1739sidebarView = stored.sidebarView | 0;1740}17411742if (scrollMode === _ui_utils.ScrollMode.UNKNOWN) {1743scrollMode = stored.scrollMode | 0;1744}17451746if (spreadMode === _ui_utils.SpreadMode.UNKNOWN) {1747spreadMode = stored.spreadMode | 0;1748}1749}17501751if (pageMode && sidebarView === _ui_utils.SidebarView.UNKNOWN) {1752sidebarView = (0, _ui_utils.apiPageModeToSidebarView)(pageMode);1753}17541755if (pageLayout && spreadMode === _ui_utils.SpreadMode.UNKNOWN) {1756spreadMode = (0, _ui_utils.apiPageLayoutToSpreadMode)(pageLayout);1757}17581759_this13.setInitialView(hash, {1760rotation: rotation,1761sidebarView: sidebarView,1762scrollMode: scrollMode,1763spreadMode: spreadMode1764});17651766_this13.eventBus.dispatch("documentinit", {1767source: _this131768});17691770if (!_this13.isViewerEmbedded) {1771pdfViewer.focus();1772}17731774_this13._initializePermissions(pdfDocument);17751776_context11.next = 19;1777return Promise.race([pagesPromise, new Promise(function (resolve) {1778setTimeout(resolve, FORCE_PAGES_LOADED_TIMEOUT);1779})]);17801781case 19:1782if (!(!initialBookmark && !hash)) {1783_context11.next = 21;1784break;1785}17861787return _context11.abrupt("return");17881789case 21:1790if (!pdfViewer.hasEqualPageSizes) {1791_context11.next = 23;1792break;1793}17941795return _context11.abrupt("return");17961797case 23:1798_this13.initialBookmark = initialBookmark;1799pdfViewer.currentScaleValue = pdfViewer.currentScaleValue;18001801_this13.setInitialView(hash);18021803case 26:1804case "end":1805return _context11.stop();1806}1807}1808}, _callee11);1809}));18101811return function (_x2) {1812return _ref6.apply(this, arguments);1813};1814}())["catch"](function () {1815_this13.setInitialView();1816}).then(function () {1817pdfViewer.update();1818});1819});1820pagesPromise.then(function () {1821_this13._unblockDocumentLoadEvent();18221823_this13._initializeAutoPrint(pdfDocument, openActionPromise);1824});1825onePageRendered.then(function () {1826pdfDocument.getOutline().then(function (outline) {1827_this13.pdfOutlineViewer.render({1828outline: outline,1829pdfDocument: pdfDocument1830});1831});1832pdfDocument.getAttachments().then(function (attachments) {1833_this13.pdfAttachmentViewer.render({1834attachments: attachments1835});1836});1837pdfViewer.optionalContentConfigPromise.then(function (optionalContentConfig) {1838_this13.pdfLayerViewer.render({1839optionalContentConfig: optionalContentConfig,1840pdfDocument: pdfDocument1841});1842});18431844if ("requestIdleCallback" in window) {1845var callback = window.requestIdleCallback(function () {1846_this13._collectTelemetry(pdfDocument);18471848_this13._idleCallbacks["delete"](callback);1849}, {1850timeout: 10001851});18521853_this13._idleCallbacks.add(callback);1854}1855});18561857this._initializePageLabels(pdfDocument);18581859this._initializeMetadata(pdfDocument);1860},1861_scriptingDocProperties: function _scriptingDocProperties(pdfDocument) {1862var _this14 = this;18631864return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee12() {1865var _this14$metadata, _this14$metadata2;18661867return _regenerator["default"].wrap(function _callee12$(_context12) {1868while (1) {1869switch (_context12.prev = _context12.next) {1870case 0:1871if (_this14.documentInfo) {1872_context12.next = 5;1873break;1874}18751876_context12.next = 3;1877return new Promise(function (resolve) {1878_this14.eventBus._on("metadataloaded", resolve, {1879once: true1880});1881});18821883case 3:1884if (!(pdfDocument !== _this14.pdfDocument)) {1885_context12.next = 5;1886break;1887}18881889return _context12.abrupt("return", null);18901891case 5:1892if (_this14._contentLength) {1893_context12.next = 10;1894break;1895}18961897_context12.next = 8;1898return new Promise(function (resolve) {1899_this14.eventBus._on("documentloaded", resolve, {1900once: true1901});1902});19031904case 8:1905if (!(pdfDocument !== _this14.pdfDocument)) {1906_context12.next = 10;1907break;1908}19091910return _context12.abrupt("return", null);19111912case 10:1913return _context12.abrupt("return", _objectSpread(_objectSpread({}, _this14.documentInfo), {}, {1914baseURL: _this14.baseUrl,1915filesize: _this14._contentLength,1916filename: _this14._docFilename,1917metadata: (_this14$metadata = _this14.metadata) === null || _this14$metadata === void 0 ? void 0 : _this14$metadata.getRaw(),1918authors: (_this14$metadata2 = _this14.metadata) === null || _this14$metadata2 === void 0 ? void 0 : _this14$metadata2.get("dc:creator"),1919numPages: _this14.pagesCount,1920URL: _this14.url1921}));19221923case 11:1924case "end":1925return _context12.stop();1926}1927}1928}, _callee12);1929}))();1930},1931_collectTelemetry: function _collectTelemetry(pdfDocument) {1932var _this15 = this;19331934return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee13() {1935var markInfo, tagged;1936return _regenerator["default"].wrap(function _callee13$(_context13) {1937while (1) {1938switch (_context13.prev = _context13.next) {1939case 0:1940_context13.next = 2;1941return _this15.pdfDocument.getMarkInfo();19421943case 2:1944markInfo = _context13.sent;19451946if (!(pdfDocument !== _this15.pdfDocument)) {1947_context13.next = 5;1948break;1949}19501951return _context13.abrupt("return");19521953case 5:1954tagged = (markInfo === null || markInfo === void 0 ? void 0 : markInfo.Marked) || false;19551956_this15.externalServices.reportTelemetry({1957type: "tagged",1958tagged: tagged1959});19601961case 7:1962case "end":1963return _context13.stop();1964}1965}1966}, _callee13);1967}))();1968},1969_initializeAutoPrint: function _initializeAutoPrint(pdfDocument, openActionPromise) {1970var _this16 = this;19711972return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee14() {1973var _yield$Promise$all, _yield$Promise$all2, openAction, javaScript, triggerAutoPrint, _iterator2, _step2, js;19741975return _regenerator["default"].wrap(function _callee14$(_context14) {1976while (1) {1977switch (_context14.prev = _context14.next) {1978case 0:1979_context14.next = 2;1980return Promise.all([openActionPromise, !_this16.pdfViewer.enableScripting ? pdfDocument.getJavaScript() : null]);19811982case 2:1983_yield$Promise$all = _context14.sent;1984_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);1985openAction = _yield$Promise$all2[0];1986javaScript = _yield$Promise$all2[1];19871988if (!(pdfDocument !== _this16.pdfDocument)) {1989_context14.next = 8;1990break;1991}19921993return _context14.abrupt("return");19941995case 8:1996triggerAutoPrint = false;19971998if ((openAction === null || openAction === void 0 ? void 0 : openAction.action) === "Print") {1999triggerAutoPrint = true;2000}20012002if (!javaScript) {2003_context14.next = 31;2004break;2005}20062007javaScript.some(function (js) {2008if (!js) {2009return false;2010}20112012console.warn("Warning: JavaScript is not supported");20132014_this16._delayedFallback(_pdfjsLib.UNSUPPORTED_FEATURES.javaScript);20152016return true;2017});20182019if (triggerAutoPrint) {2020_context14.next = 31;2021break;2022}20232024_iterator2 = _createForOfIteratorHelper(javaScript);2025_context14.prev = 14;20262027_iterator2.s();20282029case 16:2030if ((_step2 = _iterator2.n()).done) {2031_context14.next = 23;2032break;2033}20342035js = _step2.value;20362037if (!(js && _ui_utils.AutoPrintRegExp.test(js))) {2038_context14.next = 21;2039break;2040}20412042triggerAutoPrint = true;2043return _context14.abrupt("break", 23);20442045case 21:2046_context14.next = 16;2047break;20482049case 23:2050_context14.next = 28;2051break;20522053case 25:2054_context14.prev = 25;2055_context14.t0 = _context14["catch"](14);20562057_iterator2.e(_context14.t0);20582059case 28:2060_context14.prev = 28;20612062_iterator2.f();20632064return _context14.finish(28);20652066case 31:2067if (triggerAutoPrint) {2068_this16.triggerPrinting();2069}20702071case 32:2072case "end":2073return _context14.stop();2074}2075}2076}, _callee14, null, [[14, 25, 28, 31]]);2077}))();2078},2079_initializeMetadata: function _initializeMetadata(pdfDocument) {2080var _this17 = this;20812082return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee15() {2083var _this17$_contentDispo, _this17$_contentLengt;20842085var _yield$pdfDocument$ge, info, metadata, contentDispositionFilename, contentLength, pdfTitle, metadataTitle, versionId, generatorId, producer, formType;20862087return _regenerator["default"].wrap(function _callee15$(_context15) {2088while (1) {2089switch (_context15.prev = _context15.next) {2090case 0:2091_context15.next = 2;2092return pdfDocument.getMetadata();20932094case 2:2095_yield$pdfDocument$ge = _context15.sent;2096info = _yield$pdfDocument$ge.info;2097metadata = _yield$pdfDocument$ge.metadata;2098contentDispositionFilename = _yield$pdfDocument$ge.contentDispositionFilename;2099contentLength = _yield$pdfDocument$ge.contentLength;21002101if (!(pdfDocument !== _this17.pdfDocument)) {2102_context15.next = 9;2103break;2104}21052106return _context15.abrupt("return");21072108case 9:2109_this17.documentInfo = info;2110_this17.metadata = metadata;2111(_this17$_contentDispo = _this17._contentDispositionFilename) !== null && _this17$_contentDispo !== void 0 ? _this17$_contentDispo : _this17._contentDispositionFilename = contentDispositionFilename;2112(_this17$_contentLengt = _this17._contentLength) !== null && _this17$_contentLengt !== void 0 ? _this17$_contentLengt : _this17._contentLength = contentLength;2113console.log("PDF ".concat(pdfDocument.fingerprint, " [").concat(info.PDFFormatVersion, " ") + "".concat((info.Producer || "-").trim(), " / ").concat((info.Creator || "-").trim(), "] ") + "(PDF.js: ".concat(_pdfjsLib.version || "-") + "".concat(_this17.pdfViewer.enableWebGL ? " [WebGL]" : "", ")"));2114pdfTitle = info === null || info === void 0 ? void 0 : info.Title;2115metadataTitle = metadata === null || metadata === void 0 ? void 0 : metadata.get("dc:title");21162117if (metadataTitle) {2118if (metadataTitle !== "Untitled" && !/[\uFFF0-\uFFFF]/g.test(metadataTitle)) {2119pdfTitle = metadataTitle;2120}2121}21222123if (pdfTitle) {2124_this17.setTitle("".concat(pdfTitle, " - ").concat(contentDispositionFilename || document.title));2125} else if (contentDispositionFilename) {2126_this17.setTitle(contentDispositionFilename);2127}21282129if (info.IsXFAPresent && !info.IsAcroFormPresent && !pdfDocument.isPureXfa) {2130console.warn("Warning: XFA is not supported");21312132_this17._delayedFallback(_pdfjsLib.UNSUPPORTED_FEATURES.forms);2133} else if ((info.IsAcroFormPresent || info.IsXFAPresent) && !_this17.pdfViewer.renderInteractiveForms) {2134console.warn("Warning: Interactive form support is not enabled");21352136_this17._delayedFallback(_pdfjsLib.UNSUPPORTED_FEATURES.forms);2137}21382139versionId = "other";21402141if (KNOWN_VERSIONS.includes(info.PDFFormatVersion)) {2142versionId = "v".concat(info.PDFFormatVersion.replace(".", "_"));2143}21442145generatorId = "other";21462147if (info.Producer) {2148producer = info.Producer.toLowerCase();2149KNOWN_GENERATORS.some(function (generator) {2150if (!producer.includes(generator)) {2151return false;2152}21532154generatorId = generator.replace(/[ .-]/g, "_");2155return true;2156});2157}21582159formType = null;21602161if (info.IsXFAPresent) {2162formType = "xfa";2163} else if (info.IsAcroFormPresent) {2164formType = "acroform";2165}21662167_this17.externalServices.reportTelemetry({2168type: "documentInfo",2169version: versionId,2170generator: generatorId,2171formType: formType2172});21732174_this17.eventBus.dispatch("metadataloaded", {2175source: _this172176});21772178case 27:2179case "end":2180return _context15.stop();2181}2182}2183}, _callee15);2184}))();2185},2186_initializePageLabels: function _initializePageLabels(pdfDocument) {2187var _this18 = this;21882189return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee16() {2190var labels, numLabels, i, pdfViewer, pdfThumbnailViewer, toolbar;2191return _regenerator["default"].wrap(function _callee16$(_context16) {2192while (1) {2193switch (_context16.prev = _context16.next) {2194case 0:2195_context16.next = 2;2196return pdfDocument.getPageLabels();21972198case 2:2199labels = _context16.sent;22002201if (!(pdfDocument !== _this18.pdfDocument)) {2202_context16.next = 5;2203break;2204}22052206return _context16.abrupt("return");22072208case 5:2209if (!(!labels || _app_options.AppOptions.get("disablePageLabels"))) {2210_context16.next = 7;2211break;2212}22132214return _context16.abrupt("return");22152216case 7:2217numLabels = labels.length;22182219if (!(numLabels !== _this18.pagesCount)) {2220_context16.next = 11;2221break;2222}22232224console.error("The number of Page Labels does not match the number of pages in the document.");2225return _context16.abrupt("return");22262227case 11:2228i = 0;22292230while (i < numLabels && labels[i] === (i + 1).toString()) {2231i++;2232}22332234if (!(i === numLabels)) {2235_context16.next = 15;2236break;2237}22382239return _context16.abrupt("return");22402241case 15:2242pdfViewer = _this18.pdfViewer, pdfThumbnailViewer = _this18.pdfThumbnailViewer, toolbar = _this18.toolbar;2243pdfViewer.setPageLabels(labels);2244pdfThumbnailViewer.setPageLabels(labels);2245toolbar.setPagesCount(numLabels, true);2246toolbar.setPageNumber(pdfViewer.currentPageNumber, pdfViewer.currentPageLabel);22472248case 20:2249case "end":2250return _context16.stop();2251}2252}2253}, _callee16);2254}))();2255},2256_initializePdfHistory: function _initializePdfHistory(_ref8) {2257var fingerprint = _ref8.fingerprint,2258viewOnLoad = _ref8.viewOnLoad,2259_ref8$initialDest = _ref8.initialDest,2260initialDest = _ref8$initialDest === void 0 ? null : _ref8$initialDest;22612262if (this.isViewerEmbedded || _app_options.AppOptions.get("disableHistory")) {2263return;2264}22652266this.pdfHistory.initialize({2267fingerprint: fingerprint,2268resetHistory: viewOnLoad === ViewOnLoad.INITIAL,2269updateUrl: _app_options.AppOptions.get("historyUpdateUrl")2270});22712272if (this.pdfHistory.initialBookmark) {2273this.initialBookmark = this.pdfHistory.initialBookmark;2274this.initialRotation = this.pdfHistory.initialRotation;2275}22762277if (initialDest && !this.initialBookmark && viewOnLoad === ViewOnLoad.UNKNOWN) {2278this.initialBookmark = JSON.stringify(initialDest);2279this.pdfHistory.push({2280explicitDest: initialDest,2281pageNumber: null2282});2283}2284},2285_initializePermissions: function _initializePermissions(pdfDocument) {2286var _this19 = this;22872288return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee17() {2289var permissions;2290return _regenerator["default"].wrap(function _callee17$(_context17) {2291while (1) {2292switch (_context17.prev = _context17.next) {2293case 0:2294_context17.next = 2;2295return pdfDocument.getPermissions();22962297case 2:2298permissions = _context17.sent;22992300if (!(pdfDocument !== _this19.pdfDocument)) {2301_context17.next = 5;2302break;2303}23042305return _context17.abrupt("return");23062307case 5:2308if (!(!permissions || !_app_options.AppOptions.get("enablePermissions"))) {2309_context17.next = 7;2310break;2311}23122313return _context17.abrupt("return");23142315case 7:2316if (!permissions.includes(_pdfjsLib.PermissionFlag.COPY)) {2317_this19.appConfig.viewerContainer.classList.add(ENABLE_PERMISSIONS_CLASS);2318}23192320case 8:2321case "end":2322return _context17.stop();2323}2324}2325}, _callee17);2326}))();2327},2328_initializeAnnotationStorageCallbacks: function _initializeAnnotationStorageCallbacks(pdfDocument) {2329var _this20 = this;23302331if (pdfDocument !== this.pdfDocument) {2332return;2333}23342335var annotationStorage = pdfDocument.annotationStorage;23362337annotationStorage.onSetModified = function () {2338window.addEventListener("beforeunload", beforeUnload);2339_this20._annotationStorageModified = true;2340};23412342annotationStorage.onResetModified = function () {2343window.removeEventListener("beforeunload", beforeUnload);2344delete _this20._annotationStorageModified;2345};2346},2347setInitialView: function setInitialView(storedHash) {2348var _this21 = this;23492350var _ref9 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},2351rotation = _ref9.rotation,2352sidebarView = _ref9.sidebarView,2353scrollMode = _ref9.scrollMode,2354spreadMode = _ref9.spreadMode;23552356var setRotation = function setRotation(angle) {2357if ((0, _ui_utils.isValidRotation)(angle)) {2358_this21.pdfViewer.pagesRotation = angle;2359}2360};23612362var setViewerModes = function setViewerModes(scroll, spread) {2363if ((0, _ui_utils.isValidScrollMode)(scroll)) {2364_this21.pdfViewer.scrollMode = scroll;2365}23662367if ((0, _ui_utils.isValidSpreadMode)(spread)) {2368_this21.pdfViewer.spreadMode = spread;2369}2370};23712372this.isInitialViewSet = true;2373this.pdfSidebar.setInitialView(sidebarView);2374setViewerModes(scrollMode, spreadMode);23752376if (this.initialBookmark) {2377setRotation(this.initialRotation);2378delete this.initialRotation;2379this.pdfLinkService.setHash(this.initialBookmark);2380this.initialBookmark = null;2381} else if (storedHash) {2382setRotation(rotation);2383this.pdfLinkService.setHash(storedHash);2384}23852386this.toolbar.setPageNumber(this.pdfViewer.currentPageNumber, this.pdfViewer.currentPageLabel);2387this.secondaryToolbar.setPageNumber(this.pdfViewer.currentPageNumber);23882389if (!this.pdfViewer.currentScaleValue) {2390this.pdfViewer.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE;2391}2392},2393_cleanup: function _cleanup() {2394if (!this.pdfDocument) {2395return;2396}23972398this.pdfViewer.cleanup();2399this.pdfThumbnailViewer.cleanup();2400this.pdfDocument.cleanup(this.pdfViewer.renderer === _ui_utils.RendererType.SVG);2401},2402forceRendering: function forceRendering() {2403this.pdfRenderingQueue.printing = !!this.printService;2404this.pdfRenderingQueue.isThumbnailViewEnabled = this.pdfSidebar.isThumbnailViewVisible;2405this.pdfRenderingQueue.renderHighestPriority();2406},2407beforePrint: function beforePrint() {2408var _this22 = this;24092410this.pdfScriptingManager.dispatchWillPrint();24112412if (this.printService) {2413return;2414}24152416if (!this.supportsPrinting) {2417this.l10n.get("printing_not_supported").then(function (msg) {2418_this22._otherError(msg);2419});2420return;2421}24222423if (!this.pdfViewer.pageViewsReady) {2424this.l10n.get("printing_not_ready").then(function (msg) {2425window.alert(msg);2426});2427return;2428}24292430var pagesOverview = this.pdfViewer.getPagesOverview();2431var printContainer = this.appConfig.printContainer;24322433var printResolution = _app_options.AppOptions.get("printResolution");24342435var optionalContentConfigPromise = this.pdfViewer.optionalContentConfigPromise;2436var printService = PDFPrintServiceFactory.instance.createPrintService(this.pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise, this.l10n);2437this.printService = printService;2438this.forceRendering();2439printService.layout();2440this.externalServices.reportTelemetry({2441type: "print"2442});2443},2444afterPrint: function afterPrint() {2445this.pdfScriptingManager.dispatchDidPrint();24462447if (this.printService) {2448this.printService.destroy();2449this.printService = null;24502451if (this.pdfDocument) {2452this.pdfDocument.annotationStorage.resetModified();2453}2454}24552456this.forceRendering();2457},2458rotatePages: function rotatePages(delta) {2459this.pdfViewer.pagesRotation += delta;2460},2461requestPresentationMode: function requestPresentationMode() {2462if (!this.pdfPresentationMode) {2463return;2464}24652466this.pdfPresentationMode.request();2467},2468triggerPrinting: function triggerPrinting() {2469if (!this.supportsPrinting) {2470return;2471}24722473window.print();2474},2475bindEvents: function bindEvents() {2476var eventBus = this.eventBus,2477_boundEvents = this._boundEvents;2478_boundEvents.beforePrint = this.beforePrint.bind(this);2479_boundEvents.afterPrint = this.afterPrint.bind(this);24802481eventBus._on("resize", webViewerResize);24822483eventBus._on("hashchange", webViewerHashchange);24842485eventBus._on("beforeprint", _boundEvents.beforePrint);24862487eventBus._on("afterprint", _boundEvents.afterPrint);24882489eventBus._on("pagerendered", webViewerPageRendered);24902491eventBus._on("updateviewarea", webViewerUpdateViewarea);24922493eventBus._on("pagechanging", webViewerPageChanging);24942495eventBus._on("scalechanging", webViewerScaleChanging);24962497eventBus._on("rotationchanging", webViewerRotationChanging);24982499eventBus._on("sidebarviewchanged", webViewerSidebarViewChanged);25002501eventBus._on("pagemode", webViewerPageMode);25022503eventBus._on("namedaction", webViewerNamedAction);25042505eventBus._on("presentationmodechanged", webViewerPresentationModeChanged);25062507eventBus._on("presentationmode", webViewerPresentationMode);25082509eventBus._on("print", webViewerPrint);25102511eventBus._on("download", webViewerDownload);25122513eventBus._on("save", webViewerSave);25142515eventBus._on("firstpage", webViewerFirstPage);25162517eventBus._on("lastpage", webViewerLastPage);25182519eventBus._on("nextpage", webViewerNextPage);25202521eventBus._on("previouspage", webViewerPreviousPage);25222523eventBus._on("zoomin", webViewerZoomIn);25242525eventBus._on("zoomout", webViewerZoomOut);25262527eventBus._on("zoomreset", webViewerZoomReset);25282529eventBus._on("pagenumberchanged", webViewerPageNumberChanged);25302531eventBus._on("scalechanged", webViewerScaleChanged);25322533eventBus._on("rotatecw", webViewerRotateCw);25342535eventBus._on("rotateccw", webViewerRotateCcw);25362537eventBus._on("optionalcontentconfig", webViewerOptionalContentConfig);25382539eventBus._on("switchscrollmode", webViewerSwitchScrollMode);25402541eventBus._on("scrollmodechanged", webViewerScrollModeChanged);25422543eventBus._on("switchspreadmode", webViewerSwitchSpreadMode);25442545eventBus._on("spreadmodechanged", webViewerSpreadModeChanged);25462547eventBus._on("documentproperties", webViewerDocumentProperties);25482549eventBus._on("find", webViewerFind);25502551eventBus._on("findfromurlhash", webViewerFindFromUrlHash);25522553eventBus._on("updatefindmatchescount", webViewerUpdateFindMatchesCount);25542555eventBus._on("updatefindcontrolstate", webViewerUpdateFindControlState);25562557if (_app_options.AppOptions.get("pdfBug")) {2558_boundEvents.reportPageStatsPDFBug = reportPageStatsPDFBug;25592560eventBus._on("pagerendered", _boundEvents.reportPageStatsPDFBug);25612562eventBus._on("pagechanging", _boundEvents.reportPageStatsPDFBug);2563}25642565eventBus._on("fileinputchange", webViewerFileInputChange);25662567eventBus._on("openfile", webViewerOpenFile);2568},2569bindWindowEvents: function bindWindowEvents() {2570var eventBus = this.eventBus,2571_boundEvents = this._boundEvents;25722573_boundEvents.windowResize = function () {2574eventBus.dispatch("resize", {2575source: window2576});2577};25782579_boundEvents.windowHashChange = function () {2580eventBus.dispatch("hashchange", {2581source: window,2582hash: document.location.hash.substring(1)2583});2584};25852586_boundEvents.windowBeforePrint = function () {2587eventBus.dispatch("beforeprint", {2588source: window2589});2590};25912592_boundEvents.windowAfterPrint = function () {2593eventBus.dispatch("afterprint", {2594source: window2595});2596};25972598_boundEvents.windowUpdateFromSandbox = function (event) {2599eventBus.dispatch("updatefromsandbox", {2600source: window,2601detail: event.detail2602});2603};26042605window.addEventListener("visibilitychange", webViewerVisibilityChange);2606window.addEventListener("wheel", webViewerWheel, {2607passive: false2608});2609window.addEventListener("touchstart", webViewerTouchStart, {2610passive: false2611});2612window.addEventListener("click", webViewerClick);2613window.addEventListener("keydown", webViewerKeyDown);2614window.addEventListener("keyup", webViewerKeyUp);2615window.addEventListener("resize", _boundEvents.windowResize);2616window.addEventListener("hashchange", _boundEvents.windowHashChange);2617window.addEventListener("beforeprint", _boundEvents.windowBeforePrint);2618window.addEventListener("afterprint", _boundEvents.windowAfterPrint);2619window.addEventListener("updatefromsandbox", _boundEvents.windowUpdateFromSandbox);2620},2621unbindEvents: function unbindEvents() {2622var eventBus = this.eventBus,2623_boundEvents = this._boundEvents;26242625eventBus._off("resize", webViewerResize);26262627eventBus._off("hashchange", webViewerHashchange);26282629eventBus._off("beforeprint", _boundEvents.beforePrint);26302631eventBus._off("afterprint", _boundEvents.afterPrint);26322633eventBus._off("pagerendered", webViewerPageRendered);26342635eventBus._off("updateviewarea", webViewerUpdateViewarea);26362637eventBus._off("pagechanging", webViewerPageChanging);26382639eventBus._off("scalechanging", webViewerScaleChanging);26402641eventBus._off("rotationchanging", webViewerRotationChanging);26422643eventBus._off("sidebarviewchanged", webViewerSidebarViewChanged);26442645eventBus._off("pagemode", webViewerPageMode);26462647eventBus._off("namedaction", webViewerNamedAction);26482649eventBus._off("presentationmodechanged", webViewerPresentationModeChanged);26502651eventBus._off("presentationmode", webViewerPresentationMode);26522653eventBus._off("print", webViewerPrint);26542655eventBus._off("download", webViewerDownload);26562657eventBus._off("save", webViewerSave);26582659eventBus._off("firstpage", webViewerFirstPage);26602661eventBus._off("lastpage", webViewerLastPage);26622663eventBus._off("nextpage", webViewerNextPage);26642665eventBus._off("previouspage", webViewerPreviousPage);26662667eventBus._off("zoomin", webViewerZoomIn);26682669eventBus._off("zoomout", webViewerZoomOut);26702671eventBus._off("zoomreset", webViewerZoomReset);26722673eventBus._off("pagenumberchanged", webViewerPageNumberChanged);26742675eventBus._off("scalechanged", webViewerScaleChanged);26762677eventBus._off("rotatecw", webViewerRotateCw);26782679eventBus._off("rotateccw", webViewerRotateCcw);26802681eventBus._off("optionalcontentconfig", webViewerOptionalContentConfig);26822683eventBus._off("switchscrollmode", webViewerSwitchScrollMode);26842685eventBus._off("scrollmodechanged", webViewerScrollModeChanged);26862687eventBus._off("switchspreadmode", webViewerSwitchSpreadMode);26882689eventBus._off("spreadmodechanged", webViewerSpreadModeChanged);26902691eventBus._off("documentproperties", webViewerDocumentProperties);26922693eventBus._off("find", webViewerFind);26942695eventBus._off("findfromurlhash", webViewerFindFromUrlHash);26962697eventBus._off("updatefindmatchescount", webViewerUpdateFindMatchesCount);26982699eventBus._off("updatefindcontrolstate", webViewerUpdateFindControlState);27002701if (_boundEvents.reportPageStatsPDFBug) {2702eventBus._off("pagerendered", _boundEvents.reportPageStatsPDFBug);27032704eventBus._off("pagechanging", _boundEvents.reportPageStatsPDFBug);27052706_boundEvents.reportPageStatsPDFBug = null;2707}27082709eventBus._off("fileinputchange", webViewerFileInputChange);27102711eventBus._off("openfile", webViewerOpenFile);27122713_boundEvents.beforePrint = null;2714_boundEvents.afterPrint = null;2715},2716unbindWindowEvents: function unbindWindowEvents() {2717var _boundEvents = this._boundEvents;2718window.removeEventListener("visibilitychange", webViewerVisibilityChange);2719window.removeEventListener("wheel", webViewerWheel, {2720passive: false2721});2722window.removeEventListener("touchstart", webViewerTouchStart, {2723passive: false2724});2725window.removeEventListener("click", webViewerClick);2726window.removeEventListener("keydown", webViewerKeyDown);2727window.removeEventListener("keyup", webViewerKeyUp);2728window.removeEventListener("resize", _boundEvents.windowResize);2729window.removeEventListener("hashchange", _boundEvents.windowHashChange);2730window.removeEventListener("beforeprint", _boundEvents.windowBeforePrint);2731window.removeEventListener("afterprint", _boundEvents.windowAfterPrint);2732window.removeEventListener("updatefromsandbox", _boundEvents.windowUpdateFromSandbox);2733_boundEvents.windowResize = null;2734_boundEvents.windowHashChange = null;2735_boundEvents.windowBeforePrint = null;2736_boundEvents.windowAfterPrint = null;2737_boundEvents.windowUpdateFromSandbox = null;2738},2739accumulateWheelTicks: function accumulateWheelTicks(ticks) {2740if (this._wheelUnusedTicks > 0 && ticks < 0 || this._wheelUnusedTicks < 0 && ticks > 0) {2741this._wheelUnusedTicks = 0;2742}27432744this._wheelUnusedTicks += ticks;2745var wholeTicks = Math.sign(this._wheelUnusedTicks) * Math.floor(Math.abs(this._wheelUnusedTicks));2746this._wheelUnusedTicks -= wholeTicks;2747return wholeTicks;2748},2749_unblockDocumentLoadEvent: function _unblockDocumentLoadEvent() {2750if (document.blockUnblockOnload) {2751document.blockUnblockOnload(false);2752}27532754this._unblockDocumentLoadEvent = function () {};2755},27562757get scriptingReady() {2758return this.pdfScriptingManager.ready;2759}27602761};2762exports.PDFViewerApplication = PDFViewerApplication;2763var validateFileURL;2764{2765var HOSTED_VIEWER_ORIGINS = ["null", "http://mozilla.github.io", "https://mozilla.github.io"];27662767validateFileURL = function validateFileURL(file) {2768if (file === undefined) {2769return;2770}27712772try {2773var viewerOrigin = new URL(window.location.href).origin || "null";27742775if (HOSTED_VIEWER_ORIGINS.includes(viewerOrigin)) {2776return;2777}27782779var _URL = new URL(file, window.location.href),2780origin = _URL.origin,2781protocol = _URL.protocol;27822783if (origin !== viewerOrigin && protocol !== "blob:") {2784throw new Error("file origin does not match viewer's");2785}2786} catch (ex) {2787PDFViewerApplication.l10n.get("loading_error").then(function (msg) {2788PDFViewerApplication._documentError(msg, {2789message: ex === null || ex === void 0 ? void 0 : ex.message2790});2791});2792throw ex;2793}2794};2795}27962797function loadFakeWorker() {2798return _loadFakeWorker.apply(this, arguments);2799}28002801function _loadFakeWorker() {2802_loadFakeWorker = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee18() {2803return _regenerator["default"].wrap(function _callee18$(_context18) {2804while (1) {2805switch (_context18.prev = _context18.next) {2806case 0:2807if (!_pdfjsLib.GlobalWorkerOptions.workerSrc) {2808_pdfjsLib.GlobalWorkerOptions.workerSrc = _app_options.AppOptions.get("workerSrc");2809}28102811return _context18.abrupt("return", (0, _pdfjsLib.loadScript)(_pdfjsLib.PDFWorker.getWorkerSrc()));28122813case 2:2814case "end":2815return _context18.stop();2816}2817}2818}, _callee18);2819}));2820return _loadFakeWorker.apply(this, arguments);2821}28222823function loadAndEnablePDFBug(enabledTabs) {2824var appConfig = PDFViewerApplication.appConfig;2825return (0, _pdfjsLib.loadScript)(appConfig.debuggerScriptPath).then(function () {2826PDFBug.enable(enabledTabs);2827PDFBug.init({2828OPS: _pdfjsLib.OPS2829}, appConfig.mainContainer);2830});2831}28322833function reportPageStatsPDFBug(_ref10) {2834var _pageView$pdfPage;28352836var pageNumber = _ref10.pageNumber;28372838if (typeof Stats === "undefined" || !Stats.enabled) {2839return;2840}28412842var pageView = PDFViewerApplication.pdfViewer.getPageView(pageNumber - 1);2843var pageStats = pageView === null || pageView === void 0 ? void 0 : (_pageView$pdfPage = pageView.pdfPage) === null || _pageView$pdfPage === void 0 ? void 0 : _pageView$pdfPage.stats;28442845if (!pageStats) {2846return;2847}28482849Stats.add(pageNumber, pageStats);2850}28512852function webViewerInitialized() {2853var appConfig = PDFViewerApplication.appConfig;2854var file;2855var queryString = document.location.search.substring(1);2856var params = (0, _ui_utils.parseQueryString)(queryString);2857file = "file" in params ? params.file : _app_options.AppOptions.get("defaultUrl");2858validateFileURL(file);2859var fileInput = document.createElement("input");2860fileInput.id = appConfig.openFileInputName;2861fileInput.className = "fileInput";2862fileInput.setAttribute("type", "file");2863fileInput.oncontextmenu = _ui_utils.noContextMenuHandler;2864document.body.appendChild(fileInput);28652866if (!window.File || !window.FileReader || !window.FileList || !window.Blob) {2867appConfig.toolbar.openFile.hidden = true;2868appConfig.secondaryToolbar.openFileButton.hidden = true;2869} else {2870fileInput.value = null;2871}28722873fileInput.addEventListener("change", function (evt) {2874var files = evt.target.files;28752876if (!files || files.length === 0) {2877return;2878}28792880PDFViewerApplication.eventBus.dispatch("fileinputchange", {2881source: this,2882fileInput: evt.target2883});2884});2885appConfig.mainContainer.addEventListener("dragover", function (evt) {2886evt.preventDefault();2887evt.dataTransfer.dropEffect = "move";2888});2889appConfig.mainContainer.addEventListener("drop", function (evt) {2890evt.preventDefault();2891var files = evt.dataTransfer.files;28922893if (!files || files.length === 0) {2894return;2895}28962897PDFViewerApplication.eventBus.dispatch("fileinputchange", {2898source: this,2899fileInput: evt.dataTransfer2900});2901});29022903if (!PDFViewerApplication.supportsDocumentFonts) {2904_app_options.AppOptions.set("disableFontFace", true);29052906PDFViewerApplication.l10n.get("web_fonts_disabled").then(function (msg) {2907console.warn(msg);2908});2909}29102911if (!PDFViewerApplication.supportsPrinting) {2912appConfig.toolbar.print.classList.add("hidden");2913appConfig.secondaryToolbar.printButton.classList.add("hidden");2914}29152916if (!PDFViewerApplication.supportsFullscreen) {2917appConfig.toolbar.presentationModeButton.classList.add("hidden");2918appConfig.secondaryToolbar.presentationModeButton.classList.add("hidden");2919}29202921if (PDFViewerApplication.supportsIntegratedFind) {2922appConfig.toolbar.viewFind.classList.add("hidden");2923}29242925appConfig.mainContainer.addEventListener("transitionend", function (evt) {2926if (evt.target === this) {2927PDFViewerApplication.eventBus.dispatch("resize", {2928source: this2929});2930}2931}, true);29322933try {2934webViewerOpenFileViaURL(file);2935} catch (reason) {2936PDFViewerApplication.l10n.get("loading_error").then(function (msg) {2937PDFViewerApplication._documentError(msg, reason);2938});2939}2940}29412942function webViewerOpenFileViaURL(file) {2943if (file) {2944PDFViewerApplication.open(file);2945}2946}29472948function webViewerResetPermissions() {2949var appConfig = PDFViewerApplication.appConfig;29502951if (!appConfig) {2952return;2953}29542955appConfig.viewerContainer.classList.remove(ENABLE_PERMISSIONS_CLASS);2956}29572958function webViewerPageRendered(_ref11) {2959var pageNumber = _ref11.pageNumber,2960timestamp = _ref11.timestamp,2961error = _ref11.error;29622963if (pageNumber === PDFViewerApplication.page) {2964PDFViewerApplication.toolbar.updateLoadingIndicatorState(false);2965}29662967if (PDFViewerApplication.pdfSidebar.isThumbnailViewVisible) {2968var pageView = PDFViewerApplication.pdfViewer.getPageView(pageNumber - 1);2969var thumbnailView = PDFViewerApplication.pdfThumbnailViewer.getThumbnail(pageNumber - 1);29702971if (pageView && thumbnailView) {2972thumbnailView.setImage(pageView);2973}2974}29752976if (error) {2977PDFViewerApplication.l10n.get("rendering_error").then(function (msg) {2978PDFViewerApplication._otherError(msg, error);2979});2980}29812982PDFViewerApplication.externalServices.reportTelemetry({2983type: "pageInfo",2984timestamp: timestamp2985});2986PDFViewerApplication.pdfDocument.getStats().then(function (stats) {2987PDFViewerApplication.externalServices.reportTelemetry({2988type: "documentStats",2989stats: stats2990});2991});2992}29932994function webViewerPageMode(_ref12) {2995var mode = _ref12.mode;2996var view;29972998switch (mode) {2999case "thumbs":3000view = _ui_utils.SidebarView.THUMBS;3001break;30023003case "bookmarks":3004case "outline":3005view = _ui_utils.SidebarView.OUTLINE;3006break;30073008case "attachments":3009view = _ui_utils.SidebarView.ATTACHMENTS;3010break;30113012case "layers":3013view = _ui_utils.SidebarView.LAYERS;3014break;30153016case "none":3017view = _ui_utils.SidebarView.NONE;3018break;30193020default:3021console.error('Invalid "pagemode" hash parameter: ' + mode);3022return;3023}30243025PDFViewerApplication.pdfSidebar.switchView(view, true);3026}30273028function webViewerNamedAction(evt) {3029switch (evt.action) {3030case "GoToPage":3031PDFViewerApplication.appConfig.toolbar.pageNumber.select();3032break;30333034case "Find":3035if (!PDFViewerApplication.supportsIntegratedFind) {3036PDFViewerApplication.findBar.toggle();3037}30383039break;30403041case "Print":3042PDFViewerApplication.triggerPrinting();3043break;30443045case "SaveAs":3046webViewerSave();3047break;3048}3049}30503051function webViewerPresentationModeChanged(evt) {3052PDFViewerApplication.pdfViewer.presentationModeState = evt.state;3053}30543055function webViewerSidebarViewChanged(evt) {3056PDFViewerApplication.pdfRenderingQueue.isThumbnailViewEnabled = PDFViewerApplication.pdfSidebar.isThumbnailViewVisible;3057var store = PDFViewerApplication.store;30583059if (store && PDFViewerApplication.isInitialViewSet) {3060store.set("sidebarView", evt.view)["catch"](function () {});3061}3062}30633064function webViewerUpdateViewarea(evt) {3065var location = evt.location,3066store = PDFViewerApplication.store;30673068if (store && PDFViewerApplication.isInitialViewSet) {3069store.setMultiple({3070page: location.pageNumber,3071zoom: location.scale,3072scrollLeft: location.left,3073scrollTop: location.top,3074rotation: location.rotation3075})["catch"](function () {});3076}30773078var href = PDFViewerApplication.pdfLinkService.getAnchorUrl(location.pdfOpenParams);3079PDFViewerApplication.appConfig.toolbar.viewBookmark.href = href;3080PDFViewerApplication.appConfig.secondaryToolbar.viewBookmarkButton.href = href;3081var currentPage = PDFViewerApplication.pdfViewer.getPageView(PDFViewerApplication.page - 1);3082var loading = (currentPage === null || currentPage === void 0 ? void 0 : currentPage.renderingState) !== _pdf_rendering_queue.RenderingStates.FINISHED;3083PDFViewerApplication.toolbar.updateLoadingIndicatorState(loading);3084}30853086function webViewerScrollModeChanged(evt) {3087var store = PDFViewerApplication.store;30883089if (store && PDFViewerApplication.isInitialViewSet) {3090store.set("scrollMode", evt.mode)["catch"](function () {});3091}3092}30933094function webViewerSpreadModeChanged(evt) {3095var store = PDFViewerApplication.store;30963097if (store && PDFViewerApplication.isInitialViewSet) {3098store.set("spreadMode", evt.mode)["catch"](function () {});3099}3100}31013102function webViewerResize() {3103var pdfDocument = PDFViewerApplication.pdfDocument,3104pdfViewer = PDFViewerApplication.pdfViewer;31053106if (!pdfDocument) {3107return;3108}31093110var currentScaleValue = pdfViewer.currentScaleValue;31113112if (currentScaleValue === "auto" || currentScaleValue === "page-fit" || currentScaleValue === "page-width") {3113pdfViewer.currentScaleValue = currentScaleValue;3114}31153116pdfViewer.update();3117}31183119function webViewerHashchange(evt) {3120var hash = evt.hash;31213122if (!hash) {3123return;3124}31253126if (!PDFViewerApplication.isInitialViewSet) {3127PDFViewerApplication.initialBookmark = hash;3128} else if (!PDFViewerApplication.pdfHistory.popStateInProgress) {3129PDFViewerApplication.pdfLinkService.setHash(hash);3130}3131}31323133var webViewerFileInputChange, webViewerOpenFile;3134{3135webViewerFileInputChange = function webViewerFileInputChange(evt) {3136var _PDFViewerApplication;31373138if ((_PDFViewerApplication = PDFViewerApplication.pdfViewer) !== null && _PDFViewerApplication !== void 0 && _PDFViewerApplication.isInPresentationMode) {3139return;3140}31413142var file = evt.fileInput.files[0];31433144if (!_viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL) {3145var url = URL.createObjectURL(file);31463147if (file.name) {3148url = {3149url: url,3150originalUrl: file.name3151};3152}31533154PDFViewerApplication.open(url);3155} else {3156PDFViewerApplication.setTitleUsingUrl(file.name);3157var fileReader = new FileReader();31583159fileReader.onload = function webViewerChangeFileReaderOnload(event) {3160var buffer = event.target.result;3161PDFViewerApplication.open(new Uint8Array(buffer));3162};31633164fileReader.readAsArrayBuffer(file);3165}31663167var appConfig = PDFViewerApplication.appConfig;3168appConfig.toolbar.viewBookmark.hidden = true;3169appConfig.secondaryToolbar.viewBookmarkButton.hidden = true;3170appConfig.toolbar.download.hidden = true;3171appConfig.secondaryToolbar.downloadButton.hidden = true;3172};31733174webViewerOpenFile = function webViewerOpenFile(evt) {3175var openFileInputName = PDFViewerApplication.appConfig.openFileInputName;3176document.getElementById(openFileInputName).click();3177};3178}31793180function webViewerPresentationMode() {3181PDFViewerApplication.requestPresentationMode();3182}31833184function webViewerPrint() {3185PDFViewerApplication.triggerPrinting();3186}31873188function webViewerDownload() {3189PDFViewerApplication.downloadOrSave({3190sourceEventType: "download"3191});3192}31933194function webViewerSave() {3195PDFViewerApplication.downloadOrSave({3196sourceEventType: "save"3197});3198}31993200function webViewerFirstPage() {3201if (PDFViewerApplication.pdfDocument) {3202PDFViewerApplication.page = 1;3203}3204}32053206function webViewerLastPage() {3207if (PDFViewerApplication.pdfDocument) {3208PDFViewerApplication.page = PDFViewerApplication.pagesCount;3209}3210}32113212function webViewerNextPage() {3213PDFViewerApplication.pdfViewer.nextPage();3214}32153216function webViewerPreviousPage() {3217PDFViewerApplication.pdfViewer.previousPage();3218}32193220function webViewerZoomIn() {3221PDFViewerApplication.zoomIn();3222}32233224function webViewerZoomOut() {3225PDFViewerApplication.zoomOut();3226}32273228function webViewerZoomReset() {3229PDFViewerApplication.zoomReset();3230}32313232function webViewerPageNumberChanged(evt) {3233var pdfViewer = PDFViewerApplication.pdfViewer;32343235if (evt.value !== "") {3236PDFViewerApplication.pdfLinkService.goToPage(evt.value);3237}32383239if (evt.value !== pdfViewer.currentPageNumber.toString() && evt.value !== pdfViewer.currentPageLabel) {3240PDFViewerApplication.toolbar.setPageNumber(pdfViewer.currentPageNumber, pdfViewer.currentPageLabel);3241}3242}32433244function webViewerScaleChanged(evt) {3245PDFViewerApplication.pdfViewer.currentScaleValue = evt.value;3246}32473248function webViewerRotateCw() {3249PDFViewerApplication.rotatePages(90);3250}32513252function webViewerRotateCcw() {3253PDFViewerApplication.rotatePages(-90);3254}32553256function webViewerOptionalContentConfig(evt) {3257PDFViewerApplication.pdfViewer.optionalContentConfigPromise = evt.promise;3258}32593260function webViewerSwitchScrollMode(evt) {3261PDFViewerApplication.pdfViewer.scrollMode = evt.mode;3262}32633264function webViewerSwitchSpreadMode(evt) {3265PDFViewerApplication.pdfViewer.spreadMode = evt.mode;3266}32673268function webViewerDocumentProperties() {3269PDFViewerApplication.pdfDocumentProperties.open();3270}32713272function webViewerFind(evt) {3273PDFViewerApplication.findController.executeCommand("find" + evt.type, {3274query: evt.query,3275phraseSearch: evt.phraseSearch,3276caseSensitive: evt.caseSensitive,3277entireWord: evt.entireWord,3278highlightAll: evt.highlightAll,3279findPrevious: evt.findPrevious3280});3281}32823283function webViewerFindFromUrlHash(evt) {3284PDFViewerApplication.findController.executeCommand("find", {3285query: evt.query,3286phraseSearch: evt.phraseSearch,3287caseSensitive: false,3288entireWord: false,3289highlightAll: true,3290findPrevious: false3291});3292}32933294function webViewerUpdateFindMatchesCount(_ref13) {3295var matchesCount = _ref13.matchesCount;32963297if (PDFViewerApplication.supportsIntegratedFind) {3298PDFViewerApplication.externalServices.updateFindMatchesCount(matchesCount);3299} else {3300PDFViewerApplication.findBar.updateResultsCount(matchesCount);3301}3302}33033304function webViewerUpdateFindControlState(_ref14) {3305var state = _ref14.state,3306previous = _ref14.previous,3307matchesCount = _ref14.matchesCount,3308rawQuery = _ref14.rawQuery;33093310if (PDFViewerApplication.supportsIntegratedFind) {3311PDFViewerApplication.externalServices.updateFindControlState({3312result: state,3313findPrevious: previous,3314matchesCount: matchesCount,3315rawQuery: rawQuery3316});3317} else {3318PDFViewerApplication.findBar.updateUIState(state, previous, matchesCount);3319}3320}33213322function webViewerScaleChanging(evt) {3323PDFViewerApplication.toolbar.setPageScale(evt.presetValue, evt.scale);3324PDFViewerApplication.pdfViewer.update();3325}33263327function webViewerRotationChanging(evt) {3328PDFViewerApplication.pdfThumbnailViewer.pagesRotation = evt.pagesRotation;3329PDFViewerApplication.forceRendering();3330PDFViewerApplication.pdfViewer.currentPageNumber = evt.pageNumber;3331}33323333function webViewerPageChanging(_ref15) {3334var pageNumber = _ref15.pageNumber,3335pageLabel = _ref15.pageLabel;3336PDFViewerApplication.toolbar.setPageNumber(pageNumber, pageLabel);3337PDFViewerApplication.secondaryToolbar.setPageNumber(pageNumber);33383339if (PDFViewerApplication.pdfSidebar.isThumbnailViewVisible) {3340PDFViewerApplication.pdfThumbnailViewer.scrollThumbnailIntoView(pageNumber);3341}3342}33433344function webViewerVisibilityChange(evt) {3345if (document.visibilityState === "visible") {3346setZoomDisabledTimeout();3347}3348}33493350var zoomDisabledTimeout = null;33513352function setZoomDisabledTimeout() {3353if (zoomDisabledTimeout) {3354clearTimeout(zoomDisabledTimeout);3355}33563357zoomDisabledTimeout = setTimeout(function () {3358zoomDisabledTimeout = null;3359}, WHEEL_ZOOM_DISABLED_TIMEOUT);3360}33613362function webViewerWheel(evt) {3363var pdfViewer = PDFViewerApplication.pdfViewer,3364supportedMouseWheelZoomModifierKeys = PDFViewerApplication.supportedMouseWheelZoomModifierKeys;33653366if (pdfViewer.isInPresentationMode) {3367return;3368}33693370if (evt.ctrlKey && supportedMouseWheelZoomModifierKeys.ctrlKey || evt.metaKey && supportedMouseWheelZoomModifierKeys.metaKey) {3371evt.preventDefault();33723373if (zoomDisabledTimeout || document.visibilityState === "hidden") {3374return;3375}33763377var previousScale = pdfViewer.currentScale;3378var delta = (0, _ui_utils.normalizeWheelEventDirection)(evt);3379var ticks = 0;33803381if (evt.deltaMode === WheelEvent.DOM_DELTA_LINE || evt.deltaMode === WheelEvent.DOM_DELTA_PAGE) {3382if (Math.abs(delta) >= 1) {3383ticks = Math.sign(delta);3384} else {3385ticks = PDFViewerApplication.accumulateWheelTicks(delta);3386}3387} else {3388var PIXELS_PER_LINE_SCALE = 30;3389ticks = PDFViewerApplication.accumulateWheelTicks(delta / PIXELS_PER_LINE_SCALE);3390}33913392if (ticks < 0) {3393PDFViewerApplication.zoomOut(-ticks);3394} else if (ticks > 0) {3395PDFViewerApplication.zoomIn(ticks);3396}33973398var currentScale = pdfViewer.currentScale;33993400if (previousScale !== currentScale) {3401var scaleCorrectionFactor = currentScale / previousScale - 1;3402var rect = pdfViewer.container.getBoundingClientRect();3403var dx = evt.clientX - rect.left;3404var dy = evt.clientY - rect.top;3405pdfViewer.container.scrollLeft += dx * scaleCorrectionFactor;3406pdfViewer.container.scrollTop += dy * scaleCorrectionFactor;3407}3408} else {3409setZoomDisabledTimeout();3410}3411}34123413function webViewerTouchStart(evt) {3414if (evt.touches.length > 1) {3415evt.preventDefault();3416}3417}34183419function webViewerClick(evt) {3420if (PDFViewerApplication.triggerDelayedFallback && PDFViewerApplication.pdfViewer.containsElement(evt.target)) {3421PDFViewerApplication.triggerDelayedFallback();3422}34233424if (!PDFViewerApplication.secondaryToolbar.isOpen) {3425return;3426}34273428var appConfig = PDFViewerApplication.appConfig;34293430if (PDFViewerApplication.pdfViewer.containsElement(evt.target) || appConfig.toolbar.container.contains(evt.target) && evt.target !== appConfig.secondaryToolbar.toggleButton) {3431PDFViewerApplication.secondaryToolbar.close();3432}3433}34343435function webViewerKeyUp(evt) {3436if (evt.keyCode === 9) {3437if (PDFViewerApplication.triggerDelayedFallback) {3438PDFViewerApplication.triggerDelayedFallback();3439}3440}3441}34423443function webViewerKeyDown(evt) {3444if (PDFViewerApplication.overlayManager.active) {3445return;3446}34473448var handled = false,3449ensureViewerFocused = false;3450var cmd = (evt.ctrlKey ? 1 : 0) | (evt.altKey ? 2 : 0) | (evt.shiftKey ? 4 : 0) | (evt.metaKey ? 8 : 0);3451var pdfViewer = PDFViewerApplication.pdfViewer;3452var isViewerInPresentationMode = pdfViewer === null || pdfViewer === void 0 ? void 0 : pdfViewer.isInPresentationMode;34533454if (cmd === 1 || cmd === 8 || cmd === 5 || cmd === 12) {3455switch (evt.keyCode) {3456case 70:3457if (!PDFViewerApplication.supportsIntegratedFind && !evt.shiftKey) {3458PDFViewerApplication.findBar.open();3459handled = true;3460}34613462break;34633464case 71:3465if (!PDFViewerApplication.supportsIntegratedFind) {3466var findState = PDFViewerApplication.findController.state;34673468if (findState) {3469PDFViewerApplication.findController.executeCommand("findagain", {3470query: findState.query,3471phraseSearch: findState.phraseSearch,3472caseSensitive: findState.caseSensitive,3473entireWord: findState.entireWord,3474highlightAll: findState.highlightAll,3475findPrevious: cmd === 5 || cmd === 123476});3477}34783479handled = true;3480}34813482break;34833484case 61:3485case 107:3486case 187:3487case 171:3488if (!isViewerInPresentationMode) {3489PDFViewerApplication.zoomIn();3490}34913492handled = true;3493break;34943495case 173:3496case 109:3497case 189:3498if (!isViewerInPresentationMode) {3499PDFViewerApplication.zoomOut();3500}35013502handled = true;3503break;35043505case 48:3506case 96:3507if (!isViewerInPresentationMode) {3508setTimeout(function () {3509PDFViewerApplication.zoomReset();3510});3511handled = false;3512}35133514break;35153516case 38:3517if (isViewerInPresentationMode || PDFViewerApplication.page > 1) {3518PDFViewerApplication.page = 1;3519handled = true;3520ensureViewerFocused = true;3521}35223523break;35243525case 40:3526if (isViewerInPresentationMode || PDFViewerApplication.page < PDFViewerApplication.pagesCount) {3527PDFViewerApplication.page = PDFViewerApplication.pagesCount;3528handled = true;3529ensureViewerFocused = true;3530}35313532break;3533}3534}35353536var eventBus = PDFViewerApplication.eventBus;35373538if (cmd === 1 || cmd === 8) {3539switch (evt.keyCode) {3540case 83:3541eventBus.dispatch("download", {3542source: window3543});3544handled = true;3545break;35463547case 79:3548{3549eventBus.dispatch("openfile", {3550source: window3551});3552handled = true;3553}3554break;3555}3556}35573558if (cmd === 3 || cmd === 10) {3559switch (evt.keyCode) {3560case 80:3561PDFViewerApplication.requestPresentationMode();3562handled = true;3563break;35643565case 71:3566PDFViewerApplication.appConfig.toolbar.pageNumber.select();3567handled = true;3568break;3569}3570}35713572if (handled) {3573if (ensureViewerFocused && !isViewerInPresentationMode) {3574pdfViewer.focus();3575}35763577evt.preventDefault();3578return;3579}35803581var curElement = (0, _ui_utils.getActiveOrFocusedElement)();3582var curElementTagName = curElement === null || curElement === void 0 ? void 0 : curElement.tagName.toUpperCase();35833584if (curElementTagName === "INPUT" || curElementTagName === "TEXTAREA" || curElementTagName === "SELECT" || curElement !== null && curElement !== void 0 && curElement.isContentEditable) {3585if (evt.keyCode !== 27) {3586return;3587}3588}35893590if (cmd === 0) {3591var turnPage = 0,3592turnOnlyIfPageFit = false;35933594switch (evt.keyCode) {3595case 38:3596case 33:3597if (pdfViewer.isVerticalScrollbarEnabled) {3598turnOnlyIfPageFit = true;3599}36003601turnPage = -1;3602break;36033604case 8:3605if (!isViewerInPresentationMode) {3606turnOnlyIfPageFit = true;3607}36083609turnPage = -1;3610break;36113612case 37:3613if (pdfViewer.isHorizontalScrollbarEnabled) {3614turnOnlyIfPageFit = true;3615}36163617case 75:3618case 80:3619turnPage = -1;3620break;36213622case 27:3623if (PDFViewerApplication.secondaryToolbar.isOpen) {3624PDFViewerApplication.secondaryToolbar.close();3625handled = true;3626}36273628if (!PDFViewerApplication.supportsIntegratedFind && PDFViewerApplication.findBar.opened) {3629PDFViewerApplication.findBar.close();3630handled = true;3631}36323633break;36343635case 40:3636case 34:3637if (pdfViewer.isVerticalScrollbarEnabled) {3638turnOnlyIfPageFit = true;3639}36403641turnPage = 1;3642break;36433644case 13:3645case 32:3646if (!isViewerInPresentationMode) {3647turnOnlyIfPageFit = true;3648}36493650turnPage = 1;3651break;36523653case 39:3654if (pdfViewer.isHorizontalScrollbarEnabled) {3655turnOnlyIfPageFit = true;3656}36573658case 74:3659case 78:3660turnPage = 1;3661break;36623663case 36:3664if (isViewerInPresentationMode || PDFViewerApplication.page > 1) {3665PDFViewerApplication.page = 1;3666handled = true;3667ensureViewerFocused = true;3668}36693670break;36713672case 35:3673if (isViewerInPresentationMode || PDFViewerApplication.page < PDFViewerApplication.pagesCount) {3674PDFViewerApplication.page = PDFViewerApplication.pagesCount;3675handled = true;3676ensureViewerFocused = true;3677}36783679break;36803681case 83:3682PDFViewerApplication.pdfCursorTools.switchTool(_pdf_cursor_tools.CursorTool.SELECT);3683break;36843685case 72:3686PDFViewerApplication.pdfCursorTools.switchTool(_pdf_cursor_tools.CursorTool.HAND);3687break;36883689case 82:3690PDFViewerApplication.rotatePages(90);3691break;36923693case 115:3694PDFViewerApplication.pdfSidebar.toggle();3695break;3696}36973698if (turnPage !== 0 && (!turnOnlyIfPageFit || pdfViewer.currentScaleValue === "page-fit")) {3699if (turnPage > 0) {3700pdfViewer.nextPage();3701} else {3702pdfViewer.previousPage();3703}37043705handled = true;3706}3707}37083709if (cmd === 4) {3710switch (evt.keyCode) {3711case 13:3712case 32:3713if (!isViewerInPresentationMode && pdfViewer.currentScaleValue !== "page-fit") {3714break;3715}37163717if (PDFViewerApplication.page > 1) {3718PDFViewerApplication.page--;3719}37203721handled = true;3722break;37233724case 82:3725PDFViewerApplication.rotatePages(-90);3726break;3727}3728}37293730if (!handled && !isViewerInPresentationMode) {3731if (evt.keyCode >= 33 && evt.keyCode <= 40 || evt.keyCode === 32 && curElementTagName !== "BUTTON") {3732ensureViewerFocused = true;3733}3734}37353736if (ensureViewerFocused && !pdfViewer.containsElement(curElement)) {3737pdfViewer.focus();3738}37393740if (handled) {3741evt.preventDefault();3742}3743}37443745function beforeUnload(evt) {3746evt.preventDefault();3747evt.returnValue = "";3748return false;3749}37503751var PDFPrintServiceFactory = {3752instance: {3753supportsPrinting: false,3754createPrintService: function createPrintService() {3755throw new Error("Not implemented: createPrintService");3756}3757}3758};3759exports.PDFPrintServiceFactory = PDFPrintServiceFactory;37603761/***/ }),3762/* 4 */3763/***/ ((module, __unused_webpack_exports, __webpack_require__) => {3764376537663767module.exports = __webpack_require__(5);37683769/***/ }),3770/* 5 */3771/***/ ((module, __unused_webpack_exports, __webpack_require__) => {37723773/* module decorator */ module = __webpack_require__.nmd(module);377437753776function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }37773778var runtime = function (exports) {3779"use strict";37803781var Op = Object.prototype;3782var hasOwn = Op.hasOwnProperty;3783var undefined;3784var $Symbol = typeof Symbol === "function" ? Symbol : {};3785var iteratorSymbol = $Symbol.iterator || "@@iterator";3786var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";3787var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";37883789function define(obj, key, value) {3790Object.defineProperty(obj, key, {3791value: value,3792enumerable: true,3793configurable: true,3794writable: true3795});3796return obj[key];3797}37983799try {3800define({}, "");3801} catch (err) {3802define = function define(obj, key, value) {3803return obj[key] = value;3804};3805}38063807function wrap(innerFn, outerFn, self, tryLocsList) {3808var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;3809var generator = Object.create(protoGenerator.prototype);3810var context = new Context(tryLocsList || []);3811generator._invoke = makeInvokeMethod(innerFn, self, context);3812return generator;3813}38143815exports.wrap = wrap;38163817function tryCatch(fn, obj, arg) {3818try {3819return {3820type: "normal",3821arg: fn.call(obj, arg)3822};3823} catch (err) {3824return {3825type: "throw",3826arg: err3827};3828}3829}38303831var GenStateSuspendedStart = "suspendedStart";3832var GenStateSuspendedYield = "suspendedYield";3833var GenStateExecuting = "executing";3834var GenStateCompleted = "completed";3835var ContinueSentinel = {};38363837function Generator() {}38383839function GeneratorFunction() {}38403841function GeneratorFunctionPrototype() {}38423843var IteratorPrototype = {};38443845IteratorPrototype[iteratorSymbol] = function () {3846return this;3847};38483849var getProto = Object.getPrototypeOf;3850var NativeIteratorPrototype = getProto && getProto(getProto(values([])));38513852if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {3853IteratorPrototype = NativeIteratorPrototype;3854}38553856var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);3857GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;3858GeneratorFunctionPrototype.constructor = GeneratorFunction;3859GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction");38603861function defineIteratorMethods(prototype) {3862["next", "throw", "return"].forEach(function (method) {3863define(prototype, method, function (arg) {3864return this._invoke(method, arg);3865});3866});3867}38683869exports.isGeneratorFunction = function (genFun) {3870var ctor = typeof genFun === "function" && genFun.constructor;3871return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction" : false;3872};38733874exports.mark = function (genFun) {3875if (Object.setPrototypeOf) {3876Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);3877} else {3878genFun.__proto__ = GeneratorFunctionPrototype;3879define(genFun, toStringTagSymbol, "GeneratorFunction");3880}38813882genFun.prototype = Object.create(Gp);3883return genFun;3884};38853886exports.awrap = function (arg) {3887return {3888__await: arg3889};3890};38913892function AsyncIterator(generator, PromiseImpl) {3893function invoke(method, arg, resolve, reject) {3894var record = tryCatch(generator[method], generator, arg);38953896if (record.type === "throw") {3897reject(record.arg);3898} else {3899var result = record.arg;3900var value = result.value;39013902if (value && _typeof(value) === "object" && hasOwn.call(value, "__await")) {3903return PromiseImpl.resolve(value.__await).then(function (value) {3904invoke("next", value, resolve, reject);3905}, function (err) {3906invoke("throw", err, resolve, reject);3907});3908}39093910return PromiseImpl.resolve(value).then(function (unwrapped) {3911result.value = unwrapped;3912resolve(result);3913}, function (error) {3914return invoke("throw", error, resolve, reject);3915});3916}3917}39183919var previousPromise;39203921function enqueue(method, arg) {3922function callInvokeWithMethodAndArg() {3923return new PromiseImpl(function (resolve, reject) {3924invoke(method, arg, resolve, reject);3925});3926}39273928return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();3929}39303931this._invoke = enqueue;3932}39333934defineIteratorMethods(AsyncIterator.prototype);39353936AsyncIterator.prototype[asyncIteratorSymbol] = function () {3937return this;3938};39393940exports.AsyncIterator = AsyncIterator;39413942exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {3943if (PromiseImpl === void 0) PromiseImpl = Promise;3944var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);3945return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {3946return result.done ? result.value : iter.next();3947});3948};39493950function makeInvokeMethod(innerFn, self, context) {3951var state = GenStateSuspendedStart;3952return function invoke(method, arg) {3953if (state === GenStateExecuting) {3954throw new Error("Generator is already running");3955}39563957if (state === GenStateCompleted) {3958if (method === "throw") {3959throw arg;3960}39613962return doneResult();3963}39643965context.method = method;3966context.arg = arg;39673968while (true) {3969var delegate = context.delegate;39703971if (delegate) {3972var delegateResult = maybeInvokeDelegate(delegate, context);39733974if (delegateResult) {3975if (delegateResult === ContinueSentinel) continue;3976return delegateResult;3977}3978}39793980if (context.method === "next") {3981context.sent = context._sent = context.arg;3982} else if (context.method === "throw") {3983if (state === GenStateSuspendedStart) {3984state = GenStateCompleted;3985throw context.arg;3986}39873988context.dispatchException(context.arg);3989} else if (context.method === "return") {3990context.abrupt("return", context.arg);3991}39923993state = GenStateExecuting;3994var record = tryCatch(innerFn, self, context);39953996if (record.type === "normal") {3997state = context.done ? GenStateCompleted : GenStateSuspendedYield;39983999if (record.arg === ContinueSentinel) {4000continue;4001}40024003return {4004value: record.arg,4005done: context.done4006};4007} else if (record.type === "throw") {4008state = GenStateCompleted;4009context.method = "throw";4010context.arg = record.arg;4011}4012}4013};4014}40154016function maybeInvokeDelegate(delegate, context) {4017var method = delegate.iterator[context.method];40184019if (method === undefined) {4020context.delegate = null;40214022if (context.method === "throw") {4023if (delegate.iterator["return"]) {4024context.method = "return";4025context.arg = undefined;4026maybeInvokeDelegate(delegate, context);40274028if (context.method === "throw") {4029return ContinueSentinel;4030}4031}40324033context.method = "throw";4034context.arg = new TypeError("The iterator does not provide a 'throw' method");4035}40364037return ContinueSentinel;4038}40394040var record = tryCatch(method, delegate.iterator, context.arg);40414042if (record.type === "throw") {4043context.method = "throw";4044context.arg = record.arg;4045context.delegate = null;4046return ContinueSentinel;4047}40484049var info = record.arg;40504051if (!info) {4052context.method = "throw";4053context.arg = new TypeError("iterator result is not an object");4054context.delegate = null;4055return ContinueSentinel;4056}40574058if (info.done) {4059context[delegate.resultName] = info.value;4060context.next = delegate.nextLoc;40614062if (context.method !== "return") {4063context.method = "next";4064context.arg = undefined;4065}4066} else {4067return info;4068}40694070context.delegate = null;4071return ContinueSentinel;4072}40734074defineIteratorMethods(Gp);4075define(Gp, toStringTagSymbol, "Generator");40764077Gp[iteratorSymbol] = function () {4078return this;4079};40804081Gp.toString = function () {4082return "[object Generator]";4083};40844085function pushTryEntry(locs) {4086var entry = {4087tryLoc: locs[0]4088};40894090if (1 in locs) {4091entry.catchLoc = locs[1];4092}40934094if (2 in locs) {4095entry.finallyLoc = locs[2];4096entry.afterLoc = locs[3];4097}40984099this.tryEntries.push(entry);4100}41014102function resetTryEntry(entry) {4103var record = entry.completion || {};4104record.type = "normal";4105delete record.arg;4106entry.completion = record;4107}41084109function Context(tryLocsList) {4110this.tryEntries = [{4111tryLoc: "root"4112}];4113tryLocsList.forEach(pushTryEntry, this);4114this.reset(true);4115}41164117exports.keys = function (object) {4118var keys = [];41194120for (var key in object) {4121keys.push(key);4122}41234124keys.reverse();4125return function next() {4126while (keys.length) {4127var key = keys.pop();41284129if (key in object) {4130next.value = key;4131next.done = false;4132return next;4133}4134}41354136next.done = true;4137return next;4138};4139};41404141function values(iterable) {4142if (iterable) {4143var iteratorMethod = iterable[iteratorSymbol];41444145if (iteratorMethod) {4146return iteratorMethod.call(iterable);4147}41484149if (typeof iterable.next === "function") {4150return iterable;4151}41524153if (!isNaN(iterable.length)) {4154var i = -1,4155next = function next() {4156while (++i < iterable.length) {4157if (hasOwn.call(iterable, i)) {4158next.value = iterable[i];4159next.done = false;4160return next;4161}4162}41634164next.value = undefined;4165next.done = true;4166return next;4167};41684169return next.next = next;4170}4171}41724173return {4174next: doneResult4175};4176}41774178exports.values = values;41794180function doneResult() {4181return {4182value: undefined,4183done: true4184};4185}41864187Context.prototype = {4188constructor: Context,4189reset: function reset(skipTempReset) {4190this.prev = 0;4191this.next = 0;4192this.sent = this._sent = undefined;4193this.done = false;4194this.delegate = null;4195this.method = "next";4196this.arg = undefined;4197this.tryEntries.forEach(resetTryEntry);41984199if (!skipTempReset) {4200for (var name in this) {4201if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {4202this[name] = undefined;4203}4204}4205}4206},4207stop: function stop() {4208this.done = true;4209var rootEntry = this.tryEntries[0];4210var rootRecord = rootEntry.completion;42114212if (rootRecord.type === "throw") {4213throw rootRecord.arg;4214}42154216return this.rval;4217},4218dispatchException: function dispatchException(exception) {4219if (this.done) {4220throw exception;4221}42224223var context = this;42244225function handle(loc, caught) {4226record.type = "throw";4227record.arg = exception;4228context.next = loc;42294230if (caught) {4231context.method = "next";4232context.arg = undefined;4233}42344235return !!caught;4236}42374238for (var i = this.tryEntries.length - 1; i >= 0; --i) {4239var entry = this.tryEntries[i];4240var record = entry.completion;42414242if (entry.tryLoc === "root") {4243return handle("end");4244}42454246if (entry.tryLoc <= this.prev) {4247var hasCatch = hasOwn.call(entry, "catchLoc");4248var hasFinally = hasOwn.call(entry, "finallyLoc");42494250if (hasCatch && hasFinally) {4251if (this.prev < entry.catchLoc) {4252return handle(entry.catchLoc, true);4253} else if (this.prev < entry.finallyLoc) {4254return handle(entry.finallyLoc);4255}4256} else if (hasCatch) {4257if (this.prev < entry.catchLoc) {4258return handle(entry.catchLoc, true);4259}4260} else if (hasFinally) {4261if (this.prev < entry.finallyLoc) {4262return handle(entry.finallyLoc);4263}4264} else {4265throw new Error("try statement without catch or finally");4266}4267}4268}4269},4270abrupt: function abrupt(type, arg) {4271for (var i = this.tryEntries.length - 1; i >= 0; --i) {4272var entry = this.tryEntries[i];42734274if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {4275var finallyEntry = entry;4276break;4277}4278}42794280if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {4281finallyEntry = null;4282}42834284var record = finallyEntry ? finallyEntry.completion : {};4285record.type = type;4286record.arg = arg;42874288if (finallyEntry) {4289this.method = "next";4290this.next = finallyEntry.finallyLoc;4291return ContinueSentinel;4292}42934294return this.complete(record);4295},4296complete: function complete(record, afterLoc) {4297if (record.type === "throw") {4298throw record.arg;4299}43004301if (record.type === "break" || record.type === "continue") {4302this.next = record.arg;4303} else if (record.type === "return") {4304this.rval = this.arg = record.arg;4305this.method = "return";4306this.next = "end";4307} else if (record.type === "normal" && afterLoc) {4308this.next = afterLoc;4309}43104311return ContinueSentinel;4312},4313finish: function finish(finallyLoc) {4314for (var i = this.tryEntries.length - 1; i >= 0; --i) {4315var entry = this.tryEntries[i];43164317if (entry.finallyLoc === finallyLoc) {4318this.complete(entry.completion, entry.afterLoc);4319resetTryEntry(entry);4320return ContinueSentinel;4321}4322}4323},4324"catch": function _catch(tryLoc) {4325for (var i = this.tryEntries.length - 1; i >= 0; --i) {4326var entry = this.tryEntries[i];43274328if (entry.tryLoc === tryLoc) {4329var record = entry.completion;43304331if (record.type === "throw") {4332var thrown = record.arg;4333resetTryEntry(entry);4334}43354336return thrown;4337}4338}43394340throw new Error("illegal catch attempt");4341},4342delegateYield: function delegateYield(iterable, resultName, nextLoc) {4343this.delegate = {4344iterator: values(iterable),4345resultName: resultName,4346nextLoc: nextLoc4347};43484349if (this.method === "next") {4350this.arg = undefined;4351}43524353return ContinueSentinel;4354}4355};4356return exports;4357}(( false ? 0 : _typeof(module)) === "object" ? module.exports : {});43584359try {4360regeneratorRuntime = runtime;4361} catch (accidentalStrictMode) {4362Function("r", "regeneratorRuntime = r")(runtime);4363}43644365/***/ }),4366/* 6 */4367/***/ ((__unused_webpack_module, exports) => {4368436943704371Object.defineProperty(exports, "__esModule", ({4372value: true4373}));4374exports.apiPageLayoutToSpreadMode = apiPageLayoutToSpreadMode;4375exports.apiPageModeToSidebarView = apiPageModeToSidebarView;4376exports.approximateFraction = approximateFraction;4377exports.backtrackBeforeAllVisibleElements = backtrackBeforeAllVisibleElements;4378exports.binarySearchFirstItem = binarySearchFirstItem;4379exports.getActiveOrFocusedElement = getActiveOrFocusedElement;4380exports.getOutputScale = getOutputScale;4381exports.getPageSizeInches = getPageSizeInches;4382exports.getVisibleElements = getVisibleElements;4383exports.isPortraitOrientation = isPortraitOrientation;4384exports.isValidRotation = isValidRotation;4385exports.isValidScrollMode = isValidScrollMode;4386exports.isValidSpreadMode = isValidSpreadMode;4387exports.moveToEndOfArray = moveToEndOfArray;4388exports.noContextMenuHandler = noContextMenuHandler;4389exports.normalizeWheelEventDelta = normalizeWheelEventDelta;4390exports.normalizeWheelEventDirection = normalizeWheelEventDirection;4391exports.parseQueryString = parseQueryString;4392exports.roundToDivide = roundToDivide;4393exports.scrollIntoView = scrollIntoView;4394exports.waitOnEventOrTimeout = waitOnEventOrTimeout;4395exports.watchScroll = watchScroll;4396exports.WaitOnType = exports.VERTICAL_PADDING = exports.UNKNOWN_SCALE = exports.TextLayerMode = exports.SpreadMode = exports.SidebarView = exports.ScrollMode = exports.SCROLLBAR_PADDING = exports.RendererType = exports.ProgressBar = exports.PresentationModeState = exports.MIN_SCALE = exports.MAX_SCALE = exports.MAX_AUTO_SCALE = exports.EventBus = exports.DEFAULT_SCALE_VALUE = exports.DEFAULT_SCALE = exports.CSS_UNITS = exports.AutoPrintRegExp = exports.animationStarted = void 0;43974398function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }43994400function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }44014402function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }44034404function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }44054406function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }44074408function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }44094410function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }44114412function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }44134414function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }44154416function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }44174418var CSS_UNITS = 96.0 / 72.0;4419exports.CSS_UNITS = CSS_UNITS;4420var DEFAULT_SCALE_VALUE = "auto";4421exports.DEFAULT_SCALE_VALUE = DEFAULT_SCALE_VALUE;4422var DEFAULT_SCALE = 1.0;4423exports.DEFAULT_SCALE = DEFAULT_SCALE;4424var MIN_SCALE = 0.1;4425exports.MIN_SCALE = MIN_SCALE;4426var MAX_SCALE = 10.0;4427exports.MAX_SCALE = MAX_SCALE;4428var UNKNOWN_SCALE = 0;4429exports.UNKNOWN_SCALE = UNKNOWN_SCALE;4430var MAX_AUTO_SCALE = 1.25;4431exports.MAX_AUTO_SCALE = MAX_AUTO_SCALE;4432var SCROLLBAR_PADDING = 40;4433exports.SCROLLBAR_PADDING = SCROLLBAR_PADDING;4434var VERTICAL_PADDING = 5;4435exports.VERTICAL_PADDING = VERTICAL_PADDING;4436var LOADINGBAR_END_OFFSET_VAR = "--loadingBar-end-offset";4437var PresentationModeState = {4438UNKNOWN: 0,4439NORMAL: 1,4440CHANGING: 2,4441FULLSCREEN: 34442};4443exports.PresentationModeState = PresentationModeState;4444var SidebarView = {4445UNKNOWN: -1,4446NONE: 0,4447THUMBS: 1,4448OUTLINE: 2,4449ATTACHMENTS: 3,4450LAYERS: 44451};4452exports.SidebarView = SidebarView;4453var RendererType = {4454CANVAS: "canvas",4455SVG: "svg"4456};4457exports.RendererType = RendererType;4458var TextLayerMode = {4459DISABLE: 0,4460ENABLE: 1,4461ENABLE_ENHANCE: 24462};4463exports.TextLayerMode = TextLayerMode;4464var ScrollMode = {4465UNKNOWN: -1,4466VERTICAL: 0,4467HORIZONTAL: 1,4468WRAPPED: 24469};4470exports.ScrollMode = ScrollMode;4471var SpreadMode = {4472UNKNOWN: -1,4473NONE: 0,4474ODD: 1,4475EVEN: 24476};4477exports.SpreadMode = SpreadMode;4478var AutoPrintRegExp = /\bprint\s*\(/;4479exports.AutoPrintRegExp = AutoPrintRegExp;44804481function getOutputScale(ctx) {4482var devicePixelRatio = window.devicePixelRatio || 1;4483var backingStoreRatio = ctx.webkitBackingStorePixelRatio || ctx.mozBackingStorePixelRatio || ctx.backingStorePixelRatio || 1;4484var pixelRatio = devicePixelRatio / backingStoreRatio;4485return {4486sx: pixelRatio,4487sy: pixelRatio,4488scaled: pixelRatio !== 14489};4490}44914492function scrollIntoView(element, spot) {4493var skipOverflowHiddenElements = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;4494var parent = element.offsetParent;44954496if (!parent) {4497console.error("offsetParent is not set -- cannot scroll");4498return;4499}45004501var offsetY = element.offsetTop + element.clientTop;4502var offsetX = element.offsetLeft + element.clientLeft;45034504while (parent.clientHeight === parent.scrollHeight && parent.clientWidth === parent.scrollWidth || skipOverflowHiddenElements && getComputedStyle(parent).overflow === "hidden") {4505if (parent.dataset._scaleY) {4506offsetY /= parent.dataset._scaleY;4507offsetX /= parent.dataset._scaleX;4508}45094510offsetY += parent.offsetTop;4511offsetX += parent.offsetLeft;4512parent = parent.offsetParent;45134514if (!parent) {4515return;4516}4517}45184519if (spot) {4520if (spot.top !== undefined) {4521offsetY += spot.top;4522}45234524if (spot.left !== undefined) {4525offsetX += spot.left;4526parent.scrollLeft = offsetX;4527}4528}45294530parent.scrollTop = offsetY;4531}45324533function watchScroll(viewAreaElement, callback) {4534var debounceScroll = function debounceScroll(evt) {4535if (rAF) {4536return;4537}45384539rAF = window.requestAnimationFrame(function viewAreaElementScrolled() {4540rAF = null;4541var currentX = viewAreaElement.scrollLeft;4542var lastX = state.lastX;45434544if (currentX !== lastX) {4545state.right = currentX > lastX;4546}45474548state.lastX = currentX;4549var currentY = viewAreaElement.scrollTop;4550var lastY = state.lastY;45514552if (currentY !== lastY) {4553state.down = currentY > lastY;4554}45554556state.lastY = currentY;4557callback(state);4558});4559};45604561var state = {4562right: true,4563down: true,4564lastX: viewAreaElement.scrollLeft,4565lastY: viewAreaElement.scrollTop,4566_eventHandler: debounceScroll4567};4568var rAF = null;4569viewAreaElement.addEventListener("scroll", debounceScroll, true);4570return state;4571}45724573function parseQueryString(query) {4574var parts = query.split("&");4575var params = Object.create(null);45764577for (var i = 0, ii = parts.length; i < ii; ++i) {4578var param = parts[i].split("=");4579var key = param[0].toLowerCase();4580var value = param.length > 1 ? param[1] : null;4581params[decodeURIComponent(key)] = decodeURIComponent(value);4582}45834584return params;4585}45864587function binarySearchFirstItem(items, condition) {4588var minIndex = 0;4589var maxIndex = items.length - 1;45904591if (maxIndex < 0 || !condition(items[maxIndex])) {4592return items.length;4593}45944595if (condition(items[minIndex])) {4596return minIndex;4597}45984599while (minIndex < maxIndex) {4600var currentIndex = minIndex + maxIndex >> 1;4601var currentItem = items[currentIndex];46024603if (condition(currentItem)) {4604maxIndex = currentIndex;4605} else {4606minIndex = currentIndex + 1;4607}4608}46094610return minIndex;4611}46124613function approximateFraction(x) {4614if (Math.floor(x) === x) {4615return [x, 1];4616}46174618var xinv = 1 / x;4619var limit = 8;46204621if (xinv > limit) {4622return [1, limit];4623} else if (Math.floor(xinv) === xinv) {4624return [1, xinv];4625}46264627var x_ = x > 1 ? xinv : x;4628var a = 0,4629b = 1,4630c = 1,4631d = 1;46324633while (true) {4634var p = a + c,4635q = b + d;46364637if (q > limit) {4638break;4639}46404641if (x_ <= p / q) {4642c = p;4643d = q;4644} else {4645a = p;4646b = q;4647}4648}46494650var result;46514652if (x_ - a / b < c / d - x_) {4653result = x_ === x ? [a, b] : [b, a];4654} else {4655result = x_ === x ? [c, d] : [d, c];4656}46574658return result;4659}46604661function roundToDivide(x, div) {4662var r = x % div;4663return r === 0 ? x : Math.round(x - r + div);4664}46654666function getPageSizeInches(_ref) {4667var view = _ref.view,4668userUnit = _ref.userUnit,4669rotate = _ref.rotate;46704671var _view = _slicedToArray(view, 4),4672x1 = _view[0],4673y1 = _view[1],4674x2 = _view[2],4675y2 = _view[3];46764677var changeOrientation = rotate % 180 !== 0;4678var width = (x2 - x1) / 72 * userUnit;4679var height = (y2 - y1) / 72 * userUnit;4680return {4681width: changeOrientation ? height : width,4682height: changeOrientation ? width : height4683};4684}46854686function backtrackBeforeAllVisibleElements(index, views, top) {4687if (index < 2) {4688return index;4689}46904691var elt = views[index].div;4692var pageTop = elt.offsetTop + elt.clientTop;46934694if (pageTop >= top) {4695elt = views[index - 1].div;4696pageTop = elt.offsetTop + elt.clientTop;4697}46984699for (var i = index - 2; i >= 0; --i) {4700elt = views[i].div;47014702if (elt.offsetTop + elt.clientTop + elt.clientHeight <= pageTop) {4703break;4704}47054706index = i;4707}47084709return index;4710}47114712function getVisibleElements(_ref2) {4713var scrollEl = _ref2.scrollEl,4714views = _ref2.views,4715_ref2$sortByVisibilit = _ref2.sortByVisibility,4716sortByVisibility = _ref2$sortByVisibilit === void 0 ? false : _ref2$sortByVisibilit,4717_ref2$horizontal = _ref2.horizontal,4718horizontal = _ref2$horizontal === void 0 ? false : _ref2$horizontal,4719_ref2$rtl = _ref2.rtl,4720rtl = _ref2$rtl === void 0 ? false : _ref2$rtl;4721var top = scrollEl.scrollTop,4722bottom = top + scrollEl.clientHeight;4723var left = scrollEl.scrollLeft,4724right = left + scrollEl.clientWidth;47254726function isElementBottomAfterViewTop(view) {4727var element = view.div;4728var elementBottom = element.offsetTop + element.clientTop + element.clientHeight;4729return elementBottom > top;4730}47314732function isElementNextAfterViewHorizontally(view) {4733var element = view.div;4734var elementLeft = element.offsetLeft + element.clientLeft;4735var elementRight = elementLeft + element.clientWidth;4736return rtl ? elementLeft < right : elementRight > left;4737}47384739var visible = [],4740numViews = views.length;4741var firstVisibleElementInd = binarySearchFirstItem(views, horizontal ? isElementNextAfterViewHorizontally : isElementBottomAfterViewTop);47424743if (firstVisibleElementInd > 0 && firstVisibleElementInd < numViews && !horizontal) {4744firstVisibleElementInd = backtrackBeforeAllVisibleElements(firstVisibleElementInd, views, top);4745}47464747var lastEdge = horizontal ? right : -1;47484749for (var i = firstVisibleElementInd; i < numViews; i++) {4750var view = views[i],4751element = view.div;4752var currentWidth = element.offsetLeft + element.clientLeft;4753var currentHeight = element.offsetTop + element.clientTop;4754var viewWidth = element.clientWidth,4755viewHeight = element.clientHeight;4756var viewRight = currentWidth + viewWidth;4757var viewBottom = currentHeight + viewHeight;47584759if (lastEdge === -1) {4760if (viewBottom >= bottom) {4761lastEdge = viewBottom;4762}4763} else if ((horizontal ? currentWidth : currentHeight) > lastEdge) {4764break;4765}47664767if (viewBottom <= top || currentHeight >= bottom || viewRight <= left || currentWidth >= right) {4768continue;4769}47704771var hiddenHeight = Math.max(0, top - currentHeight) + Math.max(0, viewBottom - bottom);4772var hiddenWidth = Math.max(0, left - currentWidth) + Math.max(0, viewRight - right);4773var fractionHeight = (viewHeight - hiddenHeight) / viewHeight,4774fractionWidth = (viewWidth - hiddenWidth) / viewWidth;4775var percent = fractionHeight * fractionWidth * 100 | 0;4776visible.push({4777id: view.id,4778x: currentWidth,4779y: currentHeight,4780view: view,4781percent: percent,4782widthPercent: fractionWidth * 100 | 04783});4784}47854786var first = visible[0],4787last = visible[visible.length - 1];47884789if (sortByVisibility) {4790visible.sort(function (a, b) {4791var pc = a.percent - b.percent;47924793if (Math.abs(pc) > 0.001) {4794return -pc;4795}47964797return a.id - b.id;4798});4799}48004801return {4802first: first,4803last: last,4804views: visible4805};4806}48074808function noContextMenuHandler(evt) {4809evt.preventDefault();4810}48114812function normalizeWheelEventDirection(evt) {4813var delta = Math.hypot(evt.deltaX, evt.deltaY);4814var angle = Math.atan2(evt.deltaY, evt.deltaX);48154816if (-0.25 * Math.PI < angle && angle < 0.75 * Math.PI) {4817delta = -delta;4818}48194820return delta;4821}48224823function normalizeWheelEventDelta(evt) {4824var delta = normalizeWheelEventDirection(evt);4825var MOUSE_DOM_DELTA_PIXEL_MODE = 0;4826var MOUSE_DOM_DELTA_LINE_MODE = 1;4827var MOUSE_PIXELS_PER_LINE = 30;4828var MOUSE_LINES_PER_PAGE = 30;48294830if (evt.deltaMode === MOUSE_DOM_DELTA_PIXEL_MODE) {4831delta /= MOUSE_PIXELS_PER_LINE * MOUSE_LINES_PER_PAGE;4832} else if (evt.deltaMode === MOUSE_DOM_DELTA_LINE_MODE) {4833delta /= MOUSE_LINES_PER_PAGE;4834}48354836return delta;4837}48384839function isValidRotation(angle) {4840return Number.isInteger(angle) && angle % 90 === 0;4841}48424843function isValidScrollMode(mode) {4844return Number.isInteger(mode) && Object.values(ScrollMode).includes(mode) && mode !== ScrollMode.UNKNOWN;4845}48464847function isValidSpreadMode(mode) {4848return Number.isInteger(mode) && Object.values(SpreadMode).includes(mode) && mode !== SpreadMode.UNKNOWN;4849}48504851function isPortraitOrientation(size) {4852return size.width <= size.height;4853}48544855var WaitOnType = {4856EVENT: "event",4857TIMEOUT: "timeout"4858};4859exports.WaitOnType = WaitOnType;48604861function waitOnEventOrTimeout(_ref3) {4862var target = _ref3.target,4863name = _ref3.name,4864_ref3$delay = _ref3.delay,4865delay = _ref3$delay === void 0 ? 0 : _ref3$delay;4866return new Promise(function (resolve, reject) {4867if (_typeof(target) !== "object" || !(name && typeof name === "string") || !(Number.isInteger(delay) && delay >= 0)) {4868throw new Error("waitOnEventOrTimeout - invalid parameters.");4869}48704871function handler(type) {4872if (target instanceof EventBus) {4873target._off(name, eventHandler);4874} else {4875target.removeEventListener(name, eventHandler);4876}48774878if (timeout) {4879clearTimeout(timeout);4880}48814882resolve(type);4883}48844885var eventHandler = handler.bind(null, WaitOnType.EVENT);48864887if (target instanceof EventBus) {4888target._on(name, eventHandler);4889} else {4890target.addEventListener(name, eventHandler);4891}48924893var timeoutHandler = handler.bind(null, WaitOnType.TIMEOUT);4894var timeout = setTimeout(timeoutHandler, delay);4895});4896}48974898var animationStarted = new Promise(function (resolve) {4899window.requestAnimationFrame(resolve);4900});4901exports.animationStarted = animationStarted;49024903function dispatchDOMEvent(eventName) {4904var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;4905throw new Error("Not implemented: dispatchDOMEvent");4906}49074908var EventBus = /*#__PURE__*/function () {4909function EventBus(options) {4910_classCallCheck(this, EventBus);49114912this._listeners = Object.create(null);4913}49144915_createClass(EventBus, [{4916key: "on",4917value: function on(eventName, listener) {4918var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;49194920this._on(eventName, listener, {4921external: true,4922once: options === null || options === void 0 ? void 0 : options.once4923});4924}4925}, {4926key: "off",4927value: function off(eventName, listener) {4928var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;49294930this._off(eventName, listener, {4931external: true,4932once: options === null || options === void 0 ? void 0 : options.once4933});4934}4935}, {4936key: "dispatch",4937value: function dispatch(eventName) {4938var _this = this;49394940var eventListeners = this._listeners[eventName];49414942if (!eventListeners || eventListeners.length === 0) {4943return;4944}49454946var args = Array.prototype.slice.call(arguments, 1);4947var externalListeners;4948eventListeners.slice(0).forEach(function (_ref4) {4949var listener = _ref4.listener,4950external = _ref4.external,4951once = _ref4.once;49524953if (once) {4954_this._off(eventName, listener);4955}49564957if (external) {4958(externalListeners || (externalListeners = [])).push(listener);4959return;4960}49614962listener.apply(null, args);4963});49644965if (externalListeners) {4966externalListeners.forEach(function (listener) {4967listener.apply(null, args);4968});4969externalListeners = null;4970}4971}4972}, {4973key: "_on",4974value: function _on(eventName, listener) {4975var _this$_listeners;49764977var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;4978var eventListeners = (_this$_listeners = this._listeners)[eventName] || (_this$_listeners[eventName] = []);4979eventListeners.push({4980listener: listener,4981external: (options === null || options === void 0 ? void 0 : options.external) === true,4982once: (options === null || options === void 0 ? void 0 : options.once) === true4983});4984}4985}, {4986key: "_off",4987value: function _off(eventName, listener) {4988var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;4989var eventListeners = this._listeners[eventName];49904991if (!eventListeners) {4992return;4993}49944995for (var i = 0, ii = eventListeners.length; i < ii; i++) {4996if (eventListeners[i].listener === listener) {4997eventListeners.splice(i, 1);4998return;4999}5000}5001}5002}]);50035004return EventBus;5005}();50065007exports.EventBus = EventBus;50085009function clamp(v, min, max) {5010return Math.min(Math.max(v, min), max);5011}50125013var ProgressBar = /*#__PURE__*/function () {5014function ProgressBar(id) {5015var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},5016height = _ref5.height,5017width = _ref5.width,5018units = _ref5.units;50195020_classCallCheck(this, ProgressBar);50215022this.visible = true;5023this.div = document.querySelector(id + " .progress");5024this.bar = this.div.parentNode;5025this.height = height || 100;5026this.width = width || 100;5027this.units = units || "%";5028this.div.style.height = this.height + this.units;5029this.percent = 0;5030}50315032_createClass(ProgressBar, [{5033key: "_updateBar",5034value: function _updateBar() {5035if (this._indeterminate) {5036this.div.classList.add("indeterminate");5037this.div.style.width = this.width + this.units;5038return;5039}50405041this.div.classList.remove("indeterminate");5042var progressSize = this.width * this._percent / 100;5043this.div.style.width = progressSize + this.units;5044}5045}, {5046key: "percent",5047get: function get() {5048return this._percent;5049},5050set: function set(val) {5051this._indeterminate = isNaN(val);5052this._percent = clamp(val, 0, 100);50535054this._updateBar();5055}5056}, {5057key: "setWidth",5058value: function setWidth(viewer) {5059if (!viewer) {5060return;5061}50625063var container = viewer.parentNode;5064var scrollbarWidth = container.offsetWidth - viewer.offsetWidth;50655066if (scrollbarWidth > 0) {5067var doc = document.documentElement;5068doc.style.setProperty(LOADINGBAR_END_OFFSET_VAR, "".concat(scrollbarWidth, "px"));5069}5070}5071}, {5072key: "hide",5073value: function hide() {5074if (!this.visible) {5075return;5076}50775078this.visible = false;5079this.bar.classList.add("hidden");5080}5081}, {5082key: "show",5083value: function show() {5084if (this.visible) {5085return;5086}50875088this.visible = true;5089this.bar.classList.remove("hidden");5090}5091}]);50925093return ProgressBar;5094}();50955096exports.ProgressBar = ProgressBar;50975098function moveToEndOfArray(arr, condition) {5099var moved = [],5100len = arr.length;5101var write = 0;51025103for (var read = 0; read < len; ++read) {5104if (condition(arr[read])) {5105moved.push(arr[read]);5106} else {5107arr[write] = arr[read];5108++write;5109}5110}51115112for (var _read = 0; write < len; ++_read, ++write) {5113arr[write] = moved[_read];5114}5115}51165117function getActiveOrFocusedElement() {5118var curRoot = document;5119var curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus");51205121while ((_curActiveOrFocused = curActiveOrFocused) !== null && _curActiveOrFocused !== void 0 && _curActiveOrFocused.shadowRoot) {5122var _curActiveOrFocused;51235124curRoot = curActiveOrFocused.shadowRoot;5125curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus");5126}51275128return curActiveOrFocused;5129}51305131function apiPageLayoutToSpreadMode(layout) {5132switch (layout) {5133case "SinglePage":5134case "OneColumn":5135return SpreadMode.NONE;51365137case "TwoColumnLeft":5138case "TwoPageLeft":5139return SpreadMode.ODD;51405141case "TwoColumnRight":5142case "TwoPageRight":5143return SpreadMode.EVEN;5144}51455146return SpreadMode.NONE;5147}51485149function apiPageModeToSidebarView(mode) {5150switch (mode) {5151case "UseNone":5152return SidebarView.NONE;51535154case "UseThumbs":5155return SidebarView.THUMBS;51565157case "UseOutlines":5158return SidebarView.OUTLINE;51595160case "UseAttachments":5161return SidebarView.ATTACHMENTS;51625163case "UseOC":5164return SidebarView.LAYERS;5165}51665167return SidebarView.NONE;5168}51695170/***/ }),5171/* 7 */5172/***/ ((module) => {5173517451755176var pdfjsLib;51775178if (typeof window !== "undefined" && window["pdfjs-dist/build/pdf"]) {5179pdfjsLib = window["pdfjs-dist/build/pdf"];5180} else {5181pdfjsLib = require("../build/pdf.js");5182}51835184module.exports = pdfjsLib;51855186/***/ }),5187/* 8 */5188/***/ ((__unused_webpack_module, exports, __webpack_require__) => {5189519051915192Object.defineProperty(exports, "__esModule", ({5193value: true5194}));5195exports.PDFCursorTools = exports.CursorTool = void 0;51965197var _grab_to_pan = __webpack_require__(9);51985199var _ui_utils = __webpack_require__(6);52005201function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }52025203function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }52045205function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }52065207var CursorTool = {5208SELECT: 0,5209HAND: 1,5210ZOOM: 25211};5212exports.CursorTool = CursorTool;52135214var PDFCursorTools = /*#__PURE__*/function () {5215function PDFCursorTools(_ref) {5216var _this = this;52175218var container = _ref.container,5219eventBus = _ref.eventBus,5220_ref$cursorToolOnLoad = _ref.cursorToolOnLoad,5221cursorToolOnLoad = _ref$cursorToolOnLoad === void 0 ? CursorTool.SELECT : _ref$cursorToolOnLoad;52225223_classCallCheck(this, PDFCursorTools);52245225this.container = container;5226this.eventBus = eventBus;5227this.active = CursorTool.SELECT;5228this.activeBeforePresentationMode = null;5229this.handTool = new _grab_to_pan.GrabToPan({5230element: this.container5231});52325233this._addEventListeners();52345235Promise.resolve().then(function () {5236_this.switchTool(cursorToolOnLoad);5237});5238}52395240_createClass(PDFCursorTools, [{5241key: "activeTool",5242get: function get() {5243return this.active;5244}5245}, {5246key: "switchTool",5247value: function switchTool(tool) {5248var _this2 = this;52495250if (this.activeBeforePresentationMode !== null) {5251return;5252}52535254if (tool === this.active) {5255return;5256}52575258var disableActiveTool = function disableActiveTool() {5259switch (_this2.active) {5260case CursorTool.SELECT:5261break;52625263case CursorTool.HAND:5264_this2.handTool.deactivate();52655266break;52675268case CursorTool.ZOOM:5269}5270};52715272switch (tool) {5273case CursorTool.SELECT:5274disableActiveTool();5275break;52765277case CursorTool.HAND:5278disableActiveTool();5279this.handTool.activate();5280break;52815282case CursorTool.ZOOM:5283default:5284console.error("switchTool: \"".concat(tool, "\" is an unsupported value."));5285return;5286}52875288this.active = tool;52895290this._dispatchEvent();5291}5292}, {5293key: "_dispatchEvent",5294value: function _dispatchEvent() {5295this.eventBus.dispatch("cursortoolchanged", {5296source: this,5297tool: this.active5298});5299}5300}, {5301key: "_addEventListeners",5302value: function _addEventListeners() {5303var _this3 = this;53045305this.eventBus._on("switchcursortool", function (evt) {5306_this3.switchTool(evt.tool);5307});53085309this.eventBus._on("presentationmodechanged", function (evt) {5310switch (evt.state) {5311case _ui_utils.PresentationModeState.FULLSCREEN:5312{5313var previouslyActive = _this3.active;53145315_this3.switchTool(CursorTool.SELECT);53165317_this3.activeBeforePresentationMode = previouslyActive;5318break;5319}53205321case _ui_utils.PresentationModeState.NORMAL:5322{5323var _previouslyActive = _this3.activeBeforePresentationMode;5324_this3.activeBeforePresentationMode = null;53255326_this3.switchTool(_previouslyActive);53275328break;5329}5330}5331});5332}5333}]);53345335return PDFCursorTools;5336}();53375338exports.PDFCursorTools = PDFCursorTools;53395340/***/ }),5341/* 9 */5342/***/ ((__unused_webpack_module, exports) => {5343534453455346Object.defineProperty(exports, "__esModule", ({5347value: true5348}));5349exports.GrabToPan = GrabToPan;53505351function GrabToPan(options) {5352this.element = options.element;5353this.document = options.element.ownerDocument;53545355if (typeof options.ignoreTarget === "function") {5356this.ignoreTarget = options.ignoreTarget;5357}53585359this.onActiveChanged = options.onActiveChanged;5360this.activate = this.activate.bind(this);5361this.deactivate = this.deactivate.bind(this);5362this.toggle = this.toggle.bind(this);5363this._onmousedown = this._onmousedown.bind(this);5364this._onmousemove = this._onmousemove.bind(this);5365this._endPan = this._endPan.bind(this);5366var overlay = this.overlay = document.createElement("div");5367overlay.className = "grab-to-pan-grabbing";5368}53695370GrabToPan.prototype = {5371CSS_CLASS_GRAB: "grab-to-pan-grab",5372activate: function GrabToPan_activate() {5373if (!this.active) {5374this.active = true;5375this.element.addEventListener("mousedown", this._onmousedown, true);5376this.element.classList.add(this.CSS_CLASS_GRAB);53775378if (this.onActiveChanged) {5379this.onActiveChanged(true);5380}5381}5382},5383deactivate: function GrabToPan_deactivate() {5384if (this.active) {5385this.active = false;5386this.element.removeEventListener("mousedown", this._onmousedown, true);53875388this._endPan();53895390this.element.classList.remove(this.CSS_CLASS_GRAB);53915392if (this.onActiveChanged) {5393this.onActiveChanged(false);5394}5395}5396},5397toggle: function GrabToPan_toggle() {5398if (this.active) {5399this.deactivate();5400} else {5401this.activate();5402}5403},5404ignoreTarget: function GrabToPan_ignoreTarget(node) {5405return node.matches("a[href], a[href] *, input, textarea, button, button *, select, option");5406},5407_onmousedown: function GrabToPan__onmousedown(event) {5408if (event.button !== 0 || this.ignoreTarget(event.target)) {5409return;5410}54115412if (event.originalTarget) {5413try {5414event.originalTarget.tagName;5415} catch (e) {5416return;5417}5418}54195420this.scrollLeftStart = this.element.scrollLeft;5421this.scrollTopStart = this.element.scrollTop;5422this.clientXStart = event.clientX;5423this.clientYStart = event.clientY;5424this.document.addEventListener("mousemove", this._onmousemove, true);5425this.document.addEventListener("mouseup", this._endPan, true);5426this.element.addEventListener("scroll", this._endPan, true);5427event.preventDefault();5428event.stopPropagation();5429var focusedElement = document.activeElement;54305431if (focusedElement && !focusedElement.contains(event.target)) {5432focusedElement.blur();5433}5434},5435_onmousemove: function GrabToPan__onmousemove(event) {5436this.element.removeEventListener("scroll", this._endPan, true);54375438if (isLeftMouseReleased(event)) {5439this._endPan();54405441return;5442}54435444var xDiff = event.clientX - this.clientXStart;5445var yDiff = event.clientY - this.clientYStart;5446var scrollTop = this.scrollTopStart - yDiff;5447var scrollLeft = this.scrollLeftStart - xDiff;54485449if (this.element.scrollTo) {5450this.element.scrollTo({5451top: scrollTop,5452left: scrollLeft,5453behavior: "instant"5454});5455} else {5456this.element.scrollTop = scrollTop;5457this.element.scrollLeft = scrollLeft;5458}54595460if (!this.overlay.parentNode) {5461document.body.appendChild(this.overlay);5462}5463},5464_endPan: function GrabToPan__endPan() {5465this.element.removeEventListener("scroll", this._endPan, true);5466this.document.removeEventListener("mousemove", this._onmousemove, true);5467this.document.removeEventListener("mouseup", this._endPan, true);5468this.overlay.remove();5469}5470};54715472function isLeftMouseReleased(event) {5473if ("buttons" in event) {5474return !(event.buttons & 1);5475}54765477var chrome = window.chrome;5478var isChrome15OrOpera15plus = chrome && (chrome.webstore || chrome.app);5479var isSafari6plus = /Apple/.test(navigator.vendor) && /Version\/([6-9]\d*|[1-5]\d+)/.test(navigator.userAgent);54805481if (isChrome15OrOpera15plus || isSafari6plus) {5482return event.which === 0;5483}54845485return false;5486}54875488/***/ }),5489/* 10 */5490/***/ ((__unused_webpack_module, exports, __webpack_require__) => {5491549254935494Object.defineProperty(exports, "__esModule", ({5495value: true5496}));5497exports.RenderingStates = exports.PDFRenderingQueue = void 0;54985499var _pdfjsLib = __webpack_require__(7);55005501function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }55025503function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }55045505function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }55065507var CLEANUP_TIMEOUT = 30000;5508var RenderingStates = {5509INITIAL: 0,5510RUNNING: 1,5511PAUSED: 2,5512FINISHED: 35513};5514exports.RenderingStates = RenderingStates;55155516var PDFRenderingQueue = /*#__PURE__*/function () {5517function PDFRenderingQueue() {5518_classCallCheck(this, PDFRenderingQueue);55195520this.pdfViewer = null;5521this.pdfThumbnailViewer = null;5522this.onIdle = null;5523this.highestPriorityPage = null;5524this.idleTimeout = null;5525this.printing = false;5526this.isThumbnailViewEnabled = false;5527}55285529_createClass(PDFRenderingQueue, [{5530key: "setViewer",5531value: function setViewer(pdfViewer) {5532this.pdfViewer = pdfViewer;5533}5534}, {5535key: "setThumbnailViewer",5536value: function setThumbnailViewer(pdfThumbnailViewer) {5537this.pdfThumbnailViewer = pdfThumbnailViewer;5538}5539}, {5540key: "isHighestPriority",5541value: function isHighestPriority(view) {5542return this.highestPriorityPage === view.renderingId;5543}5544}, {5545key: "renderHighestPriority",5546value: function renderHighestPriority(currentlyVisiblePages) {5547if (this.idleTimeout) {5548clearTimeout(this.idleTimeout);5549this.idleTimeout = null;5550}55515552if (this.pdfViewer.forceRendering(currentlyVisiblePages)) {5553return;5554}55555556if (this.pdfThumbnailViewer && this.isThumbnailViewEnabled) {5557if (this.pdfThumbnailViewer.forceRendering()) {5558return;5559}5560}55615562if (this.printing) {5563return;5564}55655566if (this.onIdle) {5567this.idleTimeout = setTimeout(this.onIdle.bind(this), CLEANUP_TIMEOUT);5568}5569}5570}, {5571key: "getHighestPriority",5572value: function getHighestPriority(visible, views, scrolledDown) {5573var visibleViews = visible.views;5574var numVisible = visibleViews.length;55755576if (numVisible === 0) {5577return null;5578}55795580for (var i = 0; i < numVisible; ++i) {5581var view = visibleViews[i].view;55825583if (!this.isViewFinished(view)) {5584return view;5585}5586}55875588if (scrolledDown) {5589var nextPageIndex = visible.last.id;55905591if (views[nextPageIndex] && !this.isViewFinished(views[nextPageIndex])) {5592return views[nextPageIndex];5593}5594} else {5595var previousPageIndex = visible.first.id - 2;55965597if (views[previousPageIndex] && !this.isViewFinished(views[previousPageIndex])) {5598return views[previousPageIndex];5599}5600}56015602return null;5603}5604}, {5605key: "isViewFinished",5606value: function isViewFinished(view) {5607return view.renderingState === RenderingStates.FINISHED;5608}5609}, {5610key: "renderView",5611value: function renderView(view) {5612var _this = this;56135614switch (view.renderingState) {5615case RenderingStates.FINISHED:5616return false;56175618case RenderingStates.PAUSED:5619this.highestPriorityPage = view.renderingId;5620view.resume();5621break;56225623case RenderingStates.RUNNING:5624this.highestPriorityPage = view.renderingId;5625break;56265627case RenderingStates.INITIAL:5628this.highestPriorityPage = view.renderingId;5629view.draw()["finally"](function () {5630_this.renderHighestPriority();5631})["catch"](function (reason) {5632if (reason instanceof _pdfjsLib.RenderingCancelledException) {5633return;5634}56355636console.error("renderView: \"".concat(reason, "\""));5637});5638break;5639}56405641return true;5642}5643}]);56445645return PDFRenderingQueue;5646}();56475648exports.PDFRenderingQueue = PDFRenderingQueue;56495650/***/ }),5651/* 11 */5652/***/ ((__unused_webpack_module, exports, __webpack_require__) => {5653565456555656Object.defineProperty(exports, "__esModule", ({5657value: true5658}));5659exports.OverlayManager = void 0;56605661var _regenerator = _interopRequireDefault(__webpack_require__(4));56625663function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }56645665function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }56665667function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }56685669function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }56705671function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }56725673function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }56745675var OverlayManager = /*#__PURE__*/function () {5676function OverlayManager() {5677_classCallCheck(this, OverlayManager);56785679this._overlays = {};5680this._active = null;5681this._keyDownBound = this._keyDown.bind(this);5682}56835684_createClass(OverlayManager, [{5685key: "active",5686get: function get() {5687return this._active;5688}5689}, {5690key: "register",5691value: function () {5692var _register = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee(name, element) {5693var callerCloseMethod,5694canForceClose,5695container,5696_args = arguments;5697return _regenerator["default"].wrap(function _callee$(_context) {5698while (1) {5699switch (_context.prev = _context.next) {5700case 0:5701callerCloseMethod = _args.length > 2 && _args[2] !== undefined ? _args[2] : null;5702canForceClose = _args.length > 3 && _args[3] !== undefined ? _args[3] : false;57035704if (!(!name || !element || !(container = element.parentNode))) {5705_context.next = 6;5706break;5707}57085709throw new Error("Not enough parameters.");57105711case 6:5712if (!this._overlays[name]) {5713_context.next = 8;5714break;5715}57165717throw new Error("The overlay is already registered.");57185719case 8:5720this._overlays[name] = {5721element: element,5722container: container,5723callerCloseMethod: callerCloseMethod,5724canForceClose: canForceClose5725};57265727case 9:5728case "end":5729return _context.stop();5730}5731}5732}, _callee, this);5733}));57345735function register(_x, _x2) {5736return _register.apply(this, arguments);5737}57385739return register;5740}()5741}, {5742key: "unregister",5743value: function () {5744var _unregister = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2(name) {5745return _regenerator["default"].wrap(function _callee2$(_context2) {5746while (1) {5747switch (_context2.prev = _context2.next) {5748case 0:5749if (this._overlays[name]) {5750_context2.next = 4;5751break;5752}57535754throw new Error("The overlay does not exist.");57555756case 4:5757if (!(this._active === name)) {5758_context2.next = 6;5759break;5760}57615762throw new Error("The overlay cannot be removed while it is active.");57635764case 6:5765delete this._overlays[name];57665767case 7:5768case "end":5769return _context2.stop();5770}5771}5772}, _callee2, this);5773}));57745775function unregister(_x3) {5776return _unregister.apply(this, arguments);5777}57785779return unregister;5780}()5781}, {5782key: "open",5783value: function () {5784var _open = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee3(name) {5785return _regenerator["default"].wrap(function _callee3$(_context3) {5786while (1) {5787switch (_context3.prev = _context3.next) {5788case 0:5789if (this._overlays[name]) {5790_context3.next = 4;5791break;5792}57935794throw new Error("The overlay does not exist.");57955796case 4:5797if (!this._active) {5798_context3.next = 14;5799break;5800}58015802if (!this._overlays[name].canForceClose) {5803_context3.next = 9;5804break;5805}58065807this._closeThroughCaller();58085809_context3.next = 14;5810break;58115812case 9:5813if (!(this._active === name)) {5814_context3.next = 13;5815break;5816}58175818throw new Error("The overlay is already active.");58195820case 13:5821throw new Error("Another overlay is currently active.");58225823case 14:5824this._active = name;58255826this._overlays[this._active].element.classList.remove("hidden");58275828this._overlays[this._active].container.classList.remove("hidden");58295830window.addEventListener("keydown", this._keyDownBound);58315832case 18:5833case "end":5834return _context3.stop();5835}5836}5837}, _callee3, this);5838}));58395840function open(_x4) {5841return _open.apply(this, arguments);5842}58435844return open;5845}()5846}, {5847key: "close",5848value: function () {5849var _close = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee4(name) {5850return _regenerator["default"].wrap(function _callee4$(_context4) {5851while (1) {5852switch (_context4.prev = _context4.next) {5853case 0:5854if (this._overlays[name]) {5855_context4.next = 4;5856break;5857}58585859throw new Error("The overlay does not exist.");58605861case 4:5862if (this._active) {5863_context4.next = 8;5864break;5865}58665867throw new Error("The overlay is currently not active.");58685869case 8:5870if (!(this._active !== name)) {5871_context4.next = 10;5872break;5873}58745875throw new Error("Another overlay is currently active.");58765877case 10:5878this._overlays[this._active].container.classList.add("hidden");58795880this._overlays[this._active].element.classList.add("hidden");58815882this._active = null;5883window.removeEventListener("keydown", this._keyDownBound);58845885case 14:5886case "end":5887return _context4.stop();5888}5889}5890}, _callee4, this);5891}));58925893function close(_x5) {5894return _close.apply(this, arguments);5895}58965897return close;5898}()5899}, {5900key: "_keyDown",5901value: function _keyDown(evt) {5902if (this._active && evt.keyCode === 27) {5903this._closeThroughCaller();59045905evt.preventDefault();5906}5907}5908}, {5909key: "_closeThroughCaller",5910value: function _closeThroughCaller() {5911if (this._overlays[this._active].callerCloseMethod) {5912this._overlays[this._active].callerCloseMethod();5913}59145915if (this._active) {5916this.close(this._active);5917}5918}5919}]);59205921return OverlayManager;5922}();59235924exports.OverlayManager = OverlayManager;59255926/***/ }),5927/* 12 */5928/***/ ((__unused_webpack_module, exports, __webpack_require__) => {5929593059315932Object.defineProperty(exports, "__esModule", ({5933value: true5934}));5935exports.PasswordPrompt = void 0;59365937var _regenerator = _interopRequireDefault(__webpack_require__(4));59385939var _pdfjsLib = __webpack_require__(7);59405941function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }59425943function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }59445945function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }59465947function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }59485949function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }59505951function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }59525953var PasswordPrompt = /*#__PURE__*/function () {5954function PasswordPrompt(options, overlayManager, l10n) {5955var _this = this;59565957var isViewerEmbedded = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;59585959_classCallCheck(this, PasswordPrompt);59605961this.overlayName = options.overlayName;5962this.container = options.container;5963this.label = options.label;5964this.input = options.input;5965this.submitButton = options.submitButton;5966this.cancelButton = options.cancelButton;5967this.overlayManager = overlayManager;5968this.l10n = l10n;5969this._isViewerEmbedded = isViewerEmbedded;5970this.updateCallback = null;5971this.reason = null;5972this.submitButton.addEventListener("click", this.verify.bind(this));5973this.cancelButton.addEventListener("click", this.close.bind(this));5974this.input.addEventListener("keydown", function (e) {5975if (e.keyCode === 13) {5976_this.verify();5977}5978});5979this.overlayManager.register(this.overlayName, this.container, this.close.bind(this), true);5980}59815982_createClass(PasswordPrompt, [{5983key: "open",5984value: function () {5985var _open = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee() {5986var passwordIncorrect;5987return _regenerator["default"].wrap(function _callee$(_context) {5988while (1) {5989switch (_context.prev = _context.next) {5990case 0:5991_context.next = 2;5992return this.overlayManager.open(this.overlayName);59935994case 2:5995passwordIncorrect = this.reason === _pdfjsLib.PasswordResponses.INCORRECT_PASSWORD;59965997if (!this._isViewerEmbedded || passwordIncorrect) {5998this.input.focus();5999}60006001_context.next = 6;6002return this.l10n.get("password_".concat(passwordIncorrect ? "invalid" : "label"));60036004case 6:6005this.label.textContent = _context.sent;60066007case 7:6008case "end":6009return _context.stop();6010}6011}6012}, _callee, this);6013}));60146015function open() {6016return _open.apply(this, arguments);6017}60186019return open;6020}()6021}, {6022key: "close",6023value: function close() {6024var _this2 = this;60256026this.overlayManager.close(this.overlayName).then(function () {6027_this2.input.value = "";6028});6029}6030}, {6031key: "verify",6032value: function verify() {6033var password = this.input.value;60346035if ((password === null || password === void 0 ? void 0 : password.length) > 0) {6036this.close();6037this.updateCallback(password);6038}6039}6040}, {6041key: "setUpdateCallback",6042value: function setUpdateCallback(updateCallback, reason) {6043this.updateCallback = updateCallback;6044this.reason = reason;6045}6046}]);60476048return PasswordPrompt;6049}();60506051exports.PasswordPrompt = PasswordPrompt;60526053/***/ }),6054/* 13 */6055/***/ ((__unused_webpack_module, exports, __webpack_require__) => {6056605760586059function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }60606061Object.defineProperty(exports, "__esModule", ({6062value: true6063}));6064exports.PDFAttachmentViewer = void 0;60656066var _pdfjsLib = __webpack_require__(7);60676068var _base_tree_viewer = __webpack_require__(14);60696070function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }60716072function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }60736074function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }60756076function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }60776078function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }60796080function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }60816082function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }60836084function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }60856086function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }60876088function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }60896090function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }60916092function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }60936094function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }60956096function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }60976098function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }60996100var PDFAttachmentViewer = /*#__PURE__*/function (_BaseTreeViewer) {6101_inherits(PDFAttachmentViewer, _BaseTreeViewer);61026103var _super = _createSuper(PDFAttachmentViewer);61046105function PDFAttachmentViewer(options) {6106var _this;61076108_classCallCheck(this, PDFAttachmentViewer);61096110_this = _super.call(this, options);6111_this.downloadManager = options.downloadManager;61126113_this.eventBus._on("fileattachmentannotation", _this._appendAttachment.bind(_assertThisInitialized(_this)));61146115return _this;6116}61176118_createClass(PDFAttachmentViewer, [{6119key: "reset",6120value: function reset() {6121var keepRenderedCapability = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;61226123_get(_getPrototypeOf(PDFAttachmentViewer.prototype), "reset", this).call(this);61246125this._attachments = null;61266127if (!keepRenderedCapability) {6128this._renderedCapability = (0, _pdfjsLib.createPromiseCapability)();6129}61306131if (this._pendingDispatchEvent) {6132clearTimeout(this._pendingDispatchEvent);6133}61346135this._pendingDispatchEvent = null;6136}6137}, {6138key: "_dispatchEvent",6139value: function _dispatchEvent(attachmentsCount) {6140var _this2 = this;61416142this._renderedCapability.resolve();61436144if (this._pendingDispatchEvent) {6145clearTimeout(this._pendingDispatchEvent);6146this._pendingDispatchEvent = null;6147}61486149if (attachmentsCount === 0) {6150this._pendingDispatchEvent = setTimeout(function () {6151_this2.eventBus.dispatch("attachmentsloaded", {6152source: _this2,6153attachmentsCount: 06154});61556156_this2._pendingDispatchEvent = null;6157});6158return;6159}61606161this.eventBus.dispatch("attachmentsloaded", {6162source: this,6163attachmentsCount: attachmentsCount6164});6165}6166}, {6167key: "_bindLink",6168value: function _bindLink(element, _ref) {6169var _this3 = this;61706171var content = _ref.content,6172filename = _ref.filename;61736174element.onclick = function () {6175_this3.downloadManager.openOrDownloadData(element, content, filename);61766177return false;6178};6179}6180}, {6181key: "render",6182value: function render(_ref2) {6183var attachments = _ref2.attachments,6184_ref2$keepRenderedCap = _ref2.keepRenderedCapability,6185keepRenderedCapability = _ref2$keepRenderedCap === void 0 ? false : _ref2$keepRenderedCap;61866187if (this._attachments) {6188this.reset(keepRenderedCapability);6189}61906191this._attachments = attachments || null;61926193if (!attachments) {6194this._dispatchEvent(0);61956196return;6197}61986199var names = Object.keys(attachments).sort(function (a, b) {6200return a.toLowerCase().localeCompare(b.toLowerCase());6201});6202var fragment = document.createDocumentFragment();6203var attachmentsCount = 0;62046205var _iterator = _createForOfIteratorHelper(names),6206_step;62076208try {6209for (_iterator.s(); !(_step = _iterator.n()).done;) {6210var name = _step.value;6211var item = attachments[name];6212var content = item.content,6213filename = (0, _pdfjsLib.getFilenameFromUrl)(item.filename);6214var div = document.createElement("div");6215div.className = "treeItem";6216var element = document.createElement("a");62176218this._bindLink(element, {6219content: content,6220filename: filename6221});62226223element.textContent = this._normalizeTextContent(filename);6224div.appendChild(element);6225fragment.appendChild(div);6226attachmentsCount++;6227}6228} catch (err) {6229_iterator.e(err);6230} finally {6231_iterator.f();6232}62336234this._finishRendering(fragment, attachmentsCount);6235}6236}, {6237key: "_appendAttachment",6238value: function _appendAttachment(_ref3) {6239var _this4 = this;62406241var id = _ref3.id,6242filename = _ref3.filename,6243content = _ref3.content;6244var renderedPromise = this._renderedCapability.promise;6245renderedPromise.then(function () {6246if (renderedPromise !== _this4._renderedCapability.promise) {6247return;6248}62496250var attachments = _this4._attachments;62516252if (!attachments) {6253attachments = Object.create(null);6254} else {6255for (var name in attachments) {6256if (id === name) {6257return;6258}6259}6260}62616262attachments[id] = {6263filename: filename,6264content: content6265};62666267_this4.render({6268attachments: attachments,6269keepRenderedCapability: true6270});6271});6272}6273}]);62746275return PDFAttachmentViewer;6276}(_base_tree_viewer.BaseTreeViewer);62776278exports.PDFAttachmentViewer = PDFAttachmentViewer;62796280/***/ }),6281/* 14 */6282/***/ ((__unused_webpack_module, exports, __webpack_require__) => {6283628462856286Object.defineProperty(exports, "__esModule", ({6287value: true6288}));6289exports.BaseTreeViewer = void 0;62906291var _pdfjsLib = __webpack_require__(7);62926293function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }62946295function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }62966297function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }62986299function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }63006301function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }63026303function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }63046305var TREEITEM_OFFSET_TOP = -100;6306var TREEITEM_SELECTED_CLASS = "selected";63076308var BaseTreeViewer = /*#__PURE__*/function () {6309function BaseTreeViewer(options) {6310_classCallCheck(this, BaseTreeViewer);63116312if (this.constructor === BaseTreeViewer) {6313throw new Error("Cannot initialize BaseTreeViewer.");6314}63156316this.container = options.container;6317this.eventBus = options.eventBus;6318this.reset();6319}63206321_createClass(BaseTreeViewer, [{6322key: "reset",6323value: function reset() {6324this._pdfDocument = null;6325this._lastToggleIsShow = true;6326this._currentTreeItem = null;6327this.container.textContent = "";6328this.container.classList.remove("treeWithDeepNesting");6329}6330}, {6331key: "_dispatchEvent",6332value: function _dispatchEvent(count) {6333throw new Error("Not implemented: _dispatchEvent");6334}6335}, {6336key: "_bindLink",6337value: function _bindLink(element, params) {6338throw new Error("Not implemented: _bindLink");6339}6340}, {6341key: "_normalizeTextContent",6342value: function _normalizeTextContent(str) {6343return (0, _pdfjsLib.removeNullCharacters)(str) || "\u2013";6344}6345}, {6346key: "_addToggleButton",6347value: function _addToggleButton(div) {6348var _this = this;63496350var hidden = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;6351var toggler = document.createElement("div");6352toggler.className = "treeItemToggler";63536354if (hidden) {6355toggler.classList.add("treeItemsHidden");6356}63576358toggler.onclick = function (evt) {6359evt.stopPropagation();6360toggler.classList.toggle("treeItemsHidden");63616362if (evt.shiftKey) {6363var shouldShowAll = !toggler.classList.contains("treeItemsHidden");63646365_this._toggleTreeItem(div, shouldShowAll);6366}6367};63686369div.insertBefore(toggler, div.firstChild);6370}6371}, {6372key: "_toggleTreeItem",6373value: function _toggleTreeItem(root) {6374var show = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;6375this._lastToggleIsShow = show;63766377var _iterator = _createForOfIteratorHelper(root.querySelectorAll(".treeItemToggler")),6378_step;63796380try {6381for (_iterator.s(); !(_step = _iterator.n()).done;) {6382var toggler = _step.value;6383toggler.classList.toggle("treeItemsHidden", !show);6384}6385} catch (err) {6386_iterator.e(err);6387} finally {6388_iterator.f();6389}6390}6391}, {6392key: "_toggleAllTreeItems",6393value: function _toggleAllTreeItems() {6394this._toggleTreeItem(this.container, !this._lastToggleIsShow);6395}6396}, {6397key: "_finishRendering",6398value: function _finishRendering(fragment, count) {6399var hasAnyNesting = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;64006401if (hasAnyNesting) {6402this.container.classList.add("treeWithDeepNesting");6403this._lastToggleIsShow = !fragment.querySelector(".treeItemsHidden");6404}64056406this.container.appendChild(fragment);64076408this._dispatchEvent(count);6409}6410}, {6411key: "render",6412value: function render(params) {6413throw new Error("Not implemented: render");6414}6415}, {6416key: "_updateCurrentTreeItem",6417value: function _updateCurrentTreeItem() {6418var treeItem = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;64196420if (this._currentTreeItem) {6421this._currentTreeItem.classList.remove(TREEITEM_SELECTED_CLASS);64226423this._currentTreeItem = null;6424}64256426if (treeItem) {6427treeItem.classList.add(TREEITEM_SELECTED_CLASS);6428this._currentTreeItem = treeItem;6429}6430}6431}, {6432key: "_scrollToCurrentTreeItem",6433value: function _scrollToCurrentTreeItem(treeItem) {6434if (!treeItem) {6435return;6436}64376438var currentNode = treeItem.parentNode;64396440while (currentNode && currentNode !== this.container) {6441if (currentNode.classList.contains("treeItem")) {6442var toggler = currentNode.firstElementChild;6443toggler === null || toggler === void 0 ? void 0 : toggler.classList.remove("treeItemsHidden");6444}64456446currentNode = currentNode.parentNode;6447}64486449this._updateCurrentTreeItem(treeItem);64506451this.container.scrollTo(treeItem.offsetLeft, treeItem.offsetTop + TREEITEM_OFFSET_TOP);6452}6453}]);64546455return BaseTreeViewer;6456}();64576458exports.BaseTreeViewer = BaseTreeViewer;64596460/***/ }),6461/* 15 */6462/***/ ((__unused_webpack_module, exports, __webpack_require__) => {6463646464656466Object.defineProperty(exports, "__esModule", ({6467value: true6468}));6469exports.PDFDocumentProperties = void 0;64706471var _regenerator = _interopRequireDefault(__webpack_require__(4));64726473var _pdfjsLib = __webpack_require__(7);64746475var _ui_utils = __webpack_require__(6);64766477function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }64786479function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }64806481function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }64826483function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }64846485function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }64866487function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }64886489function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }64906491function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }64926493function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }64946495function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }64966497function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }64986499function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }65006501var DEFAULT_FIELD_CONTENT = "-";6502var NON_METRIC_LOCALES = ["en-us", "en-lr", "my"];6503var US_PAGE_NAMES = {6504"8.5x11": "Letter",6505"8.5x14": "Legal"6506};6507var METRIC_PAGE_NAMES = {6508"297x420": "A3",6509"210x297": "A4"6510};65116512function getPageName(size, isPortrait, pageNames) {6513var width = isPortrait ? size.width : size.height;6514var height = isPortrait ? size.height : size.width;6515return pageNames["".concat(width, "x").concat(height)];6516}65176518var PDFDocumentProperties = /*#__PURE__*/function () {6519function PDFDocumentProperties(_ref, overlayManager, eventBus, l10n) {6520var _this = this;65216522var overlayName = _ref.overlayName,6523fields = _ref.fields,6524container = _ref.container,6525closeButton = _ref.closeButton;65266527_classCallCheck(this, PDFDocumentProperties);65286529this.overlayName = overlayName;6530this.fields = fields;6531this.container = container;6532this.overlayManager = overlayManager;6533this.l10n = l10n;65346535this._reset();65366537closeButton.addEventListener("click", this.close.bind(this));6538this.overlayManager.register(this.overlayName, this.container, this.close.bind(this));65396540eventBus._on("pagechanging", function (evt) {6541_this._currentPageNumber = evt.pageNumber;6542});65436544eventBus._on("rotationchanging", function (evt) {6545_this._pagesRotation = evt.pagesRotation;6546});65476548this._isNonMetricLocale = true;6549l10n.getLanguage().then(function (locale) {6550_this._isNonMetricLocale = NON_METRIC_LOCALES.includes(locale);6551});6552}65536554_createClass(PDFDocumentProperties, [{6555key: "open",6556value: function () {6557var _open = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee() {6558var _this2 = this;65596560var freezeFieldData, currentPageNumber, pagesRotation, _yield$this$pdfDocume, info, contentDispositionFilename, contentLength, _yield$Promise$all, _yield$Promise$all2, fileName, fileSize, creationDate, modificationDate, pageSize, isLinearized, _yield$this$pdfDocume2, length, data;65616562return _regenerator["default"].wrap(function _callee$(_context) {6563while (1) {6564switch (_context.prev = _context.next) {6565case 0:6566freezeFieldData = function freezeFieldData(data) {6567Object.defineProperty(_this2, "fieldData", {6568value: Object.freeze(data),6569writable: false,6570enumerable: true,6571configurable: true6572});6573};65746575_context.next = 3;6576return Promise.all([this.overlayManager.open(this.overlayName), this._dataAvailableCapability.promise]);65776578case 3:6579currentPageNumber = this._currentPageNumber;6580pagesRotation = this._pagesRotation;65816582if (!(this.fieldData && currentPageNumber === this.fieldData._currentPageNumber && pagesRotation === this.fieldData._pagesRotation)) {6583_context.next = 8;6584break;6585}65866587this._updateUI();65886589return _context.abrupt("return");65906591case 8:6592_context.next = 10;6593return this.pdfDocument.getMetadata();65946595case 10:6596_yield$this$pdfDocume = _context.sent;6597info = _yield$this$pdfDocume.info;6598contentDispositionFilename = _yield$this$pdfDocume.contentDispositionFilename;6599contentLength = _yield$this$pdfDocume.contentLength;6600_context.next = 16;6601return Promise.all([contentDispositionFilename || (0, _pdfjsLib.getPdfFilenameFromUrl)(this.url), this._parseFileSize(contentLength), this._parseDate(info.CreationDate), this._parseDate(info.ModDate), this.pdfDocument.getPage(currentPageNumber).then(function (pdfPage) {6602return _this2._parsePageSize((0, _ui_utils.getPageSizeInches)(pdfPage), pagesRotation);6603}), this._parseLinearization(info.IsLinearized)]);66046605case 16:6606_yield$Promise$all = _context.sent;6607_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 6);6608fileName = _yield$Promise$all2[0];6609fileSize = _yield$Promise$all2[1];6610creationDate = _yield$Promise$all2[2];6611modificationDate = _yield$Promise$all2[3];6612pageSize = _yield$Promise$all2[4];6613isLinearized = _yield$Promise$all2[5];6614freezeFieldData({6615fileName: fileName,6616fileSize: fileSize,6617title: info.Title,6618author: info.Author,6619subject: info.Subject,6620keywords: info.Keywords,6621creationDate: creationDate,6622modificationDate: modificationDate,6623creator: info.Creator,6624producer: info.Producer,6625version: info.PDFFormatVersion,6626pageCount: this.pdfDocument.numPages,6627pageSize: pageSize,6628linearized: isLinearized,6629_currentPageNumber: currentPageNumber,6630_pagesRotation: pagesRotation6631});66326633this._updateUI();66346635_context.next = 28;6636return this.pdfDocument.getDownloadInfo();66376638case 28:6639_yield$this$pdfDocume2 = _context.sent;6640length = _yield$this$pdfDocume2.length;66416642if (!(contentLength === length)) {6643_context.next = 32;6644break;6645}66466647return _context.abrupt("return");66486649case 32:6650data = Object.assign(Object.create(null), this.fieldData);6651_context.next = 35;6652return this._parseFileSize(length);66536654case 35:6655data.fileSize = _context.sent;6656freezeFieldData(data);66576658this._updateUI();66596660case 38:6661case "end":6662return _context.stop();6663}6664}6665}, _callee, this);6666}));66676668function open() {6669return _open.apply(this, arguments);6670}66716672return open;6673}()6674}, {6675key: "close",6676value: function close() {6677this.overlayManager.close(this.overlayName);6678}6679}, {6680key: "setDocument",6681value: function setDocument(pdfDocument) {6682var url = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;66836684if (this.pdfDocument) {6685this._reset();66866687this._updateUI(true);6688}66896690if (!pdfDocument) {6691return;6692}66936694this.pdfDocument = pdfDocument;6695this.url = url;66966697this._dataAvailableCapability.resolve();6698}6699}, {6700key: "_reset",6701value: function _reset() {6702this.pdfDocument = null;6703this.url = null;6704delete this.fieldData;6705this._dataAvailableCapability = (0, _pdfjsLib.createPromiseCapability)();6706this._currentPageNumber = 1;6707this._pagesRotation = 0;6708}6709}, {6710key: "_updateUI",6711value: function _updateUI() {6712var reset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;67136714if (reset || !this.fieldData) {6715for (var id in this.fields) {6716this.fields[id].textContent = DEFAULT_FIELD_CONTENT;6717}67186719return;6720}67216722if (this.overlayManager.active !== this.overlayName) {6723return;6724}67256726for (var _id in this.fields) {6727var content = this.fieldData[_id];6728this.fields[_id].textContent = content || content === 0 ? content : DEFAULT_FIELD_CONTENT;6729}6730}6731}, {6732key: "_parseFileSize",6733value: function () {6734var _parseFileSize2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {6735var fileSize,6736kb,6737mb,6738_args2 = arguments;6739return _regenerator["default"].wrap(function _callee2$(_context2) {6740while (1) {6741switch (_context2.prev = _context2.next) {6742case 0:6743fileSize = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : 0;6744kb = fileSize / 1024, mb = kb / 1024;67456746if (kb) {6747_context2.next = 4;6748break;6749}67506751return _context2.abrupt("return", undefined);67526753case 4:6754return _context2.abrupt("return", this.l10n.get("document_properties_".concat(mb >= 1 ? "mb" : "kb"), {6755size_mb: mb >= 1 && (+mb.toPrecision(3)).toLocaleString(),6756size_kb: mb < 1 && (+kb.toPrecision(3)).toLocaleString(),6757size_b: fileSize.toLocaleString()6758}));67596760case 5:6761case "end":6762return _context2.stop();6763}6764}6765}, _callee2, this);6766}));67676768function _parseFileSize() {6769return _parseFileSize2.apply(this, arguments);6770}67716772return _parseFileSize;6773}()6774}, {6775key: "_parsePageSize",6776value: function () {6777var _parsePageSize2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee3(pageSizeInches, pagesRotation) {6778var isPortrait, sizeInches, sizeMillimeters, rawName, exactMillimeters, intMillimeters, _yield$Promise$all3, _yield$Promise$all4, _yield$Promise$all4$, width, height, unit, name, orientation;67796780return _regenerator["default"].wrap(function _callee3$(_context3) {6781while (1) {6782switch (_context3.prev = _context3.next) {6783case 0:6784if (pageSizeInches) {6785_context3.next = 2;6786break;6787}67886789return _context3.abrupt("return", undefined);67906791case 2:6792if (pagesRotation % 180 !== 0) {6793pageSizeInches = {6794width: pageSizeInches.height,6795height: pageSizeInches.width6796};6797}67986799isPortrait = (0, _ui_utils.isPortraitOrientation)(pageSizeInches);6800sizeInches = {6801width: Math.round(pageSizeInches.width * 100) / 100,6802height: Math.round(pageSizeInches.height * 100) / 1006803};6804sizeMillimeters = {6805width: Math.round(pageSizeInches.width * 25.4 * 10) / 10,6806height: Math.round(pageSizeInches.height * 25.4 * 10) / 106807};6808rawName = getPageName(sizeInches, isPortrait, US_PAGE_NAMES) || getPageName(sizeMillimeters, isPortrait, METRIC_PAGE_NAMES);68096810if (!rawName && !(Number.isInteger(sizeMillimeters.width) && Number.isInteger(sizeMillimeters.height))) {6811exactMillimeters = {6812width: pageSizeInches.width * 25.4,6813height: pageSizeInches.height * 25.46814};6815intMillimeters = {6816width: Math.round(sizeMillimeters.width),6817height: Math.round(sizeMillimeters.height)6818};68196820if (Math.abs(exactMillimeters.width - intMillimeters.width) < 0.1 && Math.abs(exactMillimeters.height - intMillimeters.height) < 0.1) {6821rawName = getPageName(intMillimeters, isPortrait, METRIC_PAGE_NAMES);68226823if (rawName) {6824sizeInches = {6825width: Math.round(intMillimeters.width / 25.4 * 100) / 100,6826height: Math.round(intMillimeters.height / 25.4 * 100) / 1006827};6828sizeMillimeters = intMillimeters;6829}6830}6831}68326833_context3.next = 10;6834return Promise.all([this._isNonMetricLocale ? sizeInches : sizeMillimeters, this.l10n.get("document_properties_page_size_unit_".concat(this._isNonMetricLocale ? "inches" : "millimeters")), rawName && this.l10n.get("document_properties_page_size_name_".concat(rawName.toLowerCase())), this.l10n.get("document_properties_page_size_orientation_".concat(isPortrait ? "portrait" : "landscape"))]);68356836case 10:6837_yield$Promise$all3 = _context3.sent;6838_yield$Promise$all4 = _slicedToArray(_yield$Promise$all3, 4);6839_yield$Promise$all4$ = _yield$Promise$all4[0];6840width = _yield$Promise$all4$.width;6841height = _yield$Promise$all4$.height;6842unit = _yield$Promise$all4[1];6843name = _yield$Promise$all4[2];6844orientation = _yield$Promise$all4[3];6845return _context3.abrupt("return", this.l10n.get("document_properties_page_size_dimension_".concat(name ? "name_" : "", "string"), {6846width: width.toLocaleString(),6847height: height.toLocaleString(),6848unit: unit,6849name: name,6850orientation: orientation6851}));68526853case 19:6854case "end":6855return _context3.stop();6856}6857}6858}, _callee3, this);6859}));68606861function _parsePageSize(_x, _x2) {6862return _parsePageSize2.apply(this, arguments);6863}68646865return _parsePageSize;6866}()6867}, {6868key: "_parseDate",6869value: function () {6870var _parseDate2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee4(inputDate) {6871var dateObject;6872return _regenerator["default"].wrap(function _callee4$(_context4) {6873while (1) {6874switch (_context4.prev = _context4.next) {6875case 0:6876dateObject = _pdfjsLib.PDFDateString.toDateObject(inputDate);68776878if (dateObject) {6879_context4.next = 3;6880break;6881}68826883return _context4.abrupt("return", undefined);68846885case 3:6886return _context4.abrupt("return", this.l10n.get("document_properties_date_string", {6887date: dateObject.toLocaleDateString(),6888time: dateObject.toLocaleTimeString()6889}));68906891case 4:6892case "end":6893return _context4.stop();6894}6895}6896}, _callee4, this);6897}));68986899function _parseDate(_x3) {6900return _parseDate2.apply(this, arguments);6901}69026903return _parseDate;6904}()6905}, {6906key: "_parseLinearization",6907value: function _parseLinearization(isLinearized) {6908return this.l10n.get("document_properties_linearized_".concat(isLinearized ? "yes" : "no"));6909}6910}]);69116912return PDFDocumentProperties;6913}();69146915exports.PDFDocumentProperties = PDFDocumentProperties;69166917/***/ }),6918/* 16 */6919/***/ ((__unused_webpack_module, exports, __webpack_require__) => {6920692169226923Object.defineProperty(exports, "__esModule", ({6924value: true6925}));6926exports.PDFFindBar = void 0;69276928var _pdf_find_controller = __webpack_require__(17);69296930function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }69316932function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }69336934function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }69356936var MATCHES_COUNT_LIMIT = 1000;69376938var PDFFindBar = /*#__PURE__*/function () {6939function PDFFindBar(options, eventBus, l10n) {6940var _this = this;69416942_classCallCheck(this, PDFFindBar);69436944this.opened = false;6945this.bar = options.bar;6946this.toggleButton = options.toggleButton;6947this.findField = options.findField;6948this.highlightAll = options.highlightAllCheckbox;6949this.caseSensitive = options.caseSensitiveCheckbox;6950this.entireWord = options.entireWordCheckbox;6951this.findMsg = options.findMsg;6952this.findResultsCount = options.findResultsCount;6953this.findPreviousButton = options.findPreviousButton;6954this.findNextButton = options.findNextButton;6955this.eventBus = eventBus;6956this.l10n = l10n;6957this.toggleButton.addEventListener("click", function () {6958_this.toggle();6959});6960this.findField.addEventListener("input", function () {6961_this.dispatchEvent("");6962});6963this.bar.addEventListener("keydown", function (e) {6964switch (e.keyCode) {6965case 13:6966if (e.target === _this.findField) {6967_this.dispatchEvent("again", e.shiftKey);6968}69696970break;69716972case 27:6973_this.close();69746975break;6976}6977});6978this.findPreviousButton.addEventListener("click", function () {6979_this.dispatchEvent("again", true);6980});6981this.findNextButton.addEventListener("click", function () {6982_this.dispatchEvent("again", false);6983});6984this.highlightAll.addEventListener("click", function () {6985_this.dispatchEvent("highlightallchange");6986});6987this.caseSensitive.addEventListener("click", function () {6988_this.dispatchEvent("casesensitivitychange");6989});6990this.entireWord.addEventListener("click", function () {6991_this.dispatchEvent("entirewordchange");6992});69936994this.eventBus._on("resize", this._adjustWidth.bind(this));6995}69966997_createClass(PDFFindBar, [{6998key: "reset",6999value: function reset() {7000this.updateUIState();7001}7002}, {7003key: "dispatchEvent",7004value: function dispatchEvent(type, findPrev) {7005this.eventBus.dispatch("find", {7006source: this,7007type: type,7008query: this.findField.value,7009phraseSearch: true,7010caseSensitive: this.caseSensitive.checked,7011entireWord: this.entireWord.checked,7012highlightAll: this.highlightAll.checked,7013findPrevious: findPrev7014});7015}7016}, {7017key: "updateUIState",7018value: function updateUIState(state, previous, matchesCount) {7019var _this2 = this;70207021var findMsg = Promise.resolve("");7022var status = "";70237024switch (state) {7025case _pdf_find_controller.FindState.FOUND:7026break;70277028case _pdf_find_controller.FindState.PENDING:7029status = "pending";7030break;70317032case _pdf_find_controller.FindState.NOT_FOUND:7033findMsg = this.l10n.get("find_not_found");7034status = "notFound";7035break;70367037case _pdf_find_controller.FindState.WRAPPED:7038findMsg = this.l10n.get("find_reached_".concat(previous ? "top" : "bottom"));7039break;7040}70417042this.findField.setAttribute("data-status", status);7043findMsg.then(function (msg) {7044_this2.findMsg.textContent = msg;70457046_this2._adjustWidth();7047});7048this.updateResultsCount(matchesCount);7049}7050}, {7051key: "updateResultsCount",7052value: function updateResultsCount() {7053var _this3 = this;70547055var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},7056_ref$current = _ref.current,7057current = _ref$current === void 0 ? 0 : _ref$current,7058_ref$total = _ref.total,7059total = _ref$total === void 0 ? 0 : _ref$total;70607061var limit = MATCHES_COUNT_LIMIT;7062var matchCountMsg = Promise.resolve("");70637064if (total > 0) {7065if (total > limit) {7066var key = "find_match_count_limit";7067matchCountMsg = this.l10n.get(key, {7068limit: limit7069});7070} else {7071var _key = "find_match_count";7072matchCountMsg = this.l10n.get(_key, {7073current: current,7074total: total7075});7076}7077}70787079matchCountMsg.then(function (msg) {7080_this3.findResultsCount.textContent = msg;70817082_this3.findResultsCount.classList.toggle("hidden", !total);70837084_this3._adjustWidth();7085});7086}7087}, {7088key: "open",7089value: function open() {7090if (!this.opened) {7091this.opened = true;7092this.toggleButton.classList.add("toggled");7093this.toggleButton.setAttribute("aria-expanded", "true");7094this.bar.classList.remove("hidden");7095}70967097this.findField.select();7098this.findField.focus();70997100this._adjustWidth();7101}7102}, {7103key: "close",7104value: function close() {7105if (!this.opened) {7106return;7107}71087109this.opened = false;7110this.toggleButton.classList.remove("toggled");7111this.toggleButton.setAttribute("aria-expanded", "false");7112this.bar.classList.add("hidden");7113this.eventBus.dispatch("findbarclose", {7114source: this7115});7116}7117}, {7118key: "toggle",7119value: function toggle() {7120if (this.opened) {7121this.close();7122} else {7123this.open();7124}7125}7126}, {7127key: "_adjustWidth",7128value: function _adjustWidth() {7129if (!this.opened) {7130return;7131}71327133this.bar.classList.remove("wrapContainers");7134var findbarHeight = this.bar.clientHeight;7135var inputContainerHeight = this.bar.firstElementChild.clientHeight;71367137if (findbarHeight > inputContainerHeight) {7138this.bar.classList.add("wrapContainers");7139}7140}7141}]);71427143return PDFFindBar;7144}();71457146exports.PDFFindBar = PDFFindBar;71477148/***/ }),7149/* 17 */7150/***/ ((__unused_webpack_module, exports, __webpack_require__) => {7151715271537154Object.defineProperty(exports, "__esModule", ({7155value: true7156}));7157exports.PDFFindController = exports.FindState = void 0;71587159var _pdfjsLib = __webpack_require__(7);71607161var _pdf_find_utils = __webpack_require__(18);71627163var _ui_utils = __webpack_require__(6);71647165function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }71667167function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }71687169function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }71707171function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }71727173function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }71747175function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }71767177function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }71787179function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }71807181function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }71827183function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }71847185var FindState = {7186FOUND: 0,7187NOT_FOUND: 1,7188WRAPPED: 2,7189PENDING: 37190};7191exports.FindState = FindState;7192var FIND_TIMEOUT = 250;7193var MATCH_SCROLL_OFFSET_TOP = -50;7194var MATCH_SCROLL_OFFSET_LEFT = -400;7195var CHARACTERS_TO_NORMALIZE = {7196"\u2018": "'",7197"\u2019": "'",7198"\u201A": "'",7199"\u201B": "'",7200"\u201C": '"',7201"\u201D": '"',7202"\u201E": '"',7203"\u201F": '"',7204"\xBC": "1/4",7205"\xBD": "1/2",7206"\xBE": "3/4"7207};7208var normalizationRegex = null;72097210function normalize(text) {7211if (!normalizationRegex) {7212var replace = Object.keys(CHARACTERS_TO_NORMALIZE).join("");7213normalizationRegex = new RegExp("[".concat(replace, "]"), "g");7214}72157216var diffs = null;7217var normalizedText = text.replace(normalizationRegex, function (ch, index) {7218var normalizedCh = CHARACTERS_TO_NORMALIZE[ch],7219diff = normalizedCh.length - ch.length;72207221if (diff !== 0) {7222(diffs || (diffs = [])).push([index, diff]);7223}72247225return normalizedCh;7226});7227return [normalizedText, diffs];7228}72297230function getOriginalIndex(matchIndex) {7231var diffs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;72327233if (!diffs) {7234return matchIndex;7235}72367237var totalDiff = 0;72387239var _iterator = _createForOfIteratorHelper(diffs),7240_step;72417242try {7243for (_iterator.s(); !(_step = _iterator.n()).done;) {7244var _step$value = _slicedToArray(_step.value, 2),7245index = _step$value[0],7246diff = _step$value[1];72477248var currentIndex = index + totalDiff;72497250if (currentIndex >= matchIndex) {7251break;7252}72537254if (currentIndex + diff > matchIndex) {7255totalDiff += matchIndex - currentIndex;7256break;7257}72587259totalDiff += diff;7260}7261} catch (err) {7262_iterator.e(err);7263} finally {7264_iterator.f();7265}72667267return matchIndex - totalDiff;7268}72697270var PDFFindController = /*#__PURE__*/function () {7271function PDFFindController(_ref) {7272var linkService = _ref.linkService,7273eventBus = _ref.eventBus;72747275_classCallCheck(this, PDFFindController);72767277this._linkService = linkService;7278this._eventBus = eventBus;72797280this._reset();72817282eventBus._on("findbarclose", this._onFindBarClose.bind(this));7283}72847285_createClass(PDFFindController, [{7286key: "highlightMatches",7287get: function get() {7288return this._highlightMatches;7289}7290}, {7291key: "pageMatches",7292get: function get() {7293return this._pageMatches;7294}7295}, {7296key: "pageMatchesLength",7297get: function get() {7298return this._pageMatchesLength;7299}7300}, {7301key: "selected",7302get: function get() {7303return this._selected;7304}7305}, {7306key: "state",7307get: function get() {7308return this._state;7309}7310}, {7311key: "setDocument",7312value: function setDocument(pdfDocument) {7313if (this._pdfDocument) {7314this._reset();7315}73167317if (!pdfDocument) {7318return;7319}73207321this._pdfDocument = pdfDocument;73227323this._firstPageCapability.resolve();7324}7325}, {7326key: "executeCommand",7327value: function executeCommand(cmd, state) {7328var _this = this;73297330if (!state) {7331return;7332}73337334var pdfDocument = this._pdfDocument;73357336if (this._state === null || this._shouldDirtyMatch(cmd, state)) {7337this._dirtyMatch = true;7338}73397340this._state = state;73417342if (cmd !== "findhighlightallchange") {7343this._updateUIState(FindState.PENDING);7344}73457346this._firstPageCapability.promise.then(function () {7347if (!_this._pdfDocument || pdfDocument && _this._pdfDocument !== pdfDocument) {7348return;7349}73507351_this._extractText();73527353var findbarClosed = !_this._highlightMatches;7354var pendingTimeout = !!_this._findTimeout;73557356if (_this._findTimeout) {7357clearTimeout(_this._findTimeout);7358_this._findTimeout = null;7359}73607361if (cmd === "find") {7362_this._findTimeout = setTimeout(function () {7363_this._nextMatch();73647365_this._findTimeout = null;7366}, FIND_TIMEOUT);7367} else if (_this._dirtyMatch) {7368_this._nextMatch();7369} else if (cmd === "findagain") {7370_this._nextMatch();73717372if (findbarClosed && _this._state.highlightAll) {7373_this._updateAllPages();7374}7375} else if (cmd === "findhighlightallchange") {7376if (pendingTimeout) {7377_this._nextMatch();7378} else {7379_this._highlightMatches = true;7380}73817382_this._updateAllPages();7383} else {7384_this._nextMatch();7385}7386});7387}7388}, {7389key: "scrollMatchIntoView",7390value: function scrollMatchIntoView(_ref2) {7391var _ref2$element = _ref2.element,7392element = _ref2$element === void 0 ? null : _ref2$element,7393_ref2$pageIndex = _ref2.pageIndex,7394pageIndex = _ref2$pageIndex === void 0 ? -1 : _ref2$pageIndex,7395_ref2$matchIndex = _ref2.matchIndex,7396matchIndex = _ref2$matchIndex === void 0 ? -1 : _ref2$matchIndex;73977398if (!this._scrollMatches || !element) {7399return;7400} else if (matchIndex === -1 || matchIndex !== this._selected.matchIdx) {7401return;7402} else if (pageIndex === -1 || pageIndex !== this._selected.pageIdx) {7403return;7404}74057406this._scrollMatches = false;7407var spot = {7408top: MATCH_SCROLL_OFFSET_TOP,7409left: MATCH_SCROLL_OFFSET_LEFT7410};7411(0, _ui_utils.scrollIntoView)(element, spot, true);7412}7413}, {7414key: "_reset",7415value: function _reset() {7416this._highlightMatches = false;7417this._scrollMatches = false;7418this._pdfDocument = null;7419this._pageMatches = [];7420this._pageMatchesLength = [];7421this._state = null;7422this._selected = {7423pageIdx: -1,7424matchIdx: -17425};7426this._offset = {7427pageIdx: null,7428matchIdx: null,7429wrapped: false7430};7431this._extractTextPromises = [];7432this._pageContents = [];7433this._pageDiffs = [];7434this._matchesCountTotal = 0;7435this._pagesToSearch = null;7436this._pendingFindMatches = Object.create(null);7437this._resumePageIdx = null;7438this._dirtyMatch = false;7439clearTimeout(this._findTimeout);7440this._findTimeout = null;7441this._firstPageCapability = (0, _pdfjsLib.createPromiseCapability)();7442}7443}, {7444key: "_query",7445get: function get() {7446if (this._state.query !== this._rawQuery) {7447this._rawQuery = this._state.query;74487449var _normalize = normalize(this._state.query);74507451var _normalize2 = _slicedToArray(_normalize, 1);74527453this._normalizedQuery = _normalize2[0];7454}74557456return this._normalizedQuery;7457}7458}, {7459key: "_shouldDirtyMatch",7460value: function _shouldDirtyMatch(cmd, state) {7461if (state.query !== this._state.query) {7462return true;7463}74647465switch (cmd) {7466case "findagain":7467var pageNumber = this._selected.pageIdx + 1;7468var linkService = this._linkService;74697470if (pageNumber >= 1 && pageNumber <= linkService.pagesCount && pageNumber !== linkService.page && !linkService.isPageVisible(pageNumber)) {7471return true;7472}74737474return false;74757476case "findhighlightallchange":7477return false;7478}74797480return true;7481}7482}, {7483key: "_prepareMatches",7484value: function _prepareMatches(matchesWithLength, matches, matchesLength) {7485function isSubTerm(currentIndex) {7486var currentElem = matchesWithLength[currentIndex];7487var nextElem = matchesWithLength[currentIndex + 1];74887489if (currentIndex < matchesWithLength.length - 1 && currentElem.match === nextElem.match) {7490currentElem.skipped = true;7491return true;7492}74937494for (var i = currentIndex - 1; i >= 0; i--) {7495var prevElem = matchesWithLength[i];74967497if (prevElem.skipped) {7498continue;7499}75007501if (prevElem.match + prevElem.matchLength < currentElem.match) {7502break;7503}75047505if (prevElem.match + prevElem.matchLength >= currentElem.match + currentElem.matchLength) {7506currentElem.skipped = true;7507return true;7508}7509}75107511return false;7512}75137514matchesWithLength.sort(function (a, b) {7515return a.match === b.match ? a.matchLength - b.matchLength : a.match - b.match;7516});75177518for (var i = 0, len = matchesWithLength.length; i < len; i++) {7519if (isSubTerm(i)) {7520continue;7521}75227523matches.push(matchesWithLength[i].match);7524matchesLength.push(matchesWithLength[i].matchLength);7525}7526}7527}, {7528key: "_isEntireWord",7529value: function _isEntireWord(content, startIdx, length) {7530if (startIdx > 0) {7531var first = content.charCodeAt(startIdx);7532var limit = content.charCodeAt(startIdx - 1);75337534if ((0, _pdf_find_utils.getCharacterType)(first) === (0, _pdf_find_utils.getCharacterType)(limit)) {7535return false;7536}7537}75387539var endIdx = startIdx + length - 1;75407541if (endIdx < content.length - 1) {7542var last = content.charCodeAt(endIdx);75437544var _limit = content.charCodeAt(endIdx + 1);75457546if ((0, _pdf_find_utils.getCharacterType)(last) === (0, _pdf_find_utils.getCharacterType)(_limit)) {7547return false;7548}7549}75507551return true;7552}7553}, {7554key: "_calculatePhraseMatch",7555value: function _calculatePhraseMatch(query, pageIndex, pageContent, pageDiffs, entireWord) {7556var matches = [],7557matchesLength = [];7558var queryLen = query.length;7559var matchIdx = -queryLen;75607561while (true) {7562matchIdx = pageContent.indexOf(query, matchIdx + queryLen);75637564if (matchIdx === -1) {7565break;7566}75677568if (entireWord && !this._isEntireWord(pageContent, matchIdx, queryLen)) {7569continue;7570}75717572var originalMatchIdx = getOriginalIndex(matchIdx, pageDiffs),7573matchEnd = matchIdx + queryLen - 1,7574originalQueryLen = getOriginalIndex(matchEnd, pageDiffs) - originalMatchIdx + 1;7575matches.push(originalMatchIdx);7576matchesLength.push(originalQueryLen);7577}75787579this._pageMatches[pageIndex] = matches;7580this._pageMatchesLength[pageIndex] = matchesLength;7581}7582}, {7583key: "_calculateWordMatch",7584value: function _calculateWordMatch(query, pageIndex, pageContent, pageDiffs, entireWord) {7585var matchesWithLength = [];7586var queryArray = query.match(/\S+/g);75877588for (var i = 0, len = queryArray.length; i < len; i++) {7589var subquery = queryArray[i];7590var subqueryLen = subquery.length;7591var matchIdx = -subqueryLen;75927593while (true) {7594matchIdx = pageContent.indexOf(subquery, matchIdx + subqueryLen);75957596if (matchIdx === -1) {7597break;7598}75997600if (entireWord && !this._isEntireWord(pageContent, matchIdx, subqueryLen)) {7601continue;7602}76037604var originalMatchIdx = getOriginalIndex(matchIdx, pageDiffs),7605matchEnd = matchIdx + subqueryLen - 1,7606originalQueryLen = getOriginalIndex(matchEnd, pageDiffs) - originalMatchIdx + 1;7607matchesWithLength.push({7608match: originalMatchIdx,7609matchLength: originalQueryLen,7610skipped: false7611});7612}7613}76147615this._pageMatchesLength[pageIndex] = [];7616this._pageMatches[pageIndex] = [];76177618this._prepareMatches(matchesWithLength, this._pageMatches[pageIndex], this._pageMatchesLength[pageIndex]);7619}7620}, {7621key: "_calculateMatch",7622value: function _calculateMatch(pageIndex) {7623var pageContent = this._pageContents[pageIndex];7624var pageDiffs = this._pageDiffs[pageIndex];7625var query = this._query;7626var _this$_state = this._state,7627caseSensitive = _this$_state.caseSensitive,7628entireWord = _this$_state.entireWord,7629phraseSearch = _this$_state.phraseSearch;76307631if (query.length === 0) {7632return;7633}76347635if (!caseSensitive) {7636pageContent = pageContent.toLowerCase();7637query = query.toLowerCase();7638}76397640if (phraseSearch) {7641this._calculatePhraseMatch(query, pageIndex, pageContent, pageDiffs, entireWord);7642} else {7643this._calculateWordMatch(query, pageIndex, pageContent, pageDiffs, entireWord);7644}76457646if (this._state.highlightAll) {7647this._updatePage(pageIndex);7648}76497650if (this._resumePageIdx === pageIndex) {7651this._resumePageIdx = null;76527653this._nextPageMatch();7654}76557656var pageMatchesCount = this._pageMatches[pageIndex].length;76577658if (pageMatchesCount > 0) {7659this._matchesCountTotal += pageMatchesCount;76607661this._updateUIResultsCount();7662}7663}7664}, {7665key: "_extractText",7666value: function _extractText() {7667var _this2 = this;76687669if (this._extractTextPromises.length > 0) {7670return;7671}76727673var promise = Promise.resolve();76747675var _loop = function _loop(i, ii) {7676var extractTextCapability = (0, _pdfjsLib.createPromiseCapability)();7677_this2._extractTextPromises[i] = extractTextCapability.promise;7678promise = promise.then(function () {7679return _this2._pdfDocument.getPage(i + 1).then(function (pdfPage) {7680return pdfPage.getTextContent({7681normalizeWhitespace: true7682});7683}).then(function (textContent) {7684var textItems = textContent.items;7685var strBuf = [];76867687for (var j = 0, jj = textItems.length; j < jj; j++) {7688strBuf.push(textItems[j].str);7689}76907691var _normalize3 = normalize(strBuf.join(""));76927693var _normalize4 = _slicedToArray(_normalize3, 2);76947695_this2._pageContents[i] = _normalize4[0];7696_this2._pageDiffs[i] = _normalize4[1];7697extractTextCapability.resolve(i);7698}, function (reason) {7699console.error("Unable to get text content for page ".concat(i + 1), reason);7700_this2._pageContents[i] = "";7701_this2._pageDiffs[i] = null;7702extractTextCapability.resolve(i);7703});7704});7705};77067707for (var i = 0, ii = this._linkService.pagesCount; i < ii; i++) {7708_loop(i, ii);7709}7710}7711}, {7712key: "_updatePage",7713value: function _updatePage(index) {7714if (this._scrollMatches && this._selected.pageIdx === index) {7715this._linkService.page = index + 1;7716}77177718this._eventBus.dispatch("updatetextlayermatches", {7719source: this,7720pageIndex: index7721});7722}7723}, {7724key: "_updateAllPages",7725value: function _updateAllPages() {7726this._eventBus.dispatch("updatetextlayermatches", {7727source: this,7728pageIndex: -17729});7730}7731}, {7732key: "_nextMatch",7733value: function _nextMatch() {7734var _this3 = this;77357736var previous = this._state.findPrevious;7737var currentPageIndex = this._linkService.page - 1;7738var numPages = this._linkService.pagesCount;7739this._highlightMatches = true;77407741if (this._dirtyMatch) {7742this._dirtyMatch = false;7743this._selected.pageIdx = this._selected.matchIdx = -1;7744this._offset.pageIdx = currentPageIndex;7745this._offset.matchIdx = null;7746this._offset.wrapped = false;7747this._resumePageIdx = null;7748this._pageMatches.length = 0;7749this._pageMatchesLength.length = 0;7750this._matchesCountTotal = 0;77517752this._updateAllPages();77537754for (var i = 0; i < numPages; i++) {7755if (this._pendingFindMatches[i] === true) {7756continue;7757}77587759this._pendingFindMatches[i] = true;77607761this._extractTextPromises[i].then(function (pageIdx) {7762delete _this3._pendingFindMatches[pageIdx];77637764_this3._calculateMatch(pageIdx);7765});7766}7767}77687769if (this._query === "") {7770this._updateUIState(FindState.FOUND);77717772return;7773}77747775if (this._resumePageIdx) {7776return;7777}77787779var offset = this._offset;7780this._pagesToSearch = numPages;77817782if (offset.matchIdx !== null) {7783var numPageMatches = this._pageMatches[offset.pageIdx].length;77847785if (!previous && offset.matchIdx + 1 < numPageMatches || previous && offset.matchIdx > 0) {7786offset.matchIdx = previous ? offset.matchIdx - 1 : offset.matchIdx + 1;77877788this._updateMatch(true);77897790return;7791}77927793this._advanceOffsetPage(previous);7794}77957796this._nextPageMatch();7797}7798}, {7799key: "_matchesReady",7800value: function _matchesReady(matches) {7801var offset = this._offset;7802var numMatches = matches.length;7803var previous = this._state.findPrevious;78047805if (numMatches) {7806offset.matchIdx = previous ? numMatches - 1 : 0;78077808this._updateMatch(true);78097810return true;7811}78127813this._advanceOffsetPage(previous);78147815if (offset.wrapped) {7816offset.matchIdx = null;78177818if (this._pagesToSearch < 0) {7819this._updateMatch(false);78207821return true;7822}7823}78247825return false;7826}7827}, {7828key: "_nextPageMatch",7829value: function _nextPageMatch() {7830if (this._resumePageIdx !== null) {7831console.error("There can only be one pending page.");7832}78337834var matches = null;78357836do {7837var pageIdx = this._offset.pageIdx;7838matches = this._pageMatches[pageIdx];78397840if (!matches) {7841this._resumePageIdx = pageIdx;7842break;7843}7844} while (!this._matchesReady(matches));7845}7846}, {7847key: "_advanceOffsetPage",7848value: function _advanceOffsetPage(previous) {7849var offset = this._offset;7850var numPages = this._linkService.pagesCount;7851offset.pageIdx = previous ? offset.pageIdx - 1 : offset.pageIdx + 1;7852offset.matchIdx = null;7853this._pagesToSearch--;78547855if (offset.pageIdx >= numPages || offset.pageIdx < 0) {7856offset.pageIdx = previous ? numPages - 1 : 0;7857offset.wrapped = true;7858}7859}7860}, {7861key: "_updateMatch",7862value: function _updateMatch() {7863var found = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;7864var state = FindState.NOT_FOUND;7865var wrapped = this._offset.wrapped;7866this._offset.wrapped = false;78677868if (found) {7869var previousPage = this._selected.pageIdx;7870this._selected.pageIdx = this._offset.pageIdx;7871this._selected.matchIdx = this._offset.matchIdx;7872state = wrapped ? FindState.WRAPPED : FindState.FOUND;78737874if (previousPage !== -1 && previousPage !== this._selected.pageIdx) {7875this._updatePage(previousPage);7876}7877}78787879this._updateUIState(state, this._state.findPrevious);78807881if (this._selected.pageIdx !== -1) {7882this._scrollMatches = true;78837884this._updatePage(this._selected.pageIdx);7885}7886}7887}, {7888key: "_onFindBarClose",7889value: function _onFindBarClose(evt) {7890var _this4 = this;78917892var pdfDocument = this._pdfDocument;78937894this._firstPageCapability.promise.then(function () {7895if (!_this4._pdfDocument || pdfDocument && _this4._pdfDocument !== pdfDocument) {7896return;7897}78987899if (_this4._findTimeout) {7900clearTimeout(_this4._findTimeout);7901_this4._findTimeout = null;7902}79037904if (_this4._resumePageIdx) {7905_this4._resumePageIdx = null;7906_this4._dirtyMatch = true;7907}79087909_this4._updateUIState(FindState.FOUND);79107911_this4._highlightMatches = false;79127913_this4._updateAllPages();7914});7915}7916}, {7917key: "_requestMatchesCount",7918value: function _requestMatchesCount() {7919var _this$_selected = this._selected,7920pageIdx = _this$_selected.pageIdx,7921matchIdx = _this$_selected.matchIdx;7922var current = 0,7923total = this._matchesCountTotal;79247925if (matchIdx !== -1) {7926for (var i = 0; i < pageIdx; i++) {7927var _this$_pageMatches$i;79287929current += ((_this$_pageMatches$i = this._pageMatches[i]) === null || _this$_pageMatches$i === void 0 ? void 0 : _this$_pageMatches$i.length) || 0;7930}79317932current += matchIdx + 1;7933}79347935if (current < 1 || current > total) {7936current = total = 0;7937}79387939return {7940current: current,7941total: total7942};7943}7944}, {7945key: "_updateUIResultsCount",7946value: function _updateUIResultsCount() {7947this._eventBus.dispatch("updatefindmatchescount", {7948source: this,7949matchesCount: this._requestMatchesCount()7950});7951}7952}, {7953key: "_updateUIState",7954value: function _updateUIState(state, previous) {7955var _this$_state$query, _this$_state2;79567957this._eventBus.dispatch("updatefindcontrolstate", {7958source: this,7959state: state,7960previous: previous,7961matchesCount: this._requestMatchesCount(),7962rawQuery: (_this$_state$query = (_this$_state2 = this._state) === null || _this$_state2 === void 0 ? void 0 : _this$_state2.query) !== null && _this$_state$query !== void 0 ? _this$_state$query : null7963});7964}7965}]);79667967return PDFFindController;7968}();79697970exports.PDFFindController = PDFFindController;79717972/***/ }),7973/* 18 */7974/***/ ((__unused_webpack_module, exports) => {7975797679777978Object.defineProperty(exports, "__esModule", ({7979value: true7980}));7981exports.getCharacterType = getCharacterType;7982exports.CharacterType = void 0;7983var CharacterType = {7984SPACE: 0,7985ALPHA_LETTER: 1,7986PUNCT: 2,7987HAN_LETTER: 3,7988KATAKANA_LETTER: 4,7989HIRAGANA_LETTER: 5,7990HALFWIDTH_KATAKANA_LETTER: 6,7991THAI_LETTER: 77992};7993exports.CharacterType = CharacterType;79947995function isAlphabeticalScript(charCode) {7996return charCode < 0x2e80;7997}79987999function isAscii(charCode) {8000return (charCode & 0xff80) === 0;8001}80028003function isAsciiAlpha(charCode) {8004return charCode >= 0x61 && charCode <= 0x7a || charCode >= 0x41 && charCode <= 0x5a;8005}80068007function isAsciiDigit(charCode) {8008return charCode >= 0x30 && charCode <= 0x39;8009}80108011function isAsciiSpace(charCode) {8012return charCode === 0x20 || charCode === 0x09 || charCode === 0x0d || charCode === 0x0a;8013}80148015function isHan(charCode) {8016return charCode >= 0x3400 && charCode <= 0x9fff || charCode >= 0xf900 && charCode <= 0xfaff;8017}80188019function isKatakana(charCode) {8020return charCode >= 0x30a0 && charCode <= 0x30ff;8021}80228023function isHiragana(charCode) {8024return charCode >= 0x3040 && charCode <= 0x309f;8025}80268027function isHalfwidthKatakana(charCode) {8028return charCode >= 0xff60 && charCode <= 0xff9f;8029}80308031function isThai(charCode) {8032return (charCode & 0xff80) === 0x0e00;8033}80348035function getCharacterType(charCode) {8036if (isAlphabeticalScript(charCode)) {8037if (isAscii(charCode)) {8038if (isAsciiSpace(charCode)) {8039return CharacterType.SPACE;8040} else if (isAsciiAlpha(charCode) || isAsciiDigit(charCode) || charCode === 0x5f) {8041return CharacterType.ALPHA_LETTER;8042}80438044return CharacterType.PUNCT;8045} else if (isThai(charCode)) {8046return CharacterType.THAI_LETTER;8047} else if (charCode === 0xa0) {8048return CharacterType.SPACE;8049}80508051return CharacterType.ALPHA_LETTER;8052}80538054if (isHan(charCode)) {8055return CharacterType.HAN_LETTER;8056} else if (isKatakana(charCode)) {8057return CharacterType.KATAKANA_LETTER;8058} else if (isHiragana(charCode)) {8059return CharacterType.HIRAGANA_LETTER;8060} else if (isHalfwidthKatakana(charCode)) {8061return CharacterType.HALFWIDTH_KATAKANA_LETTER;8062}80638064return CharacterType.ALPHA_LETTER;8065}80668067/***/ }),8068/* 19 */8069/***/ ((__unused_webpack_module, exports, __webpack_require__) => {8070807180728073Object.defineProperty(exports, "__esModule", ({8074value: true8075}));8076exports.isDestArraysEqual = isDestArraysEqual;8077exports.isDestHashesEqual = isDestHashesEqual;8078exports.PDFHistory = void 0;80798080var _ui_utils = __webpack_require__(6);80818082function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }80838084function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }80858086function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }80878088function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }80898090function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }80918092function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }80938094function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }80958096function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }80978098function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }80998100function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }81018102var HASH_CHANGE_TIMEOUT = 1000;8103var POSITION_UPDATED_THRESHOLD = 50;8104var UPDATE_VIEWAREA_TIMEOUT = 1000;81058106function getCurrentHash() {8107return document.location.hash;8108}81098110var PDFHistory = /*#__PURE__*/function () {8111function PDFHistory(_ref) {8112var _this = this;81138114var linkService = _ref.linkService,8115eventBus = _ref.eventBus;81168117_classCallCheck(this, PDFHistory);81188119this.linkService = linkService;8120this.eventBus = eventBus;8121this._initialized = false;8122this._fingerprint = "";8123this.reset();8124this._boundEvents = null;8125this._isViewerInPresentationMode = false;81268127this.eventBus._on("presentationmodechanged", function (evt) {8128_this._isViewerInPresentationMode = evt.state !== _ui_utils.PresentationModeState.NORMAL;8129});81308131this.eventBus._on("pagesinit", function () {8132_this._isPagesLoaded = false;81338134_this.eventBus._on("pagesloaded", function (evt) {8135_this._isPagesLoaded = !!evt.pagesCount;8136}, {8137once: true8138});8139});8140}81418142_createClass(PDFHistory, [{8143key: "initialize",8144value: function initialize(_ref2) {8145var fingerprint = _ref2.fingerprint,8146_ref2$resetHistory = _ref2.resetHistory,8147resetHistory = _ref2$resetHistory === void 0 ? false : _ref2$resetHistory,8148_ref2$updateUrl = _ref2.updateUrl,8149updateUrl = _ref2$updateUrl === void 0 ? false : _ref2$updateUrl;81508151if (!fingerprint || typeof fingerprint !== "string") {8152console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');8153return;8154}81558156if (this._initialized) {8157this.reset();8158}81598160var reInitialized = this._fingerprint !== "" && this._fingerprint !== fingerprint;8161this._fingerprint = fingerprint;8162this._updateUrl = updateUrl === true;8163this._initialized = true;81648165this._bindEvents();81668167var state = window.history.state;8168this._popStateInProgress = false;8169this._blockHashChange = 0;8170this._currentHash = getCurrentHash();8171this._numPositionUpdates = 0;8172this._uid = this._maxUid = 0;8173this._destination = null;8174this._position = null;81758176if (!this._isValidState(state, true) || resetHistory) {8177var _this$_parseCurrentHa = this._parseCurrentHash(true),8178hash = _this$_parseCurrentHa.hash,8179page = _this$_parseCurrentHa.page,8180rotation = _this$_parseCurrentHa.rotation;81818182if (!hash || reInitialized || resetHistory) {8183this._pushOrReplaceState(null, true);81848185return;8186}81878188this._pushOrReplaceState({8189hash: hash,8190page: page,8191rotation: rotation8192}, true);81938194return;8195}81968197var destination = state.destination;81988199this._updateInternalState(destination, state.uid, true);82008201if (destination.rotation !== undefined) {8202this._initialRotation = destination.rotation;8203}82048205if (destination.dest) {8206this._initialBookmark = JSON.stringify(destination.dest);8207this._destination.page = null;8208} else if (destination.hash) {8209this._initialBookmark = destination.hash;8210} else if (destination.page) {8211this._initialBookmark = "page=".concat(destination.page);8212}8213}8214}, {8215key: "reset",8216value: function reset() {8217if (this._initialized) {8218this._pageHide();82198220this._initialized = false;82218222this._unbindEvents();8223}82248225if (this._updateViewareaTimeout) {8226clearTimeout(this._updateViewareaTimeout);8227this._updateViewareaTimeout = null;8228}82298230this._initialBookmark = null;8231this._initialRotation = null;8232}8233}, {8234key: "push",8235value: function push(_ref3) {8236var _this2 = this;82378238var _ref3$namedDest = _ref3.namedDest,8239namedDest = _ref3$namedDest === void 0 ? null : _ref3$namedDest,8240explicitDest = _ref3.explicitDest,8241pageNumber = _ref3.pageNumber;82428243if (!this._initialized) {8244return;8245}82468247if (namedDest && typeof namedDest !== "string") {8248console.error("PDFHistory.push: " + "\"".concat(namedDest, "\" is not a valid namedDest parameter."));8249return;8250} else if (!Array.isArray(explicitDest)) {8251console.error("PDFHistory.push: " + "\"".concat(explicitDest, "\" is not a valid explicitDest parameter."));8252return;8253} else if (!this._isValidPage(pageNumber)) {8254if (pageNumber !== null || this._destination) {8255console.error("PDFHistory.push: " + "\"".concat(pageNumber, "\" is not a valid pageNumber parameter."));8256return;8257}8258}82598260var hash = namedDest || JSON.stringify(explicitDest);82618262if (!hash) {8263return;8264}82658266var forceReplace = false;82678268if (this._destination && (isDestHashesEqual(this._destination.hash, hash) || isDestArraysEqual(this._destination.dest, explicitDest))) {8269if (this._destination.page) {8270return;8271}82728273forceReplace = true;8274}82758276if (this._popStateInProgress && !forceReplace) {8277return;8278}82798280this._pushOrReplaceState({8281dest: explicitDest,8282hash: hash,8283page: pageNumber,8284rotation: this.linkService.rotation8285}, forceReplace);82868287if (!this._popStateInProgress) {8288this._popStateInProgress = true;8289Promise.resolve().then(function () {8290_this2._popStateInProgress = false;8291});8292}8293}8294}, {8295key: "pushPage",8296value: function pushPage(pageNumber) {8297var _this$_destination,8298_this3 = this;82998300if (!this._initialized) {8301return;8302}83038304if (!this._isValidPage(pageNumber)) {8305console.error("PDFHistory.pushPage: \"".concat(pageNumber, "\" is not a valid page number."));8306return;8307}83088309if (((_this$_destination = this._destination) === null || _this$_destination === void 0 ? void 0 : _this$_destination.page) === pageNumber) {8310return;8311}83128313if (this._popStateInProgress) {8314return;8315}83168317this._pushOrReplaceState({8318dest: null,8319hash: "page=".concat(pageNumber),8320page: pageNumber,8321rotation: this.linkService.rotation8322});83238324if (!this._popStateInProgress) {8325this._popStateInProgress = true;8326Promise.resolve().then(function () {8327_this3._popStateInProgress = false;8328});8329}8330}8331}, {8332key: "pushCurrentPosition",8333value: function pushCurrentPosition() {8334if (!this._initialized || this._popStateInProgress) {8335return;8336}83378338this._tryPushCurrentPosition();8339}8340}, {8341key: "back",8342value: function back() {8343if (!this._initialized || this._popStateInProgress) {8344return;8345}83468347var state = window.history.state;83488349if (this._isValidState(state) && state.uid > 0) {8350window.history.back();8351}8352}8353}, {8354key: "forward",8355value: function forward() {8356if (!this._initialized || this._popStateInProgress) {8357return;8358}83598360var state = window.history.state;83618362if (this._isValidState(state) && state.uid < this._maxUid) {8363window.history.forward();8364}8365}8366}, {8367key: "popStateInProgress",8368get: function get() {8369return this._initialized && (this._popStateInProgress || this._blockHashChange > 0);8370}8371}, {8372key: "initialBookmark",8373get: function get() {8374return this._initialized ? this._initialBookmark : null;8375}8376}, {8377key: "initialRotation",8378get: function get() {8379return this._initialized ? this._initialRotation : null;8380}8381}, {8382key: "_pushOrReplaceState",8383value: function _pushOrReplaceState(destination) {8384var forceReplace = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;8385var shouldReplace = forceReplace || !this._destination;8386var newState = {8387fingerprint: this._fingerprint,8388uid: shouldReplace ? this._uid : this._uid + 1,8389destination: destination8390};83918392this._updateInternalState(destination, newState.uid);83938394var newUrl;83958396if (this._updateUrl && destination !== null && destination !== void 0 && destination.hash) {8397var baseUrl = document.location.href.split("#")[0];83988399if (!baseUrl.startsWith("file://")) {8400newUrl = "".concat(baseUrl, "#").concat(destination.hash);8401}8402}84038404if (shouldReplace) {8405window.history.replaceState(newState, "", newUrl);8406} else {8407window.history.pushState(newState, "", newUrl);8408}8409}8410}, {8411key: "_tryPushCurrentPosition",8412value: function _tryPushCurrentPosition() {8413var temporary = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;84148415if (!this._position) {8416return;8417}84188419var position = this._position;84208421if (temporary) {8422position = Object.assign(Object.create(null), this._position);8423position.temporary = true;8424}84258426if (!this._destination) {8427this._pushOrReplaceState(position);84288429return;8430}84318432if (this._destination.temporary) {8433this._pushOrReplaceState(position, true);84348435return;8436}84378438if (this._destination.hash === position.hash) {8439return;8440}84418442if (!this._destination.page && (POSITION_UPDATED_THRESHOLD <= 0 || this._numPositionUpdates <= POSITION_UPDATED_THRESHOLD)) {8443return;8444}84458446var forceReplace = false;84478448if (this._destination.page >= position.first && this._destination.page <= position.page) {8449if (this._destination.dest !== undefined || !this._destination.first) {8450return;8451}84528453forceReplace = true;8454}84558456this._pushOrReplaceState(position, forceReplace);8457}8458}, {8459key: "_isValidPage",8460value: function _isValidPage(val) {8461return Number.isInteger(val) && val > 0 && val <= this.linkService.pagesCount;8462}8463}, {8464key: "_isValidState",8465value: function _isValidState(state) {8466var checkReload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;84678468if (!state) {8469return false;8470}84718472if (state.fingerprint !== this._fingerprint) {8473if (checkReload) {8474if (typeof state.fingerprint !== "string" || state.fingerprint.length !== this._fingerprint.length) {8475return false;8476}84778478var _performance$getEntri = performance.getEntriesByType("navigation"),8479_performance$getEntri2 = _slicedToArray(_performance$getEntri, 1),8480perfEntry = _performance$getEntri2[0];84818482if ((perfEntry === null || perfEntry === void 0 ? void 0 : perfEntry.type) !== "reload") {8483return false;8484}8485} else {8486return false;8487}8488}84898490if (!Number.isInteger(state.uid) || state.uid < 0) {8491return false;8492}84938494if (state.destination === null || _typeof(state.destination) !== "object") {8495return false;8496}84978498return true;8499}8500}, {8501key: "_updateInternalState",8502value: function _updateInternalState(destination, uid) {8503var removeTemporary = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;85048505if (this._updateViewareaTimeout) {8506clearTimeout(this._updateViewareaTimeout);8507this._updateViewareaTimeout = null;8508}85098510if (removeTemporary && destination !== null && destination !== void 0 && destination.temporary) {8511delete destination.temporary;8512}85138514this._destination = destination;8515this._uid = uid;8516this._maxUid = Math.max(this._maxUid, uid);8517this._numPositionUpdates = 0;8518}8519}, {8520key: "_parseCurrentHash",8521value: function _parseCurrentHash() {8522var checkNameddest = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;8523var hash = unescape(getCurrentHash()).substring(1);8524var params = (0, _ui_utils.parseQueryString)(hash);8525var nameddest = params.nameddest || "";8526var page = params.page | 0;85278528if (!this._isValidPage(page) || checkNameddest && nameddest.length > 0) {8529page = null;8530}85318532return {8533hash: hash,8534page: page,8535rotation: this.linkService.rotation8536};8537}8538}, {8539key: "_updateViewarea",8540value: function _updateViewarea(_ref4) {8541var _this4 = this;85428543var location = _ref4.location;85448545if (this._updateViewareaTimeout) {8546clearTimeout(this._updateViewareaTimeout);8547this._updateViewareaTimeout = null;8548}85498550this._position = {8551hash: this._isViewerInPresentationMode ? "page=".concat(location.pageNumber) : location.pdfOpenParams.substring(1),8552page: this.linkService.page,8553first: location.pageNumber,8554rotation: location.rotation8555};85568557if (this._popStateInProgress) {8558return;8559}85608561if (POSITION_UPDATED_THRESHOLD > 0 && this._isPagesLoaded && this._destination && !this._destination.page) {8562this._numPositionUpdates++;8563}85648565if (UPDATE_VIEWAREA_TIMEOUT > 0) {8566this._updateViewareaTimeout = setTimeout(function () {8567if (!_this4._popStateInProgress) {8568_this4._tryPushCurrentPosition(true);8569}85708571_this4._updateViewareaTimeout = null;8572}, UPDATE_VIEWAREA_TIMEOUT);8573}8574}8575}, {8576key: "_popState",8577value: function _popState(_ref5) {8578var _this5 = this;85798580var state = _ref5.state;8581var newHash = getCurrentHash(),8582hashChanged = this._currentHash !== newHash;8583this._currentHash = newHash;85848585if (!state) {8586this._uid++;85878588var _this$_parseCurrentHa2 = this._parseCurrentHash(),8589hash = _this$_parseCurrentHa2.hash,8590page = _this$_parseCurrentHa2.page,8591rotation = _this$_parseCurrentHa2.rotation;85928593this._pushOrReplaceState({8594hash: hash,8595page: page,8596rotation: rotation8597}, true);85988599return;8600}86018602if (!this._isValidState(state)) {8603return;8604}86058606this._popStateInProgress = true;86078608if (hashChanged) {8609this._blockHashChange++;8610(0, _ui_utils.waitOnEventOrTimeout)({8611target: window,8612name: "hashchange",8613delay: HASH_CHANGE_TIMEOUT8614}).then(function () {8615_this5._blockHashChange--;8616});8617}86188619var destination = state.destination;86208621this._updateInternalState(destination, state.uid, true);86228623if ((0, _ui_utils.isValidRotation)(destination.rotation)) {8624this.linkService.rotation = destination.rotation;8625}86268627if (destination.dest) {8628this.linkService.goToDestination(destination.dest);8629} else if (destination.hash) {8630this.linkService.setHash(destination.hash);8631} else if (destination.page) {8632this.linkService.page = destination.page;8633}86348635Promise.resolve().then(function () {8636_this5._popStateInProgress = false;8637});8638}8639}, {8640key: "_pageHide",8641value: function _pageHide() {8642if (!this._destination || this._destination.temporary) {8643this._tryPushCurrentPosition();8644}8645}8646}, {8647key: "_bindEvents",8648value: function _bindEvents() {8649if (this._boundEvents) {8650return;8651}86528653this._boundEvents = {8654updateViewarea: this._updateViewarea.bind(this),8655popState: this._popState.bind(this),8656pageHide: this._pageHide.bind(this)8657};86588659this.eventBus._on("updateviewarea", this._boundEvents.updateViewarea);86608661window.addEventListener("popstate", this._boundEvents.popState);8662window.addEventListener("pagehide", this._boundEvents.pageHide);8663}8664}, {8665key: "_unbindEvents",8666value: function _unbindEvents() {8667if (!this._boundEvents) {8668return;8669}86708671this.eventBus._off("updateviewarea", this._boundEvents.updateViewarea);86728673window.removeEventListener("popstate", this._boundEvents.popState);8674window.removeEventListener("pagehide", this._boundEvents.pageHide);8675this._boundEvents = null;8676}8677}]);86788679return PDFHistory;8680}();86818682exports.PDFHistory = PDFHistory;86838684function isDestHashesEqual(destHash, pushHash) {8685if (typeof destHash !== "string" || typeof pushHash !== "string") {8686return false;8687}86888689if (destHash === pushHash) {8690return true;8691}86928693var _parseQueryString = (0, _ui_utils.parseQueryString)(destHash),8694nameddest = _parseQueryString.nameddest;86958696if (nameddest === pushHash) {8697return true;8698}86998700return false;8701}87028703function isDestArraysEqual(firstDest, secondDest) {8704function isEntryEqual(first, second) {8705if (_typeof(first) !== _typeof(second)) {8706return false;8707}87088709if (Array.isArray(first) || Array.isArray(second)) {8710return false;8711}87128713if (first !== null && _typeof(first) === "object" && second !== null) {8714if (Object.keys(first).length !== Object.keys(second).length) {8715return false;8716}87178718for (var key in first) {8719if (!isEntryEqual(first[key], second[key])) {8720return false;8721}8722}87238724return true;8725}87268727return first === second || Number.isNaN(first) && Number.isNaN(second);8728}87298730if (!(Array.isArray(firstDest) && Array.isArray(secondDest))) {8731return false;8732}87338734if (firstDest.length !== secondDest.length) {8735return false;8736}87378738for (var i = 0, ii = firstDest.length; i < ii; i++) {8739if (!isEntryEqual(firstDest[i], secondDest[i])) {8740return false;8741}8742}87438744return true;8745}87468747/***/ }),8748/* 20 */8749/***/ ((__unused_webpack_module, exports, __webpack_require__) => {8750875187528753Object.defineProperty(exports, "__esModule", ({8754value: true8755}));8756exports.PDFLayerViewer = void 0;87578758var _regenerator = _interopRequireDefault(__webpack_require__(4));87598760var _base_tree_viewer = __webpack_require__(14);87618762function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }87638764function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }87658766function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }87678768function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }87698770function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }87718772function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }87738774function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }87758776function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }87778778function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }87798780function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }87818782function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }87838784function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }87858786function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }87878788function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }87898790function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }87918792function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }87938794function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }87958796function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }87978798function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }87998800var PDFLayerViewer = /*#__PURE__*/function (_BaseTreeViewer) {8801_inherits(PDFLayerViewer, _BaseTreeViewer);88028803var _super = _createSuper(PDFLayerViewer);88048805function PDFLayerViewer(options) {8806var _this;88078808_classCallCheck(this, PDFLayerViewer);88098810_this = _super.call(this, options);8811_this.l10n = options.l10n;88128813_this.eventBus._on("resetlayers", _this._resetLayers.bind(_assertThisInitialized(_this)));88148815_this.eventBus._on("togglelayerstree", _this._toggleAllTreeItems.bind(_assertThisInitialized(_this)));88168817return _this;8818}88198820_createClass(PDFLayerViewer, [{8821key: "reset",8822value: function reset() {8823_get(_getPrototypeOf(PDFLayerViewer.prototype), "reset", this).call(this);88248825this._optionalContentConfig = null;8826}8827}, {8828key: "_dispatchEvent",8829value: function _dispatchEvent(layersCount) {8830this.eventBus.dispatch("layersloaded", {8831source: this,8832layersCount: layersCount8833});8834}8835}, {8836key: "_bindLink",8837value: function _bindLink(element, _ref) {8838var _this2 = this;88398840var groupId = _ref.groupId,8841input = _ref.input;88428843var setVisibility = function setVisibility() {8844_this2._optionalContentConfig.setVisibility(groupId, input.checked);88458846_this2.eventBus.dispatch("optionalcontentconfig", {8847source: _this2,8848promise: Promise.resolve(_this2._optionalContentConfig)8849});8850};88518852element.onclick = function (evt) {8853if (evt.target === input) {8854setVisibility();8855return true;8856} else if (evt.target !== element) {8857return true;8858}88598860input.checked = !input.checked;8861setVisibility();8862return false;8863};8864}8865}, {8866key: "_setNestedName",8867value: function () {8868var _setNestedName2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee(element, _ref2) {8869var _ref2$name, name;88708871return _regenerator["default"].wrap(function _callee$(_context) {8872while (1) {8873switch (_context.prev = _context.next) {8874case 0:8875_ref2$name = _ref2.name, name = _ref2$name === void 0 ? null : _ref2$name;88768877if (!(typeof name === "string")) {8878_context.next = 4;8879break;8880}88818882element.textContent = this._normalizeTextContent(name);8883return _context.abrupt("return");88848885case 4:8886_context.next = 6;8887return this.l10n.get("additional_layers");88888889case 6:8890element.textContent = _context.sent;8891element.style.fontStyle = "italic";88928893case 8:8894case "end":8895return _context.stop();8896}8897}8898}, _callee, this);8899}));89008901function _setNestedName(_x, _x2) {8902return _setNestedName2.apply(this, arguments);8903}89048905return _setNestedName;8906}()8907}, {8908key: "_addToggleButton",8909value: function _addToggleButton(div, _ref3) {8910var _ref3$name = _ref3.name,8911name = _ref3$name === void 0 ? null : _ref3$name;89128913_get(_getPrototypeOf(PDFLayerViewer.prototype), "_addToggleButton", this).call(this, div, name === null);8914}8915}, {8916key: "_toggleAllTreeItems",8917value: function _toggleAllTreeItems() {8918if (!this._optionalContentConfig) {8919return;8920}89218922_get(_getPrototypeOf(PDFLayerViewer.prototype), "_toggleAllTreeItems", this).call(this);8923}8924}, {8925key: "render",8926value: function render(_ref4) {8927var optionalContentConfig = _ref4.optionalContentConfig,8928pdfDocument = _ref4.pdfDocument;89298930if (this._optionalContentConfig) {8931this.reset();8932}89338934this._optionalContentConfig = optionalContentConfig || null;8935this._pdfDocument = pdfDocument || null;8936var groups = optionalContentConfig === null || optionalContentConfig === void 0 ? void 0 : optionalContentConfig.getOrder();89378938if (!groups) {8939this._dispatchEvent(0);89408941return;8942}89438944var fragment = document.createDocumentFragment(),8945queue = [{8946parent: fragment,8947groups: groups8948}];8949var layersCount = 0,8950hasAnyNesting = false;89518952while (queue.length > 0) {8953var levelData = queue.shift();89548955var _iterator = _createForOfIteratorHelper(levelData.groups),8956_step;89578958try {8959for (_iterator.s(); !(_step = _iterator.n()).done;) {8960var groupId = _step.value;8961var div = document.createElement("div");8962div.className = "treeItem";8963var element = document.createElement("a");8964div.appendChild(element);89658966if (_typeof(groupId) === "object") {8967hasAnyNesting = true;89688969this._addToggleButton(div, groupId);89708971this._setNestedName(element, groupId);89728973var itemsDiv = document.createElement("div");8974itemsDiv.className = "treeItems";8975div.appendChild(itemsDiv);8976queue.push({8977parent: itemsDiv,8978groups: groupId.order8979});8980} else {8981var group = optionalContentConfig.getGroup(groupId);8982var input = document.createElement("input");89838984this._bindLink(element, {8985groupId: groupId,8986input: input8987});89888989input.type = "checkbox";8990input.id = groupId;8991input.checked = group.visible;8992var label = document.createElement("label");8993label.setAttribute("for", groupId);8994label.textContent = this._normalizeTextContent(group.name);8995element.appendChild(input);8996element.appendChild(label);8997layersCount++;8998}89999000levelData.parent.appendChild(div);9001}9002} catch (err) {9003_iterator.e(err);9004} finally {9005_iterator.f();9006}9007}90089009this._finishRendering(fragment, layersCount, hasAnyNesting);9010}9011}, {9012key: "_resetLayers",9013value: function () {9014var _resetLayers2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {9015var optionalContentConfig;9016return _regenerator["default"].wrap(function _callee2$(_context2) {9017while (1) {9018switch (_context2.prev = _context2.next) {9019case 0:9020if (this._optionalContentConfig) {9021_context2.next = 2;9022break;9023}90249025return _context2.abrupt("return");90269027case 2:9028_context2.next = 4;9029return this._pdfDocument.getOptionalContentConfig();90309031case 4:9032optionalContentConfig = _context2.sent;9033this.eventBus.dispatch("optionalcontentconfig", {9034source: this,9035promise: Promise.resolve(optionalContentConfig)9036});9037this.render({9038optionalContentConfig: optionalContentConfig,9039pdfDocument: this._pdfDocument9040});90419042case 7:9043case "end":9044return _context2.stop();9045}9046}9047}, _callee2, this);9048}));90499050function _resetLayers() {9051return _resetLayers2.apply(this, arguments);9052}90539054return _resetLayers;9055}()9056}]);90579058return PDFLayerViewer;9059}(_base_tree_viewer.BaseTreeViewer);90609061exports.PDFLayerViewer = PDFLayerViewer;90629063/***/ }),9064/* 21 */9065/***/ ((__unused_webpack_module, exports, __webpack_require__) => {9066906790689069Object.defineProperty(exports, "__esModule", ({9070value: true9071}));9072exports.SimpleLinkService = exports.PDFLinkService = void 0;90739074var _regenerator = _interopRequireDefault(__webpack_require__(4));90759076var _ui_utils = __webpack_require__(6);90779078function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }90799080function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }90819082function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }90839084function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }90859086function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }90879088function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }90899090function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }90919092var PDFLinkService = /*#__PURE__*/function () {9093function PDFLinkService() {9094var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},9095eventBus = _ref.eventBus,9096_ref$externalLinkTarg = _ref.externalLinkTarget,9097externalLinkTarget = _ref$externalLinkTarg === void 0 ? null : _ref$externalLinkTarg,9098_ref$externalLinkRel = _ref.externalLinkRel,9099externalLinkRel = _ref$externalLinkRel === void 0 ? null : _ref$externalLinkRel,9100_ref$externalLinkEnab = _ref.externalLinkEnabled,9101externalLinkEnabled = _ref$externalLinkEnab === void 0 ? true : _ref$externalLinkEnab,9102_ref$ignoreDestinatio = _ref.ignoreDestinationZoom,9103ignoreDestinationZoom = _ref$ignoreDestinatio === void 0 ? false : _ref$ignoreDestinatio;91049105_classCallCheck(this, PDFLinkService);91069107this.eventBus = eventBus;9108this.externalLinkTarget = externalLinkTarget;9109this.externalLinkRel = externalLinkRel;9110this.externalLinkEnabled = externalLinkEnabled;9111this._ignoreDestinationZoom = ignoreDestinationZoom;9112this.baseUrl = null;9113this.pdfDocument = null;9114this.pdfViewer = null;9115this.pdfHistory = null;9116this._pagesRefCache = null;9117}91189119_createClass(PDFLinkService, [{9120key: "setDocument",9121value: function setDocument(pdfDocument) {9122var baseUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;9123this.baseUrl = baseUrl;9124this.pdfDocument = pdfDocument;9125this._pagesRefCache = Object.create(null);9126}9127}, {9128key: "setViewer",9129value: function setViewer(pdfViewer) {9130this.pdfViewer = pdfViewer;9131}9132}, {9133key: "setHistory",9134value: function setHistory(pdfHistory) {9135this.pdfHistory = pdfHistory;9136}9137}, {9138key: "pagesCount",9139get: function get() {9140return this.pdfDocument ? this.pdfDocument.numPages : 0;9141}9142}, {9143key: "page",9144get: function get() {9145return this.pdfViewer.currentPageNumber;9146},9147set: function set(value) {9148this.pdfViewer.currentPageNumber = value;9149}9150}, {9151key: "rotation",9152get: function get() {9153return this.pdfViewer.pagesRotation;9154},9155set: function set(value) {9156this.pdfViewer.pagesRotation = value;9157}9158}, {9159key: "navigateTo",9160value: function navigateTo(dest) {9161console.error("Deprecated method: `navigateTo`, use `goToDestination` instead.");9162this.goToDestination(dest);9163}9164}, {9165key: "_goToDestinationHelper",9166value: function _goToDestinationHelper(rawDest) {9167var _this = this;91689169var namedDest = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;9170var explicitDest = arguments.length > 2 ? arguments[2] : undefined;9171var destRef = explicitDest[0];9172var pageNumber;91739174if (destRef instanceof Object) {9175pageNumber = this._cachedPageNumber(destRef);91769177if (pageNumber === null) {9178this.pdfDocument.getPageIndex(destRef).then(function (pageIndex) {9179_this.cachePageRef(pageIndex + 1, destRef);91809181_this._goToDestinationHelper(rawDest, namedDest, explicitDest);9182})["catch"](function () {9183console.error("PDFLinkService._goToDestinationHelper: \"".concat(destRef, "\" is not ") + "a valid page reference, for dest=\"".concat(rawDest, "\"."));9184});9185return;9186}9187} else if (Number.isInteger(destRef)) {9188pageNumber = destRef + 1;9189} else {9190console.error("PDFLinkService._goToDestinationHelper: \"".concat(destRef, "\" is not ") + "a valid destination reference, for dest=\"".concat(rawDest, "\"."));9191return;9192}91939194if (!pageNumber || pageNumber < 1 || pageNumber > this.pagesCount) {9195console.error("PDFLinkService._goToDestinationHelper: \"".concat(pageNumber, "\" is not ") + "a valid page number, for dest=\"".concat(rawDest, "\"."));9196return;9197}91989199if (this.pdfHistory) {9200this.pdfHistory.pushCurrentPosition();9201this.pdfHistory.push({9202namedDest: namedDest,9203explicitDest: explicitDest,9204pageNumber: pageNumber9205});9206}92079208this.pdfViewer.scrollPageIntoView({9209pageNumber: pageNumber,9210destArray: explicitDest,9211ignoreDestinationZoom: this._ignoreDestinationZoom9212});9213}9214}, {9215key: "goToDestination",9216value: function () {9217var _goToDestination = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee(dest) {9218var namedDest, explicitDest;9219return _regenerator["default"].wrap(function _callee$(_context) {9220while (1) {9221switch (_context.prev = _context.next) {9222case 0:9223if (this.pdfDocument) {9224_context.next = 2;9225break;9226}92279228return _context.abrupt("return");92299230case 2:9231if (!(typeof dest === "string")) {9232_context.next = 9;9233break;9234}92359236namedDest = dest;9237_context.next = 6;9238return this.pdfDocument.getDestination(dest);92399240case 6:9241explicitDest = _context.sent;9242_context.next = 13;9243break;92449245case 9:9246namedDest = null;9247_context.next = 12;9248return dest;92499250case 12:9251explicitDest = _context.sent;92529253case 13:9254if (Array.isArray(explicitDest)) {9255_context.next = 16;9256break;9257}92589259console.error("PDFLinkService.goToDestination: \"".concat(explicitDest, "\" is not ") + "a valid destination array, for dest=\"".concat(dest, "\"."));9260return _context.abrupt("return");92619262case 16:9263this._goToDestinationHelper(dest, namedDest, explicitDest);92649265case 17:9266case "end":9267return _context.stop();9268}9269}9270}, _callee, this);9271}));92729273function goToDestination(_x) {9274return _goToDestination.apply(this, arguments);9275}92769277return goToDestination;9278}()9279}, {9280key: "goToPage",9281value: function goToPage(val) {9282if (!this.pdfDocument) {9283return;9284}92859286var pageNumber = typeof val === "string" && this.pdfViewer.pageLabelToPageNumber(val) || val | 0;92879288if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {9289console.error("PDFLinkService.goToPage: \"".concat(val, "\" is not a valid page."));9290return;9291}92929293if (this.pdfHistory) {9294this.pdfHistory.pushCurrentPosition();9295this.pdfHistory.pushPage(pageNumber);9296}92979298this.pdfViewer.scrollPageIntoView({9299pageNumber: pageNumber9300});9301}9302}, {9303key: "getDestinationHash",9304value: function getDestinationHash(dest) {9305if (typeof dest === "string") {9306if (dest.length > 0) {9307return this.getAnchorUrl("#" + escape(dest));9308}9309} else if (Array.isArray(dest)) {9310var str = JSON.stringify(dest);93119312if (str.length > 0) {9313return this.getAnchorUrl("#" + escape(str));9314}9315}93169317return this.getAnchorUrl("");9318}9319}, {9320key: "getAnchorUrl",9321value: function getAnchorUrl(anchor) {9322return (this.baseUrl || "") + anchor;9323}9324}, {9325key: "setHash",9326value: function setHash(hash) {9327if (!this.pdfDocument) {9328return;9329}93309331var pageNumber, dest;93329333if (hash.includes("=")) {9334var params = (0, _ui_utils.parseQueryString)(hash);93359336if ("search" in params) {9337this.eventBus.dispatch("findfromurlhash", {9338source: this,9339query: params.search.replace(/"/g, ""),9340phraseSearch: params.phrase === "true"9341});9342}93439344if ("page" in params) {9345pageNumber = params.page | 0 || 1;9346}93479348if ("zoom" in params) {9349var zoomArgs = params.zoom.split(",");9350var zoomArg = zoomArgs[0];9351var zoomArgNumber = parseFloat(zoomArg);93529353if (!zoomArg.includes("Fit")) {9354dest = [null, {9355name: "XYZ"9356}, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null, zoomArgs.length > 2 ? zoomArgs[2] | 0 : null, zoomArgNumber ? zoomArgNumber / 100 : zoomArg];9357} else {9358if (zoomArg === "Fit" || zoomArg === "FitB") {9359dest = [null, {9360name: zoomArg9361}];9362} else if (zoomArg === "FitH" || zoomArg === "FitBH" || zoomArg === "FitV" || zoomArg === "FitBV") {9363dest = [null, {9364name: zoomArg9365}, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null];9366} else if (zoomArg === "FitR") {9367if (zoomArgs.length !== 5) {9368console.error('PDFLinkService.setHash: Not enough parameters for "FitR".');9369} else {9370dest = [null, {9371name: zoomArg9372}, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0];9373}9374} else {9375console.error("PDFLinkService.setHash: \"".concat(zoomArg, "\" is not ") + "a valid zoom value.");9376}9377}9378}93799380if (dest) {9381this.pdfViewer.scrollPageIntoView({9382pageNumber: pageNumber || this.page,9383destArray: dest,9384allowNegativeOffset: true9385});9386} else if (pageNumber) {9387this.page = pageNumber;9388}93899390if ("pagemode" in params) {9391this.eventBus.dispatch("pagemode", {9392source: this,9393mode: params.pagemode9394});9395}93969397if ("nameddest" in params) {9398this.goToDestination(params.nameddest);9399}9400} else {9401dest = unescape(hash);94029403try {9404dest = JSON.parse(dest);94059406if (!Array.isArray(dest)) {9407dest = dest.toString();9408}9409} catch (ex) {}94109411if (typeof dest === "string" || isValidExplicitDestination(dest)) {9412this.goToDestination(dest);9413return;9414}94159416console.error("PDFLinkService.setHash: \"".concat(unescape(hash), "\" is not ") + "a valid destination.");9417}9418}9419}, {9420key: "executeNamedAction",9421value: function executeNamedAction(action) {9422switch (action) {9423case "GoBack":9424if (this.pdfHistory) {9425this.pdfHistory.back();9426}94279428break;94299430case "GoForward":9431if (this.pdfHistory) {9432this.pdfHistory.forward();9433}94349435break;94369437case "NextPage":9438this.pdfViewer.nextPage();9439break;94409441case "PrevPage":9442this.pdfViewer.previousPage();9443break;94449445case "LastPage":9446this.page = this.pagesCount;9447break;94489449case "FirstPage":9450this.page = 1;9451break;94529453default:9454break;9455}94569457this.eventBus.dispatch("namedaction", {9458source: this,9459action: action9460});9461}9462}, {9463key: "cachePageRef",9464value: function cachePageRef(pageNum, pageRef) {9465if (!pageRef) {9466return;9467}94689469var refStr = pageRef.gen === 0 ? "".concat(pageRef.num, "R") : "".concat(pageRef.num, "R").concat(pageRef.gen);9470this._pagesRefCache[refStr] = pageNum;9471}9472}, {9473key: "_cachedPageNumber",9474value: function _cachedPageNumber(pageRef) {9475var _this$_pagesRefCache;94769477var refStr = pageRef.gen === 0 ? "".concat(pageRef.num, "R") : "".concat(pageRef.num, "R").concat(pageRef.gen);9478return ((_this$_pagesRefCache = this._pagesRefCache) === null || _this$_pagesRefCache === void 0 ? void 0 : _this$_pagesRefCache[refStr]) || null;9479}9480}, {9481key: "isPageVisible",9482value: function isPageVisible(pageNumber) {9483return this.pdfViewer.isPageVisible(pageNumber);9484}9485}, {9486key: "isPageCached",9487value: function isPageCached(pageNumber) {9488return this.pdfViewer.isPageCached(pageNumber);9489}9490}]);94919492return PDFLinkService;9493}();94949495exports.PDFLinkService = PDFLinkService;94969497function isValidExplicitDestination(dest) {9498if (!Array.isArray(dest)) {9499return false;9500}95019502var destLength = dest.length;95039504if (destLength < 2) {9505return false;9506}95079508var page = dest[0];95099510if (!(_typeof(page) === "object" && Number.isInteger(page.num) && Number.isInteger(page.gen)) && !(Number.isInteger(page) && page >= 0)) {9511return false;9512}95139514var zoom = dest[1];95159516if (!(_typeof(zoom) === "object" && typeof zoom.name === "string")) {9517return false;9518}95199520var allowNull = true;95219522switch (zoom.name) {9523case "XYZ":9524if (destLength !== 5) {9525return false;9526}95279528break;95299530case "Fit":9531case "FitB":9532return destLength === 2;95339534case "FitH":9535case "FitBH":9536case "FitV":9537case "FitBV":9538if (destLength !== 3) {9539return false;9540}95419542break;95439544case "FitR":9545if (destLength !== 6) {9546return false;9547}95489549allowNull = false;9550break;95519552default:9553return false;9554}95559556for (var i = 2; i < destLength; i++) {9557var param = dest[i];95589559if (!(typeof param === "number" || allowNull && param === null)) {9560return false;9561}9562}95639564return true;9565}95669567var SimpleLinkService = /*#__PURE__*/function () {9568function SimpleLinkService() {9569_classCallCheck(this, SimpleLinkService);95709571this.externalLinkTarget = null;9572this.externalLinkRel = null;9573this.externalLinkEnabled = true;9574this._ignoreDestinationZoom = false;9575}95769577_createClass(SimpleLinkService, [{9578key: "pagesCount",9579get: function get() {9580return 0;9581}9582}, {9583key: "page",9584get: function get() {9585return 0;9586},9587set: function set(value) {}9588}, {9589key: "rotation",9590get: function get() {9591return 0;9592},9593set: function set(value) {}9594}, {9595key: "goToDestination",9596value: function () {9597var _goToDestination2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2(dest) {9598return _regenerator["default"].wrap(function _callee2$(_context2) {9599while (1) {9600switch (_context2.prev = _context2.next) {9601case 0:9602case "end":9603return _context2.stop();9604}9605}9606}, _callee2);9607}));96089609function goToDestination(_x2) {9610return _goToDestination2.apply(this, arguments);9611}96129613return goToDestination;9614}()9615}, {9616key: "goToPage",9617value: function goToPage(val) {}9618}, {9619key: "getDestinationHash",9620value: function getDestinationHash(dest) {9621return "#";9622}9623}, {9624key: "getAnchorUrl",9625value: function getAnchorUrl(hash) {9626return "#";9627}9628}, {9629key: "setHash",9630value: function setHash(hash) {}9631}, {9632key: "executeNamedAction",9633value: function executeNamedAction(action) {}9634}, {9635key: "cachePageRef",9636value: function cachePageRef(pageNum, pageRef) {}9637}, {9638key: "isPageVisible",9639value: function isPageVisible(pageNumber) {9640return true;9641}9642}, {9643key: "isPageCached",9644value: function isPageCached(pageNumber) {9645return true;9646}9647}]);96489649return SimpleLinkService;9650}();96519652exports.SimpleLinkService = SimpleLinkService;96539654/***/ }),9655/* 22 */9656/***/ ((__unused_webpack_module, exports, __webpack_require__) => {9657965896599660function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }96619662Object.defineProperty(exports, "__esModule", ({9663value: true9664}));9665exports.PDFOutlineViewer = void 0;96669667var _regenerator = _interopRequireDefault(__webpack_require__(4));96689669var _pdfjsLib = __webpack_require__(7);96709671var _base_tree_viewer = __webpack_require__(14);96729673var _ui_utils = __webpack_require__(6);96749675function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }96769677function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }96789679function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }96809681function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }96829683function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }96849685function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }96869687function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }96889689function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }96909691function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }96929693function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }96949695function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }96969697function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }96989699function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }97009701function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }97029703function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }97049705function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }97069707function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }97089709function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }97109711function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }97129713function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }97149715function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }97169717function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }97189719function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }97209721function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }97229723function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }97249725function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }97269727var PDFOutlineViewer = /*#__PURE__*/function (_BaseTreeViewer) {9728_inherits(PDFOutlineViewer, _BaseTreeViewer);97299730var _super = _createSuper(PDFOutlineViewer);97319732function PDFOutlineViewer(options) {9733var _this;97349735_classCallCheck(this, PDFOutlineViewer);97369737_this = _super.call(this, options);9738_this.linkService = options.linkService;97399740_this.eventBus._on("toggleoutlinetree", _this._toggleAllTreeItems.bind(_assertThisInitialized(_this)));97419742_this.eventBus._on("currentoutlineitem", _this._currentOutlineItem.bind(_assertThisInitialized(_this)));97439744_this.eventBus._on("pagechanging", function (evt) {9745_this._currentPageNumber = evt.pageNumber;9746});97479748_this.eventBus._on("pagesloaded", function (evt) {9749_this._isPagesLoaded = !!evt.pagesCount;9750});97519752_this.eventBus._on("sidebarviewchanged", function (evt) {9753_this._sidebarView = evt.view;9754});97559756return _this;9757}97589759_createClass(PDFOutlineViewer, [{9760key: "reset",9761value: function reset() {9762_get(_getPrototypeOf(PDFOutlineViewer.prototype), "reset", this).call(this);97639764this._outline = null;9765this._pageNumberToDestHashCapability = null;9766this._currentPageNumber = 1;9767this._isPagesLoaded = false;9768}9769}, {9770key: "_dispatchEvent",9771value: function _dispatchEvent(outlineCount) {9772var _this$_pdfDocument;97739774this.eventBus.dispatch("outlineloaded", {9775source: this,9776outlineCount: outlineCount,9777enableCurrentOutlineItemButton: outlineCount > 0 && !((_this$_pdfDocument = this._pdfDocument) !== null && _this$_pdfDocument !== void 0 && _this$_pdfDocument.loadingParams.disableAutoFetch)9778});9779}9780}, {9781key: "_bindLink",9782value: function _bindLink(element, _ref) {9783var _this2 = this;97849785var url = _ref.url,9786newWindow = _ref.newWindow,9787dest = _ref.dest;9788var linkService = this.linkService;97899790if (url) {9791(0, _pdfjsLib.addLinkAttributes)(element, {9792url: url,9793target: newWindow ? _pdfjsLib.LinkTarget.BLANK : linkService.externalLinkTarget,9794rel: linkService.externalLinkRel,9795enabled: linkService.externalLinkEnabled9796});9797return;9798}97999800element.href = linkService.getDestinationHash(dest);98019802element.onclick = function (evt) {9803_this2._updateCurrentTreeItem(evt.target.parentNode);98049805if (dest) {9806linkService.goToDestination(dest);9807}98089809return false;9810};9811}9812}, {9813key: "_setStyles",9814value: function _setStyles(element, _ref2) {9815var bold = _ref2.bold,9816italic = _ref2.italic;98179818if (bold) {9819element.style.fontWeight = "bold";9820}98219822if (italic) {9823element.style.fontStyle = "italic";9824}9825}9826}, {9827key: "_addToggleButton",9828value: function _addToggleButton(div, _ref3) {9829var count = _ref3.count,9830items = _ref3.items;9831var hidden = false;98329833if (count < 0) {9834var totalCount = items.length;98359836if (totalCount > 0) {9837var queue = _toConsumableArray(items);98389839while (queue.length > 0) {9840var _queue$shift = queue.shift(),9841nestedCount = _queue$shift.count,9842nestedItems = _queue$shift.items;98439844if (nestedCount > 0 && nestedItems.length > 0) {9845totalCount += nestedItems.length;9846queue.push.apply(queue, _toConsumableArray(nestedItems));9847}9848}9849}98509851if (Math.abs(count) === totalCount) {9852hidden = true;9853}9854}98559856_get(_getPrototypeOf(PDFOutlineViewer.prototype), "_addToggleButton", this).call(this, div, hidden);9857}9858}, {9859key: "_toggleAllTreeItems",9860value: function _toggleAllTreeItems() {9861if (!this._outline) {9862return;9863}98649865_get(_getPrototypeOf(PDFOutlineViewer.prototype), "_toggleAllTreeItems", this).call(this);9866}9867}, {9868key: "render",9869value: function render(_ref4) {9870var outline = _ref4.outline,9871pdfDocument = _ref4.pdfDocument;98729873if (this._outline) {9874this.reset();9875}98769877this._outline = outline || null;9878this._pdfDocument = pdfDocument || null;98799880if (!outline) {9881this._dispatchEvent(0);98829883return;9884}98859886var fragment = document.createDocumentFragment();9887var queue = [{9888parent: fragment,9889items: outline9890}];9891var outlineCount = 0,9892hasAnyNesting = false;98939894while (queue.length > 0) {9895var levelData = queue.shift();98969897var _iterator = _createForOfIteratorHelper(levelData.items),9898_step;98999900try {9901for (_iterator.s(); !(_step = _iterator.n()).done;) {9902var item = _step.value;9903var div = document.createElement("div");9904div.className = "treeItem";9905var element = document.createElement("a");99069907this._bindLink(element, item);99089909this._setStyles(element, item);99109911element.textContent = this._normalizeTextContent(item.title);9912div.appendChild(element);99139914if (item.items.length > 0) {9915hasAnyNesting = true;99169917this._addToggleButton(div, item);99189919var itemsDiv = document.createElement("div");9920itemsDiv.className = "treeItems";9921div.appendChild(itemsDiv);9922queue.push({9923parent: itemsDiv,9924items: item.items9925});9926}99279928levelData.parent.appendChild(div);9929outlineCount++;9930}9931} catch (err) {9932_iterator.e(err);9933} finally {9934_iterator.f();9935}9936}99379938this._finishRendering(fragment, outlineCount, hasAnyNesting);9939}9940}, {9941key: "_currentOutlineItem",9942value: function () {9943var _currentOutlineItem2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee() {9944var pageNumberToDestHash, i, destHash, linkElement;9945return _regenerator["default"].wrap(function _callee$(_context) {9946while (1) {9947switch (_context.prev = _context.next) {9948case 0:9949if (this._isPagesLoaded) {9950_context.next = 2;9951break;9952}99539954throw new Error("_currentOutlineItem: All pages have not been loaded.");99559956case 2:9957if (!(!this._outline || !this._pdfDocument)) {9958_context.next = 4;9959break;9960}99619962return _context.abrupt("return");99639964case 4:9965_context.next = 6;9966return this._getPageNumberToDestHash(this._pdfDocument);99679968case 6:9969pageNumberToDestHash = _context.sent;99709971if (pageNumberToDestHash) {9972_context.next = 9;9973break;9974}99759976return _context.abrupt("return");99779978case 9:9979this._updateCurrentTreeItem(null);99809981if (!(this._sidebarView !== _ui_utils.SidebarView.OUTLINE)) {9982_context.next = 12;9983break;9984}99859986return _context.abrupt("return");99879988case 12:9989i = this._currentPageNumber;99909991case 13:9992if (!(i > 0)) {9993_context.next = 25;9994break;9995}99969997destHash = pageNumberToDestHash.get(i);99989999if (destHash) {10000_context.next = 17;10001break;10002}1000310004return _context.abrupt("continue", 22);1000510006case 17:10007linkElement = this.container.querySelector("a[href=\"".concat(destHash, "\"]"));1000810009if (linkElement) {10010_context.next = 20;10011break;10012}1001310014return _context.abrupt("continue", 22);1001510016case 20:10017this._scrollToCurrentTreeItem(linkElement.parentNode);1001810019return _context.abrupt("break", 25);1002010021case 22:10022i--;10023_context.next = 13;10024break;1002510026case 25:10027case "end":10028return _context.stop();10029}10030}10031}, _callee, this);10032}));1003310034function _currentOutlineItem() {10035return _currentOutlineItem2.apply(this, arguments);10036}1003710038return _currentOutlineItem;10039}()10040}, {10041key: "_getPageNumberToDestHash",10042value: function () {10043var _getPageNumberToDestHash2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2(pdfDocument) {10044var pageNumberToDestHash, pageNumberNesting, queue, levelData, currentNesting, _iterator2, _step2, _step2$value, dest, items, explicitDest, pageNumber, _explicitDest, _explicitDest2, destRef, destHash;1004510046return _regenerator["default"].wrap(function _callee2$(_context2) {10047while (1) {10048switch (_context2.prev = _context2.next) {10049case 0:10050if (!this._pageNumberToDestHashCapability) {10051_context2.next = 2;10052break;10053}1005410055return _context2.abrupt("return", this._pageNumberToDestHashCapability.promise);1005610057case 2:10058this._pageNumberToDestHashCapability = (0, _pdfjsLib.createPromiseCapability)();10059pageNumberToDestHash = new Map(), pageNumberNesting = new Map();10060queue = [{10061nesting: 0,10062items: this._outline10063}];1006410065case 5:10066if (!(queue.length > 0)) {10067_context2.next = 56;10068break;10069}1007010071levelData = queue.shift(), currentNesting = levelData.nesting;10072_iterator2 = _createForOfIteratorHelper(levelData.items);10073_context2.prev = 8;1007410075_iterator2.s();1007610077case 10:10078if ((_step2 = _iterator2.n()).done) {10079_context2.next = 46;10080break;10081}1008210083_step2$value = _step2.value, dest = _step2$value.dest, items = _step2$value.items;10084explicitDest = void 0, pageNumber = void 0;1008510086if (!(typeof dest === "string")) {10087_context2.next = 21;10088break;10089}1009010091_context2.next = 16;10092return pdfDocument.getDestination(dest);1009310094case 16:10095explicitDest = _context2.sent;1009610097if (!(pdfDocument !== this._pdfDocument)) {10098_context2.next = 19;10099break;10100}1010110102return _context2.abrupt("return", null);1010310104case 19:10105_context2.next = 22;10106break;1010710108case 21:10109explicitDest = dest;1011010111case 22:10112if (!Array.isArray(explicitDest)) {10113_context2.next = 43;10114break;10115}1011610117_explicitDest = explicitDest, _explicitDest2 = _slicedToArray(_explicitDest, 1), destRef = _explicitDest2[0];1011810119if (!(destRef instanceof Object)) {10120_context2.next = 41;10121break;10122}1012310124pageNumber = this.linkService._cachedPageNumber(destRef);1012510126if (pageNumber) {10127_context2.next = 39;10128break;10129}1013010131_context2.prev = 27;10132_context2.next = 30;10133return pdfDocument.getPageIndex(destRef);1013410135case 30:10136_context2.t0 = _context2.sent;10137pageNumber = _context2.t0 + 1;1013810139if (!(pdfDocument !== this._pdfDocument)) {10140_context2.next = 34;10141break;10142}1014310144return _context2.abrupt("return", null);1014510146case 34:10147this.linkService.cachePageRef(pageNumber, destRef);10148_context2.next = 39;10149break;1015010151case 37:10152_context2.prev = 37;10153_context2.t1 = _context2["catch"](27);1015410155case 39:10156_context2.next = 42;10157break;1015810159case 41:10160if (Number.isInteger(destRef)) {10161pageNumber = destRef + 1;10162}1016310164case 42:10165if (Number.isInteger(pageNumber) && (!pageNumberToDestHash.has(pageNumber) || currentNesting > pageNumberNesting.get(pageNumber))) {10166destHash = this.linkService.getDestinationHash(dest);10167pageNumberToDestHash.set(pageNumber, destHash);10168pageNumberNesting.set(pageNumber, currentNesting);10169}1017010171case 43:10172if (items.length > 0) {10173queue.push({10174nesting: currentNesting + 1,10175items: items10176});10177}1017810179case 44:10180_context2.next = 10;10181break;1018210183case 46:10184_context2.next = 51;10185break;1018610187case 48:10188_context2.prev = 48;10189_context2.t2 = _context2["catch"](8);1019010191_iterator2.e(_context2.t2);1019210193case 51:10194_context2.prev = 51;1019510196_iterator2.f();1019710198return _context2.finish(51);1019910200case 54:10201_context2.next = 5;10202break;1020310204case 56:10205this._pageNumberToDestHashCapability.resolve(pageNumberToDestHash.size > 0 ? pageNumberToDestHash : null);1020610207return _context2.abrupt("return", this._pageNumberToDestHashCapability.promise);1020810209case 58:10210case "end":10211return _context2.stop();10212}10213}10214}, _callee2, this, [[8, 48, 51, 54], [27, 37]]);10215}));1021610217function _getPageNumberToDestHash(_x) {10218return _getPageNumberToDestHash2.apply(this, arguments);10219}1022010221return _getPageNumberToDestHash;10222}()10223}]);1022410225return PDFOutlineViewer;10226}(_base_tree_viewer.BaseTreeViewer);1022710228exports.PDFOutlineViewer = PDFOutlineViewer;1022910230/***/ }),10231/* 23 */10232/***/ ((__unused_webpack_module, exports, __webpack_require__) => {10233102341023510236Object.defineProperty(exports, "__esModule", ({10237value: true10238}));10239exports.PDFPresentationMode = void 0;1024010241var _ui_utils = __webpack_require__(6);1024210243function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1024410245function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1024610247function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1024810249var DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS = 1500;10250var DELAY_BEFORE_HIDING_CONTROLS = 3000;10251var ACTIVE_SELECTOR = "pdfPresentationMode";10252var CONTROLS_SELECTOR = "pdfPresentationModeControls";10253var MOUSE_SCROLL_COOLDOWN_TIME = 50;10254var PAGE_SWITCH_THRESHOLD = 0.1;10255var SWIPE_MIN_DISTANCE_THRESHOLD = 50;10256var SWIPE_ANGLE_THRESHOLD = Math.PI / 6;1025710258var PDFPresentationMode = /*#__PURE__*/function () {10259function PDFPresentationMode(_ref) {10260var container = _ref.container,10261pdfViewer = _ref.pdfViewer,10262eventBus = _ref.eventBus;1026310264_classCallCheck(this, PDFPresentationMode);1026510266this.container = container;10267this.pdfViewer = pdfViewer;10268this.eventBus = eventBus;10269this.active = false;10270this.args = null;10271this.contextMenuOpen = false;10272this.mouseScrollTimeStamp = 0;10273this.mouseScrollDelta = 0;10274this.touchSwipeState = null;10275}1027610277_createClass(PDFPresentationMode, [{10278key: "request",10279value: function request() {10280if (this.switchInProgress || this.active || !this.pdfViewer.pagesCount) {10281return false;10282}1028310284this._addFullscreenChangeListeners();1028510286this._setSwitchInProgress();1028710288this._notifyStateChange();1028910290if (this.container.requestFullscreen) {10291this.container.requestFullscreen();10292} else if (this.container.mozRequestFullScreen) {10293this.container.mozRequestFullScreen();10294} else if (this.container.webkitRequestFullscreen) {10295this.container.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);10296} else {10297return false;10298}1029910300this.args = {10301page: this.pdfViewer.currentPageNumber,10302previousScale: this.pdfViewer.currentScaleValue10303};10304return true;10305}10306}, {10307key: "_mouseWheel",10308value: function _mouseWheel(evt) {10309if (!this.active) {10310return;10311}1031210313evt.preventDefault();10314var delta = (0, _ui_utils.normalizeWheelEventDelta)(evt);10315var currentTime = Date.now();10316var storedTime = this.mouseScrollTimeStamp;1031710318if (currentTime > storedTime && currentTime - storedTime < MOUSE_SCROLL_COOLDOWN_TIME) {10319return;10320}1032110322if (this.mouseScrollDelta > 0 && delta < 0 || this.mouseScrollDelta < 0 && delta > 0) {10323this._resetMouseScrollState();10324}1032510326this.mouseScrollDelta += delta;1032710328if (Math.abs(this.mouseScrollDelta) >= PAGE_SWITCH_THRESHOLD) {10329var totalDelta = this.mouseScrollDelta;1033010331this._resetMouseScrollState();1033210333var success = totalDelta > 0 ? this.pdfViewer.previousPage() : this.pdfViewer.nextPage();1033410335if (success) {10336this.mouseScrollTimeStamp = currentTime;10337}10338}10339}10340}, {10341key: "isFullscreen",10342get: function get() {10343return !!(document.fullscreenElement || document.mozFullScreen || document.webkitIsFullScreen);10344}10345}, {10346key: "_notifyStateChange",10347value: function _notifyStateChange() {10348var state = _ui_utils.PresentationModeState.NORMAL;1034910350if (this.switchInProgress) {10351state = _ui_utils.PresentationModeState.CHANGING;10352} else if (this.active) {10353state = _ui_utils.PresentationModeState.FULLSCREEN;10354}1035510356this.eventBus.dispatch("presentationmodechanged", {10357source: this,10358state: state,1035910360get active() {10361throw new Error("Deprecated parameter: `active`, please use `state` instead.");10362},1036310364get switchInProgress() {10365throw new Error("Deprecated parameter: `switchInProgress`, please use `state` instead.");10366}1036710368});10369}10370}, {10371key: "_setSwitchInProgress",10372value: function _setSwitchInProgress() {10373var _this = this;1037410375if (this.switchInProgress) {10376clearTimeout(this.switchInProgress);10377}1037810379this.switchInProgress = setTimeout(function () {10380_this._removeFullscreenChangeListeners();1038110382delete _this.switchInProgress;1038310384_this._notifyStateChange();10385}, DELAY_BEFORE_RESETTING_SWITCH_IN_PROGRESS);10386}10387}, {10388key: "_resetSwitchInProgress",10389value: function _resetSwitchInProgress() {10390if (this.switchInProgress) {10391clearTimeout(this.switchInProgress);10392delete this.switchInProgress;10393}10394}10395}, {10396key: "_enter",10397value: function _enter() {10398var _this2 = this;1039910400this.active = true;1040110402this._resetSwitchInProgress();1040310404this._notifyStateChange();1040510406this.container.classList.add(ACTIVE_SELECTOR);10407setTimeout(function () {10408_this2.pdfViewer.currentPageNumber = _this2.args.page;10409_this2.pdfViewer.currentScaleValue = "page-fit";10410}, 0);1041110412this._addWindowListeners();1041310414this._showControls();1041510416this.contextMenuOpen = false;10417window.getSelection().removeAllRanges();10418}10419}, {10420key: "_exit",10421value: function _exit() {10422var _this3 = this;1042310424var page = this.pdfViewer.currentPageNumber;10425this.container.classList.remove(ACTIVE_SELECTOR);10426setTimeout(function () {10427_this3.active = false;1042810429_this3._removeFullscreenChangeListeners();1043010431_this3._notifyStateChange();1043210433_this3.pdfViewer.currentScaleValue = _this3.args.previousScale;10434_this3.pdfViewer.currentPageNumber = page;10435_this3.args = null;10436}, 0);1043710438this._removeWindowListeners();1043910440this._hideControls();1044110442this._resetMouseScrollState();1044310444this.contextMenuOpen = false;10445}10446}, {10447key: "_mouseDown",10448value: function _mouseDown(evt) {10449if (this.contextMenuOpen) {10450this.contextMenuOpen = false;10451evt.preventDefault();10452return;10453}1045410455if (evt.button === 0) {10456var isInternalLink = evt.target.href && evt.target.classList.contains("internalLink");1045710458if (!isInternalLink) {10459evt.preventDefault();1046010461if (evt.shiftKey) {10462this.pdfViewer.previousPage();10463} else {10464this.pdfViewer.nextPage();10465}10466}10467}10468}10469}, {10470key: "_contextMenu",10471value: function _contextMenu() {10472this.contextMenuOpen = true;10473}10474}, {10475key: "_showControls",10476value: function _showControls() {10477var _this4 = this;1047810479if (this.controlsTimeout) {10480clearTimeout(this.controlsTimeout);10481} else {10482this.container.classList.add(CONTROLS_SELECTOR);10483}1048410485this.controlsTimeout = setTimeout(function () {10486_this4.container.classList.remove(CONTROLS_SELECTOR);1048710488delete _this4.controlsTimeout;10489}, DELAY_BEFORE_HIDING_CONTROLS);10490}10491}, {10492key: "_hideControls",10493value: function _hideControls() {10494if (!this.controlsTimeout) {10495return;10496}1049710498clearTimeout(this.controlsTimeout);10499this.container.classList.remove(CONTROLS_SELECTOR);10500delete this.controlsTimeout;10501}10502}, {10503key: "_resetMouseScrollState",10504value: function _resetMouseScrollState() {10505this.mouseScrollTimeStamp = 0;10506this.mouseScrollDelta = 0;10507}10508}, {10509key: "_touchSwipe",10510value: function _touchSwipe(evt) {10511if (!this.active) {10512return;10513}1051410515if (evt.touches.length > 1) {10516this.touchSwipeState = null;10517return;10518}1051910520switch (evt.type) {10521case "touchstart":10522this.touchSwipeState = {10523startX: evt.touches[0].pageX,10524startY: evt.touches[0].pageY,10525endX: evt.touches[0].pageX,10526endY: evt.touches[0].pageY10527};10528break;1052910530case "touchmove":10531if (this.touchSwipeState === null) {10532return;10533}1053410535this.touchSwipeState.endX = evt.touches[0].pageX;10536this.touchSwipeState.endY = evt.touches[0].pageY;10537evt.preventDefault();10538break;1053910540case "touchend":10541if (this.touchSwipeState === null) {10542return;10543}1054410545var delta = 0;10546var dx = this.touchSwipeState.endX - this.touchSwipeState.startX;10547var dy = this.touchSwipeState.endY - this.touchSwipeState.startY;10548var absAngle = Math.abs(Math.atan2(dy, dx));1054910550if (Math.abs(dx) > SWIPE_MIN_DISTANCE_THRESHOLD && (absAngle <= SWIPE_ANGLE_THRESHOLD || absAngle >= Math.PI - SWIPE_ANGLE_THRESHOLD)) {10551delta = dx;10552} else if (Math.abs(dy) > SWIPE_MIN_DISTANCE_THRESHOLD && Math.abs(absAngle - Math.PI / 2) <= SWIPE_ANGLE_THRESHOLD) {10553delta = dy;10554}1055510556if (delta > 0) {10557this.pdfViewer.previousPage();10558} else if (delta < 0) {10559this.pdfViewer.nextPage();10560}1056110562break;10563}10564}10565}, {10566key: "_addWindowListeners",10567value: function _addWindowListeners() {10568this.showControlsBind = this._showControls.bind(this);10569this.mouseDownBind = this._mouseDown.bind(this);10570this.mouseWheelBind = this._mouseWheel.bind(this);10571this.resetMouseScrollStateBind = this._resetMouseScrollState.bind(this);10572this.contextMenuBind = this._contextMenu.bind(this);10573this.touchSwipeBind = this._touchSwipe.bind(this);10574window.addEventListener("mousemove", this.showControlsBind);10575window.addEventListener("mousedown", this.mouseDownBind);10576window.addEventListener("wheel", this.mouseWheelBind, {10577passive: false10578});10579window.addEventListener("keydown", this.resetMouseScrollStateBind);10580window.addEventListener("contextmenu", this.contextMenuBind);10581window.addEventListener("touchstart", this.touchSwipeBind);10582window.addEventListener("touchmove", this.touchSwipeBind);10583window.addEventListener("touchend", this.touchSwipeBind);10584}10585}, {10586key: "_removeWindowListeners",10587value: function _removeWindowListeners() {10588window.removeEventListener("mousemove", this.showControlsBind);10589window.removeEventListener("mousedown", this.mouseDownBind);10590window.removeEventListener("wheel", this.mouseWheelBind, {10591passive: false10592});10593window.removeEventListener("keydown", this.resetMouseScrollStateBind);10594window.removeEventListener("contextmenu", this.contextMenuBind);10595window.removeEventListener("touchstart", this.touchSwipeBind);10596window.removeEventListener("touchmove", this.touchSwipeBind);10597window.removeEventListener("touchend", this.touchSwipeBind);10598delete this.showControlsBind;10599delete this.mouseDownBind;10600delete this.mouseWheelBind;10601delete this.resetMouseScrollStateBind;10602delete this.contextMenuBind;10603delete this.touchSwipeBind;10604}10605}, {10606key: "_fullscreenChange",10607value: function _fullscreenChange() {10608if (this.isFullscreen) {10609this._enter();10610} else {10611this._exit();10612}10613}10614}, {10615key: "_addFullscreenChangeListeners",10616value: function _addFullscreenChangeListeners() {10617this.fullscreenChangeBind = this._fullscreenChange.bind(this);10618window.addEventListener("fullscreenchange", this.fullscreenChangeBind);10619window.addEventListener("mozfullscreenchange", this.fullscreenChangeBind);10620window.addEventListener("webkitfullscreenchange", this.fullscreenChangeBind);10621}10622}, {10623key: "_removeFullscreenChangeListeners",10624value: function _removeFullscreenChangeListeners() {10625window.removeEventListener("fullscreenchange", this.fullscreenChangeBind);10626window.removeEventListener("mozfullscreenchange", this.fullscreenChangeBind);10627window.removeEventListener("webkitfullscreenchange", this.fullscreenChangeBind);10628delete this.fullscreenChangeBind;10629}10630}]);1063110632return PDFPresentationMode;10633}();1063410635exports.PDFPresentationMode = PDFPresentationMode;1063610637/***/ }),10638/* 24 */10639/***/ ((__unused_webpack_module, exports, __webpack_require__) => {10640106411064210643Object.defineProperty(exports, "__esModule", ({10644value: true10645}));10646exports.PDFScriptingManager = void 0;1064710648var _regenerator = _interopRequireDefault(__webpack_require__(4));1064910650var _pdfjsLib = __webpack_require__(7);1065110652var _ui_utils = __webpack_require__(6);1065310654var _pdf_rendering_queue = __webpack_require__(10);1065510656function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }1065710658function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }1065910660function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }1066110662function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }1066310664function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }1066510666function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }1066710668function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }1066910670function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }1067110672function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }1067310674function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }1067510676function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }1067710678function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }1067910680function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }1068110682function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1068310684function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1068510686function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1068710688var PDFScriptingManager = /*#__PURE__*/function () {10689function PDFScriptingManager(_ref) {10690var eventBus = _ref.eventBus,10691_ref$sandboxBundleSrc = _ref.sandboxBundleSrc,10692sandboxBundleSrc = _ref$sandboxBundleSrc === void 0 ? null : _ref$sandboxBundleSrc,10693_ref$scriptingFactory = _ref.scriptingFactory,10694scriptingFactory = _ref$scriptingFactory === void 0 ? null : _ref$scriptingFactory,10695_ref$docPropertiesLoo = _ref.docPropertiesLookup,10696docPropertiesLookup = _ref$docPropertiesLoo === void 0 ? null : _ref$docPropertiesLoo;1069710698_classCallCheck(this, PDFScriptingManager);1069910700this._pdfDocument = null;10701this._pdfViewer = null;10702this._closeCapability = null;10703this._destroyCapability = null;10704this._scripting = null;10705this._mouseState = Object.create(null);10706this._pageEventsReady = false;10707this._ready = false;10708this._eventBus = eventBus;10709this._sandboxBundleSrc = sandboxBundleSrc;10710this._scriptingFactory = scriptingFactory;10711this._docPropertiesLookup = docPropertiesLookup;10712}1071310714_createClass(PDFScriptingManager, [{10715key: "setViewer",10716value: function setViewer(pdfViewer) {10717this._pdfViewer = pdfViewer;10718}10719}, {10720key: "setDocument",10721value: function () {10722var _setDocument = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2(pdfDocument) {10723var _this = this,10724_this$_scripting3;1072510726var _yield$Promise$all, _yield$Promise$all2, objects, calculationOrder, docActions, _iterator, _step, _step$value, name, listener, _iterator2, _step2, _step2$value, _name, _listener, docProperties;1072710728return _regenerator["default"].wrap(function _callee2$(_context2) {10729while (1) {10730switch (_context2.prev = _context2.next) {10731case 0:10732if (!this._pdfDocument) {10733_context2.next = 3;10734break;10735}1073610737_context2.next = 3;10738return this._destroyScripting();1073910740case 3:10741this._pdfDocument = pdfDocument;1074210743if (pdfDocument) {10744_context2.next = 6;10745break;10746}1074710748return _context2.abrupt("return");1074910750case 6:10751_context2.next = 8;10752return Promise.all([pdfDocument.getFieldObjects(), pdfDocument.getCalculationOrderIds(), pdfDocument.getJSActions()]);1075310754case 8:10755_yield$Promise$all = _context2.sent;10756_yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 3);10757objects = _yield$Promise$all2[0];10758calculationOrder = _yield$Promise$all2[1];10759docActions = _yield$Promise$all2[2];1076010761if (!(!objects && !docActions)) {10762_context2.next = 17;10763break;10764}1076510766_context2.next = 16;10767return this._destroyScripting();1076810769case 16:10770return _context2.abrupt("return");1077110772case 17:10773if (!(pdfDocument !== this._pdfDocument)) {10774_context2.next = 19;10775break;10776}1077710778return _context2.abrupt("return");1077910780case 19:10781this._scripting = this._createScripting();1078210783this._internalEvents.set("updatefromsandbox", function (event) {10784if ((event === null || event === void 0 ? void 0 : event.source) !== window) {10785return;10786}1078710788_this._updateFromSandbox(event.detail);10789});1079010791this._internalEvents.set("dispatcheventinsandbox", function (event) {10792var _this$_scripting;1079310794(_this$_scripting = _this._scripting) === null || _this$_scripting === void 0 ? void 0 : _this$_scripting.dispatchEventInSandbox(event.detail);10795});1079610797this._internalEvents.set("pagechanging", function (_ref2) {10798var pageNumber = _ref2.pageNumber,10799previous = _ref2.previous;1080010801if (pageNumber === previous) {10802return;10803}1080410805_this._dispatchPageClose(previous);1080610807_this._dispatchPageOpen(pageNumber);10808});1080910810this._internalEvents.set("pagerendered", function (_ref3) {10811var pageNumber = _ref3.pageNumber;1081210813if (!_this._pageOpenPending.has(pageNumber)) {10814return;10815}1081610817if (pageNumber !== _this._pdfViewer.currentPageNumber) {10818return;10819}1082010821_this._dispatchPageOpen(pageNumber);10822});1082310824this._internalEvents.set("pagesdestroy", /*#__PURE__*/function () {10825var _ref4 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee(event) {10826var _this$_scripting2, _this$_closeCapabilit;1082710828return _regenerator["default"].wrap(function _callee$(_context) {10829while (1) {10830switch (_context.prev = _context.next) {10831case 0:10832_context.next = 2;10833return _this._dispatchPageClose(_this._pdfViewer.currentPageNumber);1083410835case 2:10836_context.next = 4;10837return (_this$_scripting2 = _this._scripting) === null || _this$_scripting2 === void 0 ? void 0 : _this$_scripting2.dispatchEventInSandbox({10838id: "doc",10839name: "WillClose"10840});1084110842case 4:10843(_this$_closeCapabilit = _this._closeCapability) === null || _this$_closeCapabilit === void 0 ? void 0 : _this$_closeCapabilit.resolve();1084410845case 5:10846case "end":10847return _context.stop();10848}10849}10850}, _callee);10851}));1085210853return function (_x2) {10854return _ref4.apply(this, arguments);10855};10856}());1085710858this._domEvents.set("mousedown", function (event) {10859_this._mouseState.isDown = true;10860});1086110862this._domEvents.set("mouseup", function (event) {10863_this._mouseState.isDown = false;10864});1086510866_iterator = _createForOfIteratorHelper(this._internalEvents);1086710868try {10869for (_iterator.s(); !(_step = _iterator.n()).done;) {10870_step$value = _slicedToArray(_step.value, 2), name = _step$value[0], listener = _step$value[1];1087110872this._eventBus._on(name, listener);10873}10874} catch (err) {10875_iterator.e(err);10876} finally {10877_iterator.f();10878}1087910880_iterator2 = _createForOfIteratorHelper(this._domEvents);1088110882try {10883for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {10884_step2$value = _slicedToArray(_step2.value, 2), _name = _step2$value[0], _listener = _step2$value[1];10885window.addEventListener(_name, _listener);10886}10887} catch (err) {10888_iterator2.e(err);10889} finally {10890_iterator2.f();10891}1089210893_context2.prev = 31;10894_context2.next = 34;10895return this._getDocProperties();1089610897case 34:10898docProperties = _context2.sent;1089910900if (!(pdfDocument !== this._pdfDocument)) {10901_context2.next = 37;10902break;10903}1090410905return _context2.abrupt("return");1090610907case 37:10908_context2.next = 39;10909return this._scripting.createSandbox({10910objects: objects,10911calculationOrder: calculationOrder,10912appInfo: {10913platform: navigator.platform,10914language: navigator.language10915},10916docInfo: _objectSpread(_objectSpread({}, docProperties), {}, {10917actions: docActions10918})10919});1092010921case 39:10922this._eventBus.dispatch("sandboxcreated", {10923source: this10924});1092510926_context2.next = 48;10927break;1092810929case 42:10930_context2.prev = 42;10931_context2.t0 = _context2["catch"](31);10932console.error("PDFScriptingManager.setDocument: \"".concat(_context2.t0 === null || _context2.t0 === void 0 ? void 0 : _context2.t0.message, "\"."));10933_context2.next = 47;10934return this._destroyScripting();1093510936case 47:10937return _context2.abrupt("return");1093810939case 48:10940_context2.next = 50;10941return (_this$_scripting3 = this._scripting) === null || _this$_scripting3 === void 0 ? void 0 : _this$_scripting3.dispatchEventInSandbox({10942id: "doc",10943name: "Open"10944});1094510946case 50:10947_context2.next = 52;10948return this._dispatchPageOpen(this._pdfViewer.currentPageNumber, true);1094910950case 52:10951Promise.resolve().then(function () {10952if (pdfDocument === _this._pdfDocument) {10953_this._ready = true;10954}10955});1095610957case 53:10958case "end":10959return _context2.stop();10960}10961}10962}, _callee2, this, [[31, 42]]);10963}));1096410965function setDocument(_x) {10966return _setDocument.apply(this, arguments);10967}1096810969return setDocument;10970}()10971}, {10972key: "dispatchWillSave",10973value: function () {10974var _dispatchWillSave = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee3(detail) {10975var _this$_scripting4;1097610977return _regenerator["default"].wrap(function _callee3$(_context3) {10978while (1) {10979switch (_context3.prev = _context3.next) {10980case 0:10981return _context3.abrupt("return", (_this$_scripting4 = this._scripting) === null || _this$_scripting4 === void 0 ? void 0 : _this$_scripting4.dispatchEventInSandbox({10982id: "doc",10983name: "WillSave"10984}));1098510986case 1:10987case "end":10988return _context3.stop();10989}10990}10991}, _callee3, this);10992}));1099310994function dispatchWillSave(_x3) {10995return _dispatchWillSave.apply(this, arguments);10996}1099710998return dispatchWillSave;10999}()11000}, {11001key: "dispatchDidSave",11002value: function () {11003var _dispatchDidSave = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee4(detail) {11004var _this$_scripting5;1100511006return _regenerator["default"].wrap(function _callee4$(_context4) {11007while (1) {11008switch (_context4.prev = _context4.next) {11009case 0:11010return _context4.abrupt("return", (_this$_scripting5 = this._scripting) === null || _this$_scripting5 === void 0 ? void 0 : _this$_scripting5.dispatchEventInSandbox({11011id: "doc",11012name: "DidSave"11013}));1101411015case 1:11016case "end":11017return _context4.stop();11018}11019}11020}, _callee4, this);11021}));1102211023function dispatchDidSave(_x4) {11024return _dispatchDidSave.apply(this, arguments);11025}1102611027return dispatchDidSave;11028}()11029}, {11030key: "dispatchWillPrint",11031value: function () {11032var _dispatchWillPrint = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee5(detail) {11033var _this$_scripting6;1103411035return _regenerator["default"].wrap(function _callee5$(_context5) {11036while (1) {11037switch (_context5.prev = _context5.next) {11038case 0:11039return _context5.abrupt("return", (_this$_scripting6 = this._scripting) === null || _this$_scripting6 === void 0 ? void 0 : _this$_scripting6.dispatchEventInSandbox({11040id: "doc",11041name: "WillPrint"11042}));1104311044case 1:11045case "end":11046return _context5.stop();11047}11048}11049}, _callee5, this);11050}));1105111052function dispatchWillPrint(_x5) {11053return _dispatchWillPrint.apply(this, arguments);11054}1105511056return dispatchWillPrint;11057}()11058}, {11059key: "dispatchDidPrint",11060value: function () {11061var _dispatchDidPrint = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee6(detail) {11062var _this$_scripting7;1106311064return _regenerator["default"].wrap(function _callee6$(_context6) {11065while (1) {11066switch (_context6.prev = _context6.next) {11067case 0:11068return _context6.abrupt("return", (_this$_scripting7 = this._scripting) === null || _this$_scripting7 === void 0 ? void 0 : _this$_scripting7.dispatchEventInSandbox({11069id: "doc",11070name: "DidPrint"11071}));1107211073case 1:11074case "end":11075return _context6.stop();11076}11077}11078}, _callee6, this);11079}));1108011081function dispatchDidPrint(_x6) {11082return _dispatchDidPrint.apply(this, arguments);11083}1108411085return dispatchDidPrint;11086}()11087}, {11088key: "mouseState",11089get: function get() {11090return this._mouseState;11091}11092}, {11093key: "destroyPromise",11094get: function get() {11095var _this$_destroyCapabil;1109611097return ((_this$_destroyCapabil = this._destroyCapability) === null || _this$_destroyCapabil === void 0 ? void 0 : _this$_destroyCapabil.promise) || null;11098}11099}, {11100key: "ready",11101get: function get() {11102return this._ready;11103}11104}, {11105key: "_internalEvents",11106get: function get() {11107return (0, _pdfjsLib.shadow)(this, "_internalEvents", new Map());11108}11109}, {11110key: "_domEvents",11111get: function get() {11112return (0, _pdfjsLib.shadow)(this, "_domEvents", new Map());11113}11114}, {11115key: "_pageOpenPending",11116get: function get() {11117return (0, _pdfjsLib.shadow)(this, "_pageOpenPending", new Set());11118}11119}, {11120key: "_visitedPages",11121get: function get() {11122return (0, _pdfjsLib.shadow)(this, "_visitedPages", new Map());11123}11124}, {11125key: "_updateFromSandbox",11126value: function () {11127var _updateFromSandbox2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee7(detail) {11128var isInPresentationMode, id, command, value, element, _this$_pdfDocument;1112911130return _regenerator["default"].wrap(function _callee7$(_context7) {11131while (1) {11132switch (_context7.prev = _context7.next) {11133case 0:11134isInPresentationMode = this._pdfViewer.isInPresentationMode || this._pdfViewer.isChangingPresentationMode;11135id = detail.id, command = detail.command, value = detail.value;1113611137if (id) {11138_context7.next = 25;11139break;11140}1114111142_context7.t0 = command;11143_context7.next = _context7.t0 === "clear" ? 6 : _context7.t0 === "error" ? 8 : _context7.t0 === "layout" ? 10 : _context7.t0 === "page-num" ? 12 : _context7.t0 === "print" ? 14 : _context7.t0 === "println" ? 18 : _context7.t0 === "zoom" ? 20 : 24;11144break;1114511146case 6:11147console.clear();11148return _context7.abrupt("break", 24);1114911150case 8:11151console.error(value);11152return _context7.abrupt("break", 24);1115311154case 10:11155this._pdfViewer.spreadMode = (0, _ui_utils.apiPageLayoutToSpreadMode)(value);11156return _context7.abrupt("break", 24);1115711158case 12:11159this._pdfViewer.currentPageNumber = value + 1;11160return _context7.abrupt("break", 24);1116111162case 14:11163_context7.next = 16;11164return this._pdfViewer.pagesPromise;1116511166case 16:11167this._eventBus.dispatch("print", {11168source: this11169});1117011171return _context7.abrupt("break", 24);1117211173case 18:11174console.log(value);11175return _context7.abrupt("break", 24);1117611177case 20:11178if (!isInPresentationMode) {11179_context7.next = 22;11180break;11181}1118211183return _context7.abrupt("return");1118411185case 22:11186this._pdfViewer.currentScaleValue = value;11187return _context7.abrupt("break", 24);1118811189case 24:11190return _context7.abrupt("return");1119111192case 25:11193if (!isInPresentationMode) {11194_context7.next = 28;11195break;11196}1119711198if (!detail.focus) {11199_context7.next = 28;11200break;11201}1120211203return _context7.abrupt("return");1120411205case 28:11206element = document.getElementById(id);1120711208if (element) {11209element.dispatchEvent(new CustomEvent("updatefromsandbox", {11210detail: detail11211}));11212} else {11213delete detail.id;11214(_this$_pdfDocument = this._pdfDocument) === null || _this$_pdfDocument === void 0 ? void 0 : _this$_pdfDocument.annotationStorage.setValue(id, detail);11215}1121611217case 30:11218case "end":11219return _context7.stop();11220}11221}11222}, _callee7, this);11223}));1122411225function _updateFromSandbox(_x7) {11226return _updateFromSandbox2.apply(this, arguments);11227}1122811229return _updateFromSandbox;11230}()11231}, {11232key: "_dispatchPageOpen",11233value: function () {11234var _dispatchPageOpen2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee9(pageNumber) {11235var _this2 = this;1123611237var initialize,11238pdfDocument,11239visitedPages,11240pageView,11241actionsPromise,11242_args9 = arguments;11243return _regenerator["default"].wrap(function _callee9$(_context9) {11244while (1) {11245switch (_context9.prev = _context9.next) {11246case 0:11247initialize = _args9.length > 1 && _args9[1] !== undefined ? _args9[1] : false;11248pdfDocument = this._pdfDocument, visitedPages = this._visitedPages;1124911250if (initialize) {11251this._closeCapability = (0, _pdfjsLib.createPromiseCapability)();11252this._pageEventsReady = true;11253}1125411255if (this._pageEventsReady) {11256_context9.next = 5;11257break;11258}1125911260return _context9.abrupt("return");1126111262case 5:11263pageView = this._pdfViewer.getPageView(pageNumber - 1);1126411265if (!((pageView === null || pageView === void 0 ? void 0 : pageView.renderingState) !== _pdf_rendering_queue.RenderingStates.FINISHED)) {11266_context9.next = 9;11267break;11268}1126911270this._pageOpenPending.add(pageNumber);1127111272return _context9.abrupt("return");1127311274case 9:11275this._pageOpenPending["delete"](pageNumber);1127611277actionsPromise = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee8() {11278var _pageView$pdfPage, _this2$_scripting;1127911280var actions;11281return _regenerator["default"].wrap(function _callee8$(_context8) {11282while (1) {11283switch (_context8.prev = _context8.next) {11284case 0:11285_context8.next = 2;11286return !visitedPages.has(pageNumber) ? (_pageView$pdfPage = pageView.pdfPage) === null || _pageView$pdfPage === void 0 ? void 0 : _pageView$pdfPage.getJSActions() : null;1128711288case 2:11289actions = _context8.sent;1129011291if (!(pdfDocument !== _this2._pdfDocument)) {11292_context8.next = 5;11293break;11294}1129511296return _context8.abrupt("return");1129711298case 5:11299_context8.next = 7;11300return (_this2$_scripting = _this2._scripting) === null || _this2$_scripting === void 0 ? void 0 : _this2$_scripting.dispatchEventInSandbox({11301id: "page",11302name: "PageOpen",11303pageNumber: pageNumber,11304actions: actions11305});1130611307case 7:11308case "end":11309return _context8.stop();11310}11311}11312}, _callee8);11313}))();11314visitedPages.set(pageNumber, actionsPromise);1131511316case 12:11317case "end":11318return _context9.stop();11319}11320}11321}, _callee9, this);11322}));1132311324function _dispatchPageOpen(_x8) {11325return _dispatchPageOpen2.apply(this, arguments);11326}1132711328return _dispatchPageOpen;11329}()11330}, {11331key: "_dispatchPageClose",11332value: function () {11333var _dispatchPageClose2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee10(pageNumber) {11334var _this$_scripting8;1133511336var pdfDocument, visitedPages, actionsPromise;11337return _regenerator["default"].wrap(function _callee10$(_context10) {11338while (1) {11339switch (_context10.prev = _context10.next) {11340case 0:11341pdfDocument = this._pdfDocument, visitedPages = this._visitedPages;1134211343if (this._pageEventsReady) {11344_context10.next = 3;11345break;11346}1134711348return _context10.abrupt("return");1134911350case 3:11351if (!this._pageOpenPending.has(pageNumber)) {11352_context10.next = 5;11353break;11354}1135511356return _context10.abrupt("return");1135711358case 5:11359actionsPromise = visitedPages.get(pageNumber);1136011361if (actionsPromise) {11362_context10.next = 8;11363break;11364}1136511366return _context10.abrupt("return");1136711368case 8:11369visitedPages.set(pageNumber, null);11370_context10.next = 11;11371return actionsPromise;1137211373case 11:11374if (!(pdfDocument !== this._pdfDocument)) {11375_context10.next = 13;11376break;11377}1137811379return _context10.abrupt("return");1138011381case 13:11382_context10.next = 15;11383return (_this$_scripting8 = this._scripting) === null || _this$_scripting8 === void 0 ? void 0 : _this$_scripting8.dispatchEventInSandbox({11384id: "page",11385name: "PageClose",11386pageNumber: pageNumber11387});1138811389case 15:11390case "end":11391return _context10.stop();11392}11393}11394}, _callee10, this);11395}));1139611397function _dispatchPageClose(_x9) {11398return _dispatchPageClose2.apply(this, arguments);11399}1140011401return _dispatchPageClose;11402}()11403}, {11404key: "_getDocProperties",11405value: function () {11406var _getDocProperties2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee11() {11407return _regenerator["default"].wrap(function _callee11$(_context11) {11408while (1) {11409switch (_context11.prev = _context11.next) {11410case 0:11411if (!this._docPropertiesLookup) {11412_context11.next = 2;11413break;11414}1141511416return _context11.abrupt("return", this._docPropertiesLookup(this._pdfDocument));1141711418case 2:11419throw new Error("_getDocProperties: Unable to lookup properties.");1142011421case 3:11422case "end":11423return _context11.stop();11424}11425}11426}, _callee11, this);11427}));1142811429function _getDocProperties() {11430return _getDocProperties2.apply(this, arguments);11431}1143211433return _getDocProperties;11434}()11435}, {11436key: "_createScripting",11437value: function _createScripting() {11438this._destroyCapability = (0, _pdfjsLib.createPromiseCapability)();1143911440if (this._scripting) {11441throw new Error("_createScripting: Scripting already exists.");11442}1144311444if (this._scriptingFactory) {11445return this._scriptingFactory.createScripting({11446sandboxBundleSrc: this._sandboxBundleSrc11447});11448}1144911450throw new Error("_createScripting: Cannot create scripting.");11451}11452}, {11453key: "_destroyScripting",11454value: function () {11455var _destroyScripting2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee12() {11456var _this$_destroyCapabil3;1145711458var _this$_destroyCapabil2, _iterator3, _step3, _step3$value, name, listener, _iterator4, _step4, _step4$value, _name2, _listener2;1145911460return _regenerator["default"].wrap(function _callee12$(_context12) {11461while (1) {11462switch (_context12.prev = _context12.next) {11463case 0:11464if (this._scripting) {11465_context12.next = 4;11466break;11467}1146811469this._pdfDocument = null;11470(_this$_destroyCapabil2 = this._destroyCapability) === null || _this$_destroyCapabil2 === void 0 ? void 0 : _this$_destroyCapabil2.resolve();11471return _context12.abrupt("return");1147211473case 4:11474if (!this._closeCapability) {11475_context12.next = 8;11476break;11477}1147811479_context12.next = 7;11480return Promise.race([this._closeCapability.promise, new Promise(function (resolve) {11481setTimeout(resolve, 1000);11482})])["catch"](function (reason) {});1148311484case 7:11485this._closeCapability = null;1148611487case 8:11488this._pdfDocument = null;11489_context12.prev = 9;11490_context12.next = 12;11491return this._scripting.destroySandbox();1149211493case 12:11494_context12.next = 16;11495break;1149611497case 14:11498_context12.prev = 14;11499_context12.t0 = _context12["catch"](9);1150011501case 16:11502_iterator3 = _createForOfIteratorHelper(this._internalEvents);1150311504try {11505for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {11506_step3$value = _slicedToArray(_step3.value, 2), name = _step3$value[0], listener = _step3$value[1];1150711508this._eventBus._off(name, listener);11509}11510} catch (err) {11511_iterator3.e(err);11512} finally {11513_iterator3.f();11514}1151511516this._internalEvents.clear();1151711518_iterator4 = _createForOfIteratorHelper(this._domEvents);1151911520try {11521for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {11522_step4$value = _slicedToArray(_step4.value, 2), _name2 = _step4$value[0], _listener2 = _step4$value[1];11523window.removeEventListener(_name2, _listener2);11524}11525} catch (err) {11526_iterator4.e(err);11527} finally {11528_iterator4.f();11529}1153011531this._domEvents.clear();1153211533this._pageOpenPending.clear();1153411535this._visitedPages.clear();1153611537this._scripting = null;11538delete this._mouseState.isDown;11539this._pageEventsReady = false;11540this._ready = false;11541(_this$_destroyCapabil3 = this._destroyCapability) === null || _this$_destroyCapabil3 === void 0 ? void 0 : _this$_destroyCapabil3.resolve();1154211543case 29:11544case "end":11545return _context12.stop();11546}11547}11548}, _callee12, this, [[9, 14]]);11549}));1155011551function _destroyScripting() {11552return _destroyScripting2.apply(this, arguments);11553}1155411555return _destroyScripting;11556}()11557}]);1155811559return PDFScriptingManager;11560}();1156111562exports.PDFScriptingManager = PDFScriptingManager;1156311564/***/ }),11565/* 25 */11566/***/ ((__unused_webpack_module, exports, __webpack_require__) => {11567115681156911570Object.defineProperty(exports, "__esModule", ({11571value: true11572}));11573exports.PDFSidebar = void 0;1157411575var _ui_utils = __webpack_require__(6);1157611577var _pdf_rendering_queue = __webpack_require__(10);1157811579function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1158011581function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1158211583function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1158411585var UI_NOTIFICATION_CLASS = "pdfSidebarNotification";1158611587var PDFSidebar = /*#__PURE__*/function () {11588function PDFSidebar(_ref) {11589var elements = _ref.elements,11590pdfViewer = _ref.pdfViewer,11591pdfThumbnailViewer = _ref.pdfThumbnailViewer,11592eventBus = _ref.eventBus,11593l10n = _ref.l10n;1159411595_classCallCheck(this, PDFSidebar);1159611597this.isOpen = false;11598this.active = _ui_utils.SidebarView.THUMBS;11599this.isInitialViewSet = false;11600this.onToggled = null;11601this.pdfViewer = pdfViewer;11602this.pdfThumbnailViewer = pdfThumbnailViewer;11603this.outerContainer = elements.outerContainer;11604this.viewerContainer = elements.viewerContainer;11605this.toggleButton = elements.toggleButton;11606this.thumbnailButton = elements.thumbnailButton;11607this.outlineButton = elements.outlineButton;11608this.attachmentsButton = elements.attachmentsButton;11609this.layersButton = elements.layersButton;11610this.thumbnailView = elements.thumbnailView;11611this.outlineView = elements.outlineView;11612this.attachmentsView = elements.attachmentsView;11613this.layersView = elements.layersView;11614this._outlineOptionsContainer = elements.outlineOptionsContainer;11615this._currentOutlineItemButton = elements.currentOutlineItemButton;11616this.eventBus = eventBus;11617this.l10n = l10n;1161811619this._addEventListeners();11620}1162111622_createClass(PDFSidebar, [{11623key: "reset",11624value: function reset() {11625this.isInitialViewSet = false;1162611627this._hideUINotification(true);1162811629this.switchView(_ui_utils.SidebarView.THUMBS);11630this.outlineButton.disabled = false;11631this.attachmentsButton.disabled = false;11632this.layersButton.disabled = false;11633this._currentOutlineItemButton.disabled = true;11634}11635}, {11636key: "visibleView",11637get: function get() {11638return this.isOpen ? this.active : _ui_utils.SidebarView.NONE;11639}11640}, {11641key: "isThumbnailViewVisible",11642get: function get() {11643return this.isOpen && this.active === _ui_utils.SidebarView.THUMBS;11644}11645}, {11646key: "isOutlineViewVisible",11647get: function get() {11648return this.isOpen && this.active === _ui_utils.SidebarView.OUTLINE;11649}11650}, {11651key: "isAttachmentsViewVisible",11652get: function get() {11653return this.isOpen && this.active === _ui_utils.SidebarView.ATTACHMENTS;11654}11655}, {11656key: "isLayersViewVisible",11657get: function get() {11658return this.isOpen && this.active === _ui_utils.SidebarView.LAYERS;11659}11660}, {11661key: "setInitialView",11662value: function setInitialView() {11663var view = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _ui_utils.SidebarView.NONE;1166411665if (this.isInitialViewSet) {11666return;11667}1166811669this.isInitialViewSet = true;1167011671if (view === _ui_utils.SidebarView.NONE || view === _ui_utils.SidebarView.UNKNOWN) {11672this._dispatchEvent();1167311674return;11675}1167611677if (!this._switchView(view, true)) {11678this._dispatchEvent();11679}11680}11681}, {11682key: "switchView",11683value: function switchView(view) {11684var forceOpen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;1168511686this._switchView(view, forceOpen);11687}11688}, {11689key: "_switchView",11690value: function _switchView(view) {11691var forceOpen = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;11692var isViewChanged = view !== this.active;11693var shouldForceRendering = false;1169411695switch (view) {11696case _ui_utils.SidebarView.NONE:11697if (this.isOpen) {11698this.close();11699return true;11700}1170111702return false;1170311704case _ui_utils.SidebarView.THUMBS:11705if (this.isOpen && isViewChanged) {11706shouldForceRendering = true;11707}1170811709break;1171011711case _ui_utils.SidebarView.OUTLINE:11712if (this.outlineButton.disabled) {11713return false;11714}1171511716break;1171711718case _ui_utils.SidebarView.ATTACHMENTS:11719if (this.attachmentsButton.disabled) {11720return false;11721}1172211723break;1172411725case _ui_utils.SidebarView.LAYERS:11726if (this.layersButton.disabled) {11727return false;11728}1172911730break;1173111732default:11733console.error("PDFSidebar._switchView: \"".concat(view, "\" is not a valid view."));11734return false;11735}1173611737this.active = view;11738this.thumbnailButton.classList.toggle("toggled", view === _ui_utils.SidebarView.THUMBS);11739this.outlineButton.classList.toggle("toggled", view === _ui_utils.SidebarView.OUTLINE);11740this.attachmentsButton.classList.toggle("toggled", view === _ui_utils.SidebarView.ATTACHMENTS);11741this.layersButton.classList.toggle("toggled", view === _ui_utils.SidebarView.LAYERS);11742this.thumbnailView.classList.toggle("hidden", view !== _ui_utils.SidebarView.THUMBS);11743this.outlineView.classList.toggle("hidden", view !== _ui_utils.SidebarView.OUTLINE);11744this.attachmentsView.classList.toggle("hidden", view !== _ui_utils.SidebarView.ATTACHMENTS);11745this.layersView.classList.toggle("hidden", view !== _ui_utils.SidebarView.LAYERS);1174611747this._outlineOptionsContainer.classList.toggle("hidden", view !== _ui_utils.SidebarView.OUTLINE);1174811749if (forceOpen && !this.isOpen) {11750this.open();11751return true;11752}1175311754if (shouldForceRendering) {11755this._updateThumbnailViewer();1175611757this._forceRendering();11758}1175911760if (isViewChanged) {11761this._dispatchEvent();11762}1176311764return isViewChanged;11765}11766}, {11767key: "open",11768value: function open() {11769if (this.isOpen) {11770return;11771}1177211773this.isOpen = true;11774this.toggleButton.classList.add("toggled");11775this.toggleButton.setAttribute("aria-expanded", "true");11776this.outerContainer.classList.add("sidebarMoving", "sidebarOpen");1177711778if (this.active === _ui_utils.SidebarView.THUMBS) {11779this._updateThumbnailViewer();11780}1178111782this._forceRendering();1178311784this._dispatchEvent();1178511786this._hideUINotification();11787}11788}, {11789key: "close",11790value: function close() {11791if (!this.isOpen) {11792return;11793}1179411795this.isOpen = false;11796this.toggleButton.classList.remove("toggled");11797this.toggleButton.setAttribute("aria-expanded", "false");11798this.outerContainer.classList.add("sidebarMoving");11799this.outerContainer.classList.remove("sidebarOpen");1180011801this._forceRendering();1180211803this._dispatchEvent();11804}11805}, {11806key: "toggle",11807value: function toggle() {11808if (this.isOpen) {11809this.close();11810} else {11811this.open();11812}11813}11814}, {11815key: "_dispatchEvent",11816value: function _dispatchEvent() {11817this.eventBus.dispatch("sidebarviewchanged", {11818source: this,11819view: this.visibleView11820});11821}11822}, {11823key: "_forceRendering",11824value: function _forceRendering() {11825if (this.onToggled) {11826this.onToggled();11827} else {11828this.pdfViewer.forceRendering();11829this.pdfThumbnailViewer.forceRendering();11830}11831}11832}, {11833key: "_updateThumbnailViewer",11834value: function _updateThumbnailViewer() {11835var pdfViewer = this.pdfViewer,11836pdfThumbnailViewer = this.pdfThumbnailViewer;11837var pagesCount = pdfViewer.pagesCount;1183811839for (var pageIndex = 0; pageIndex < pagesCount; pageIndex++) {11840var pageView = pdfViewer.getPageView(pageIndex);1184111842if ((pageView === null || pageView === void 0 ? void 0 : pageView.renderingState) === _pdf_rendering_queue.RenderingStates.FINISHED) {11843var thumbnailView = pdfThumbnailViewer.getThumbnail(pageIndex);11844thumbnailView.setImage(pageView);11845}11846}1184711848pdfThumbnailViewer.scrollThumbnailIntoView(pdfViewer.currentPageNumber);11849}11850}, {11851key: "_showUINotification",11852value: function _showUINotification() {11853var _this = this;1185411855this.l10n.get("toggle_sidebar_notification2.title").then(function (msg) {11856_this.toggleButton.title = msg;11857});1185811859if (!this.isOpen) {11860this.toggleButton.classList.add(UI_NOTIFICATION_CLASS);11861}11862}11863}, {11864key: "_hideUINotification",11865value: function _hideUINotification() {11866var _this2 = this;1186711868var reset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;1186911870if (this.isOpen || reset) {11871this.toggleButton.classList.remove(UI_NOTIFICATION_CLASS);11872}1187311874if (reset) {11875this.l10n.get("toggle_sidebar.title").then(function (msg) {11876_this2.toggleButton.title = msg;11877});11878}11879}11880}, {11881key: "_addEventListeners",11882value: function _addEventListeners() {11883var _this3 = this;1188411885this.viewerContainer.addEventListener("transitionend", function (evt) {11886if (evt.target === _this3.viewerContainer) {11887_this3.outerContainer.classList.remove("sidebarMoving");11888}11889});11890this.toggleButton.addEventListener("click", function () {11891_this3.toggle();11892});11893this.thumbnailButton.addEventListener("click", function () {11894_this3.switchView(_ui_utils.SidebarView.THUMBS);11895});11896this.outlineButton.addEventListener("click", function () {11897_this3.switchView(_ui_utils.SidebarView.OUTLINE);11898});11899this.outlineButton.addEventListener("dblclick", function () {11900_this3.eventBus.dispatch("toggleoutlinetree", {11901source: _this311902});11903});11904this.attachmentsButton.addEventListener("click", function () {11905_this3.switchView(_ui_utils.SidebarView.ATTACHMENTS);11906});11907this.layersButton.addEventListener("click", function () {11908_this3.switchView(_ui_utils.SidebarView.LAYERS);11909});11910this.layersButton.addEventListener("dblclick", function () {11911_this3.eventBus.dispatch("resetlayers", {11912source: _this311913});11914});1191511916this._currentOutlineItemButton.addEventListener("click", function () {11917_this3.eventBus.dispatch("currentoutlineitem", {11918source: _this311919});11920});1192111922var onTreeLoaded = function onTreeLoaded(count, button, view) {11923button.disabled = !count;1192411925if (count) {11926_this3._showUINotification();11927} else if (_this3.active === view) {11928_this3.switchView(_ui_utils.SidebarView.THUMBS);11929}11930};1193111932this.eventBus._on("outlineloaded", function (evt) {11933onTreeLoaded(evt.outlineCount, _this3.outlineButton, _ui_utils.SidebarView.OUTLINE);1193411935if (evt.enableCurrentOutlineItemButton) {11936_this3.pdfViewer.pagesPromise.then(function () {11937_this3._currentOutlineItemButton.disabled = !_this3.isInitialViewSet;11938});11939}11940});1194111942this.eventBus._on("attachmentsloaded", function (evt) {11943onTreeLoaded(evt.attachmentsCount, _this3.attachmentsButton, _ui_utils.SidebarView.ATTACHMENTS);11944});1194511946this.eventBus._on("layersloaded", function (evt) {11947onTreeLoaded(evt.layersCount, _this3.layersButton, _ui_utils.SidebarView.LAYERS);11948});1194911950this.eventBus._on("presentationmodechanged", function (evt) {11951if (evt.state === _ui_utils.PresentationModeState.NORMAL && _this3.isThumbnailViewVisible) {11952_this3._updateThumbnailViewer();11953}11954});11955}11956}]);1195711958return PDFSidebar;11959}();1196011961exports.PDFSidebar = PDFSidebar;1196211963/***/ }),11964/* 26 */11965/***/ ((__unused_webpack_module, exports) => {11966119671196811969Object.defineProperty(exports, "__esModule", ({11970value: true11971}));11972exports.PDFSidebarResizer = void 0;1197311974function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1197511976function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1197711978function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1197911980var SIDEBAR_WIDTH_VAR = "--sidebar-width";11981var SIDEBAR_MIN_WIDTH = 200;11982var SIDEBAR_RESIZING_CLASS = "sidebarResizing";1198311984var PDFSidebarResizer = /*#__PURE__*/function () {11985function PDFSidebarResizer(options, eventBus, l10n) {11986var _this = this;1198711988_classCallCheck(this, PDFSidebarResizer);1198911990this.isRTL = false;11991this.sidebarOpen = false;11992this.doc = document.documentElement;11993this._width = null;11994this._outerContainerWidth = null;11995this._boundEvents = Object.create(null);11996this.outerContainer = options.outerContainer;11997this.resizer = options.resizer;11998this.eventBus = eventBus;11999l10n.getDirection().then(function (dir) {12000_this.isRTL = dir === "rtl";12001});1200212003this._addEventListeners();12004}1200512006_createClass(PDFSidebarResizer, [{12007key: "outerContainerWidth",12008get: function get() {12009return this._outerContainerWidth || (this._outerContainerWidth = this.outerContainer.clientWidth);12010}12011}, {12012key: "_updateWidth",12013value: function _updateWidth() {12014var width = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;12015var maxWidth = Math.floor(this.outerContainerWidth / 2);1201612017if (width > maxWidth) {12018width = maxWidth;12019}1202012021if (width < SIDEBAR_MIN_WIDTH) {12022width = SIDEBAR_MIN_WIDTH;12023}1202412025if (width === this._width) {12026return false;12027}1202812029this._width = width;12030this.doc.style.setProperty(SIDEBAR_WIDTH_VAR, "".concat(width, "px"));12031return true;12032}12033}, {12034key: "_mouseMove",12035value: function _mouseMove(evt) {12036var width = evt.clientX;1203712038if (this.isRTL) {12039width = this.outerContainerWidth - width;12040}1204112042this._updateWidth(width);12043}12044}, {12045key: "_mouseUp",12046value: function _mouseUp(evt) {12047this.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS);12048this.eventBus.dispatch("resize", {12049source: this12050});12051var _boundEvents = this._boundEvents;12052window.removeEventListener("mousemove", _boundEvents.mouseMove);12053window.removeEventListener("mouseup", _boundEvents.mouseUp);12054}12055}, {12056key: "_addEventListeners",12057value: function _addEventListeners() {12058var _this2 = this;1205912060var _boundEvents = this._boundEvents;12061_boundEvents.mouseMove = this._mouseMove.bind(this);12062_boundEvents.mouseUp = this._mouseUp.bind(this);12063this.resizer.addEventListener("mousedown", function (evt) {12064if (evt.button !== 0) {12065return;12066}1206712068_this2.outerContainer.classList.add(SIDEBAR_RESIZING_CLASS);1206912070window.addEventListener("mousemove", _boundEvents.mouseMove);12071window.addEventListener("mouseup", _boundEvents.mouseUp);12072});1207312074this.eventBus._on("sidebarviewchanged", function (evt) {12075_this2.sidebarOpen = !!(evt !== null && evt !== void 0 && evt.view);12076});1207712078this.eventBus._on("resize", function (evt) {12079if ((evt === null || evt === void 0 ? void 0 : evt.source) !== window) {12080return;12081}1208212083_this2._outerContainerWidth = null;1208412085if (!_this2._width) {12086return;12087}1208812089if (!_this2.sidebarOpen) {12090_this2._updateWidth(_this2._width);1209112092return;12093}1209412095_this2.outerContainer.classList.add(SIDEBAR_RESIZING_CLASS);1209612097var updated = _this2._updateWidth(_this2._width);1209812099Promise.resolve().then(function () {12100_this2.outerContainer.classList.remove(SIDEBAR_RESIZING_CLASS);1210112102if (updated) {12103_this2.eventBus.dispatch("resize", {12104source: _this212105});12106}12107});12108});12109}12110}]);1211112112return PDFSidebarResizer;12113}();1211412115exports.PDFSidebarResizer = PDFSidebarResizer;1211612117/***/ }),12118/* 27 */12119/***/ ((__unused_webpack_module, exports, __webpack_require__) => {12120121211212212123Object.defineProperty(exports, "__esModule", ({12124value: true12125}));12126exports.PDFThumbnailViewer = void 0;1212712128var _ui_utils = __webpack_require__(6);1212912130var _pdf_thumbnail_view = __webpack_require__(28);1213112132var _pdf_rendering_queue = __webpack_require__(10);1213312134function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1213512136function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1213712138function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1213912140var THUMBNAIL_SCROLL_MARGIN = -19;12141var THUMBNAIL_SELECTED_CLASS = "selected";1214212143var PDFThumbnailViewer = /*#__PURE__*/function () {12144function PDFThumbnailViewer(_ref) {12145var _this = this;1214612147var container = _ref.container,12148eventBus = _ref.eventBus,12149linkService = _ref.linkService,12150renderingQueue = _ref.renderingQueue,12151l10n = _ref.l10n;1215212153_classCallCheck(this, PDFThumbnailViewer);1215412155this.container = container;12156this.linkService = linkService;12157this.renderingQueue = renderingQueue;12158this.l10n = l10n;12159this.scroll = (0, _ui_utils.watchScroll)(this.container, this._scrollUpdated.bind(this));1216012161this._resetView();1216212163eventBus._on("optionalcontentconfigchanged", function () {12164_this._setImageDisabled = true;12165});12166}1216712168_createClass(PDFThumbnailViewer, [{12169key: "_scrollUpdated",12170value: function _scrollUpdated() {12171this.renderingQueue.renderHighestPriority();12172}12173}, {12174key: "getThumbnail",12175value: function getThumbnail(index) {12176return this._thumbnails[index];12177}12178}, {12179key: "_getVisibleThumbs",12180value: function _getVisibleThumbs() {12181return (0, _ui_utils.getVisibleElements)({12182scrollEl: this.container,12183views: this._thumbnails12184});12185}12186}, {12187key: "scrollThumbnailIntoView",12188value: function scrollThumbnailIntoView(pageNumber) {12189if (!this.pdfDocument) {12190return;12191}1219212193var thumbnailView = this._thumbnails[pageNumber - 1];1219412195if (!thumbnailView) {12196console.error('scrollThumbnailIntoView: Invalid "pageNumber" parameter.');12197return;12198}1219912200if (pageNumber !== this._currentPageNumber) {12201var prevThumbnailView = this._thumbnails[this._currentPageNumber - 1];12202prevThumbnailView.div.classList.remove(THUMBNAIL_SELECTED_CLASS);12203thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);12204}1220512206var visibleThumbs = this._getVisibleThumbs();1220712208var numVisibleThumbs = visibleThumbs.views.length;1220912210if (numVisibleThumbs > 0) {12211var first = visibleThumbs.first.id;12212var last = numVisibleThumbs > 1 ? visibleThumbs.last.id : first;12213var shouldScroll = false;1221412215if (pageNumber <= first || pageNumber >= last) {12216shouldScroll = true;12217} else {12218visibleThumbs.views.some(function (view) {12219if (view.id !== pageNumber) {12220return false;12221}1222212223shouldScroll = view.percent < 100;12224return true;12225});12226}1222712228if (shouldScroll) {12229(0, _ui_utils.scrollIntoView)(thumbnailView.div, {12230top: THUMBNAIL_SCROLL_MARGIN12231});12232}12233}1223412235this._currentPageNumber = pageNumber;12236}12237}, {12238key: "pagesRotation",12239get: function get() {12240return this._pagesRotation;12241},12242set: function set(rotation) {12243if (!(0, _ui_utils.isValidRotation)(rotation)) {12244throw new Error("Invalid thumbnails rotation angle.");12245}1224612247if (!this.pdfDocument) {12248return;12249}1225012251if (this._pagesRotation === rotation) {12252return;12253}1225412255this._pagesRotation = rotation;1225612257for (var i = 0, ii = this._thumbnails.length; i < ii; i++) {12258this._thumbnails[i].update(rotation);12259}12260}12261}, {12262key: "cleanup",12263value: function cleanup() {12264for (var i = 0, ii = this._thumbnails.length; i < ii; i++) {12265if (this._thumbnails[i] && this._thumbnails[i].renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED) {12266this._thumbnails[i].reset();12267}12268}1226912270_pdf_thumbnail_view.TempImageFactory.destroyCanvas();12271}12272}, {12273key: "_resetView",12274value: function _resetView() {12275this._thumbnails = [];12276this._currentPageNumber = 1;12277this._pageLabels = null;12278this._pagesRotation = 0;12279this._optionalContentConfigPromise = null;12280this._pagesRequests = new WeakMap();12281this._setImageDisabled = false;12282this.container.textContent = "";12283}12284}, {12285key: "setDocument",12286value: function setDocument(pdfDocument) {12287var _this2 = this;1228812289if (this.pdfDocument) {12290this._cancelRendering();1229112292this._resetView();12293}1229412295this.pdfDocument = pdfDocument;1229612297if (!pdfDocument) {12298return;12299}1230012301var firstPagePromise = pdfDocument.getPage(1);12302var optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();12303firstPagePromise.then(function (firstPdfPage) {12304_this2._optionalContentConfigPromise = optionalContentConfigPromise;12305var pagesCount = pdfDocument.numPages;12306var viewport = firstPdfPage.getViewport({12307scale: 112308});1230912310var checkSetImageDisabled = function checkSetImageDisabled() {12311return _this2._setImageDisabled;12312};1231312314for (var pageNum = 1; pageNum <= pagesCount; ++pageNum) {12315var thumbnail = new _pdf_thumbnail_view.PDFThumbnailView({12316container: _this2.container,12317id: pageNum,12318defaultViewport: viewport.clone(),12319optionalContentConfigPromise: optionalContentConfigPromise,12320linkService: _this2.linkService,12321renderingQueue: _this2.renderingQueue,12322checkSetImageDisabled: checkSetImageDisabled,12323disableCanvasToImageConversion: false,12324l10n: _this2.l10n12325});1232612327_this2._thumbnails.push(thumbnail);12328}1232912330var firstThumbnailView = _this2._thumbnails[0];1233112332if (firstThumbnailView) {12333firstThumbnailView.setPdfPage(firstPdfPage);12334}1233512336var thumbnailView = _this2._thumbnails[_this2._currentPageNumber - 1];12337thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);12338})["catch"](function (reason) {12339console.error("Unable to initialize thumbnail viewer", reason);12340});12341}12342}, {12343key: "_cancelRendering",12344value: function _cancelRendering() {12345for (var i = 0, ii = this._thumbnails.length; i < ii; i++) {12346if (this._thumbnails[i]) {12347this._thumbnails[i].cancelRendering();12348}12349}12350}12351}, {12352key: "setPageLabels",12353value: function setPageLabels(labels) {12354if (!this.pdfDocument) {12355return;12356}1235712358if (!labels) {12359this._pageLabels = null;12360} else if (!(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)) {12361this._pageLabels = null;12362console.error("PDFThumbnailViewer_setPageLabels: Invalid page labels.");12363} else {12364this._pageLabels = labels;12365}1236612367for (var i = 0, ii = this._thumbnails.length; i < ii; i++) {12368var _this$_pageLabels$i, _this$_pageLabels;1236912370this._thumbnails[i].setPageLabel((_this$_pageLabels$i = (_this$_pageLabels = this._pageLabels) === null || _this$_pageLabels === void 0 ? void 0 : _this$_pageLabels[i]) !== null && _this$_pageLabels$i !== void 0 ? _this$_pageLabels$i : null);12371}12372}12373}, {12374key: "_ensurePdfPageLoaded",12375value: function _ensurePdfPageLoaded(thumbView) {12376var _this3 = this;1237712378if (thumbView.pdfPage) {12379return Promise.resolve(thumbView.pdfPage);12380}1238112382if (this._pagesRequests.has(thumbView)) {12383return this._pagesRequests.get(thumbView);12384}1238512386var promise = this.pdfDocument.getPage(thumbView.id).then(function (pdfPage) {12387if (!thumbView.pdfPage) {12388thumbView.setPdfPage(pdfPage);12389}1239012391_this3._pagesRequests["delete"](thumbView);1239212393return pdfPage;12394})["catch"](function (reason) {12395console.error("Unable to get page for thumb view", reason);1239612397_this3._pagesRequests["delete"](thumbView);12398});1239912400this._pagesRequests.set(thumbView, promise);1240112402return promise;12403}12404}, {12405key: "forceRendering",12406value: function forceRendering() {12407var _this4 = this;1240812409var visibleThumbs = this._getVisibleThumbs();1241012411var thumbView = this.renderingQueue.getHighestPriority(visibleThumbs, this._thumbnails, this.scroll.down);1241212413if (thumbView) {12414this._ensurePdfPageLoaded(thumbView).then(function () {12415_this4.renderingQueue.renderView(thumbView);12416});1241712418return true;12419}1242012421return false;12422}12423}]);1242412425return PDFThumbnailViewer;12426}();1242712428exports.PDFThumbnailViewer = PDFThumbnailViewer;1242912430/***/ }),12431/* 28 */12432/***/ ((__unused_webpack_module, exports, __webpack_require__) => {12433124341243512436Object.defineProperty(exports, "__esModule", ({12437value: true12438}));12439exports.TempImageFactory = exports.PDFThumbnailView = void 0;1244012441var _regenerator = _interopRequireDefault(__webpack_require__(4));1244212443var _ui_utils = __webpack_require__(6);1244412445var _pdfjsLib = __webpack_require__(7);1244612447var _pdf_rendering_queue = __webpack_require__(10);1244812449function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }1245012451function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }1245212453function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }1245412455function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }1245612457function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }1245812459function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }1246012461function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }1246212463function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }1246412465function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }1246612467function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1246812469function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1247012471function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1247212473var MAX_NUM_SCALING_STEPS = 3;12474var THUMBNAIL_CANVAS_BORDER_WIDTH = 1;12475var THUMBNAIL_WIDTH = 98;1247612477var TempImageFactory = function TempImageFactoryClosure() {12478var tempCanvasCache = null;12479return {12480getCanvas: function getCanvas(width, height) {12481var tempCanvas = tempCanvasCache;1248212483if (!tempCanvas) {12484tempCanvas = document.createElement("canvas");12485tempCanvasCache = tempCanvas;12486}1248712488tempCanvas.width = width;12489tempCanvas.height = height;12490tempCanvas.mozOpaque = true;12491var ctx = tempCanvas.getContext("2d", {12492alpha: false12493});12494ctx.save();12495ctx.fillStyle = "rgb(255, 255, 255)";12496ctx.fillRect(0, 0, width, height);12497ctx.restore();12498return tempCanvas;12499},12500destroyCanvas: function destroyCanvas() {12501var tempCanvas = tempCanvasCache;1250212503if (tempCanvas) {12504tempCanvas.width = 0;12505tempCanvas.height = 0;12506}1250712508tempCanvasCache = null;12509}12510};12511}();1251212513exports.TempImageFactory = TempImageFactory;1251412515var PDFThumbnailView = /*#__PURE__*/function () {12516function PDFThumbnailView(_ref) {12517var container = _ref.container,12518id = _ref.id,12519defaultViewport = _ref.defaultViewport,12520optionalContentConfigPromise = _ref.optionalContentConfigPromise,12521linkService = _ref.linkService,12522renderingQueue = _ref.renderingQueue,12523checkSetImageDisabled = _ref.checkSetImageDisabled,12524_ref$disableCanvasToI = _ref.disableCanvasToImageConversion,12525disableCanvasToImageConversion = _ref$disableCanvasToI === void 0 ? false : _ref$disableCanvasToI,12526l10n = _ref.l10n;1252712528_classCallCheck(this, PDFThumbnailView);1252912530this.id = id;12531this.renderingId = "thumbnail" + id;12532this.pageLabel = null;12533this.pdfPage = null;12534this.rotation = 0;12535this.viewport = defaultViewport;12536this.pdfPageRotate = defaultViewport.rotation;12537this._optionalContentConfigPromise = optionalContentConfigPromise || null;12538this.linkService = linkService;12539this.renderingQueue = renderingQueue;12540this.renderTask = null;12541this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;12542this.resume = null;1254312544this._checkSetImageDisabled = checkSetImageDisabled || function () {12545return false;12546};1254712548this.disableCanvasToImageConversion = disableCanvasToImageConversion;12549this.pageWidth = this.viewport.width;12550this.pageHeight = this.viewport.height;12551this.pageRatio = this.pageWidth / this.pageHeight;12552this.canvasWidth = THUMBNAIL_WIDTH;12553this.canvasHeight = this.canvasWidth / this.pageRatio | 0;12554this.scale = this.canvasWidth / this.pageWidth;12555this.l10n = l10n;12556var anchor = document.createElement("a");12557anchor.href = linkService.getAnchorUrl("#page=" + id);1255812559this._thumbPageTitle.then(function (msg) {12560anchor.title = msg;12561});1256212563anchor.onclick = function () {12564linkService.goToPage(id);12565return false;12566};1256712568this.anchor = anchor;12569var div = document.createElement("div");12570div.className = "thumbnail";12571div.setAttribute("data-page-number", this.id);12572this.div = div;12573var ring = document.createElement("div");12574ring.className = "thumbnailSelectionRing";12575var borderAdjustment = 2 * THUMBNAIL_CANVAS_BORDER_WIDTH;12576ring.style.width = this.canvasWidth + borderAdjustment + "px";12577ring.style.height = this.canvasHeight + borderAdjustment + "px";12578this.ring = ring;12579div.appendChild(ring);12580anchor.appendChild(div);12581container.appendChild(anchor);12582}1258312584_createClass(PDFThumbnailView, [{12585key: "setPdfPage",12586value: function setPdfPage(pdfPage) {12587this.pdfPage = pdfPage;12588this.pdfPageRotate = pdfPage.rotate;12589var totalRotation = (this.rotation + this.pdfPageRotate) % 360;12590this.viewport = pdfPage.getViewport({12591scale: 1,12592rotation: totalRotation12593});12594this.reset();12595}12596}, {12597key: "reset",12598value: function reset() {12599this.cancelRendering();12600this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;12601this.pageWidth = this.viewport.width;12602this.pageHeight = this.viewport.height;12603this.pageRatio = this.pageWidth / this.pageHeight;12604this.canvasHeight = this.canvasWidth / this.pageRatio | 0;12605this.scale = this.canvasWidth / this.pageWidth;12606this.div.removeAttribute("data-loaded");12607var ring = this.ring;12608var childNodes = ring.childNodes;1260912610for (var i = childNodes.length - 1; i >= 0; i--) {12611ring.removeChild(childNodes[i]);12612}1261312614var borderAdjustment = 2 * THUMBNAIL_CANVAS_BORDER_WIDTH;12615ring.style.width = this.canvasWidth + borderAdjustment + "px";12616ring.style.height = this.canvasHeight + borderAdjustment + "px";1261712618if (this.canvas) {12619this.canvas.width = 0;12620this.canvas.height = 0;12621delete this.canvas;12622}1262312624if (this.image) {12625this.image.removeAttribute("src");12626delete this.image;12627}12628}12629}, {12630key: "update",12631value: function update(rotation) {12632if (typeof rotation !== "undefined") {12633this.rotation = rotation;12634}1263512636var totalRotation = (this.rotation + this.pdfPageRotate) % 360;12637this.viewport = this.viewport.clone({12638scale: 1,12639rotation: totalRotation12640});12641this.reset();12642}12643}, {12644key: "cancelRendering",12645value: function cancelRendering() {12646if (this.renderTask) {12647this.renderTask.cancel();12648this.renderTask = null;12649}1265012651this.resume = null;12652}12653}, {12654key: "_getPageDrawContext",12655value: function _getPageDrawContext() {12656var canvas = document.createElement("canvas");12657this.canvas = canvas;12658canvas.mozOpaque = true;12659var ctx = canvas.getContext("2d", {12660alpha: false12661});12662var outputScale = (0, _ui_utils.getOutputScale)(ctx);12663canvas.width = this.canvasWidth * outputScale.sx | 0;12664canvas.height = this.canvasHeight * outputScale.sy | 0;12665canvas.style.width = this.canvasWidth + "px";12666canvas.style.height = this.canvasHeight + "px";12667var transform = outputScale.scaled ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0] : null;12668return [ctx, transform];12669}12670}, {12671key: "_convertCanvasToImage",12672value: function _convertCanvasToImage() {12673var _this = this;1267412675if (!this.canvas) {12676return;12677}1267812679if (this.renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED) {12680return;12681}1268212683var className = "thumbnailImage";1268412685if (this.disableCanvasToImageConversion) {12686this.canvas.className = className;1268712688this._thumbPageCanvas.then(function (msg) {12689_this.canvas.setAttribute("aria-label", msg);12690});1269112692this.div.setAttribute("data-loaded", true);12693this.ring.appendChild(this.canvas);12694return;12695}1269612697var image = document.createElement("img");12698image.className = className;1269912700this._thumbPageCanvas.then(function (msg) {12701image.setAttribute("aria-label", msg);12702});1270312704image.style.width = this.canvasWidth + "px";12705image.style.height = this.canvasHeight + "px";12706image.src = this.canvas.toDataURL();12707this.image = image;12708this.div.setAttribute("data-loaded", true);12709this.ring.appendChild(image);12710this.canvas.width = 0;12711this.canvas.height = 0;12712delete this.canvas;12713}12714}, {12715key: "draw",12716value: function draw() {12717var _this2 = this;1271812719if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {12720console.error("Must be in new state before drawing");12721return Promise.resolve(undefined);12722}1272312724var pdfPage = this.pdfPage;1272512726if (!pdfPage) {12727this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;12728return Promise.reject(new Error("pdfPage is not loaded"));12729}1273012731this.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;1273212733var finishRenderTask = /*#__PURE__*/function () {12734var _ref2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee() {12735var error,12736_args = arguments;12737return _regenerator["default"].wrap(function _callee$(_context) {12738while (1) {12739switch (_context.prev = _context.next) {12740case 0:12741error = _args.length > 0 && _args[0] !== undefined ? _args[0] : null;1274212743if (renderTask === _this2.renderTask) {12744_this2.renderTask = null;12745}1274612747if (!(error instanceof _pdfjsLib.RenderingCancelledException)) {12748_context.next = 4;12749break;12750}1275112752return _context.abrupt("return");1275312754case 4:12755_this2.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;1275612757_this2._convertCanvasToImage();1275812759if (!error) {12760_context.next = 8;12761break;12762}1276312764throw error;1276512766case 8:12767case "end":12768return _context.stop();12769}12770}12771}, _callee);12772}));1277312774return function finishRenderTask() {12775return _ref2.apply(this, arguments);12776};12777}();1277812779var _this$_getPageDrawCon = this._getPageDrawContext(),12780_this$_getPageDrawCon2 = _slicedToArray(_this$_getPageDrawCon, 2),12781ctx = _this$_getPageDrawCon2[0],12782transform = _this$_getPageDrawCon2[1];1278312784var drawViewport = this.viewport.clone({12785scale: this.scale12786});1278712788var renderContinueCallback = function renderContinueCallback(cont) {12789if (!_this2.renderingQueue.isHighestPriority(_this2)) {12790_this2.renderingState = _pdf_rendering_queue.RenderingStates.PAUSED;1279112792_this2.resume = function () {12793_this2.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;12794cont();12795};1279612797return;12798}1279912800cont();12801};1280212803var renderContext = {12804canvasContext: ctx,12805transform: transform,12806viewport: drawViewport,12807optionalContentConfigPromise: this._optionalContentConfigPromise12808};12809var renderTask = this.renderTask = pdfPage.render(renderContext);12810renderTask.onContinue = renderContinueCallback;12811var resultPromise = renderTask.promise.then(function () {12812finishRenderTask(null);12813}, function (error) {12814finishRenderTask(error);12815});12816resultPromise["finally"](function () {12817var _this2$pdfPage;1281812819var pageCached = _this2.linkService.isPageCached(_this2.id);1282012821if (pageCached) {12822return;12823}1282412825(_this2$pdfPage = _this2.pdfPage) === null || _this2$pdfPage === void 0 ? void 0 : _this2$pdfPage.cleanup();12826});12827return resultPromise;12828}12829}, {12830key: "setImage",12831value: function setImage(pageView) {12832if (this._checkSetImageDisabled()) {12833return;12834}1283512836if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {12837return;12838}1283912840var img = pageView.canvas;1284112842if (!img) {12843return;12844}1284512846if (!this.pdfPage) {12847this.setPdfPage(pageView.pdfPage);12848}1284912850this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;1285112852var _this$_getPageDrawCon3 = this._getPageDrawContext(),12853_this$_getPageDrawCon4 = _slicedToArray(_this$_getPageDrawCon3, 1),12854ctx = _this$_getPageDrawCon4[0];1285512856var canvas = ctx.canvas;1285712858if (img.width <= 2 * canvas.width) {12859ctx.drawImage(img, 0, 0, img.width, img.height, 0, 0, canvas.width, canvas.height);1286012861this._convertCanvasToImage();1286212863return;12864}1286512866var reducedWidth = canvas.width << MAX_NUM_SCALING_STEPS;12867var reducedHeight = canvas.height << MAX_NUM_SCALING_STEPS;12868var reducedImage = TempImageFactory.getCanvas(reducedWidth, reducedHeight);12869var reducedImageCtx = reducedImage.getContext("2d");1287012871while (reducedWidth > img.width || reducedHeight > img.height) {12872reducedWidth >>= 1;12873reducedHeight >>= 1;12874}1287512876reducedImageCtx.drawImage(img, 0, 0, img.width, img.height, 0, 0, reducedWidth, reducedHeight);1287712878while (reducedWidth > 2 * canvas.width) {12879reducedImageCtx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, reducedWidth >> 1, reducedHeight >> 1);12880reducedWidth >>= 1;12881reducedHeight >>= 1;12882}1288312884ctx.drawImage(reducedImage, 0, 0, reducedWidth, reducedHeight, 0, 0, canvas.width, canvas.height);1288512886this._convertCanvasToImage();12887}12888}, {12889key: "_thumbPageTitle",12890get: function get() {12891var _this$pageLabel;1289212893return this.l10n.get("thumb_page_title", {12894page: (_this$pageLabel = this.pageLabel) !== null && _this$pageLabel !== void 0 ? _this$pageLabel : this.id12895});12896}12897}, {12898key: "_thumbPageCanvas",12899get: function get() {12900var _this$pageLabel2;1290112902return this.l10n.get("thumb_page_canvas", {12903page: (_this$pageLabel2 = this.pageLabel) !== null && _this$pageLabel2 !== void 0 ? _this$pageLabel2 : this.id12904});12905}12906}, {12907key: "setPageLabel",12908value: function setPageLabel(label) {12909var _this3 = this;1291012911this.pageLabel = typeof label === "string" ? label : null;1291212913this._thumbPageTitle.then(function (msg) {12914_this3.anchor.title = msg;12915});1291612917if (this.renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED) {12918return;12919}1292012921this._thumbPageCanvas.then(function (msg) {12922if (_this3.image) {12923_this3.image.setAttribute("aria-label", msg);12924} else if (_this3.disableCanvasToImageConversion && _this3.canvas) {12925_this3.canvas.setAttribute("aria-label", msg);12926}12927});12928}12929}]);1293012931return PDFThumbnailView;12932}();1293312934exports.PDFThumbnailView = PDFThumbnailView;1293512936/***/ }),12937/* 29 */12938/***/ ((__unused_webpack_module, exports, __webpack_require__) => {12939129401294112942function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }1294312944Object.defineProperty(exports, "__esModule", ({12945value: true12946}));12947exports.PDFViewer = void 0;1294812949var _ui_utils = __webpack_require__(6);1295012951var _base_viewer = __webpack_require__(30);1295212953var _pdfjsLib = __webpack_require__(7);1295412955function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }1295612957function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }1295812959function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }1296012961function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1296212963function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1296412965function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1296612967function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }1296812969function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }1297012971function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }1297212973function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }1297412975function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }1297612977function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }1297812979function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }1298012981function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }1298212983function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }1298412985var PDFViewer = /*#__PURE__*/function (_BaseViewer) {12986_inherits(PDFViewer, _BaseViewer);1298712988var _super = _createSuper(PDFViewer);1298912990function PDFViewer() {12991_classCallCheck(this, PDFViewer);1299212993return _super.apply(this, arguments);12994}1299512996_createClass(PDFViewer, [{12997key: "_viewerElement",12998get: function get() {12999return (0, _pdfjsLib.shadow)(this, "_viewerElement", this.viewer);13000}13001}, {13002key: "_scrollIntoView",13003value: function _scrollIntoView(_ref) {13004var pageDiv = _ref.pageDiv,13005_ref$pageSpot = _ref.pageSpot,13006pageSpot = _ref$pageSpot === void 0 ? null : _ref$pageSpot,13007_ref$pageNumber = _ref.pageNumber,13008pageNumber = _ref$pageNumber === void 0 ? null : _ref$pageNumber;1300913010if (!pageSpot && !this.isInPresentationMode) {13011var left = pageDiv.offsetLeft + pageDiv.clientLeft;13012var right = left + pageDiv.clientWidth;13013var _this$container = this.container,13014scrollLeft = _this$container.scrollLeft,13015clientWidth = _this$container.clientWidth;1301613017if (this._isScrollModeHorizontal || left < scrollLeft || right > scrollLeft + clientWidth) {13018pageSpot = {13019left: 0,13020top: 013021};13022}13023}1302413025_get(_getPrototypeOf(PDFViewer.prototype), "_scrollIntoView", this).call(this, {13026pageDiv: pageDiv,13027pageSpot: pageSpot,13028pageNumber: pageNumber13029});13030}13031}, {13032key: "_getVisiblePages",13033value: function _getVisiblePages() {13034if (this.isInPresentationMode) {13035return this._getCurrentVisiblePage();13036}1303713038return _get(_getPrototypeOf(PDFViewer.prototype), "_getVisiblePages", this).call(this);13039}13040}, {13041key: "_updateHelper",13042value: function _updateHelper(visiblePages) {13043if (this.isInPresentationMode) {13044return;13045}1304613047var currentId = this._currentPageNumber;13048var stillFullyVisible = false;1304913050var _iterator = _createForOfIteratorHelper(visiblePages),13051_step;1305213053try {13054for (_iterator.s(); !(_step = _iterator.n()).done;) {13055var page = _step.value;1305613057if (page.percent < 100) {13058break;13059}1306013061if (page.id === currentId && this._scrollMode === _ui_utils.ScrollMode.VERTICAL && this._spreadMode === _ui_utils.SpreadMode.NONE) {13062stillFullyVisible = true;13063break;13064}13065}13066} catch (err) {13067_iterator.e(err);13068} finally {13069_iterator.f();13070}1307113072if (!stillFullyVisible) {13073currentId = visiblePages[0].id;13074}1307513076this._setCurrentPageNumber(currentId);13077}13078}]);1307913080return PDFViewer;13081}(_base_viewer.BaseViewer);1308213083exports.PDFViewer = PDFViewer;1308413085/***/ }),13086/* 30 */13087/***/ ((__unused_webpack_module, exports, __webpack_require__) => {13088130891309013091Object.defineProperty(exports, "__esModule", ({13092value: true13093}));13094exports.BaseViewer = void 0;1309513096var _pdfjsLib = __webpack_require__(7);1309713098var _ui_utils = __webpack_require__(6);1309913100var _pdf_rendering_queue = __webpack_require__(10);1310113102var _annotation_layer_builder = __webpack_require__(31);1310313104var _l10n_utils = __webpack_require__(32);1310513106var _pdf_page_view = __webpack_require__(33);1310713108var _pdf_link_service = __webpack_require__(21);1310913110var _text_layer_builder = __webpack_require__(34);1311113112var _xfa_layer_builder = __webpack_require__(35);1311313114function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }1311513116function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }1311713118function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }1311913120function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1312113122function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1312313124function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1312513126var DEFAULT_CACHE_SIZE = 10;1312713128function PDFPageViewBuffer(size) {13129var data = [];1313013131this.push = function (view) {13132var i = data.indexOf(view);1313313134if (i >= 0) {13135data.splice(i, 1);13136}1313713138data.push(view);1313913140if (data.length > size) {13141data.shift().destroy();13142}13143};1314413145this.resize = function (newSize, pagesToKeep) {13146size = newSize;1314713148if (pagesToKeep) {13149var pageIdsToKeep = new Set();1315013151for (var i = 0, iMax = pagesToKeep.length; i < iMax; ++i) {13152pageIdsToKeep.add(pagesToKeep[i].id);13153}1315413155(0, _ui_utils.moveToEndOfArray)(data, function (page) {13156return pageIdsToKeep.has(page.id);13157});13158}1315913160while (data.length > size) {13161data.shift().destroy();13162}13163};1316413165this.has = function (view) {13166return data.includes(view);13167};13168}1316913170function isSameScale(oldScale, newScale) {13171if (newScale === oldScale) {13172return true;13173}1317413175if (Math.abs(newScale - oldScale) < 1e-15) {13176return true;13177}1317813179return false;13180}1318113182var BaseViewer = /*#__PURE__*/function () {13183function BaseViewer(options) {13184var _this$container,13185_this$viewer,13186_this = this;1318713188_classCallCheck(this, BaseViewer);1318913190if (this.constructor === BaseViewer) {13191throw new Error("Cannot initialize BaseViewer.");13192}1319313194var viewerVersion = '2.8.335';1319513196if (_pdfjsLib.version !== viewerVersion) {13197throw new Error("The API version \"".concat(_pdfjsLib.version, "\" does not match the Viewer version \"").concat(viewerVersion, "\"."));13198}1319913200this._name = this.constructor.name;13201this.container = options.container;13202this.viewer = options.viewer || options.container.firstElementChild;1320313204if (!(((_this$container = this.container) === null || _this$container === void 0 ? void 0 : _this$container.tagName.toUpperCase()) === "DIV" && ((_this$viewer = this.viewer) === null || _this$viewer === void 0 ? void 0 : _this$viewer.tagName.toUpperCase()) === "DIV")) {13205throw new Error("Invalid `container` and/or `viewer` option.");13206}1320713208if (this.container.offsetParent && getComputedStyle(this.container).position !== "absolute") {13209throw new Error("The `container` must be absolutely positioned.");13210}1321113212this.eventBus = options.eventBus;13213this.linkService = options.linkService || new _pdf_link_service.SimpleLinkService();13214this.downloadManager = options.downloadManager || null;13215this.findController = options.findController || null;13216this._scriptingManager = options.scriptingManager || null;13217this.removePageBorders = options.removePageBorders || false;13218this.textLayerMode = Number.isInteger(options.textLayerMode) ? options.textLayerMode : _ui_utils.TextLayerMode.ENABLE;13219this.imageResourcesPath = options.imageResourcesPath || "";13220this.renderInteractiveForms = options.renderInteractiveForms !== false;13221this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;13222this.renderer = options.renderer || _ui_utils.RendererType.CANVAS;13223this.enableWebGL = options.enableWebGL || false;13224this.useOnlyCssZoom = options.useOnlyCssZoom || false;13225this.maxCanvasPixels = options.maxCanvasPixels;13226this.l10n = options.l10n || _l10n_utils.NullL10n;13227this.enableScripting = options.enableScripting === true && !!this._scriptingManager;13228this.defaultRenderingQueue = !options.renderingQueue;1322913230if (this.defaultRenderingQueue) {13231this.renderingQueue = new _pdf_rendering_queue.PDFRenderingQueue();13232this.renderingQueue.setViewer(this);13233} else {13234this.renderingQueue = options.renderingQueue;13235}1323613237this.scroll = (0, _ui_utils.watchScroll)(this.container, this._scrollUpdate.bind(this));13238this.presentationModeState = _ui_utils.PresentationModeState.UNKNOWN;13239this._onBeforeDraw = this._onAfterDraw = null;1324013241this._resetView();1324213243if (this.removePageBorders) {13244this.viewer.classList.add("removePageBorders");13245}1324613247Promise.resolve().then(function () {13248_this.eventBus.dispatch("baseviewerinit", {13249source: _this13250});13251});13252}1325313254_createClass(BaseViewer, [{13255key: "pagesCount",13256get: function get() {13257return this._pages.length;13258}13259}, {13260key: "getPageView",13261value: function getPageView(index) {13262return this._pages[index];13263}13264}, {13265key: "pageViewsReady",13266get: function get() {13267if (!this._pagesCapability.settled) {13268return false;13269}1327013271return this._pages.every(function (pageView) {13272return pageView === null || pageView === void 0 ? void 0 : pageView.pdfPage;13273});13274}13275}, {13276key: "currentPageNumber",13277get: function get() {13278return this._currentPageNumber;13279},13280set: function set(val) {13281if (!Number.isInteger(val)) {13282throw new Error("Invalid page number.");13283}1328413285if (!this.pdfDocument) {13286return;13287}1328813289if (!this._setCurrentPageNumber(val, true)) {13290console.error("".concat(this._name, ".currentPageNumber: \"").concat(val, "\" is not a valid page."));13291}13292}13293}, {13294key: "_setCurrentPageNumber",13295value: function _setCurrentPageNumber(val) {13296var _this$_pageLabels, _this$_pageLabels2;1329713298var resetCurrentPageView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;1329913300if (this._currentPageNumber === val) {13301if (resetCurrentPageView) {13302this._resetCurrentPageView();13303}1330413305return true;13306}1330713308if (!(0 < val && val <= this.pagesCount)) {13309return false;13310}1331113312var previous = this._currentPageNumber;13313this._currentPageNumber = val;13314this.eventBus.dispatch("pagechanging", {13315source: this,13316pageNumber: val,13317pageLabel: (_this$_pageLabels = (_this$_pageLabels2 = this._pageLabels) === null || _this$_pageLabels2 === void 0 ? void 0 : _this$_pageLabels2[val - 1]) !== null && _this$_pageLabels !== void 0 ? _this$_pageLabels : null,13318previous: previous13319});1332013321if (resetCurrentPageView) {13322this._resetCurrentPageView();13323}1332413325return true;13326}13327}, {13328key: "currentPageLabel",13329get: function get() {13330var _this$_pageLabels3, _this$_pageLabels4;1333113332return (_this$_pageLabels3 = (_this$_pageLabels4 = this._pageLabels) === null || _this$_pageLabels4 === void 0 ? void 0 : _this$_pageLabels4[this._currentPageNumber - 1]) !== null && _this$_pageLabels3 !== void 0 ? _this$_pageLabels3 : null;13333},13334set: function set(val) {13335if (!this.pdfDocument) {13336return;13337}1333813339var page = val | 0;1334013341if (this._pageLabels) {13342var i = this._pageLabels.indexOf(val);1334313344if (i >= 0) {13345page = i + 1;13346}13347}1334813349if (!this._setCurrentPageNumber(page, true)) {13350console.error("".concat(this._name, ".currentPageLabel: \"").concat(val, "\" is not a valid page."));13351}13352}13353}, {13354key: "currentScale",13355get: function get() {13356return this._currentScale !== _ui_utils.UNKNOWN_SCALE ? this._currentScale : _ui_utils.DEFAULT_SCALE;13357},13358set: function set(val) {13359if (isNaN(val)) {13360throw new Error("Invalid numeric scale.");13361}1336213363if (!this.pdfDocument) {13364return;13365}1336613367this._setScale(val, false);13368}13369}, {13370key: "currentScaleValue",13371get: function get() {13372return this._currentScaleValue;13373},13374set: function set(val) {13375if (!this.pdfDocument) {13376return;13377}1337813379this._setScale(val, false);13380}13381}, {13382key: "pagesRotation",13383get: function get() {13384return this._pagesRotation;13385},13386set: function set(rotation) {13387if (!(0, _ui_utils.isValidRotation)(rotation)) {13388throw new Error("Invalid pages rotation angle.");13389}1339013391if (!this.pdfDocument) {13392return;13393}1339413395rotation %= 360;1339613397if (rotation < 0) {13398rotation += 360;13399}1340013401if (this._pagesRotation === rotation) {13402return;13403}1340413405this._pagesRotation = rotation;13406var pageNumber = this._currentPageNumber;1340713408for (var i = 0, ii = this._pages.length; i < ii; i++) {13409var pageView = this._pages[i];13410pageView.update(pageView.scale, rotation);13411}1341213413if (this._currentScaleValue) {13414this._setScale(this._currentScaleValue, true);13415}1341613417this.eventBus.dispatch("rotationchanging", {13418source: this,13419pagesRotation: rotation,13420pageNumber: pageNumber13421});1342213423if (this.defaultRenderingQueue) {13424this.update();13425}13426}13427}, {13428key: "firstPagePromise",13429get: function get() {13430return this.pdfDocument ? this._firstPageCapability.promise : null;13431}13432}, {13433key: "onePageRendered",13434get: function get() {13435return this.pdfDocument ? this._onePageRenderedCapability.promise : null;13436}13437}, {13438key: "pagesPromise",13439get: function get() {13440return this.pdfDocument ? this._pagesCapability.promise : null;13441}13442}, {13443key: "_viewerElement",13444get: function get() {13445throw new Error("Not implemented: _viewerElement");13446}13447}, {13448key: "_onePageRenderedOrForceFetch",13449value: function _onePageRenderedOrForceFetch() {13450if (!this.container.offsetParent || this._getVisiblePages().views.length === 0) {13451return Promise.resolve();13452}1345313454return this._onePageRenderedCapability.promise;13455}13456}, {13457key: "setDocument",13458value: function setDocument(pdfDocument) {13459var _this2 = this;1346013461if (this.pdfDocument) {13462this.eventBus.dispatch("pagesdestroy", {13463source: this13464});1346513466this._cancelRendering();1346713468this._resetView();1346913470if (this.findController) {13471this.findController.setDocument(null);13472}1347313474if (this._scriptingManager) {13475this._scriptingManager.setDocument(null);13476}13477}1347813479this.pdfDocument = pdfDocument;1348013481if (!pdfDocument) {13482return;13483}1348413485var isPureXfa = pdfDocument.isPureXfa;13486var pagesCount = pdfDocument.numPages;13487var firstPagePromise = pdfDocument.getPage(1);13488var optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();1348913490this._pagesCapability.promise.then(function () {13491_this2.eventBus.dispatch("pagesloaded", {13492source: _this2,13493pagesCount: pagesCount13494});13495});1349613497this._onBeforeDraw = function (evt) {13498var pageView = _this2._pages[evt.pageNumber - 1];1349913500if (!pageView) {13501return;13502}1350313504_this2._buffer.push(pageView);13505};1350613507this.eventBus._on("pagerender", this._onBeforeDraw);1350813509this._onAfterDraw = function (evt) {13510if (evt.cssTransform || _this2._onePageRenderedCapability.settled) {13511return;13512}1351313514_this2._onePageRenderedCapability.resolve();1351513516_this2.eventBus._off("pagerendered", _this2._onAfterDraw);1351713518_this2._onAfterDraw = null;13519};1352013521this.eventBus._on("pagerendered", this._onAfterDraw);1352213523firstPagePromise.then(function (firstPdfPage) {13524_this2._firstPageCapability.resolve(firstPdfPage);1352513526_this2._optionalContentConfigPromise = optionalContentConfigPromise;13527var scale = _this2.currentScale;13528var viewport = firstPdfPage.getViewport({13529scale: scale * _ui_utils.CSS_UNITS13530});13531var textLayerFactory = _this2.textLayerMode !== _ui_utils.TextLayerMode.DISABLE ? _this2 : null;13532var xfaLayerFactory = isPureXfa ? _this2 : null;1353313534for (var pageNum = 1; pageNum <= pagesCount; ++pageNum) {13535var pageView = new _pdf_page_view.PDFPageView({13536container: _this2._viewerElement,13537eventBus: _this2.eventBus,13538id: pageNum,13539scale: scale,13540defaultViewport: viewport.clone(),13541optionalContentConfigPromise: optionalContentConfigPromise,13542renderingQueue: _this2.renderingQueue,13543textLayerFactory: textLayerFactory,13544textLayerMode: _this2.textLayerMode,13545annotationLayerFactory: _this2,13546xfaLayerFactory: xfaLayerFactory,13547imageResourcesPath: _this2.imageResourcesPath,13548renderInteractiveForms: _this2.renderInteractiveForms,13549renderer: _this2.renderer,13550enableWebGL: _this2.enableWebGL,13551useOnlyCssZoom: _this2.useOnlyCssZoom,13552maxCanvasPixels: _this2.maxCanvasPixels,13553l10n: _this2.l10n,13554enableScripting: _this2.enableScripting13555});1355613557_this2._pages.push(pageView);13558}1355913560var firstPageView = _this2._pages[0];1356113562if (firstPageView) {13563firstPageView.setPdfPage(firstPdfPage);1356413565_this2.linkService.cachePageRef(1, firstPdfPage.ref);13566}1356713568if (_this2._spreadMode !== _ui_utils.SpreadMode.NONE) {13569_this2._updateSpreadMode();13570}1357113572_this2._onePageRenderedOrForceFetch().then(function () {13573if (_this2.findController) {13574_this2.findController.setDocument(pdfDocument);13575}1357613577if (_this2.enableScripting) {13578_this2._scriptingManager.setDocument(pdfDocument);13579}1358013581if (pdfDocument.loadingParams.disableAutoFetch || pagesCount > 7500) {13582_this2._pagesCapability.resolve();1358313584return;13585}1358613587var getPagesLeft = pagesCount - 1;1358813589if (getPagesLeft <= 0) {13590_this2._pagesCapability.resolve();1359113592return;13593}1359413595var _loop = function _loop(_pageNum) {13596pdfDocument.getPage(_pageNum).then(function (pdfPage) {13597var pageView = _this2._pages[_pageNum - 1];1359813599if (!pageView.pdfPage) {13600pageView.setPdfPage(pdfPage);13601}1360213603_this2.linkService.cachePageRef(_pageNum, pdfPage.ref);1360413605if (--getPagesLeft === 0) {13606_this2._pagesCapability.resolve();13607}13608}, function (reason) {13609console.error("Unable to get page ".concat(_pageNum, " to initialize viewer"), reason);1361013611if (--getPagesLeft === 0) {13612_this2._pagesCapability.resolve();13613}13614});13615};1361613617for (var _pageNum = 2; _pageNum <= pagesCount; ++_pageNum) {13618_loop(_pageNum);13619}13620});1362113622_this2.eventBus.dispatch("pagesinit", {13623source: _this213624});1362513626if (_this2.defaultRenderingQueue) {13627_this2.update();13628}13629})["catch"](function (reason) {13630console.error("Unable to initialize viewer", reason);13631});13632}13633}, {13634key: "setPageLabels",13635value: function setPageLabels(labels) {13636if (!this.pdfDocument) {13637return;13638}1363913640if (!labels) {13641this._pageLabels = null;13642} else if (!(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)) {13643this._pageLabels = null;13644console.error("".concat(this._name, ".setPageLabels: Invalid page labels."));13645} else {13646this._pageLabels = labels;13647}1364813649for (var i = 0, ii = this._pages.length; i < ii; i++) {13650var _this$_pageLabels$i, _this$_pageLabels5;1365113652this._pages[i].setPageLabel((_this$_pageLabels$i = (_this$_pageLabels5 = this._pageLabels) === null || _this$_pageLabels5 === void 0 ? void 0 : _this$_pageLabels5[i]) !== null && _this$_pageLabels$i !== void 0 ? _this$_pageLabels$i : null);13653}13654}13655}, {13656key: "_resetView",13657value: function _resetView() {13658this._pages = [];13659this._currentPageNumber = 1;13660this._currentScale = _ui_utils.UNKNOWN_SCALE;13661this._currentScaleValue = null;13662this._pageLabels = null;13663this._buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE);13664this._location = null;13665this._pagesRotation = 0;13666this._optionalContentConfigPromise = null;13667this._pagesRequests = new WeakMap();13668this._firstPageCapability = (0, _pdfjsLib.createPromiseCapability)();13669this._onePageRenderedCapability = (0, _pdfjsLib.createPromiseCapability)();13670this._pagesCapability = (0, _pdfjsLib.createPromiseCapability)();13671this._scrollMode = _ui_utils.ScrollMode.VERTICAL;13672this._spreadMode = _ui_utils.SpreadMode.NONE;1367313674if (this._onBeforeDraw) {13675this.eventBus._off("pagerender", this._onBeforeDraw);1367613677this._onBeforeDraw = null;13678}1367913680if (this._onAfterDraw) {13681this.eventBus._off("pagerendered", this._onAfterDraw);1368213683this._onAfterDraw = null;13684}1368513686this.viewer.textContent = "";1368713688this._updateScrollMode();13689}13690}, {13691key: "_scrollUpdate",13692value: function _scrollUpdate() {13693if (this.pagesCount === 0) {13694return;13695}1369613697this.update();13698}13699}, {13700key: "_scrollIntoView",13701value: function _scrollIntoView(_ref) {13702var pageDiv = _ref.pageDiv,13703_ref$pageSpot = _ref.pageSpot,13704pageSpot = _ref$pageSpot === void 0 ? null : _ref$pageSpot,13705_ref$pageNumber = _ref.pageNumber,13706pageNumber = _ref$pageNumber === void 0 ? null : _ref$pageNumber;13707(0, _ui_utils.scrollIntoView)(pageDiv, pageSpot);13708}13709}, {13710key: "_setScaleUpdatePages",13711value: function _setScaleUpdatePages(newScale, newValue) {13712var noScroll = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;13713var preset = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;13714this._currentScaleValue = newValue.toString();1371513716if (isSameScale(this._currentScale, newScale)) {13717if (preset) {13718this.eventBus.dispatch("scalechanging", {13719source: this,13720scale: newScale,13721presetValue: newValue13722});13723}1372413725return;13726}1372713728for (var i = 0, ii = this._pages.length; i < ii; i++) {13729this._pages[i].update(newScale);13730}1373113732this._currentScale = newScale;1373313734if (!noScroll) {13735var page = this._currentPageNumber,13736dest;1373713738if (this._location && !(this.isInPresentationMode || this.isChangingPresentationMode)) {13739page = this._location.pageNumber;13740dest = [null, {13741name: "XYZ"13742}, this._location.left, this._location.top, null];13743}1374413745this.scrollPageIntoView({13746pageNumber: page,13747destArray: dest,13748allowNegativeOffset: true13749});13750}1375113752this.eventBus.dispatch("scalechanging", {13753source: this,13754scale: newScale,13755presetValue: preset ? newValue : undefined13756});1375713758if (this.defaultRenderingQueue) {13759this.update();13760}13761}13762}, {13763key: "_pageWidthScaleFactor",13764get: function get() {13765if (this._spreadMode !== _ui_utils.SpreadMode.NONE && this._scrollMode !== _ui_utils.ScrollMode.HORIZONTAL && !this.isInPresentationMode) {13766return 2;13767}1376813769return 1;13770}13771}, {13772key: "_setScale",13773value: function _setScale(value) {13774var noScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;13775var scale = parseFloat(value);1377613777if (scale > 0) {13778this._setScaleUpdatePages(scale, value, noScroll, false);13779} else {13780var currentPage = this._pages[this._currentPageNumber - 1];1378113782if (!currentPage) {13783return;13784}1378513786var noPadding = this.isInPresentationMode || this.removePageBorders;13787var hPadding = noPadding ? 0 : _ui_utils.SCROLLBAR_PADDING;13788var vPadding = noPadding ? 0 : _ui_utils.VERTICAL_PADDING;1378913790if (!noPadding && this._isScrollModeHorizontal) {13791var _ref2 = [vPadding, hPadding];13792hPadding = _ref2[0];13793vPadding = _ref2[1];13794}1379513796var pageWidthScale = (this.container.clientWidth - hPadding) / currentPage.width * currentPage.scale / this._pageWidthScaleFactor;13797var pageHeightScale = (this.container.clientHeight - vPadding) / currentPage.height * currentPage.scale;1379813799switch (value) {13800case "page-actual":13801scale = 1;13802break;1380313804case "page-width":13805scale = pageWidthScale;13806break;1380713808case "page-height":13809scale = pageHeightScale;13810break;1381113812case "page-fit":13813scale = Math.min(pageWidthScale, pageHeightScale);13814break;1381513816case "auto":13817var horizontalScale = (0, _ui_utils.isPortraitOrientation)(currentPage) ? pageWidthScale : Math.min(pageHeightScale, pageWidthScale);13818scale = Math.min(_ui_utils.MAX_AUTO_SCALE, horizontalScale);13819break;1382013821default:13822console.error("".concat(this._name, "._setScale: \"").concat(value, "\" is an unknown zoom value."));13823return;13824}1382513826this._setScaleUpdatePages(scale, value, noScroll, true);13827}13828}13829}, {13830key: "_resetCurrentPageView",13831value: function _resetCurrentPageView() {13832if (this.isInPresentationMode) {13833this._setScale(this._currentScaleValue, true);13834}1383513836var pageView = this._pages[this._currentPageNumber - 1];1383713838this._scrollIntoView({13839pageDiv: pageView.div13840});13841}13842}, {13843key: "pageLabelToPageNumber",13844value: function pageLabelToPageNumber(label) {13845if (!this._pageLabels) {13846return null;13847}1384813849var i = this._pageLabels.indexOf(label);1385013851if (i < 0) {13852return null;13853}1385413855return i + 1;13856}13857}, {13858key: "scrollPageIntoView",13859value: function scrollPageIntoView(_ref3) {13860var pageNumber = _ref3.pageNumber,13861_ref3$destArray = _ref3.destArray,13862destArray = _ref3$destArray === void 0 ? null : _ref3$destArray,13863_ref3$allowNegativeOf = _ref3.allowNegativeOffset,13864allowNegativeOffset = _ref3$allowNegativeOf === void 0 ? false : _ref3$allowNegativeOf,13865_ref3$ignoreDestinati = _ref3.ignoreDestinationZoom,13866ignoreDestinationZoom = _ref3$ignoreDestinati === void 0 ? false : _ref3$ignoreDestinati;1386713868if (!this.pdfDocument) {13869return;13870}1387113872var pageView = Number.isInteger(pageNumber) && this._pages[pageNumber - 1];1387313874if (!pageView) {13875console.error("".concat(this._name, ".scrollPageIntoView: ") + "\"".concat(pageNumber, "\" is not a valid pageNumber parameter."));13876return;13877}1387813879if (this.isInPresentationMode || !destArray) {13880this._setCurrentPageNumber(pageNumber, true);1388113882return;13883}1388413885var x = 0,13886y = 0;13887var width = 0,13888height = 0,13889widthScale,13890heightScale;13891var changeOrientation = pageView.rotation % 180 !== 0;13892var pageWidth = (changeOrientation ? pageView.height : pageView.width) / pageView.scale / _ui_utils.CSS_UNITS;13893var pageHeight = (changeOrientation ? pageView.width : pageView.height) / pageView.scale / _ui_utils.CSS_UNITS;13894var scale = 0;1389513896switch (destArray[1].name) {13897case "XYZ":13898x = destArray[2];13899y = destArray[3];13900scale = destArray[4];13901x = x !== null ? x : 0;13902y = y !== null ? y : pageHeight;13903break;1390413905case "Fit":13906case "FitB":13907scale = "page-fit";13908break;1390913910case "FitH":13911case "FitBH":13912y = destArray[2];13913scale = "page-width";1391413915if (y === null && this._location) {13916x = this._location.left;13917y = this._location.top;13918} else if (typeof y !== "number") {13919y = pageHeight;13920}1392113922break;1392313924case "FitV":13925case "FitBV":13926x = destArray[2];13927width = pageWidth;13928height = pageHeight;13929scale = "page-height";13930break;1393113932case "FitR":13933x = destArray[2];13934y = destArray[3];13935width = destArray[4] - x;13936height = destArray[5] - y;13937var hPadding = this.removePageBorders ? 0 : _ui_utils.SCROLLBAR_PADDING;13938var vPadding = this.removePageBorders ? 0 : _ui_utils.VERTICAL_PADDING;13939widthScale = (this.container.clientWidth - hPadding) / width / _ui_utils.CSS_UNITS;13940heightScale = (this.container.clientHeight - vPadding) / height / _ui_utils.CSS_UNITS;13941scale = Math.min(Math.abs(widthScale), Math.abs(heightScale));13942break;1394313944default:13945console.error("".concat(this._name, ".scrollPageIntoView: ") + "\"".concat(destArray[1].name, "\" is not a valid destination type."));13946return;13947}1394813949if (!ignoreDestinationZoom) {13950if (scale && scale !== this._currentScale) {13951this.currentScaleValue = scale;13952} else if (this._currentScale === _ui_utils.UNKNOWN_SCALE) {13953this.currentScaleValue = _ui_utils.DEFAULT_SCALE_VALUE;13954}13955}1395613957if (scale === "page-fit" && !destArray[4]) {13958this._scrollIntoView({13959pageDiv: pageView.div,13960pageNumber: pageNumber13961});1396213963return;13964}1396513966var boundingRect = [pageView.viewport.convertToViewportPoint(x, y), pageView.viewport.convertToViewportPoint(x + width, y + height)];13967var left = Math.min(boundingRect[0][0], boundingRect[1][0]);13968var top = Math.min(boundingRect[0][1], boundingRect[1][1]);1396913970if (!allowNegativeOffset) {13971left = Math.max(left, 0);13972top = Math.max(top, 0);13973}1397413975this._scrollIntoView({13976pageDiv: pageView.div,13977pageSpot: {13978left: left,13979top: top13980},13981pageNumber: pageNumber13982});13983}13984}, {13985key: "_updateLocation",13986value: function _updateLocation(firstPage) {13987var currentScale = this._currentScale;13988var currentScaleValue = this._currentScaleValue;13989var normalizedScaleValue = parseFloat(currentScaleValue) === currentScale ? Math.round(currentScale * 10000) / 100 : currentScaleValue;13990var pageNumber = firstPage.id;13991var pdfOpenParams = "#page=" + pageNumber;13992pdfOpenParams += "&zoom=" + normalizedScaleValue;13993var currentPageView = this._pages[pageNumber - 1];13994var container = this.container;13995var topLeft = currentPageView.getPagePoint(container.scrollLeft - firstPage.x, container.scrollTop - firstPage.y);13996var intLeft = Math.round(topLeft[0]);13997var intTop = Math.round(topLeft[1]);13998pdfOpenParams += "," + intLeft + "," + intTop;13999this._location = {14000pageNumber: pageNumber,14001scale: normalizedScaleValue,14002top: intTop,14003left: intLeft,14004rotation: this._pagesRotation,14005pdfOpenParams: pdfOpenParams14006};14007}14008}, {14009key: "_updateHelper",14010value: function _updateHelper(visiblePages) {14011throw new Error("Not implemented: _updateHelper");14012}14013}, {14014key: "update",14015value: function update() {14016var visible = this._getVisiblePages();1401714018var visiblePages = visible.views,14019numVisiblePages = visiblePages.length;1402014021if (numVisiblePages === 0) {14022return;14023}1402414025var newCacheSize = Math.max(DEFAULT_CACHE_SIZE, 2 * numVisiblePages + 1);1402614027this._buffer.resize(newCacheSize, visiblePages);1402814029this.renderingQueue.renderHighestPriority(visible);1403014031this._updateHelper(visiblePages);1403214033this._updateLocation(visible.first);1403414035this.eventBus.dispatch("updateviewarea", {14036source: this,14037location: this._location14038});14039}14040}, {14041key: "containsElement",14042value: function containsElement(element) {14043return this.container.contains(element);14044}14045}, {14046key: "focus",14047value: function focus() {14048this.container.focus();14049}14050}, {14051key: "_isScrollModeHorizontal",14052get: function get() {14053return this.isInPresentationMode ? false : this._scrollMode === _ui_utils.ScrollMode.HORIZONTAL;14054}14055}, {14056key: "_isContainerRtl",14057get: function get() {14058return getComputedStyle(this.container).direction === "rtl";14059}14060}, {14061key: "isInPresentationMode",14062get: function get() {14063return this.presentationModeState === _ui_utils.PresentationModeState.FULLSCREEN;14064}14065}, {14066key: "isChangingPresentationMode",14067get: function get() {14068return this.presentationModeState === _ui_utils.PresentationModeState.CHANGING;14069}14070}, {14071key: "isHorizontalScrollbarEnabled",14072get: function get() {14073return this.isInPresentationMode ? false : this.container.scrollWidth > this.container.clientWidth;14074}14075}, {14076key: "isVerticalScrollbarEnabled",14077get: function get() {14078return this.isInPresentationMode ? false : this.container.scrollHeight > this.container.clientHeight;14079}14080}, {14081key: "_getCurrentVisiblePage",14082value: function _getCurrentVisiblePage() {14083if (!this.pagesCount) {14084return {14085views: []14086};14087}1408814089var pageView = this._pages[this._currentPageNumber - 1];14090var element = pageView.div;14091var view = {14092id: pageView.id,14093x: element.offsetLeft + element.clientLeft,14094y: element.offsetTop + element.clientTop,14095view: pageView14096};14097return {14098first: view,14099last: view,14100views: [view]14101};14102}14103}, {14104key: "_getVisiblePages",14105value: function _getVisiblePages() {14106return (0, _ui_utils.getVisibleElements)({14107scrollEl: this.container,14108views: this._pages,14109sortByVisibility: true,14110horizontal: this._isScrollModeHorizontal,14111rtl: this._isScrollModeHorizontal && this._isContainerRtl14112});14113}14114}, {14115key: "isPageVisible",14116value: function isPageVisible(pageNumber) {14117if (!this.pdfDocument) {14118return false;14119}1412014121if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {14122console.error("".concat(this._name, ".isPageVisible: \"").concat(pageNumber, "\" is not a valid page."));14123return false;14124}1412514126return this._getVisiblePages().views.some(function (view) {14127return view.id === pageNumber;14128});14129}14130}, {14131key: "isPageCached",14132value: function isPageCached(pageNumber) {14133if (!this.pdfDocument || !this._buffer) {14134return false;14135}1413614137if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {14138console.error("".concat(this._name, ".isPageCached: \"").concat(pageNumber, "\" is not a valid page."));14139return false;14140}1414114142var pageView = this._pages[pageNumber - 1];1414314144if (!pageView) {14145return false;14146}1414714148return this._buffer.has(pageView);14149}14150}, {14151key: "cleanup",14152value: function cleanup() {14153for (var i = 0, ii = this._pages.length; i < ii; i++) {14154if (this._pages[i] && this._pages[i].renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED) {14155this._pages[i].reset();14156}14157}14158}14159}, {14160key: "_cancelRendering",14161value: function _cancelRendering() {14162for (var i = 0, ii = this._pages.length; i < ii; i++) {14163if (this._pages[i]) {14164this._pages[i].cancelRendering();14165}14166}14167}14168}, {14169key: "_ensurePdfPageLoaded",14170value: function _ensurePdfPageLoaded(pageView) {14171var _this3 = this;1417214173if (pageView.pdfPage) {14174return Promise.resolve(pageView.pdfPage);14175}1417614177if (this._pagesRequests.has(pageView)) {14178return this._pagesRequests.get(pageView);14179}1418014181var promise = this.pdfDocument.getPage(pageView.id).then(function (pdfPage) {14182if (!pageView.pdfPage) {14183pageView.setPdfPage(pdfPage);14184}1418514186_this3._pagesRequests["delete"](pageView);1418714188return pdfPage;14189})["catch"](function (reason) {14190console.error("Unable to get page for page view", reason);1419114192_this3._pagesRequests["delete"](pageView);14193});1419414195this._pagesRequests.set(pageView, promise);1419614197return promise;14198}14199}, {14200key: "forceRendering",14201value: function forceRendering(currentlyVisiblePages) {14202var _this4 = this;1420314204var visiblePages = currentlyVisiblePages || this._getVisiblePages();1420514206var scrollAhead = this._isScrollModeHorizontal ? this.scroll.right : this.scroll.down;14207var pageView = this.renderingQueue.getHighestPriority(visiblePages, this._pages, scrollAhead);1420814209if (pageView) {14210this._ensurePdfPageLoaded(pageView).then(function () {14211_this4.renderingQueue.renderView(pageView);14212});1421314214return true;14215}1421614217return false;14218}14219}, {14220key: "createTextLayerBuilder",14221value: function createTextLayerBuilder(textLayerDiv, pageIndex, viewport) {14222var enhanceTextSelection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;14223var eventBus = arguments.length > 4 ? arguments[4] : undefined;14224return new _text_layer_builder.TextLayerBuilder({14225textLayerDiv: textLayerDiv,14226eventBus: eventBus,14227pageIndex: pageIndex,14228viewport: viewport,14229findController: this.isInPresentationMode ? null : this.findController,14230enhanceTextSelection: this.isInPresentationMode ? false : enhanceTextSelection14231});14232}14233}, {14234key: "createAnnotationLayerBuilder",14235value: function createAnnotationLayerBuilder(pageDiv, pdfPage) {14236var _this$pdfDocument, _this$pdfDocument2, _this$_scriptingManag;1423714238var annotationStorage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;14239var imageResourcesPath = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "";14240var renderInteractiveForms = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;14241var l10n = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : _l10n_utils.NullL10n;14242var enableScripting = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;14243var hasJSActionsPromise = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;14244var mouseState = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;14245return new _annotation_layer_builder.AnnotationLayerBuilder({14246pageDiv: pageDiv,14247pdfPage: pdfPage,14248annotationStorage: annotationStorage || ((_this$pdfDocument = this.pdfDocument) === null || _this$pdfDocument === void 0 ? void 0 : _this$pdfDocument.annotationStorage),14249imageResourcesPath: imageResourcesPath,14250renderInteractiveForms: renderInteractiveForms,14251linkService: this.linkService,14252downloadManager: this.downloadManager,14253l10n: l10n,14254enableScripting: enableScripting,14255hasJSActionsPromise: hasJSActionsPromise || ((_this$pdfDocument2 = this.pdfDocument) === null || _this$pdfDocument2 === void 0 ? void 0 : _this$pdfDocument2.hasJSActions()),14256mouseState: mouseState || ((_this$_scriptingManag = this._scriptingManager) === null || _this$_scriptingManag === void 0 ? void 0 : _this$_scriptingManag.mouseState)14257});14258}14259}, {14260key: "createXfaLayerBuilder",14261value: function createXfaLayerBuilder(pageDiv, pdfPage) {14262return new _xfa_layer_builder.XfaLayerBuilder({14263pageDiv: pageDiv,14264pdfPage: pdfPage14265});14266}14267}, {14268key: "hasEqualPageSizes",14269get: function get() {14270var firstPageView = this._pages[0];1427114272for (var i = 1, ii = this._pages.length; i < ii; ++i) {14273var pageView = this._pages[i];1427414275if (pageView.width !== firstPageView.width || pageView.height !== firstPageView.height) {14276return false;14277}14278}1427914280return true;14281}14282}, {14283key: "getPagesOverview",14284value: function getPagesOverview() {14285var _this5 = this;1428614287return this._pages.map(function (pageView) {14288var viewport = pageView.pdfPage.getViewport({14289scale: 114290});1429114292if (!_this5.enablePrintAutoRotate || (0, _ui_utils.isPortraitOrientation)(viewport)) {14293return {14294width: viewport.width,14295height: viewport.height,14296rotation: viewport.rotation14297};14298}1429914300return {14301width: viewport.height,14302height: viewport.width,14303rotation: (viewport.rotation - 90) % 36014304};14305});14306}14307}, {14308key: "optionalContentConfigPromise",14309get: function get() {14310if (!this.pdfDocument) {14311return Promise.resolve(null);14312}1431314314if (!this._optionalContentConfigPromise) {14315return this.pdfDocument.getOptionalContentConfig();14316}1431714318return this._optionalContentConfigPromise;14319},14320set: function set(promise) {14321if (!(promise instanceof Promise)) {14322throw new Error("Invalid optionalContentConfigPromise: ".concat(promise));14323}1432414325if (!this.pdfDocument) {14326return;14327}1432814329if (!this._optionalContentConfigPromise) {14330return;14331}1433214333this._optionalContentConfigPromise = promise;1433414335var _iterator = _createForOfIteratorHelper(this._pages),14336_step;1433714338try {14339for (_iterator.s(); !(_step = _iterator.n()).done;) {14340var pageView = _step.value;14341pageView.update(pageView.scale, pageView.rotation, promise);14342}14343} catch (err) {14344_iterator.e(err);14345} finally {14346_iterator.f();14347}1434814349this.update();14350this.eventBus.dispatch("optionalcontentconfigchanged", {14351source: this,14352promise: promise14353});14354}14355}, {14356key: "scrollMode",14357get: function get() {14358return this._scrollMode;14359},14360set: function set(mode) {14361if (this._scrollMode === mode) {14362return;14363}1436414365if (!(0, _ui_utils.isValidScrollMode)(mode)) {14366throw new Error("Invalid scroll mode: ".concat(mode));14367}1436814369this._scrollMode = mode;14370this.eventBus.dispatch("scrollmodechanged", {14371source: this,14372mode: mode14373});1437414375this._updateScrollMode(this._currentPageNumber);14376}14377}, {14378key: "_updateScrollMode",14379value: function _updateScrollMode() {14380var pageNumber = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;14381var scrollMode = this._scrollMode,14382viewer = this.viewer;14383viewer.classList.toggle("scrollHorizontal", scrollMode === _ui_utils.ScrollMode.HORIZONTAL);14384viewer.classList.toggle("scrollWrapped", scrollMode === _ui_utils.ScrollMode.WRAPPED);1438514386if (!this.pdfDocument || !pageNumber) {14387return;14388}1438914390if (this._currentScaleValue && isNaN(this._currentScaleValue)) {14391this._setScale(this._currentScaleValue, true);14392}1439314394this._setCurrentPageNumber(pageNumber, true);1439514396this.update();14397}14398}, {14399key: "spreadMode",14400get: function get() {14401return this._spreadMode;14402},14403set: function set(mode) {14404if (this._spreadMode === mode) {14405return;14406}1440714408if (!(0, _ui_utils.isValidSpreadMode)(mode)) {14409throw new Error("Invalid spread mode: ".concat(mode));14410}1441114412this._spreadMode = mode;14413this.eventBus.dispatch("spreadmodechanged", {14414source: this,14415mode: mode14416});1441714418this._updateSpreadMode(this._currentPageNumber);14419}14420}, {14421key: "_updateSpreadMode",14422value: function _updateSpreadMode() {14423var pageNumber = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;1442414425if (!this.pdfDocument) {14426return;14427}1442814429var viewer = this.viewer,14430pages = this._pages;14431viewer.textContent = "";1443214433if (this._spreadMode === _ui_utils.SpreadMode.NONE) {14434for (var i = 0, iMax = pages.length; i < iMax; ++i) {14435viewer.appendChild(pages[i].div);14436}14437} else {14438var parity = this._spreadMode - 1;14439var spread = null;1444014441for (var _i = 0, _iMax = pages.length; _i < _iMax; ++_i) {14442if (spread === null) {14443spread = document.createElement("div");14444spread.className = "spread";14445viewer.appendChild(spread);14446} else if (_i % 2 === parity) {14447spread = spread.cloneNode(false);14448viewer.appendChild(spread);14449}1445014451spread.appendChild(pages[_i].div);14452}14453}1445414455if (!pageNumber) {14456return;14457}1445814459if (this._currentScaleValue && isNaN(this._currentScaleValue)) {14460this._setScale(this._currentScaleValue, true);14461}1446214463this._setCurrentPageNumber(pageNumber, true);1446414465this.update();14466}14467}, {14468key: "_getPageAdvance",14469value: function _getPageAdvance(currentPageNumber) {14470var previous = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;1447114472if (this.isInPresentationMode) {14473return 1;14474}1447514476switch (this._scrollMode) {14477case _ui_utils.ScrollMode.WRAPPED:14478{14479var _this$_getVisiblePage = this._getVisiblePages(),14480views = _this$_getVisiblePage.views,14481pageLayout = new Map();1448214483var _iterator2 = _createForOfIteratorHelper(views),14484_step2;1448514486try {14487for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {14488var _step2$value = _step2.value,14489id = _step2$value.id,14490y = _step2$value.y,14491percent = _step2$value.percent,14492widthPercent = _step2$value.widthPercent;1449314494if (percent === 0 || widthPercent < 100) {14495continue;14496}1449714498var yArray = pageLayout.get(y);1449914500if (!yArray) {14501pageLayout.set(y, yArray || (yArray = []));14502}1450314504yArray.push(id);14505}14506} catch (err) {14507_iterator2.e(err);14508} finally {14509_iterator2.f();14510}1451114512var _iterator3 = _createForOfIteratorHelper(pageLayout.values()),14513_step3;1451414515try {14516for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {14517var _yArray = _step3.value;1451814519var currentIndex = _yArray.indexOf(currentPageNumber);1452014521if (currentIndex === -1) {14522continue;14523}1452414525var numPages = _yArray.length;1452614527if (numPages === 1) {14528break;14529}1453014531if (previous) {14532for (var i = currentIndex - 1, ii = 0; i >= ii; i--) {14533var currentId = _yArray[i],14534expectedId = _yArray[i + 1] - 1;1453514536if (currentId < expectedId) {14537return currentPageNumber - expectedId;14538}14539}14540} else {14541for (var _i2 = currentIndex + 1, _ii = numPages; _i2 < _ii; _i2++) {14542var _currentId = _yArray[_i2],14543_expectedId = _yArray[_i2 - 1] + 1;1454414545if (_currentId > _expectedId) {14546return _expectedId - currentPageNumber;14547}14548}14549}1455014551if (previous) {14552var firstId = _yArray[0];1455314554if (firstId < currentPageNumber) {14555return currentPageNumber - firstId + 1;14556}14557} else {14558var lastId = _yArray[numPages - 1];1455914560if (lastId > currentPageNumber) {14561return lastId - currentPageNumber + 1;14562}14563}1456414565break;14566}14567} catch (err) {14568_iterator3.e(err);14569} finally {14570_iterator3.f();14571}1457214573break;14574}1457514576case _ui_utils.ScrollMode.HORIZONTAL:14577{14578break;14579}1458014581case _ui_utils.ScrollMode.VERTICAL:14582{14583if (this._spreadMode === _ui_utils.SpreadMode.NONE) {14584break;14585}1458614587var parity = this._spreadMode - 1;1458814589if (previous && currentPageNumber % 2 !== parity) {14590break;14591} else if (!previous && currentPageNumber % 2 === parity) {14592break;14593}1459414595var _this$_getVisiblePage2 = this._getVisiblePages(),14596_views = _this$_getVisiblePage2.views,14597_expectedId2 = previous ? currentPageNumber - 1 : currentPageNumber + 1;1459814599var _iterator4 = _createForOfIteratorHelper(_views),14600_step4;1460114602try {14603for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {14604var _step4$value = _step4.value,14605_id = _step4$value.id,14606_percent = _step4$value.percent,14607_widthPercent = _step4$value.widthPercent;1460814609if (_id !== _expectedId2) {14610continue;14611}1461214613if (_percent > 0 && _widthPercent === 100) {14614return 2;14615}1461614617break;14618}14619} catch (err) {14620_iterator4.e(err);14621} finally {14622_iterator4.f();14623}1462414625break;14626}14627}1462814629return 1;14630}14631}, {14632key: "nextPage",14633value: function nextPage() {14634var currentPageNumber = this._currentPageNumber,14635pagesCount = this.pagesCount;1463614637if (currentPageNumber >= pagesCount) {14638return false;14639}1464014641var advance = this._getPageAdvance(currentPageNumber, false) || 1;14642this.currentPageNumber = Math.min(currentPageNumber + advance, pagesCount);14643return true;14644}14645}, {14646key: "previousPage",14647value: function previousPage() {14648var currentPageNumber = this._currentPageNumber;1464914650if (currentPageNumber <= 1) {14651return false;14652}1465314654var advance = this._getPageAdvance(currentPageNumber, true) || 1;14655this.currentPageNumber = Math.max(currentPageNumber - advance, 1);14656return true;14657}14658}]);1465914660return BaseViewer;14661}();1466214663exports.BaseViewer = BaseViewer;1466414665/***/ }),14666/* 31 */14667/***/ ((__unused_webpack_module, exports, __webpack_require__) => {14668146691467014671Object.defineProperty(exports, "__esModule", ({14672value: true14673}));14674exports.DefaultAnnotationLayerFactory = exports.AnnotationLayerBuilder = void 0;1467514676var _pdfjsLib = __webpack_require__(7);1467714678var _l10n_utils = __webpack_require__(32);1467914680var _pdf_link_service = __webpack_require__(21);1468114682function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }1468314684function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }1468514686function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }1468714688function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }1468914690function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }1469114692function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }1469314694function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1469514696function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1469714698function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1469914700var AnnotationLayerBuilder = /*#__PURE__*/function () {14701function AnnotationLayerBuilder(_ref) {14702var pageDiv = _ref.pageDiv,14703pdfPage = _ref.pdfPage,14704linkService = _ref.linkService,14705downloadManager = _ref.downloadManager,14706_ref$annotationStorag = _ref.annotationStorage,14707annotationStorage = _ref$annotationStorag === void 0 ? null : _ref$annotationStorag,14708_ref$imageResourcesPa = _ref.imageResourcesPath,14709imageResourcesPath = _ref$imageResourcesPa === void 0 ? "" : _ref$imageResourcesPa,14710_ref$renderInteractiv = _ref.renderInteractiveForms,14711renderInteractiveForms = _ref$renderInteractiv === void 0 ? true : _ref$renderInteractiv,14712_ref$l10n = _ref.l10n,14713l10n = _ref$l10n === void 0 ? _l10n_utils.NullL10n : _ref$l10n,14714_ref$enableScripting = _ref.enableScripting,14715enableScripting = _ref$enableScripting === void 0 ? false : _ref$enableScripting,14716_ref$hasJSActionsProm = _ref.hasJSActionsPromise,14717hasJSActionsPromise = _ref$hasJSActionsProm === void 0 ? null : _ref$hasJSActionsProm,14718_ref$mouseState = _ref.mouseState,14719mouseState = _ref$mouseState === void 0 ? null : _ref$mouseState;1472014721_classCallCheck(this, AnnotationLayerBuilder);1472214723this.pageDiv = pageDiv;14724this.pdfPage = pdfPage;14725this.linkService = linkService;14726this.downloadManager = downloadManager;14727this.imageResourcesPath = imageResourcesPath;14728this.renderInteractiveForms = renderInteractiveForms;14729this.l10n = l10n;14730this.annotationStorage = annotationStorage;14731this.enableScripting = enableScripting;14732this._hasJSActionsPromise = hasJSActionsPromise;14733this._mouseState = mouseState;14734this.div = null;14735this._cancelled = false;14736}1473714738_createClass(AnnotationLayerBuilder, [{14739key: "render",14740value: function render(viewport) {14741var _this = this;1474214743var intent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "display";14744return Promise.all([this.pdfPage.getAnnotations({14745intent: intent14746}), this._hasJSActionsPromise]).then(function (_ref2) {14747var _ref3 = _slicedToArray(_ref2, 2),14748annotations = _ref3[0],14749_ref3$ = _ref3[1],14750hasJSActions = _ref3$ === void 0 ? false : _ref3$;1475114752if (_this._cancelled) {14753return;14754}1475514756if (annotations.length === 0) {14757return;14758}1475914760var parameters = {14761viewport: viewport.clone({14762dontFlip: true14763}),14764div: _this.div,14765annotations: annotations,14766page: _this.pdfPage,14767imageResourcesPath: _this.imageResourcesPath,14768renderInteractiveForms: _this.renderInteractiveForms,14769linkService: _this.linkService,14770downloadManager: _this.downloadManager,14771annotationStorage: _this.annotationStorage,14772enableScripting: _this.enableScripting,14773hasJSActions: hasJSActions,14774mouseState: _this._mouseState14775};1477614777if (_this.div) {14778_pdfjsLib.AnnotationLayer.update(parameters);14779} else {14780_this.div = document.createElement("div");14781_this.div.className = "annotationLayer";1478214783_this.pageDiv.appendChild(_this.div);1478414785parameters.div = _this.div;1478614787_pdfjsLib.AnnotationLayer.render(parameters);1478814789_this.l10n.translate(_this.div);14790}14791});14792}14793}, {14794key: "cancel",14795value: function cancel() {14796this._cancelled = true;14797}14798}, {14799key: "hide",14800value: function hide() {14801if (!this.div) {14802return;14803}1480414805this.div.hidden = true;14806}14807}]);1480814809return AnnotationLayerBuilder;14810}();1481114812exports.AnnotationLayerBuilder = AnnotationLayerBuilder;1481314814var DefaultAnnotationLayerFactory = /*#__PURE__*/function () {14815function DefaultAnnotationLayerFactory() {14816_classCallCheck(this, DefaultAnnotationLayerFactory);14817}1481814819_createClass(DefaultAnnotationLayerFactory, [{14820key: "createAnnotationLayerBuilder",14821value: function createAnnotationLayerBuilder(pageDiv, pdfPage) {14822var annotationStorage = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;14823var imageResourcesPath = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "";14824var renderInteractiveForms = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : true;14825var l10n = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : _l10n_utils.NullL10n;14826var enableScripting = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;14827var hasJSActionsPromise = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : null;14828var mouseState = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : null;14829return new AnnotationLayerBuilder({14830pageDiv: pageDiv,14831pdfPage: pdfPage,14832imageResourcesPath: imageResourcesPath,14833renderInteractiveForms: renderInteractiveForms,14834linkService: new _pdf_link_service.SimpleLinkService(),14835l10n: l10n,14836annotationStorage: annotationStorage,14837enableScripting: enableScripting,14838hasJSActionsPromise: hasJSActionsPromise,14839mouseState: mouseState14840});14841}14842}]);1484314844return DefaultAnnotationLayerFactory;14845}();1484614847exports.DefaultAnnotationLayerFactory = DefaultAnnotationLayerFactory;1484814849/***/ }),14850/* 32 */14851/***/ ((__unused_webpack_module, exports, __webpack_require__) => {14852148531485414855Object.defineProperty(exports, "__esModule", ({14856value: true14857}));14858exports.getL10nFallback = getL10nFallback;14859exports.NullL10n = void 0;1486014861var _regenerator = _interopRequireDefault(__webpack_require__(4));1486214863function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }1486414865function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }1486614867function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }1486814869var DEFAULT_L10N_STRINGS = {14870of_pages: "of {{pagesCount}}",14871page_of_pages: "({{pageNumber}} of {{pagesCount}})",14872document_properties_kb: "{{size_kb}} KB ({{size_b}} bytes)",14873document_properties_mb: "{{size_mb}} MB ({{size_b}} bytes)",14874document_properties_date_string: "{{date}}, {{time}}",14875document_properties_page_size_unit_inches: "in",14876document_properties_page_size_unit_millimeters: "mm",14877document_properties_page_size_orientation_portrait: "portrait",14878document_properties_page_size_orientation_landscape: "landscape",14879document_properties_page_size_name_a3: "A3",14880document_properties_page_size_name_a4: "A4",14881document_properties_page_size_name_letter: "Letter",14882document_properties_page_size_name_legal: "Legal",14883document_properties_page_size_dimension_string: "{{width}} × {{height}} {{unit}} ({{orientation}})",14884document_properties_page_size_dimension_name_string: "{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",14885document_properties_linearized_yes: "Yes",14886document_properties_linearized_no: "No",14887print_progress_percent: "{{progress}}%",14888"toggle_sidebar.title": "Toggle Sidebar",14889"toggle_sidebar_notification2.title": "Toggle Sidebar (document contains outline/attachments/layers)",14890additional_layers: "Additional Layers",14891page_landmark: "Page {{page}}",14892thumb_page_title: "Page {{page}}",14893thumb_page_canvas: "Thumbnail of Page {{page}}",14894find_reached_top: "Reached top of document, continued from bottom",14895find_reached_bottom: "Reached end of document, continued from top",14896"find_match_count[one]": "{{current}} of {{total}} match",14897"find_match_count[other]": "{{current}} of {{total}} matches",14898"find_match_count_limit[one]": "More than {{limit}} match",14899"find_match_count_limit[other]": "More than {{limit}} matches",14900find_not_found: "Phrase not found",14901error_version_info: "PDF.js v{{version}} (build: {{build}})",14902error_message: "Message: {{message}}",14903error_stack: "Stack: {{stack}}",14904error_file: "File: {{file}}",14905error_line: "Line: {{line}}",14906rendering_error: "An error occurred while rendering the page.",14907page_scale_width: "Page Width",14908page_scale_fit: "Page Fit",14909page_scale_auto: "Automatic Zoom",14910page_scale_actual: "Actual Size",14911page_scale_percent: "{{scale}}%",14912loading: "Loading…",14913loading_error: "An error occurred while loading the PDF.",14914invalid_file_error: "Invalid or corrupted PDF file.",14915missing_file_error: "Missing PDF file.",14916unexpected_response_error: "Unexpected server response.",14917printing_not_supported: "Warning: Printing is not fully supported by this browser.",14918printing_not_ready: "Warning: The PDF is not fully loaded for printing.",14919web_fonts_disabled: "Web fonts are disabled: unable to use embedded PDF fonts."14920};1492114922function getL10nFallback(key, args) {14923switch (key) {14924case "find_match_count":14925key = "find_match_count[".concat(args.total === 1 ? "one" : "other", "]");14926break;1492714928case "find_match_count_limit":14929key = "find_match_count_limit[".concat(args.limit === 1 ? "one" : "other", "]");14930break;14931}1493214933return DEFAULT_L10N_STRINGS[key] || "";14934}1493514936function formatL10nValue(text, args) {14937if (!args) {14938return text;14939}1494014941return text.replace(/\{\{\s*(\w+)\s*\}\}/g, function (all, name) {14942return name in args ? args[name] : "{{" + name + "}}";14943});14944}1494514946var NullL10n = {14947getLanguage: function getLanguage() {14948return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee() {14949return _regenerator["default"].wrap(function _callee$(_context) {14950while (1) {14951switch (_context.prev = _context.next) {14952case 0:14953return _context.abrupt("return", "en-us");1495414955case 1:14956case "end":14957return _context.stop();14958}14959}14960}, _callee);14961}))();14962},14963getDirection: function getDirection() {14964return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {14965return _regenerator["default"].wrap(function _callee2$(_context2) {14966while (1) {14967switch (_context2.prev = _context2.next) {14968case 0:14969return _context2.abrupt("return", "ltr");1497014971case 1:14972case "end":14973return _context2.stop();14974}14975}14976}, _callee2);14977}))();14978},14979get: function get(key) {14980var _arguments = arguments;14981return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {14982var args, fallback;14983return _regenerator["default"].wrap(function _callee3$(_context3) {14984while (1) {14985switch (_context3.prev = _context3.next) {14986case 0:14987args = _arguments.length > 1 && _arguments[1] !== undefined ? _arguments[1] : null;14988fallback = _arguments.length > 2 && _arguments[2] !== undefined ? _arguments[2] : getL10nFallback(key, args);14989return _context3.abrupt("return", formatL10nValue(fallback, args));1499014991case 3:14992case "end":14993return _context3.stop();14994}14995}14996}, _callee3);14997}))();14998},14999translate: function translate(element) {15000return _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee4() {15001return _regenerator["default"].wrap(function _callee4$(_context4) {15002while (1) {15003switch (_context4.prev = _context4.next) {15004case 0:15005case "end":15006return _context4.stop();15007}15008}15009}, _callee4);15010}))();15011}15012};15013exports.NullL10n = NullL10n;1501415015/***/ }),15016/* 33 */15017/***/ ((__unused_webpack_module, exports, __webpack_require__) => {15018150191502015021Object.defineProperty(exports, "__esModule", ({15022value: true15023}));15024exports.PDFPageView = void 0;1502515026var _regenerator = _interopRequireDefault(__webpack_require__(4));1502715028var _ui_utils = __webpack_require__(6);1502915030var _pdfjsLib = __webpack_require__(7);1503115032var _l10n_utils = __webpack_require__(32);1503315034var _pdf_rendering_queue = __webpack_require__(10);1503515036var _viewer_compatibility = __webpack_require__(2);1503715038function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }1503915040function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }1504115042function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }1504315044function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1504515046function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1504715048function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1504915050var MAX_CANVAS_PIXELS = _viewer_compatibility.viewerCompatibilityParams.maxCanvasPixels || 16777216;1505115052var PDFPageView = /*#__PURE__*/function () {15053function PDFPageView(options) {15054_classCallCheck(this, PDFPageView);1505515056var container = options.container;15057var defaultViewport = options.defaultViewport;15058this.id = options.id;15059this.renderingId = "page" + this.id;15060this.pdfPage = null;15061this.pageLabel = null;15062this.rotation = 0;15063this.scale = options.scale || _ui_utils.DEFAULT_SCALE;15064this.viewport = defaultViewport;15065this.pdfPageRotate = defaultViewport.rotation;15066this._optionalContentConfigPromise = options.optionalContentConfigPromise || null;15067this.hasRestrictedScaling = false;15068this.textLayerMode = Number.isInteger(options.textLayerMode) ? options.textLayerMode : _ui_utils.TextLayerMode.ENABLE;15069this.imageResourcesPath = options.imageResourcesPath || "";15070this.renderInteractiveForms = options.renderInteractiveForms !== false;15071this.useOnlyCssZoom = options.useOnlyCssZoom || false;15072this.maxCanvasPixels = options.maxCanvasPixels || MAX_CANVAS_PIXELS;15073this.eventBus = options.eventBus;15074this.renderingQueue = options.renderingQueue;15075this.textLayerFactory = options.textLayerFactory;15076this.annotationLayerFactory = options.annotationLayerFactory;15077this.xfaLayerFactory = options.xfaLayerFactory;15078this.renderer = options.renderer || _ui_utils.RendererType.CANVAS;15079this.enableWebGL = options.enableWebGL || false;15080this.l10n = options.l10n || _l10n_utils.NullL10n;15081this.enableScripting = options.enableScripting === true;15082this.paintTask = null;15083this.paintedViewportMap = new WeakMap();15084this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;15085this.resume = null;15086this._renderError = null;15087this.annotationLayer = null;15088this.textLayer = null;15089this.zoomLayer = null;15090this.xfaLayer = null;15091var div = document.createElement("div");15092div.className = "page";15093div.style.width = Math.floor(this.viewport.width) + "px";15094div.style.height = Math.floor(this.viewport.height) + "px";15095div.setAttribute("data-page-number", this.id);15096div.setAttribute("role", "region");15097this.l10n.get("page_landmark", {15098page: this.id15099}).then(function (msg) {15100div.setAttribute("aria-label", msg);15101});15102this.div = div;15103container.appendChild(div);15104}1510515106_createClass(PDFPageView, [{15107key: "setPdfPage",15108value: function setPdfPage(pdfPage) {15109this.pdfPage = pdfPage;15110this.pdfPageRotate = pdfPage.rotate;15111var totalRotation = (this.rotation + this.pdfPageRotate) % 360;15112this.viewport = pdfPage.getViewport({15113scale: this.scale * _ui_utils.CSS_UNITS,15114rotation: totalRotation15115});15116this.reset();15117}15118}, {15119key: "destroy",15120value: function destroy() {15121this.reset();1512215123if (this.pdfPage) {15124this.pdfPage.cleanup();15125}15126}15127}, {15128key: "_renderAnnotationLayer",15129value: function () {15130var _renderAnnotationLayer2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee() {15131var error;15132return _regenerator["default"].wrap(function _callee$(_context) {15133while (1) {15134switch (_context.prev = _context.next) {15135case 0:15136error = null;15137_context.prev = 1;15138_context.next = 4;15139return this.annotationLayer.render(this.viewport, "display");1514015141case 4:15142_context.next = 9;15143break;1514415145case 6:15146_context.prev = 6;15147_context.t0 = _context["catch"](1);15148error = _context.t0;1514915150case 9:15151_context.prev = 9;15152this.eventBus.dispatch("annotationlayerrendered", {15153source: this,15154pageNumber: this.id,15155error: error15156});15157return _context.finish(9);1515815159case 12:15160case "end":15161return _context.stop();15162}15163}15164}, _callee, this, [[1, 6, 9, 12]]);15165}));1516615167function _renderAnnotationLayer() {15168return _renderAnnotationLayer2.apply(this, arguments);15169}1517015171return _renderAnnotationLayer;15172}()15173}, {15174key: "_renderXfaLayer",15175value: function () {15176var _renderXfaLayer2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {15177var error;15178return _regenerator["default"].wrap(function _callee2$(_context2) {15179while (1) {15180switch (_context2.prev = _context2.next) {15181case 0:15182error = null;15183_context2.prev = 1;15184_context2.next = 4;15185return this.xfaLayer.render(this.viewport, "display");1518615187case 4:15188_context2.next = 9;15189break;1519015191case 6:15192_context2.prev = 6;15193_context2.t0 = _context2["catch"](1);15194error = _context2.t0;1519515196case 9:15197_context2.prev = 9;15198this.eventBus.dispatch("xfalayerrendered", {15199source: this,15200pageNumber: this.id,15201error: error15202});15203return _context2.finish(9);1520415205case 12:15206case "end":15207return _context2.stop();15208}15209}15210}, _callee2, this, [[1, 6, 9, 12]]);15211}));1521215213function _renderXfaLayer() {15214return _renderXfaLayer2.apply(this, arguments);15215}1521615217return _renderXfaLayer;15218}()15219}, {15220key: "_resetZoomLayer",15221value: function _resetZoomLayer() {15222var removeFromDOM = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;1522315224if (!this.zoomLayer) {15225return;15226}1522715228var zoomLayerCanvas = this.zoomLayer.firstChild;15229this.paintedViewportMap["delete"](zoomLayerCanvas);15230zoomLayerCanvas.width = 0;15231zoomLayerCanvas.height = 0;1523215233if (removeFromDOM) {15234this.zoomLayer.remove();15235}1523615237this.zoomLayer = null;15238}15239}, {15240key: "reset",15241value: function reset() {15242var _this$annotationLayer,15243_this$xfaLayer,15244_this = this;1524515246var keepZoomLayer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;15247var keepAnnotations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;15248this.cancelRendering(keepAnnotations);15249this.renderingState = _pdf_rendering_queue.RenderingStates.INITIAL;15250var div = this.div;15251div.style.width = Math.floor(this.viewport.width) + "px";15252div.style.height = Math.floor(this.viewport.height) + "px";15253var childNodes = div.childNodes;15254var currentZoomLayerNode = keepZoomLayer && this.zoomLayer || null;15255var currentAnnotationNode = keepAnnotations && ((_this$annotationLayer = this.annotationLayer) === null || _this$annotationLayer === void 0 ? void 0 : _this$annotationLayer.div) || null;15256var currentXfaLayerNode = ((_this$xfaLayer = this.xfaLayer) === null || _this$xfaLayer === void 0 ? void 0 : _this$xfaLayer.div) || null;1525715258for (var i = childNodes.length - 1; i >= 0; i--) {15259var node = childNodes[i];1526015261if (currentZoomLayerNode === node || currentAnnotationNode === node || currentXfaLayerNode === node) {15262continue;15263}1526415265div.removeChild(node);15266}1526715268div.removeAttribute("data-loaded");1526915270if (currentAnnotationNode) {15271this.annotationLayer.hide();15272} else if (this.annotationLayer) {15273this.annotationLayer.cancel();15274this.annotationLayer = null;15275}1527615277if (!currentZoomLayerNode) {15278if (this.canvas) {15279this.paintedViewportMap["delete"](this.canvas);15280this.canvas.width = 0;15281this.canvas.height = 0;15282delete this.canvas;15283}1528415285this._resetZoomLayer();15286}1528715288if (this.svg) {15289this.paintedViewportMap["delete"](this.svg);15290delete this.svg;15291}1529215293this.loadingIconDiv = document.createElement("div");15294this.loadingIconDiv.className = "loadingIcon";15295this.loadingIconDiv.setAttribute("role", "img");15296this.l10n.get("loading").then(function (msg) {15297var _this$loadingIconDiv;1529815299(_this$loadingIconDiv = _this.loadingIconDiv) === null || _this$loadingIconDiv === void 0 ? void 0 : _this$loadingIconDiv.setAttribute("aria-label", msg);15300});15301div.appendChild(this.loadingIconDiv);15302}15303}, {15304key: "update",15305value: function update(scale, rotation) {15306var optionalContentConfigPromise = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;15307this.scale = scale || this.scale;1530815309if (typeof rotation !== "undefined") {15310this.rotation = rotation;15311}1531215313if (optionalContentConfigPromise instanceof Promise) {15314this._optionalContentConfigPromise = optionalContentConfigPromise;15315}1531615317var totalRotation = (this.rotation + this.pdfPageRotate) % 360;15318this.viewport = this.viewport.clone({15319scale: this.scale * _ui_utils.CSS_UNITS,15320rotation: totalRotation15321});1532215323if (this.svg) {15324this.cssTransform(this.svg, true);15325this.eventBus.dispatch("pagerendered", {15326source: this,15327pageNumber: this.id,15328cssTransform: true,15329timestamp: performance.now(),15330error: this._renderError15331});15332return;15333}1533415335var isScalingRestricted = false;1533615337if (this.canvas && this.maxCanvasPixels > 0) {15338var outputScale = this.outputScale;1533915340if ((Math.floor(this.viewport.width) * outputScale.sx | 0) * (Math.floor(this.viewport.height) * outputScale.sy | 0) > this.maxCanvasPixels) {15341isScalingRestricted = true;15342}15343}1534415345if (this.canvas) {15346if (this.useOnlyCssZoom || this.hasRestrictedScaling && isScalingRestricted) {15347this.cssTransform(this.canvas, true);15348this.eventBus.dispatch("pagerendered", {15349source: this,15350pageNumber: this.id,15351cssTransform: true,15352timestamp: performance.now(),15353error: this._renderError15354});15355return;15356}1535715358if (!this.zoomLayer && !this.canvas.hidden) {15359this.zoomLayer = this.canvas.parentNode;15360this.zoomLayer.style.position = "absolute";15361}15362}1536315364if (this.zoomLayer) {15365this.cssTransform(this.zoomLayer.firstChild);15366}1536715368this.reset(true, true);15369}15370}, {15371key: "cancelRendering",15372value: function cancelRendering() {15373var keepAnnotations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;1537415375if (this.paintTask) {15376this.paintTask.cancel();15377this.paintTask = null;15378}1537915380this.resume = null;1538115382if (this.textLayer) {15383this.textLayer.cancel();15384this.textLayer = null;15385}1538615387if (!keepAnnotations && this.annotationLayer) {15388this.annotationLayer.cancel();15389this.annotationLayer = null;15390}15391}15392}, {15393key: "cssTransform",15394value: function cssTransform(target) {15395var redrawAnnotations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;15396var width = this.viewport.width;15397var height = this.viewport.height;15398var div = this.div;15399target.style.width = target.parentNode.style.width = div.style.width = Math.floor(width) + "px";15400target.style.height = target.parentNode.style.height = div.style.height = Math.floor(height) + "px";15401var relativeRotation = this.viewport.rotation - this.paintedViewportMap.get(target).rotation;15402var absRotation = Math.abs(relativeRotation);15403var scaleX = 1,15404scaleY = 1;1540515406if (absRotation === 90 || absRotation === 270) {15407scaleX = height / width;15408scaleY = width / height;15409}1541015411target.style.transform = "rotate(".concat(relativeRotation, "deg) scale(").concat(scaleX, ", ").concat(scaleY, ")");1541215413if (this.textLayer) {15414var textLayerViewport = this.textLayer.viewport;15415var textRelativeRotation = this.viewport.rotation - textLayerViewport.rotation;15416var textAbsRotation = Math.abs(textRelativeRotation);15417var scale = width / textLayerViewport.width;1541815419if (textAbsRotation === 90 || textAbsRotation === 270) {15420scale = width / textLayerViewport.height;15421}1542215423var textLayerDiv = this.textLayer.textLayerDiv;15424var transX, transY;1542515426switch (textAbsRotation) {15427case 0:15428transX = transY = 0;15429break;1543015431case 90:15432transX = 0;15433transY = "-" + textLayerDiv.style.height;15434break;1543515436case 180:15437transX = "-" + textLayerDiv.style.width;15438transY = "-" + textLayerDiv.style.height;15439break;1544015441case 270:15442transX = "-" + textLayerDiv.style.width;15443transY = 0;15444break;1544515446default:15447console.error("Bad rotation value.");15448break;15449}1545015451textLayerDiv.style.transform = "rotate(".concat(textAbsRotation, "deg) ") + "scale(".concat(scale, ") ") + "translate(".concat(transX, ", ").concat(transY, ")");15452textLayerDiv.style.transformOrigin = "0% 0%";15453}1545415455if (redrawAnnotations && this.annotationLayer) {15456this._renderAnnotationLayer();15457}1545815459if (this.xfaLayer) {15460this._renderXfaLayer();15461}15462}15463}, {15464key: "width",15465get: function get() {15466return this.viewport.width;15467}15468}, {15469key: "height",15470get: function get() {15471return this.viewport.height;15472}15473}, {15474key: "getPagePoint",15475value: function getPagePoint(x, y) {15476return this.viewport.convertToPdfPoint(x, y);15477}15478}, {15479key: "draw",15480value: function draw() {15481var _this$annotationLayer2,15482_this2 = this;1548315484if (this.renderingState !== _pdf_rendering_queue.RenderingStates.INITIAL) {15485console.error("Must be in new state before drawing");15486this.reset();15487}1548815489var div = this.div,15490pdfPage = this.pdfPage;1549115492if (!pdfPage) {15493this.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;1549415495if (this.loadingIconDiv) {15496div.removeChild(this.loadingIconDiv);15497delete this.loadingIconDiv;15498}1549915500return Promise.reject(new Error("pdfPage is not loaded"));15501}1550215503this.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;15504var canvasWrapper = document.createElement("div");15505canvasWrapper.style.width = div.style.width;15506canvasWrapper.style.height = div.style.height;15507canvasWrapper.classList.add("canvasWrapper");1550815509if ((_this$annotationLayer2 = this.annotationLayer) !== null && _this$annotationLayer2 !== void 0 && _this$annotationLayer2.div) {15510div.insertBefore(canvasWrapper, this.annotationLayer.div);15511} else {15512div.appendChild(canvasWrapper);15513}1551415515var textLayer = null;1551615517if (this.textLayerMode !== _ui_utils.TextLayerMode.DISABLE && this.textLayerFactory) {15518var _this$annotationLayer3;1551915520var textLayerDiv = document.createElement("div");15521textLayerDiv.className = "textLayer";15522textLayerDiv.style.width = canvasWrapper.style.width;15523textLayerDiv.style.height = canvasWrapper.style.height;1552415525if ((_this$annotationLayer3 = this.annotationLayer) !== null && _this$annotationLayer3 !== void 0 && _this$annotationLayer3.div) {15526div.insertBefore(textLayerDiv, this.annotationLayer.div);15527} else {15528div.appendChild(textLayerDiv);15529}1553015531textLayer = this.textLayerFactory.createTextLayerBuilder(textLayerDiv, this.id - 1, this.viewport, this.textLayerMode === _ui_utils.TextLayerMode.ENABLE_ENHANCE, this.eventBus);15532}1553315534this.textLayer = textLayer;15535var renderContinueCallback = null;1553615537if (this.renderingQueue) {15538renderContinueCallback = function renderContinueCallback(cont) {15539if (!_this2.renderingQueue.isHighestPriority(_this2)) {15540_this2.renderingState = _pdf_rendering_queue.RenderingStates.PAUSED;1554115542_this2.resume = function () {15543_this2.renderingState = _pdf_rendering_queue.RenderingStates.RUNNING;15544cont();15545};1554615547return;15548}1554915550cont();15551};15552}1555315554var finishPaintTask = /*#__PURE__*/function () {15555var _ref = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {15556var error,15557_args3 = arguments;15558return _regenerator["default"].wrap(function _callee3$(_context3) {15559while (1) {15560switch (_context3.prev = _context3.next) {15561case 0:15562error = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : null;1556315564if (paintTask === _this2.paintTask) {15565_this2.paintTask = null;15566}1556715568if (!(error instanceof _pdfjsLib.RenderingCancelledException)) {15569_context3.next = 5;15570break;15571}1557215573_this2._renderError = null;15574return _context3.abrupt("return");1557515576case 5:15577_this2._renderError = error;15578_this2.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;1557915580if (_this2.loadingIconDiv) {15581div.removeChild(_this2.loadingIconDiv);15582delete _this2.loadingIconDiv;15583}1558415585_this2._resetZoomLayer(true);1558615587_this2.eventBus.dispatch("pagerendered", {15588source: _this2,15589pageNumber: _this2.id,15590cssTransform: false,15591timestamp: performance.now(),15592error: _this2._renderError15593});1559415595if (!error) {15596_context3.next = 12;15597break;15598}1559915600throw error;1560115602case 12:15603case "end":15604return _context3.stop();15605}15606}15607}, _callee3);15608}));1560915610return function finishPaintTask() {15611return _ref.apply(this, arguments);15612};15613}();1561415615var paintTask = this.renderer === _ui_utils.RendererType.SVG ? this.paintOnSvg(canvasWrapper) : this.paintOnCanvas(canvasWrapper);15616paintTask.onRenderContinue = renderContinueCallback;15617this.paintTask = paintTask;15618var resultPromise = paintTask.promise.then(function () {15619return finishPaintTask(null).then(function () {15620if (textLayer) {15621var readableStream = pdfPage.streamTextContent({15622normalizeWhitespace: true15623});15624textLayer.setTextContentStream(readableStream);15625textLayer.render();15626}15627});15628}, function (reason) {15629return finishPaintTask(reason);15630});1563115632if (this.annotationLayerFactory) {15633if (!this.annotationLayer) {15634this.annotationLayer = this.annotationLayerFactory.createAnnotationLayerBuilder(div, pdfPage, null, this.imageResourcesPath, this.renderInteractiveForms, this.l10n, this.enableScripting, null, null);15635}1563615637this._renderAnnotationLayer();15638}1563915640if (this.xfaLayerFactory) {15641if (!this.xfaLayer) {15642this.xfaLayer = this.xfaLayerFactory.createXfaLayerBuilder(div, pdfPage);15643}1564415645this._renderXfaLayer();15646}1564715648div.setAttribute("data-loaded", true);15649this.eventBus.dispatch("pagerender", {15650source: this,15651pageNumber: this.id15652});15653return resultPromise;15654}15655}, {15656key: "paintOnCanvas",15657value: function paintOnCanvas(canvasWrapper) {15658var renderCapability = (0, _pdfjsLib.createPromiseCapability)();15659var result = {15660promise: renderCapability.promise,15661onRenderContinue: function onRenderContinue(cont) {15662cont();15663},15664cancel: function cancel() {15665renderTask.cancel();15666}15667};15668var viewport = this.viewport;15669var canvas = document.createElement("canvas");15670canvas.hidden = true;15671var isCanvasHidden = true;1567215673var showCanvas = function showCanvas() {15674if (isCanvasHidden) {15675canvas.hidden = false;15676isCanvasHidden = false;15677}15678};1567915680canvasWrapper.appendChild(canvas);15681this.canvas = canvas;15682canvas.mozOpaque = true;15683var ctx = canvas.getContext("2d", {15684alpha: false15685});15686var outputScale = (0, _ui_utils.getOutputScale)(ctx);15687this.outputScale = outputScale;1568815689if (this.useOnlyCssZoom) {15690var actualSizeViewport = viewport.clone({15691scale: _ui_utils.CSS_UNITS15692});15693outputScale.sx *= actualSizeViewport.width / viewport.width;15694outputScale.sy *= actualSizeViewport.height / viewport.height;15695outputScale.scaled = true;15696}1569715698if (this.maxCanvasPixels > 0) {15699var pixelsInViewport = viewport.width * viewport.height;15700var maxScale = Math.sqrt(this.maxCanvasPixels / pixelsInViewport);1570115702if (outputScale.sx > maxScale || outputScale.sy > maxScale) {15703outputScale.sx = maxScale;15704outputScale.sy = maxScale;15705outputScale.scaled = true;15706this.hasRestrictedScaling = true;15707} else {15708this.hasRestrictedScaling = false;15709}15710}1571115712var sfx = (0, _ui_utils.approximateFraction)(outputScale.sx);15713var sfy = (0, _ui_utils.approximateFraction)(outputScale.sy);15714canvas.width = (0, _ui_utils.roundToDivide)(viewport.width * outputScale.sx, sfx[0]);15715canvas.height = (0, _ui_utils.roundToDivide)(viewport.height * outputScale.sy, sfy[0]);15716canvas.style.width = (0, _ui_utils.roundToDivide)(viewport.width, sfx[1]) + "px";15717canvas.style.height = (0, _ui_utils.roundToDivide)(viewport.height, sfy[1]) + "px";15718this.paintedViewportMap.set(canvas, viewport);15719var transform = !outputScale.scaled ? null : [outputScale.sx, 0, 0, outputScale.sy, 0, 0];15720var renderContext = {15721canvasContext: ctx,15722transform: transform,15723viewport: this.viewport,15724enableWebGL: this.enableWebGL,15725renderInteractiveForms: this.renderInteractiveForms,15726optionalContentConfigPromise: this._optionalContentConfigPromise15727};15728var renderTask = this.pdfPage.render(renderContext);1572915730renderTask.onContinue = function (cont) {15731showCanvas();1573215733if (result.onRenderContinue) {15734result.onRenderContinue(cont);15735} else {15736cont();15737}15738};1573915740renderTask.promise.then(function () {15741showCanvas();15742renderCapability.resolve(undefined);15743}, function (error) {15744showCanvas();15745renderCapability.reject(error);15746});15747return result;15748}15749}, {15750key: "paintOnSvg",15751value: function paintOnSvg(wrapper) {15752var _this3 = this;1575315754var cancelled = false;1575515756var ensureNotCancelled = function ensureNotCancelled() {15757if (cancelled) {15758throw new _pdfjsLib.RenderingCancelledException("Rendering cancelled, page ".concat(_this3.id), "svg");15759}15760};1576115762var pdfPage = this.pdfPage;15763var actualSizeViewport = this.viewport.clone({15764scale: _ui_utils.CSS_UNITS15765});15766var promise = pdfPage.getOperatorList().then(function (opList) {15767ensureNotCancelled();15768var svgGfx = new _pdfjsLib.SVGGraphics(pdfPage.commonObjs, pdfPage.objs, _viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL);15769return svgGfx.getSVG(opList, actualSizeViewport).then(function (svg) {15770ensureNotCancelled();15771_this3.svg = svg;1577215773_this3.paintedViewportMap.set(svg, actualSizeViewport);1577415775svg.style.width = wrapper.style.width;15776svg.style.height = wrapper.style.height;15777_this3.renderingState = _pdf_rendering_queue.RenderingStates.FINISHED;15778wrapper.appendChild(svg);15779});15780});15781return {15782promise: promise,15783onRenderContinue: function onRenderContinue(cont) {15784cont();15785},15786cancel: function cancel() {15787cancelled = true;15788}15789};15790}15791}, {15792key: "setPageLabel",15793value: function setPageLabel(label) {15794this.pageLabel = typeof label === "string" ? label : null;1579515796if (this.pageLabel !== null) {15797this.div.setAttribute("data-page-label", this.pageLabel);15798} else {15799this.div.removeAttribute("data-page-label");15800}15801}15802}]);1580315804return PDFPageView;15805}();1580615807exports.PDFPageView = PDFPageView;1580815809/***/ }),15810/* 34 */15811/***/ ((__unused_webpack_module, exports, __webpack_require__) => {15812158131581415815Object.defineProperty(exports, "__esModule", ({15816value: true15817}));15818exports.TextLayerBuilder = exports.DefaultTextLayerFactory = void 0;1581915820var _pdfjsLib = __webpack_require__(7);1582115822function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1582315824function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1582515826function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1582715828var EXPAND_DIVS_TIMEOUT = 300;1582915830var TextLayerBuilder = /*#__PURE__*/function () {15831function TextLayerBuilder(_ref) {15832var textLayerDiv = _ref.textLayerDiv,15833eventBus = _ref.eventBus,15834pageIndex = _ref.pageIndex,15835viewport = _ref.viewport,15836_ref$findController = _ref.findController,15837findController = _ref$findController === void 0 ? null : _ref$findController,15838_ref$enhanceTextSelec = _ref.enhanceTextSelection,15839enhanceTextSelection = _ref$enhanceTextSelec === void 0 ? false : _ref$enhanceTextSelec;1584015841_classCallCheck(this, TextLayerBuilder);1584215843this.textLayerDiv = textLayerDiv;15844this.eventBus = eventBus;15845this.textContent = null;15846this.textContentItemsStr = [];15847this.textContentStream = null;15848this.renderingDone = false;15849this.pageIdx = pageIndex;15850this.pageNumber = this.pageIdx + 1;15851this.matches = [];15852this.viewport = viewport;15853this.textDivs = [];15854this.findController = findController;15855this.textLayerRenderTask = null;15856this.enhanceTextSelection = enhanceTextSelection;15857this._onUpdateTextLayerMatches = null;1585815859this._bindMouse();15860}1586115862_createClass(TextLayerBuilder, [{15863key: "_finishRendering",15864value: function _finishRendering() {15865this.renderingDone = true;1586615867if (!this.enhanceTextSelection) {15868var endOfContent = document.createElement("div");15869endOfContent.className = "endOfContent";15870this.textLayerDiv.appendChild(endOfContent);15871}1587215873this.eventBus.dispatch("textlayerrendered", {15874source: this,15875pageNumber: this.pageNumber,15876numTextDivs: this.textDivs.length15877});15878}15879}, {15880key: "render",15881value: function render() {15882var _this = this;1588315884var timeout = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;1588515886if (!(this.textContent || this.textContentStream) || this.renderingDone) {15887return;15888}1588915890this.cancel();15891this.textDivs = [];15892var textLayerFrag = document.createDocumentFragment();15893this.textLayerRenderTask = (0, _pdfjsLib.renderTextLayer)({15894textContent: this.textContent,15895textContentStream: this.textContentStream,15896container: textLayerFrag,15897viewport: this.viewport,15898textDivs: this.textDivs,15899textContentItemsStr: this.textContentItemsStr,15900timeout: timeout,15901enhanceTextSelection: this.enhanceTextSelection15902});15903this.textLayerRenderTask.promise.then(function () {15904_this.textLayerDiv.appendChild(textLayerFrag);1590515906_this._finishRendering();1590715908_this._updateMatches();15909}, function (reason) {});1591015911if (!this._onUpdateTextLayerMatches) {15912this._onUpdateTextLayerMatches = function (evt) {15913if (evt.pageIndex === _this.pageIdx || evt.pageIndex === -1) {15914_this._updateMatches();15915}15916};1591715918this.eventBus._on("updatetextlayermatches", this._onUpdateTextLayerMatches);15919}15920}15921}, {15922key: "cancel",15923value: function cancel() {15924if (this.textLayerRenderTask) {15925this.textLayerRenderTask.cancel();15926this.textLayerRenderTask = null;15927}1592815929if (this._onUpdateTextLayerMatches) {15930this.eventBus._off("updatetextlayermatches", this._onUpdateTextLayerMatches);1593115932this._onUpdateTextLayerMatches = null;15933}15934}15935}, {15936key: "setTextContentStream",15937value: function setTextContentStream(readableStream) {15938this.cancel();15939this.textContentStream = readableStream;15940}15941}, {15942key: "setTextContent",15943value: function setTextContent(textContent) {15944this.cancel();15945this.textContent = textContent;15946}15947}, {15948key: "_convertMatches",15949value: function _convertMatches(matches, matchesLength) {15950if (!matches) {15951return [];15952}1595315954var textContentItemsStr = this.textContentItemsStr;15955var i = 0,15956iIndex = 0;15957var end = textContentItemsStr.length - 1;15958var result = [];1595915960for (var m = 0, mm = matches.length; m < mm; m++) {15961var matchIdx = matches[m];1596215963while (i !== end && matchIdx >= iIndex + textContentItemsStr[i].length) {15964iIndex += textContentItemsStr[i].length;15965i++;15966}1596715968if (i === textContentItemsStr.length) {15969console.error("Could not find a matching mapping");15970}1597115972var match = {15973begin: {15974divIdx: i,15975offset: matchIdx - iIndex15976}15977};15978matchIdx += matchesLength[m];1597915980while (i !== end && matchIdx > iIndex + textContentItemsStr[i].length) {15981iIndex += textContentItemsStr[i].length;15982i++;15983}1598415985match.end = {15986divIdx: i,15987offset: matchIdx - iIndex15988};15989result.push(match);15990}1599115992return result;15993}15994}, {15995key: "_renderMatches",15996value: function _renderMatches(matches) {15997if (matches.length === 0) {15998return;15999}1600016001var findController = this.findController,16002pageIdx = this.pageIdx,16003textContentItemsStr = this.textContentItemsStr,16004textDivs = this.textDivs;16005var isSelectedPage = pageIdx === findController.selected.pageIdx;16006var selectedMatchIdx = findController.selected.matchIdx;16007var highlightAll = findController.state.highlightAll;16008var prevEnd = null;16009var infinity = {16010divIdx: -1,16011offset: undefined16012};1601316014function beginText(begin, className) {16015var divIdx = begin.divIdx;16016textDivs[divIdx].textContent = "";16017appendTextToDiv(divIdx, 0, begin.offset, className);16018}1601916020function appendTextToDiv(divIdx, fromOffset, toOffset, className) {16021var div = textDivs[divIdx];16022var content = textContentItemsStr[divIdx].substring(fromOffset, toOffset);16023var node = document.createTextNode(content);1602416025if (className) {16026var span = document.createElement("span");16027span.className = className;16028span.appendChild(node);16029div.appendChild(span);16030return;16031}1603216033div.appendChild(node);16034}1603516036var i0 = selectedMatchIdx,16037i1 = i0 + 1;1603816039if (highlightAll) {16040i0 = 0;16041i1 = matches.length;16042} else if (!isSelectedPage) {16043return;16044}1604516046for (var i = i0; i < i1; i++) {16047var match = matches[i];16048var begin = match.begin;16049var end = match.end;16050var isSelected = isSelectedPage && i === selectedMatchIdx;16051var highlightSuffix = isSelected ? " selected" : "";1605216053if (isSelected) {16054findController.scrollMatchIntoView({16055element: textDivs[begin.divIdx],16056pageIndex: pageIdx,16057matchIndex: selectedMatchIdx16058});16059}1606016061if (!prevEnd || begin.divIdx !== prevEnd.divIdx) {16062if (prevEnd !== null) {16063appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);16064}1606516066beginText(begin);16067} else {16068appendTextToDiv(prevEnd.divIdx, prevEnd.offset, begin.offset);16069}1607016071if (begin.divIdx === end.divIdx) {16072appendTextToDiv(begin.divIdx, begin.offset, end.offset, "highlight" + highlightSuffix);16073} else {16074appendTextToDiv(begin.divIdx, begin.offset, infinity.offset, "highlight begin" + highlightSuffix);1607516076for (var n0 = begin.divIdx + 1, n1 = end.divIdx; n0 < n1; n0++) {16077textDivs[n0].className = "highlight middle" + highlightSuffix;16078}1607916080beginText(end, "highlight end" + highlightSuffix);16081}1608216083prevEnd = end;16084}1608516086if (prevEnd) {16087appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);16088}16089}16090}, {16091key: "_updateMatches",16092value: function _updateMatches() {16093if (!this.renderingDone) {16094return;16095}1609616097var findController = this.findController,16098matches = this.matches,16099pageIdx = this.pageIdx,16100textContentItemsStr = this.textContentItemsStr,16101textDivs = this.textDivs;16102var clearedUntilDivIdx = -1;1610316104for (var i = 0, ii = matches.length; i < ii; i++) {16105var match = matches[i];16106var begin = Math.max(clearedUntilDivIdx, match.begin.divIdx);1610716108for (var n = begin, end = match.end.divIdx; n <= end; n++) {16109var div = textDivs[n];16110div.textContent = textContentItemsStr[n];16111div.className = "";16112}1611316114clearedUntilDivIdx = match.end.divIdx + 1;16115}1611616117if (!(findController !== null && findController !== void 0 && findController.highlightMatches)) {16118return;16119}1612016121var pageMatches = findController.pageMatches[pageIdx] || null;16122var pageMatchesLength = findController.pageMatchesLength[pageIdx] || null;16123this.matches = this._convertMatches(pageMatches, pageMatchesLength);1612416125this._renderMatches(this.matches);16126}16127}, {16128key: "_bindMouse",16129value: function _bindMouse() {16130var _this2 = this;1613116132var div = this.textLayerDiv;16133var expandDivsTimer = null;16134div.addEventListener("mousedown", function (evt) {16135if (_this2.enhanceTextSelection && _this2.textLayerRenderTask) {16136_this2.textLayerRenderTask.expandTextDivs(true);1613716138if (expandDivsTimer) {16139clearTimeout(expandDivsTimer);16140expandDivsTimer = null;16141}1614216143return;16144}1614516146var end = div.querySelector(".endOfContent");1614716148if (!end) {16149return;16150}1615116152var adjustTop = evt.target !== div;16153adjustTop = adjustTop && window.getComputedStyle(end).getPropertyValue("-moz-user-select") !== "none";1615416155if (adjustTop) {16156var divBounds = div.getBoundingClientRect();16157var r = Math.max(0, (evt.pageY - divBounds.top) / divBounds.height);16158end.style.top = (r * 100).toFixed(2) + "%";16159}1616016161end.classList.add("active");16162});16163div.addEventListener("mouseup", function () {16164if (_this2.enhanceTextSelection && _this2.textLayerRenderTask) {16165expandDivsTimer = setTimeout(function () {16166if (_this2.textLayerRenderTask) {16167_this2.textLayerRenderTask.expandTextDivs(false);16168}1616916170expandDivsTimer = null;16171}, EXPAND_DIVS_TIMEOUT);16172return;16173}1617416175var end = div.querySelector(".endOfContent");1617616177if (!end) {16178return;16179}1618016181end.style.top = "";16182end.classList.remove("active");16183});16184}16185}]);1618616187return TextLayerBuilder;16188}();1618916190exports.TextLayerBuilder = TextLayerBuilder;1619116192var DefaultTextLayerFactory = /*#__PURE__*/function () {16193function DefaultTextLayerFactory() {16194_classCallCheck(this, DefaultTextLayerFactory);16195}1619616197_createClass(DefaultTextLayerFactory, [{16198key: "createTextLayerBuilder",16199value: function createTextLayerBuilder(textLayerDiv, pageIndex, viewport) {16200var enhanceTextSelection = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;16201var eventBus = arguments.length > 4 ? arguments[4] : undefined;16202return new TextLayerBuilder({16203textLayerDiv: textLayerDiv,16204pageIndex: pageIndex,16205viewport: viewport,16206enhanceTextSelection: enhanceTextSelection,16207eventBus: eventBus16208});16209}16210}]);1621116212return DefaultTextLayerFactory;16213}();1621416215exports.DefaultTextLayerFactory = DefaultTextLayerFactory;1621616217/***/ }),16218/* 35 */16219/***/ ((__unused_webpack_module, exports, __webpack_require__) => {16220162211622216223Object.defineProperty(exports, "__esModule", ({16224value: true16225}));16226exports.XfaLayerBuilder = exports.DefaultXfaLayerFactory = void 0;1622716228var _pdfjsLib = __webpack_require__(7);1622916230function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1623116232function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1623316234function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1623516236var XfaLayerBuilder = /*#__PURE__*/function () {16237function XfaLayerBuilder(_ref) {16238var pageDiv = _ref.pageDiv,16239pdfPage = _ref.pdfPage;1624016241_classCallCheck(this, XfaLayerBuilder);1624216243this.pageDiv = pageDiv;16244this.pdfPage = pdfPage;16245this.div = null;16246this._cancelled = false;16247}1624816249_createClass(XfaLayerBuilder, [{16250key: "render",16251value: function render(viewport) {16252var _this = this;1625316254var intent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "display";16255return this.pdfPage.getXfa().then(function (xfa) {16256if (_this._cancelled) {16257return;16258}1625916260var parameters = {16261viewport: viewport.clone({16262dontFlip: true16263}),16264div: _this.div,16265xfa: xfa,16266page: _this.pdfPage16267};1626816269if (_this.div) {16270_pdfjsLib.XfaLayer.update(parameters);16271} else {16272_this.div = document.createElement("div");1627316274_this.pageDiv.appendChild(_this.div);1627516276parameters.div = _this.div;1627716278_pdfjsLib.XfaLayer.render(parameters);16279}16280});16281}16282}, {16283key: "cancel",16284value: function cancel() {16285this._cancelled = true;16286}16287}, {16288key: "hide",16289value: function hide() {16290if (!this.div) {16291return;16292}1629316294this.div.hidden = true;16295}16296}]);1629716298return XfaLayerBuilder;16299}();1630016301exports.XfaLayerBuilder = XfaLayerBuilder;1630216303var DefaultXfaLayerFactory = /*#__PURE__*/function () {16304function DefaultXfaLayerFactory() {16305_classCallCheck(this, DefaultXfaLayerFactory);16306}1630716308_createClass(DefaultXfaLayerFactory, [{16309key: "createXfaLayerBuilder",16310value: function createXfaLayerBuilder(pageDiv, pdfPage) {16311return new XfaLayerBuilder({16312pageDiv: pageDiv,16313pdfPage: pdfPage16314});16315}16316}]);1631716318return DefaultXfaLayerFactory;16319}();1632016321exports.DefaultXfaLayerFactory = DefaultXfaLayerFactory;1632216323/***/ }),16324/* 36 */16325/***/ ((__unused_webpack_module, exports, __webpack_require__) => {16326163271632816329Object.defineProperty(exports, "__esModule", ({16330value: true16331}));16332exports.SecondaryToolbar = void 0;1633316334var _ui_utils = __webpack_require__(6);1633516336var _pdf_cursor_tools = __webpack_require__(8);1633716338var _pdf_single_page_viewer = __webpack_require__(37);1633916340function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }1634116342function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }1634316344function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }1634516346function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1634716348function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1634916350function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1635116352var SecondaryToolbar = /*#__PURE__*/function () {16353function SecondaryToolbar(options, mainContainer, eventBus) {16354var _this = this;1635516356_classCallCheck(this, SecondaryToolbar);1635716358this.toolbar = options.toolbar;16359this.toggleButton = options.toggleButton;16360this.toolbarButtonContainer = options.toolbarButtonContainer;16361this.buttons = [{16362element: options.presentationModeButton,16363eventName: "presentationmode",16364close: true16365}, {16366element: options.openFileButton,16367eventName: "openfile",16368close: true16369}, {16370element: options.printButton,16371eventName: "print",16372close: true16373}, {16374element: options.downloadButton,16375eventName: "download",16376close: true16377}, {16378element: options.viewBookmarkButton,16379eventName: null,16380close: true16381}, {16382element: options.firstPageButton,16383eventName: "firstpage",16384close: true16385}, {16386element: options.lastPageButton,16387eventName: "lastpage",16388close: true16389}, {16390element: options.pageRotateCwButton,16391eventName: "rotatecw",16392close: false16393}, {16394element: options.pageRotateCcwButton,16395eventName: "rotateccw",16396close: false16397}, {16398element: options.cursorSelectToolButton,16399eventName: "switchcursortool",16400eventDetails: {16401tool: _pdf_cursor_tools.CursorTool.SELECT16402},16403close: true16404}, {16405element: options.cursorHandToolButton,16406eventName: "switchcursortool",16407eventDetails: {16408tool: _pdf_cursor_tools.CursorTool.HAND16409},16410close: true16411}, {16412element: options.scrollVerticalButton,16413eventName: "switchscrollmode",16414eventDetails: {16415mode: _ui_utils.ScrollMode.VERTICAL16416},16417close: true16418}, {16419element: options.scrollHorizontalButton,16420eventName: "switchscrollmode",16421eventDetails: {16422mode: _ui_utils.ScrollMode.HORIZONTAL16423},16424close: true16425}, {16426element: options.scrollWrappedButton,16427eventName: "switchscrollmode",16428eventDetails: {16429mode: _ui_utils.ScrollMode.WRAPPED16430},16431close: true16432}, {16433element: options.spreadNoneButton,16434eventName: "switchspreadmode",16435eventDetails: {16436mode: _ui_utils.SpreadMode.NONE16437},16438close: true16439}, {16440element: options.spreadOddButton,16441eventName: "switchspreadmode",16442eventDetails: {16443mode: _ui_utils.SpreadMode.ODD16444},16445close: true16446}, {16447element: options.spreadEvenButton,16448eventName: "switchspreadmode",16449eventDetails: {16450mode: _ui_utils.SpreadMode.EVEN16451},16452close: true16453}, {16454element: options.documentPropertiesButton,16455eventName: "documentproperties",16456close: true16457}];16458this.items = {16459firstPage: options.firstPageButton,16460lastPage: options.lastPageButton,16461pageRotateCw: options.pageRotateCwButton,16462pageRotateCcw: options.pageRotateCcwButton16463};16464this.mainContainer = mainContainer;16465this.eventBus = eventBus;16466this.opened = false;16467this.containerHeight = null;16468this.previousContainerHeight = null;16469this.reset();1647016471this._bindClickListeners();1647216473this._bindCursorToolsListener(options);1647416475this._bindScrollModeListener(options);1647616477this._bindSpreadModeListener(options);1647816479this.eventBus._on("resize", this._setMaxHeight.bind(this));1648016481this.eventBus._on("baseviewerinit", function (evt) {16482if (evt.source instanceof _pdf_single_page_viewer.PDFSinglePageViewer) {16483_this.toolbarButtonContainer.classList.add("hiddenScrollModeButtons", "hiddenSpreadModeButtons");16484} else {16485_this.toolbarButtonContainer.classList.remove("hiddenScrollModeButtons", "hiddenSpreadModeButtons");16486}16487});16488}1648916490_createClass(SecondaryToolbar, [{16491key: "isOpen",16492get: function get() {16493return this.opened;16494}16495}, {16496key: "setPageNumber",16497value: function setPageNumber(pageNumber) {16498this.pageNumber = pageNumber;1649916500this._updateUIState();16501}16502}, {16503key: "setPagesCount",16504value: function setPagesCount(pagesCount) {16505this.pagesCount = pagesCount;1650616507this._updateUIState();16508}16509}, {16510key: "reset",16511value: function reset() {16512this.pageNumber = 0;16513this.pagesCount = 0;1651416515this._updateUIState();1651616517this.eventBus.dispatch("secondarytoolbarreset", {16518source: this16519});16520}16521}, {16522key: "_updateUIState",16523value: function _updateUIState() {16524this.items.firstPage.disabled = this.pageNumber <= 1;16525this.items.lastPage.disabled = this.pageNumber >= this.pagesCount;16526this.items.pageRotateCw.disabled = this.pagesCount === 0;16527this.items.pageRotateCcw.disabled = this.pagesCount === 0;16528}16529}, {16530key: "_bindClickListeners",16531value: function _bindClickListeners() {16532var _this2 = this;1653316534this.toggleButton.addEventListener("click", this.toggle.bind(this));1653516536var _iterator = _createForOfIteratorHelper(this.buttons),16537_step;1653816539try {16540var _loop = function _loop() {16541var _step$value = _step.value,16542element = _step$value.element,16543eventName = _step$value.eventName,16544close = _step$value.close,16545eventDetails = _step$value.eventDetails;16546element.addEventListener("click", function (evt) {16547if (eventName !== null) {16548var details = {16549source: _this216550};1655116552for (var property in eventDetails) {16553details[property] = eventDetails[property];16554}1655516556_this2.eventBus.dispatch(eventName, details);16557}1655816559if (close) {16560_this2.close();16561}16562});16563};1656416565for (_iterator.s(); !(_step = _iterator.n()).done;) {16566_loop();16567}16568} catch (err) {16569_iterator.e(err);16570} finally {16571_iterator.f();16572}16573}16574}, {16575key: "_bindCursorToolsListener",16576value: function _bindCursorToolsListener(buttons) {16577this.eventBus._on("cursortoolchanged", function (_ref) {16578var tool = _ref.tool;16579buttons.cursorSelectToolButton.classList.toggle("toggled", tool === _pdf_cursor_tools.CursorTool.SELECT);16580buttons.cursorHandToolButton.classList.toggle("toggled", tool === _pdf_cursor_tools.CursorTool.HAND);16581});16582}16583}, {16584key: "_bindScrollModeListener",16585value: function _bindScrollModeListener(buttons) {16586var _this3 = this;1658716588function scrollModeChanged(_ref2) {16589var mode = _ref2.mode;16590buttons.scrollVerticalButton.classList.toggle("toggled", mode === _ui_utils.ScrollMode.VERTICAL);16591buttons.scrollHorizontalButton.classList.toggle("toggled", mode === _ui_utils.ScrollMode.HORIZONTAL);16592buttons.scrollWrappedButton.classList.toggle("toggled", mode === _ui_utils.ScrollMode.WRAPPED);16593var isScrollModeHorizontal = mode === _ui_utils.ScrollMode.HORIZONTAL;16594buttons.spreadNoneButton.disabled = isScrollModeHorizontal;16595buttons.spreadOddButton.disabled = isScrollModeHorizontal;16596buttons.spreadEvenButton.disabled = isScrollModeHorizontal;16597}1659816599this.eventBus._on("scrollmodechanged", scrollModeChanged);1660016601this.eventBus._on("secondarytoolbarreset", function (evt) {16602if (evt.source === _this3) {16603scrollModeChanged({16604mode: _ui_utils.ScrollMode.VERTICAL16605});16606}16607});16608}16609}, {16610key: "_bindSpreadModeListener",16611value: function _bindSpreadModeListener(buttons) {16612var _this4 = this;1661316614function spreadModeChanged(_ref3) {16615var mode = _ref3.mode;16616buttons.spreadNoneButton.classList.toggle("toggled", mode === _ui_utils.SpreadMode.NONE);16617buttons.spreadOddButton.classList.toggle("toggled", mode === _ui_utils.SpreadMode.ODD);16618buttons.spreadEvenButton.classList.toggle("toggled", mode === _ui_utils.SpreadMode.EVEN);16619}1662016621this.eventBus._on("spreadmodechanged", spreadModeChanged);1662216623this.eventBus._on("secondarytoolbarreset", function (evt) {16624if (evt.source === _this4) {16625spreadModeChanged({16626mode: _ui_utils.SpreadMode.NONE16627});16628}16629});16630}16631}, {16632key: "open",16633value: function open() {16634if (this.opened) {16635return;16636}1663716638this.opened = true;1663916640this._setMaxHeight();1664116642this.toggleButton.classList.add("toggled");16643this.toggleButton.setAttribute("aria-expanded", "true");16644this.toolbar.classList.remove("hidden");16645}16646}, {16647key: "close",16648value: function close() {16649if (!this.opened) {16650return;16651}1665216653this.opened = false;16654this.toolbar.classList.add("hidden");16655this.toggleButton.classList.remove("toggled");16656this.toggleButton.setAttribute("aria-expanded", "false");16657}16658}, {16659key: "toggle",16660value: function toggle() {16661if (this.opened) {16662this.close();16663} else {16664this.open();16665}16666}16667}, {16668key: "_setMaxHeight",16669value: function _setMaxHeight() {16670if (!this.opened) {16671return;16672}1667316674this.containerHeight = this.mainContainer.clientHeight;1667516676if (this.containerHeight === this.previousContainerHeight) {16677return;16678}1667916680this.toolbarButtonContainer.style.maxHeight = "".concat(this.containerHeight - _ui_utils.SCROLLBAR_PADDING, "px");16681this.previousContainerHeight = this.containerHeight;16682}16683}]);1668416685return SecondaryToolbar;16686}();1668716688exports.SecondaryToolbar = SecondaryToolbar;1668916690/***/ }),16691/* 37 */16692/***/ ((__unused_webpack_module, exports, __webpack_require__) => {16693166941669516696function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }1669716698Object.defineProperty(exports, "__esModule", ({16699value: true16700}));16701exports.PDFSinglePageViewer = void 0;1670216703var _base_viewer = __webpack_require__(30);1670416705var _pdfjsLib = __webpack_require__(7);1670616707function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1670816709function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1671016711function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1671216713function _get(target, property, receiver) { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(receiver); } return desc.value; }; } return _get(target, property, receiver || target); }1671416715function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }1671616717function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }1671816719function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }1672016721function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }1672216723function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }1672416725function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }1672616727function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }1672816729function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }1673016731var PDFSinglePageViewer = /*#__PURE__*/function (_BaseViewer) {16732_inherits(PDFSinglePageViewer, _BaseViewer);1673316734var _super = _createSuper(PDFSinglePageViewer);1673516736function PDFSinglePageViewer(options) {16737var _this;1673816739_classCallCheck(this, PDFSinglePageViewer);1674016741_this = _super.call(this, options);1674216743_this.eventBus._on("pagesinit", function (evt) {16744_this._ensurePageViewVisible();16745});1674616747return _this;16748}1674916750_createClass(PDFSinglePageViewer, [{16751key: "_viewerElement",16752get: function get() {16753return (0, _pdfjsLib.shadow)(this, "_viewerElement", this._shadowViewer);16754}16755}, {16756key: "_pageWidthScaleFactor",16757get: function get() {16758return 1;16759}16760}, {16761key: "_resetView",16762value: function _resetView() {16763_get(_getPrototypeOf(PDFSinglePageViewer.prototype), "_resetView", this).call(this);1676416765this._previousPageNumber = 1;16766this._shadowViewer = document.createDocumentFragment();16767this._updateScrollDown = null;16768}16769}, {16770key: "_ensurePageViewVisible",16771value: function _ensurePageViewVisible() {16772var pageView = this._pages[this._currentPageNumber - 1];16773var previousPageView = this._pages[this._previousPageNumber - 1];16774var viewerNodes = this.viewer.childNodes;1677516776switch (viewerNodes.length) {16777case 0:16778this.viewer.appendChild(pageView.div);16779break;1678016781case 1:16782if (viewerNodes[0] !== previousPageView.div) {16783throw new Error("_ensurePageViewVisible: Unexpected previously visible page.");16784}1678516786if (pageView === previousPageView) {16787break;16788}1678916790this._shadowViewer.appendChild(previousPageView.div);1679116792this.viewer.appendChild(pageView.div);16793this.container.scrollTop = 0;16794break;1679516796default:16797throw new Error("_ensurePageViewVisible: Only one page should be visible at a time.");16798}1679916800this._previousPageNumber = this._currentPageNumber;16801}16802}, {16803key: "_scrollUpdate",16804value: function _scrollUpdate() {16805if (this._updateScrollDown) {16806this._updateScrollDown();16807}1680816809_get(_getPrototypeOf(PDFSinglePageViewer.prototype), "_scrollUpdate", this).call(this);16810}16811}, {16812key: "_scrollIntoView",16813value: function _scrollIntoView(_ref) {16814var _this2 = this;1681516816var pageDiv = _ref.pageDiv,16817_ref$pageSpot = _ref.pageSpot,16818pageSpot = _ref$pageSpot === void 0 ? null : _ref$pageSpot,16819_ref$pageNumber = _ref.pageNumber,16820pageNumber = _ref$pageNumber === void 0 ? null : _ref$pageNumber;1682116822if (pageNumber) {16823this._setCurrentPageNumber(pageNumber);16824}1682516826var scrolledDown = this._currentPageNumber >= this._previousPageNumber;1682716828this._ensurePageViewVisible();1682916830this.update();1683116832_get(_getPrototypeOf(PDFSinglePageViewer.prototype), "_scrollIntoView", this).call(this, {16833pageDiv: pageDiv,16834pageSpot: pageSpot,16835pageNumber: pageNumber16836});1683716838this._updateScrollDown = function () {16839_this2.scroll.down = scrolledDown;16840_this2._updateScrollDown = null;16841};16842}16843}, {16844key: "_getVisiblePages",16845value: function _getVisiblePages() {16846return this._getCurrentVisiblePage();16847}16848}, {16849key: "_updateHelper",16850value: function _updateHelper(visiblePages) {}16851}, {16852key: "_isScrollModeHorizontal",16853get: function get() {16854return (0, _pdfjsLib.shadow)(this, "_isScrollModeHorizontal", false);16855}16856}, {16857key: "_updateScrollMode",16858value: function _updateScrollMode() {}16859}, {16860key: "_updateSpreadMode",16861value: function _updateSpreadMode() {}16862}, {16863key: "_getPageAdvance",16864value: function _getPageAdvance() {16865return 1;16866}16867}]);1686816869return PDFSinglePageViewer;16870}(_base_viewer.BaseViewer);1687116872exports.PDFSinglePageViewer = PDFSinglePageViewer;1687316874/***/ }),16875/* 38 */16876/***/ ((__unused_webpack_module, exports, __webpack_require__) => {16877168781687916880Object.defineProperty(exports, "__esModule", ({16881value: true16882}));16883exports.Toolbar = void 0;1688416885var _regenerator = _interopRequireDefault(__webpack_require__(4));1688616887var _ui_utils = __webpack_require__(6);1688816889function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }1689016891function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }1689216893function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }1689416895function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }1689616897function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }1689816899function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }1690016901function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1690216903function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1690416905function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1690616907var PAGE_NUMBER_LOADING_INDICATOR = "visiblePageIsLoading";16908var SCALE_SELECT_CONTAINER_WIDTH = 140;16909var SCALE_SELECT_WIDTH = 162;1691016911var Toolbar = /*#__PURE__*/function () {16912function Toolbar(options, eventBus, l10n) {16913_classCallCheck(this, Toolbar);1691416915this.toolbar = options.container;16916this.eventBus = eventBus;16917this.l10n = l10n;16918this.buttons = [{16919element: options.previous,16920eventName: "previouspage"16921}, {16922element: options.next,16923eventName: "nextpage"16924}, {16925element: options.zoomIn,16926eventName: "zoomin"16927}, {16928element: options.zoomOut,16929eventName: "zoomout"16930}, {16931element: options.openFile,16932eventName: "openfile"16933}, {16934element: options.print,16935eventName: "print"16936}, {16937element: options.presentationModeButton,16938eventName: "presentationmode"16939}, {16940element: options.download,16941eventName: "download"16942}, {16943element: options.viewBookmark,16944eventName: null16945}];16946this.items = {16947numPages: options.numPages,16948pageNumber: options.pageNumber,16949scaleSelectContainer: options.scaleSelectContainer,16950scaleSelect: options.scaleSelect,16951customScaleOption: options.customScaleOption,16952previous: options.previous,16953next: options.next,16954zoomIn: options.zoomIn,16955zoomOut: options.zoomOut16956};16957this._wasLocalized = false;16958this.reset();1695916960this._bindListeners();16961}1696216963_createClass(Toolbar, [{16964key: "setPageNumber",16965value: function setPageNumber(pageNumber, pageLabel) {16966this.pageNumber = pageNumber;16967this.pageLabel = pageLabel;1696816969this._updateUIState(false);16970}16971}, {16972key: "setPagesCount",16973value: function setPagesCount(pagesCount, hasPageLabels) {16974this.pagesCount = pagesCount;16975this.hasPageLabels = hasPageLabels;1697616977this._updateUIState(true);16978}16979}, {16980key: "setPageScale",16981value: function setPageScale(pageScaleValue, pageScale) {16982this.pageScaleValue = (pageScaleValue || pageScale).toString();16983this.pageScale = pageScale;1698416985this._updateUIState(false);16986}16987}, {16988key: "reset",16989value: function reset() {16990this.pageNumber = 0;16991this.pageLabel = null;16992this.hasPageLabels = false;16993this.pagesCount = 0;16994this.pageScaleValue = _ui_utils.DEFAULT_SCALE_VALUE;16995this.pageScale = _ui_utils.DEFAULT_SCALE;1699616997this._updateUIState(true);1699816999this.updateLoadingIndicatorState();17000}17001}, {17002key: "_bindListeners",17003value: function _bindListeners() {17004var _this = this;1700517006var _this$items = this.items,17007pageNumber = _this$items.pageNumber,17008scaleSelect = _this$items.scaleSelect;17009var self = this;1701017011var _iterator = _createForOfIteratorHelper(this.buttons),17012_step;1701317014try {17015var _loop = function _loop() {17016var _step$value = _step.value,17017element = _step$value.element,17018eventName = _step$value.eventName;17019element.addEventListener("click", function (evt) {17020if (eventName !== null) {17021_this.eventBus.dispatch(eventName, {17022source: _this17023});17024}17025});17026};1702717028for (_iterator.s(); !(_step = _iterator.n()).done;) {17029_loop();17030}17031} catch (err) {17032_iterator.e(err);17033} finally {17034_iterator.f();17035}1703617037pageNumber.addEventListener("click", function () {17038this.select();17039});17040pageNumber.addEventListener("change", function () {17041self.eventBus.dispatch("pagenumberchanged", {17042source: self,17043value: this.value17044});17045});17046scaleSelect.addEventListener("change", function () {17047if (this.value === "custom") {17048return;17049}1705017051self.eventBus.dispatch("scalechanged", {17052source: self,17053value: this.value17054});17055});17056scaleSelect.oncontextmenu = _ui_utils.noContextMenuHandler;1705717058this.eventBus._on("localized", function () {17059_this._wasLocalized = true;1706017061_this._adjustScaleWidth();1706217063_this._updateUIState(true);17064});17065}17066}, {17067key: "_updateUIState",17068value: function _updateUIState() {17069var resetNumPages = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;1707017071if (!this._wasLocalized) {17072return;17073}1707417075var pageNumber = this.pageNumber,17076pagesCount = this.pagesCount,17077pageScaleValue = this.pageScaleValue,17078pageScale = this.pageScale,17079items = this.items;1708017081if (resetNumPages) {17082if (this.hasPageLabels) {17083items.pageNumber.type = "text";17084} else {17085items.pageNumber.type = "number";17086this.l10n.get("of_pages", {17087pagesCount: pagesCount17088}).then(function (msg) {17089items.numPages.textContent = msg;17090});17091}1709217093items.pageNumber.max = pagesCount;17094}1709517096if (this.hasPageLabels) {17097items.pageNumber.value = this.pageLabel;17098this.l10n.get("page_of_pages", {17099pageNumber: pageNumber,17100pagesCount: pagesCount17101}).then(function (msg) {17102items.numPages.textContent = msg;17103});17104} else {17105items.pageNumber.value = pageNumber;17106}1710717108items.previous.disabled = pageNumber <= 1;17109items.next.disabled = pageNumber >= pagesCount;17110items.zoomOut.disabled = pageScale <= _ui_utils.MIN_SCALE;17111items.zoomIn.disabled = pageScale >= _ui_utils.MAX_SCALE;17112this.l10n.get("page_scale_percent", {17113scale: Math.round(pageScale * 10000) / 10017114}).then(function (msg) {17115var predefinedValueFound = false;1711617117var _iterator2 = _createForOfIteratorHelper(items.scaleSelect.options),17118_step2;1711917120try {17121for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {17122var option = _step2.value;1712317124if (option.value !== pageScaleValue) {17125option.selected = false;17126continue;17127}1712817129option.selected = true;17130predefinedValueFound = true;17131}17132} catch (err) {17133_iterator2.e(err);17134} finally {17135_iterator2.f();17136}1713717138if (!predefinedValueFound) {17139items.customScaleOption.textContent = msg;17140items.customScaleOption.selected = true;17141}17142});17143}17144}, {17145key: "updateLoadingIndicatorState",17146value: function updateLoadingIndicatorState() {17147var loading = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;17148var pageNumberInput = this.items.pageNumber;17149pageNumberInput.classList.toggle(PAGE_NUMBER_LOADING_INDICATOR, loading);17150}17151}, {17152key: "_adjustScaleWidth",17153value: function () {17154var _adjustScaleWidth2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee() {17155var items, l10n, predefinedValuesPromise, canvas, ctx, _getComputedStyle, fontSize, fontFamily, maxWidth, _iterator3, _step3, predefinedValue, _ctx$measureText, width, overflow;1715617157return _regenerator["default"].wrap(function _callee$(_context) {17158while (1) {17159switch (_context.prev = _context.next) {17160case 0:17161items = this.items, l10n = this.l10n;17162predefinedValuesPromise = Promise.all([l10n.get("page_scale_auto"), l10n.get("page_scale_actual"), l10n.get("page_scale_fit"), l10n.get("page_scale_width")]);17163canvas = document.createElement("canvas");17164canvas.mozOpaque = true;17165ctx = canvas.getContext("2d", {17166alpha: false17167});17168_context.next = 7;17169return _ui_utils.animationStarted;1717017171case 7:17172_getComputedStyle = getComputedStyle(items.scaleSelect), fontSize = _getComputedStyle.fontSize, fontFamily = _getComputedStyle.fontFamily;17173ctx.font = "".concat(fontSize, " ").concat(fontFamily);17174maxWidth = 0;17175_context.t0 = _createForOfIteratorHelper;17176_context.next = 13;17177return predefinedValuesPromise;1717817179case 13:17180_context.t1 = _context.sent;17181_iterator3 = (0, _context.t0)(_context.t1);1718217183try {17184for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {17185predefinedValue = _step3.value;17186_ctx$measureText = ctx.measureText(predefinedValue), width = _ctx$measureText.width;1718717188if (width > maxWidth) {17189maxWidth = width;17190}17191}17192} catch (err) {17193_iterator3.e(err);17194} finally {17195_iterator3.f();17196}1719717198overflow = SCALE_SELECT_WIDTH - SCALE_SELECT_CONTAINER_WIDTH;17199maxWidth += 2 * overflow;1720017201if (maxWidth > SCALE_SELECT_CONTAINER_WIDTH) {17202items.scaleSelect.style.width = "".concat(maxWidth + overflow, "px");17203items.scaleSelectContainer.style.width = "".concat(maxWidth, "px");17204}1720517206canvas.width = 0;17207canvas.height = 0;17208canvas = ctx = null;1720917210case 22:17211case "end":17212return _context.stop();17213}17214}17215}, _callee, this);17216}));1721717218function _adjustScaleWidth() {17219return _adjustScaleWidth2.apply(this, arguments);17220}1722117222return _adjustScaleWidth;17223}()17224}]);1722517226return Toolbar;17227}();1722817229exports.Toolbar = Toolbar;1723017231/***/ }),17232/* 39 */17233/***/ ((__unused_webpack_module, exports, __webpack_require__) => {17234172351723617237Object.defineProperty(exports, "__esModule", ({17238value: true17239}));17240exports.ViewHistory = void 0;1724117242var _regenerator = _interopRequireDefault(__webpack_require__(4));1724317244function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }1724517246function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }1724717248function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }1724917250function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1725117252function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1725317254function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1725517256var DEFAULT_VIEW_HISTORY_CACHE_SIZE = 20;1725717258var ViewHistory = /*#__PURE__*/function () {17259function ViewHistory(fingerprint) {17260var _this = this;1726117262var cacheSize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : DEFAULT_VIEW_HISTORY_CACHE_SIZE;1726317264_classCallCheck(this, ViewHistory);1726517266this.fingerprint = fingerprint;17267this.cacheSize = cacheSize;17268this._initializedPromise = this._readFromStorage().then(function (databaseStr) {17269var database = JSON.parse(databaseStr || "{}");17270var index = -1;1727117272if (!Array.isArray(database.files)) {17273database.files = [];17274} else {17275while (database.files.length >= _this.cacheSize) {17276database.files.shift();17277}1727817279for (var i = 0, ii = database.files.length; i < ii; i++) {17280var branch = database.files[i];1728117282if (branch.fingerprint === _this.fingerprint) {17283index = i;17284break;17285}17286}17287}1728817289if (index === -1) {17290index = database.files.push({17291fingerprint: _this.fingerprint17292}) - 1;17293}1729417295_this.file = database.files[index];17296_this.database = database;17297});17298}1729917300_createClass(ViewHistory, [{17301key: "_writeToStorage",17302value: function () {17303var _writeToStorage2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee() {17304var databaseStr;17305return _regenerator["default"].wrap(function _callee$(_context) {17306while (1) {17307switch (_context.prev = _context.next) {17308case 0:17309databaseStr = JSON.stringify(this.database);17310localStorage.setItem("pdfjs.history", databaseStr);1731117312case 2:17313case "end":17314return _context.stop();17315}17316}17317}, _callee, this);17318}));1731917320function _writeToStorage() {17321return _writeToStorage2.apply(this, arguments);17322}1732317324return _writeToStorage;17325}()17326}, {17327key: "_readFromStorage",17328value: function () {17329var _readFromStorage2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {17330return _regenerator["default"].wrap(function _callee2$(_context2) {17331while (1) {17332switch (_context2.prev = _context2.next) {17333case 0:17334return _context2.abrupt("return", localStorage.getItem("pdfjs.history"));1733517336case 1:17337case "end":17338return _context2.stop();17339}17340}17341}, _callee2);17342}));1734317344function _readFromStorage() {17345return _readFromStorage2.apply(this, arguments);17346}1734717348return _readFromStorage;17349}()17350}, {17351key: "set",17352value: function () {17353var _set = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee3(name, val) {17354return _regenerator["default"].wrap(function _callee3$(_context3) {17355while (1) {17356switch (_context3.prev = _context3.next) {17357case 0:17358_context3.next = 2;17359return this._initializedPromise;1736017361case 2:17362this.file[name] = val;17363return _context3.abrupt("return", this._writeToStorage());1736417365case 4:17366case "end":17367return _context3.stop();17368}17369}17370}, _callee3, this);17371}));1737217373function set(_x, _x2) {17374return _set.apply(this, arguments);17375}1737617377return set;17378}()17379}, {17380key: "setMultiple",17381value: function () {17382var _setMultiple = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee4(properties) {17383var name;17384return _regenerator["default"].wrap(function _callee4$(_context4) {17385while (1) {17386switch (_context4.prev = _context4.next) {17387case 0:17388_context4.next = 2;17389return this._initializedPromise;1739017391case 2:17392for (name in properties) {17393this.file[name] = properties[name];17394}1739517396return _context4.abrupt("return", this._writeToStorage());1739717398case 4:17399case "end":17400return _context4.stop();17401}17402}17403}, _callee4, this);17404}));1740517406function setMultiple(_x3) {17407return _setMultiple.apply(this, arguments);17408}1740917410return setMultiple;17411}()17412}, {17413key: "get",17414value: function () {17415var _get = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee5(name, defaultValue) {17416var val;17417return _regenerator["default"].wrap(function _callee5$(_context5) {17418while (1) {17419switch (_context5.prev = _context5.next) {17420case 0:17421_context5.next = 2;17422return this._initializedPromise;1742317424case 2:17425val = this.file[name];17426return _context5.abrupt("return", val !== undefined ? val : defaultValue);1742717428case 4:17429case "end":17430return _context5.stop();17431}17432}17433}, _callee5, this);17434}));1743517436function get(_x4, _x5) {17437return _get.apply(this, arguments);17438}1743917440return get;17441}()17442}, {17443key: "getMultiple",17444value: function () {17445var _getMultiple = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee6(properties) {17446var values, name, val;17447return _regenerator["default"].wrap(function _callee6$(_context6) {17448while (1) {17449switch (_context6.prev = _context6.next) {17450case 0:17451_context6.next = 2;17452return this._initializedPromise;1745317454case 2:17455values = Object.create(null);1745617457for (name in properties) {17458val = this.file[name];17459values[name] = val !== undefined ? val : properties[name];17460}1746117462return _context6.abrupt("return", values);1746317464case 5:17465case "end":17466return _context6.stop();17467}17468}17469}, _callee6, this);17470}));1747117472function getMultiple(_x6) {17473return _getMultiple.apply(this, arguments);17474}1747517476return getMultiple;17477}()17478}]);1747917480return ViewHistory;17481}();1748217483exports.ViewHistory = ViewHistory;1748417485/***/ }),17486/* 40 */17487/***/ ((__unused_webpack_module, exports, __webpack_require__) => {17488174891749017491function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }1749217493Object.defineProperty(exports, "__esModule", ({17494value: true17495}));17496exports.GenericCom = void 0;1749717498var _regenerator = _interopRequireDefault(__webpack_require__(4));1749917500var _app = __webpack_require__(3);1750117502var _preferences = __webpack_require__(41);1750317504var _download_manager = __webpack_require__(42);1750517506var _genericl10n = __webpack_require__(43);1750717508var _generic_scripting = __webpack_require__(45);1750917510function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }1751117512function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }1751317514function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }1751517516function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1751717518function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1751917520function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1752117522function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }1752317524function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }1752517526function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }1752717528function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }1752917530function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }1753117532function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }1753317534function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }1753517536;17537var GenericCom = {};17538exports.GenericCom = GenericCom;1753917540var GenericPreferences = /*#__PURE__*/function (_BasePreferences) {17541_inherits(GenericPreferences, _BasePreferences);1754217543var _super = _createSuper(GenericPreferences);1754417545function GenericPreferences() {17546_classCallCheck(this, GenericPreferences);1754717548return _super.apply(this, arguments);17549}1755017551_createClass(GenericPreferences, [{17552key: "_writeToStorage",17553value: function () {17554var _writeToStorage2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee(prefObj) {17555return _regenerator["default"].wrap(function _callee$(_context) {17556while (1) {17557switch (_context.prev = _context.next) {17558case 0:17559localStorage.setItem("pdfjs.preferences", JSON.stringify(prefObj));1756017561case 1:17562case "end":17563return _context.stop();17564}17565}17566}, _callee);17567}));1756817569function _writeToStorage(_x) {17570return _writeToStorage2.apply(this, arguments);17571}1757217573return _writeToStorage;17574}()17575}, {17576key: "_readFromStorage",17577value: function () {17578var _readFromStorage2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2(prefObj) {17579return _regenerator["default"].wrap(function _callee2$(_context2) {17580while (1) {17581switch (_context2.prev = _context2.next) {17582case 0:17583return _context2.abrupt("return", JSON.parse(localStorage.getItem("pdfjs.preferences")));1758417585case 1:17586case "end":17587return _context2.stop();17588}17589}17590}, _callee2);17591}));1759217593function _readFromStorage(_x2) {17594return _readFromStorage2.apply(this, arguments);17595}1759617597return _readFromStorage;17598}()17599}]);1760017601return GenericPreferences;17602}(_preferences.BasePreferences);1760317604var GenericExternalServices = /*#__PURE__*/function (_DefaultExternalServi) {17605_inherits(GenericExternalServices, _DefaultExternalServi);1760617607var _super2 = _createSuper(GenericExternalServices);1760817609function GenericExternalServices() {17610_classCallCheck(this, GenericExternalServices);1761117612return _super2.apply(this, arguments);17613}1761417615_createClass(GenericExternalServices, null, [{17616key: "createDownloadManager",17617value: function createDownloadManager(options) {17618return new _download_manager.DownloadManager();17619}17620}, {17621key: "createPreferences",17622value: function createPreferences() {17623return new GenericPreferences();17624}17625}, {17626key: "createL10n",17627value: function createL10n(_ref) {17628var _ref$locale = _ref.locale,17629locale = _ref$locale === void 0 ? "en-US" : _ref$locale;17630return new _genericl10n.GenericL10n(locale);17631}17632}, {17633key: "createScripting",17634value: function createScripting(_ref2) {17635var sandboxBundleSrc = _ref2.sandboxBundleSrc;17636return new _generic_scripting.GenericScripting(sandboxBundleSrc);17637}17638}]);1763917640return GenericExternalServices;17641}(_app.DefaultExternalServices);1764217643_app.PDFViewerApplication.externalServices = GenericExternalServices;1764417645/***/ }),17646/* 41 */17647/***/ ((__unused_webpack_module, exports, __webpack_require__) => {17648176491765017651Object.defineProperty(exports, "__esModule", ({17652value: true17653}));17654exports.BasePreferences = void 0;1765517656var _regenerator = _interopRequireDefault(__webpack_require__(4));1765717658var _app_options = __webpack_require__(1);1765917660function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }1766117662function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }1766317664function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }1766517666function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }1766717668function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1766917670function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1767117672function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1767317674var BasePreferences = /*#__PURE__*/function () {17675function BasePreferences() {17676var _this = this;1767717678_classCallCheck(this, BasePreferences);1767917680if (this.constructor === BasePreferences) {17681throw new Error("Cannot initialize BasePreferences.");17682}1768317684Object.defineProperty(this, "defaults", {17685value: Object.freeze({17686"cursorToolOnLoad": 0,17687"defaultZoomValue": "",17688"disablePageLabels": false,17689"enablePermissions": false,17690"enablePrintAutoRotate": true,17691"enableScripting": true,17692"enableWebGL": false,17693"externalLinkTarget": 0,17694"historyUpdateUrl": false,17695"ignoreDestinationZoom": false,17696"pdfBugEnabled": false,17697"renderer": "canvas",17698"renderInteractiveForms": true,17699"sidebarViewOnLoad": -1,17700"scrollModeOnLoad": -1,17701"spreadModeOnLoad": -1,17702"textLayerMode": 1,17703"useOnlyCssZoom": false,17704"viewerCssTheme": 0,17705"viewOnLoad": 0,17706"disableAutoFetch": false,17707"disableFontFace": false,17708"disableRange": false,17709"disableStream": false17710}),17711writable: false,17712enumerable: true,17713configurable: false17714});17715this.prefs = Object.create(null);17716this._initializedPromise = this._readFromStorage(this.defaults).then(function (prefs) {17717for (var name in _this.defaults) {17718var prefValue = prefs === null || prefs === void 0 ? void 0 : prefs[name];1771917720if (_typeof(prefValue) === _typeof(_this.defaults[name])) {17721_this.prefs[name] = prefValue;17722}17723}17724});17725}1772617727_createClass(BasePreferences, [{17728key: "_writeToStorage",17729value: function () {17730var _writeToStorage2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee(prefObj) {17731return _regenerator["default"].wrap(function _callee$(_context) {17732while (1) {17733switch (_context.prev = _context.next) {17734case 0:17735throw new Error("Not implemented: _writeToStorage");1773617737case 1:17738case "end":17739return _context.stop();17740}17741}17742}, _callee);17743}));1774417745function _writeToStorage(_x) {17746return _writeToStorage2.apply(this, arguments);17747}1774817749return _writeToStorage;17750}()17751}, {17752key: "_readFromStorage",17753value: function () {17754var _readFromStorage2 = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2(prefObj) {17755return _regenerator["default"].wrap(function _callee2$(_context2) {17756while (1) {17757switch (_context2.prev = _context2.next) {17758case 0:17759throw new Error("Not implemented: _readFromStorage");1776017761case 1:17762case "end":17763return _context2.stop();17764}17765}17766}, _callee2);17767}));1776817769function _readFromStorage(_x2) {17770return _readFromStorage2.apply(this, arguments);17771}1777217773return _readFromStorage;17774}()17775}, {17776key: "reset",17777value: function () {17778var _reset = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {17779return _regenerator["default"].wrap(function _callee3$(_context3) {17780while (1) {17781switch (_context3.prev = _context3.next) {17782case 0:17783_context3.next = 2;17784return this._initializedPromise;1778517786case 2:17787this.prefs = Object.create(null);17788return _context3.abrupt("return", this._writeToStorage(this.defaults));1778917790case 4:17791case "end":17792return _context3.stop();17793}17794}17795}, _callee3, this);17796}));1779717798function reset() {17799return _reset.apply(this, arguments);17800}1780117802return reset;17803}()17804}, {17805key: "set",17806value: function () {17807var _set = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee4(name, value) {17808var defaultValue, valueType, defaultType;17809return _regenerator["default"].wrap(function _callee4$(_context4) {17810while (1) {17811switch (_context4.prev = _context4.next) {17812case 0:17813_context4.next = 2;17814return this._initializedPromise;1781517816case 2:17817defaultValue = this.defaults[name];1781817819if (!(defaultValue === undefined)) {17820_context4.next = 7;17821break;17822}1782317824throw new Error("Set preference: \"".concat(name, "\" is undefined."));1782517826case 7:17827if (!(value === undefined)) {17828_context4.next = 9;17829break;17830}1783117832throw new Error("Set preference: no value is specified.");1783317834case 9:17835valueType = _typeof(value);17836defaultType = _typeof(defaultValue);1783717838if (!(valueType !== defaultType)) {17839_context4.next = 19;17840break;17841}1784217843if (!(valueType === "number" && defaultType === "string")) {17844_context4.next = 16;17845break;17846}1784717848value = value.toString();17849_context4.next = 17;17850break;1785117852case 16:17853throw new Error("Set preference: \"".concat(value, "\" is a ").concat(valueType, ", expected a ").concat(defaultType, "."));1785417855case 17:17856_context4.next = 21;17857break;1785817859case 19:17860if (!(valueType === "number" && !Number.isInteger(value))) {17861_context4.next = 21;17862break;17863}1786417865throw new Error("Set preference: \"".concat(value, "\" must be an integer."));1786617867case 21:17868this.prefs[name] = value;17869return _context4.abrupt("return", this._writeToStorage(this.prefs));1787017871case 23:17872case "end":17873return _context4.stop();17874}17875}17876}, _callee4, this);17877}));1787817879function set(_x3, _x4) {17880return _set.apply(this, arguments);17881}1788217883return set;17884}()17885}, {17886key: "get",17887value: function () {17888var _get = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee5(name) {17889var defaultValue, prefValue;17890return _regenerator["default"].wrap(function _callee5$(_context5) {17891while (1) {17892switch (_context5.prev = _context5.next) {17893case 0:17894_context5.next = 2;17895return this._initializedPromise;1789617897case 2:17898defaultValue = this.defaults[name], prefValue = this.prefs[name];1789917900if (!(defaultValue === undefined)) {17901_context5.next = 5;17902break;17903}1790417905throw new Error("Get preference: \"".concat(name, "\" is undefined."));1790617907case 5:17908return _context5.abrupt("return", prefValue !== undefined ? prefValue : defaultValue);1790917910case 6:17911case "end":17912return _context5.stop();17913}17914}17915}, _callee5, this);17916}));1791717918function get(_x5) {17919return _get.apply(this, arguments);17920}1792117922return get;17923}()17924}, {17925key: "getAll",17926value: function () {17927var _getAll = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee6() {17928var obj, name, prefValue;17929return _regenerator["default"].wrap(function _callee6$(_context6) {17930while (1) {17931switch (_context6.prev = _context6.next) {17932case 0:17933_context6.next = 2;17934return this._initializedPromise;1793517936case 2:17937obj = Object.create(null);1793817939for (name in this.defaults) {17940prefValue = this.prefs[name];17941obj[name] = prefValue !== undefined ? prefValue : this.defaults[name];17942}1794317944return _context6.abrupt("return", obj);1794517946case 5:17947case "end":17948return _context6.stop();17949}17950}17951}, _callee6, this);17952}));1795317954function getAll() {17955return _getAll.apply(this, arguments);17956}1795717958return getAll;17959}()17960}]);1796117962return BasePreferences;17963}();1796417965exports.BasePreferences = BasePreferences;1796617967/***/ }),17968/* 42 */17969/***/ ((__unused_webpack_module, exports, __webpack_require__) => {17970179711797217973Object.defineProperty(exports, "__esModule", ({17974value: true17975}));17976exports.DownloadManager = void 0;1797717978var _pdfjsLib = __webpack_require__(7);1797917980var _viewer_compatibility = __webpack_require__(2);1798117982function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1798317984function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1798517986function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1798717988;1798917990function _download(blobUrl, filename) {17991var a = document.createElement("a");1799217993if (!a.click) {17994throw new Error('DownloadManager: "a.click()" is not supported.');17995}1799617997a.href = blobUrl;17998a.target = "_parent";1799918000if ("download" in a) {18001a.download = filename;18002}1800318004(document.body || document.documentElement).appendChild(a);18005a.click();18006a.remove();18007}1800818009var DownloadManager = /*#__PURE__*/function () {18010function DownloadManager() {18011_classCallCheck(this, DownloadManager);1801218013this._openBlobUrls = new WeakMap();18014}1801518016_createClass(DownloadManager, [{18017key: "downloadUrl",18018value: function downloadUrl(url, filename) {18019if (!(0, _pdfjsLib.createValidAbsoluteUrl)(url, "http://example.com")) {18020return;18021}1802218023_download(url + "#pdfjs.action=download", filename);18024}18025}, {18026key: "downloadData",18027value: function downloadData(data, filename, contentType) {18028var blobUrl = (0, _pdfjsLib.createObjectURL)(data, contentType, _viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL);1802918030_download(blobUrl, filename);18031}18032}, {18033key: "openOrDownloadData",18034value: function openOrDownloadData(element, data, filename) {18035var isPdfData = (0, _pdfjsLib.isPdfFile)(filename);18036var contentType = isPdfData ? "application/pdf" : "";1803718038if (isPdfData && !_viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL) {18039var blobUrl = this._openBlobUrls.get(element);1804018041if (!blobUrl) {18042blobUrl = URL.createObjectURL(new Blob([data], {18043type: contentType18044}));1804518046this._openBlobUrls.set(element, blobUrl);18047}1804818049var viewerUrl;18050viewerUrl = "?file=" + encodeURIComponent(blobUrl + "#" + filename);1805118052try {18053window.open(viewerUrl);18054return true;18055} catch (ex) {18056console.error("openOrDownloadData: ".concat(ex));18057URL.revokeObjectURL(blobUrl);1805818059this._openBlobUrls["delete"](element);18060}18061}1806218063this.downloadData(data, filename, contentType);18064return false;18065}18066}, {18067key: "download",18068value: function download(blob, url, filename) {18069var sourceEventType = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "download";1807018071if (_viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL) {18072this.downloadUrl(url, filename);18073return;18074}1807518076var blobUrl = URL.createObjectURL(blob);1807718078_download(blobUrl, filename);18079}18080}]);1808118082return DownloadManager;18083}();1808418085exports.DownloadManager = DownloadManager;1808618087/***/ }),18088/* 43 */18089/***/ ((__unused_webpack_module, exports, __webpack_require__) => {18090180911809218093Object.defineProperty(exports, "__esModule", ({18094value: true18095}));18096exports.GenericL10n = void 0;1809718098var _regenerator = _interopRequireDefault(__webpack_require__(4));1809918100__webpack_require__(44);1810118102var _l10n_utils = __webpack_require__(32);1810318104function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }1810518106function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }1810718108function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }1810918110function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1811118112function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1811318114function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1811518116var webL10n = document.webL10n;1811718118var GenericL10n = /*#__PURE__*/function () {18119function GenericL10n(lang) {18120_classCallCheck(this, GenericL10n);1812118122this._lang = lang;18123this._ready = new Promise(function (resolve, reject) {18124webL10n.setLanguage(lang, function () {18125resolve(webL10n);18126});18127});18128}1812918130_createClass(GenericL10n, [{18131key: "getLanguage",18132value: function () {18133var _getLanguage = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee() {18134var l10n;18135return _regenerator["default"].wrap(function _callee$(_context) {18136while (1) {18137switch (_context.prev = _context.next) {18138case 0:18139_context.next = 2;18140return this._ready;1814118142case 2:18143l10n = _context.sent;18144return _context.abrupt("return", l10n.getLanguage());1814518146case 4:18147case "end":18148return _context.stop();18149}18150}18151}, _callee, this);18152}));1815318154function getLanguage() {18155return _getLanguage.apply(this, arguments);18156}1815718158return getLanguage;18159}()18160}, {18161key: "getDirection",18162value: function () {18163var _getDirection = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {18164var l10n;18165return _regenerator["default"].wrap(function _callee2$(_context2) {18166while (1) {18167switch (_context2.prev = _context2.next) {18168case 0:18169_context2.next = 2;18170return this._ready;1817118172case 2:18173l10n = _context2.sent;18174return _context2.abrupt("return", l10n.getDirection());1817518176case 4:18177case "end":18178return _context2.stop();18179}18180}18181}, _callee2, this);18182}));1818318184function getDirection() {18185return _getDirection.apply(this, arguments);18186}1818718188return getDirection;18189}()18190}, {18191key: "get",18192value: function () {18193var _get = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee3(key) {18194var args,18195fallback,18196l10n,18197_args3 = arguments;18198return _regenerator["default"].wrap(function _callee3$(_context3) {18199while (1) {18200switch (_context3.prev = _context3.next) {18201case 0:18202args = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : null;18203fallback = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : (0, _l10n_utils.getL10nFallback)(key, args);18204_context3.next = 4;18205return this._ready;1820618207case 4:18208l10n = _context3.sent;18209return _context3.abrupt("return", l10n.get(key, args, fallback));1821018211case 6:18212case "end":18213return _context3.stop();18214}18215}18216}, _callee3, this);18217}));1821818219function get(_x) {18220return _get.apply(this, arguments);18221}1822218223return get;18224}()18225}, {18226key: "translate",18227value: function () {18228var _translate = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee4(element) {18229var l10n;18230return _regenerator["default"].wrap(function _callee4$(_context4) {18231while (1) {18232switch (_context4.prev = _context4.next) {18233case 0:18234_context4.next = 2;18235return this._ready;1823618237case 2:18238l10n = _context4.sent;18239return _context4.abrupt("return", l10n.translate(element));1824018241case 4:18242case "end":18243return _context4.stop();18244}18245}18246}, _callee4, this);18247}));1824818249function translate(_x2) {18250return _translate.apply(this, arguments);18251}1825218253return translate;18254}()18255}]);1825618257return GenericL10n;18258}();1825918260exports.GenericL10n = GenericL10n;1826118262/***/ }),18263/* 44 */18264/***/ (() => {18265182661826718268document.webL10n = function (window, document, undefined) {18269var gL10nData = {};18270var gTextData = '';18271var gTextProp = 'textContent';18272var gLanguage = '';18273var gMacros = {};18274var gReadyState = 'loading';18275var gAsyncResourceLoading = true;1827618277function getL10nResourceLinks() {18278return document.querySelectorAll('link[type="application/l10n"]');18279}1828018281function getL10nDictionary() {18282var script = document.querySelector('script[type="application/l10n"]');18283return script ? JSON.parse(script.innerHTML) : null;18284}1828518286function getTranslatableChildren(element) {18287return element ? element.querySelectorAll('*[data-l10n-id]') : [];18288}1828918290function getL10nAttributes(element) {18291if (!element) return {};18292var l10nId = element.getAttribute('data-l10n-id');18293var l10nArgs = element.getAttribute('data-l10n-args');18294var args = {};1829518296if (l10nArgs) {18297try {18298args = JSON.parse(l10nArgs);18299} catch (e) {18300console.warn('could not parse arguments for #' + l10nId);18301}18302}1830318304return {18305id: l10nId,18306args: args18307};18308}1830918310function xhrLoadText(url, onSuccess, onFailure) {18311onSuccess = onSuccess || function _onSuccess(data) {};1831218313onFailure = onFailure || function _onFailure() {};1831418315var xhr = new XMLHttpRequest();18316xhr.open('GET', url, gAsyncResourceLoading);1831718318if (xhr.overrideMimeType) {18319xhr.overrideMimeType('text/plain; charset=utf-8');18320}1832118322xhr.onreadystatechange = function () {18323if (xhr.readyState == 4) {18324if (xhr.status == 200 || xhr.status === 0) {18325onSuccess(xhr.responseText);18326} else {18327onFailure();18328}18329}18330};1833118332xhr.onerror = onFailure;18333xhr.ontimeout = onFailure;1833418335try {18336xhr.send(null);18337} catch (e) {18338onFailure();18339}18340}1834118342function parseResource(href, lang, successCallback, failureCallback) {18343var baseURL = href.replace(/[^\/]*$/, '') || './';1834418345function evalString(text) {18346if (text.lastIndexOf('\\') < 0) return text;18347return text.replace(/\\\\/g, '\\').replace(/\\n/g, '\n').replace(/\\r/g, '\r').replace(/\\t/g, '\t').replace(/\\b/g, '\b').replace(/\\f/g, '\f').replace(/\\{/g, '{').replace(/\\}/g, '}').replace(/\\"/g, '"').replace(/\\'/g, "'");18348}1834918350function parseProperties(text, parsedPropertiesCallback) {18351var dictionary = {};18352var reBlank = /^\s*|\s*$/;18353var reComment = /^\s*#|^\s*$/;18354var reSection = /^\s*\[(.*)\]\s*$/;18355var reImport = /^\s*@import\s+url\((.*)\)\s*$/i;18356var reSplit = /^([^=\s]*)\s*=\s*(.+)$/;1835718358function parseRawLines(rawText, extendedSyntax, parsedRawLinesCallback) {18359var entries = rawText.replace(reBlank, '').split(/[\r\n]+/);18360var currentLang = '*';18361var genericLang = lang.split('-', 1)[0];18362var skipLang = false;18363var match = '';1836418365function nextEntry() {18366while (true) {18367if (!entries.length) {18368parsedRawLinesCallback();18369return;18370}1837118372var line = entries.shift();18373if (reComment.test(line)) continue;1837418375if (extendedSyntax) {18376match = reSection.exec(line);1837718378if (match) {18379currentLang = match[1].toLowerCase();18380skipLang = currentLang !== '*' && currentLang !== lang && currentLang !== genericLang;18381continue;18382} else if (skipLang) {18383continue;18384}1838518386match = reImport.exec(line);1838718388if (match) {18389loadImport(baseURL + match[1], nextEntry);18390return;18391}18392}1839318394var tmp = line.match(reSplit);1839518396if (tmp && tmp.length == 3) {18397dictionary[tmp[1]] = evalString(tmp[2]);18398}18399}18400}1840118402nextEntry();18403}1840418405function loadImport(url, callback) {18406xhrLoadText(url, function (content) {18407parseRawLines(content, false, callback);18408}, function () {18409console.warn(url + ' not found.');18410callback();18411});18412}1841318414parseRawLines(text, true, function () {18415parsedPropertiesCallback(dictionary);18416});18417}1841818419xhrLoadText(href, function (response) {18420gTextData += response;18421parseProperties(response, function (data) {18422for (var key in data) {18423var id,18424prop,18425index = key.lastIndexOf('.');1842618427if (index > 0) {18428id = key.substring(0, index);18429prop = key.substring(index + 1);18430} else {18431id = key;18432prop = gTextProp;18433}1843418435if (!gL10nData[id]) {18436gL10nData[id] = {};18437}1843818439gL10nData[id][prop] = data[key];18440}1844118442if (successCallback) {18443successCallback();18444}18445});18446}, failureCallback);18447}1844818449function loadLocale(lang, callback) {18450if (lang) {18451lang = lang.toLowerCase();18452}1845318454callback = callback || function _callback() {};1845518456clear();18457gLanguage = lang;18458var langLinks = getL10nResourceLinks();18459var langCount = langLinks.length;1846018461if (langCount === 0) {18462var dict = getL10nDictionary();1846318464if (dict && dict.locales && dict.default_locale) {18465console.log('using the embedded JSON directory, early way out');18466gL10nData = dict.locales[lang];1846718468if (!gL10nData) {18469var defaultLocale = dict.default_locale.toLowerCase();1847018471for (var anyCaseLang in dict.locales) {18472anyCaseLang = anyCaseLang.toLowerCase();1847318474if (anyCaseLang === lang) {18475gL10nData = dict.locales[lang];18476break;18477} else if (anyCaseLang === defaultLocale) {18478gL10nData = dict.locales[defaultLocale];18479}18480}18481}1848218483callback();18484} else {18485console.log('no resource to load, early way out');18486}1848718488gReadyState = 'complete';18489return;18490}1849118492var onResourceLoaded = null;18493var gResourceCount = 0;1849418495onResourceLoaded = function onResourceLoaded() {18496gResourceCount++;1849718498if (gResourceCount >= langCount) {18499callback();18500gReadyState = 'complete';18501}18502};1850318504function L10nResourceLink(link) {18505var href = link.href;1850618507this.load = function (lang, callback) {18508parseResource(href, lang, callback, function () {18509console.warn(href + ' not found.');18510console.warn('"' + lang + '" resource not found');18511gLanguage = '';18512callback();18513});18514};18515}1851618517for (var i = 0; i < langCount; i++) {18518var resource = new L10nResourceLink(langLinks[i]);18519resource.load(lang, onResourceLoaded);18520}18521}1852218523function clear() {18524gL10nData = {};18525gTextData = '';18526gLanguage = '';18527}1852818529function getPluralRules(lang) {18530var locales2rules = {18531'af': 3,18532'ak': 4,18533'am': 4,18534'ar': 1,18535'asa': 3,18536'az': 0,18537'be': 11,18538'bem': 3,18539'bez': 3,18540'bg': 3,18541'bh': 4,18542'bm': 0,18543'bn': 3,18544'bo': 0,18545'br': 20,18546'brx': 3,18547'bs': 11,18548'ca': 3,18549'cgg': 3,18550'chr': 3,18551'cs': 12,18552'cy': 17,18553'da': 3,18554'de': 3,18555'dv': 3,18556'dz': 0,18557'ee': 3,18558'el': 3,18559'en': 3,18560'eo': 3,18561'es': 3,18562'et': 3,18563'eu': 3,18564'fa': 0,18565'ff': 5,18566'fi': 3,18567'fil': 4,18568'fo': 3,18569'fr': 5,18570'fur': 3,18571'fy': 3,18572'ga': 8,18573'gd': 24,18574'gl': 3,18575'gsw': 3,18576'gu': 3,18577'guw': 4,18578'gv': 23,18579'ha': 3,18580'haw': 3,18581'he': 2,18582'hi': 4,18583'hr': 11,18584'hu': 0,18585'id': 0,18586'ig': 0,18587'ii': 0,18588'is': 3,18589'it': 3,18590'iu': 7,18591'ja': 0,18592'jmc': 3,18593'jv': 0,18594'ka': 0,18595'kab': 5,18596'kaj': 3,18597'kcg': 3,18598'kde': 0,18599'kea': 0,18600'kk': 3,18601'kl': 3,18602'km': 0,18603'kn': 0,18604'ko': 0,18605'ksb': 3,18606'ksh': 21,18607'ku': 3,18608'kw': 7,18609'lag': 18,18610'lb': 3,18611'lg': 3,18612'ln': 4,18613'lo': 0,18614'lt': 10,18615'lv': 6,18616'mas': 3,18617'mg': 4,18618'mk': 16,18619'ml': 3,18620'mn': 3,18621'mo': 9,18622'mr': 3,18623'ms': 0,18624'mt': 15,18625'my': 0,18626'nah': 3,18627'naq': 7,18628'nb': 3,18629'nd': 3,18630'ne': 3,18631'nl': 3,18632'nn': 3,18633'no': 3,18634'nr': 3,18635'nso': 4,18636'ny': 3,18637'nyn': 3,18638'om': 3,18639'or': 3,18640'pa': 3,18641'pap': 3,18642'pl': 13,18643'ps': 3,18644'pt': 3,18645'rm': 3,18646'ro': 9,18647'rof': 3,18648'ru': 11,18649'rwk': 3,18650'sah': 0,18651'saq': 3,18652'se': 7,18653'seh': 3,18654'ses': 0,18655'sg': 0,18656'sh': 11,18657'shi': 19,18658'sk': 12,18659'sl': 14,18660'sma': 7,18661'smi': 7,18662'smj': 7,18663'smn': 7,18664'sms': 7,18665'sn': 3,18666'so': 3,18667'sq': 3,18668'sr': 11,18669'ss': 3,18670'ssy': 3,18671'st': 3,18672'sv': 3,18673'sw': 3,18674'syr': 3,18675'ta': 3,18676'te': 3,18677'teo': 3,18678'th': 0,18679'ti': 4,18680'tig': 3,18681'tk': 3,18682'tl': 4,18683'tn': 3,18684'to': 0,18685'tr': 0,18686'ts': 3,18687'tzm': 22,18688'uk': 11,18689'ur': 3,18690've': 3,18691'vi': 0,18692'vun': 3,18693'wa': 4,18694'wae': 3,18695'wo': 0,18696'xh': 3,18697'xog': 3,18698'yo': 0,18699'zh': 0,18700'zu': 318701};1870218703function isIn(n, list) {18704return list.indexOf(n) !== -1;18705}1870618707function isBetween(n, start, end) {18708return start <= n && n <= end;18709}1871018711var pluralRules = {18712'0': function _(n) {18713return 'other';18714},18715'1': function _(n) {18716if (isBetween(n % 100, 3, 10)) return 'few';18717if (n === 0) return 'zero';18718if (isBetween(n % 100, 11, 99)) return 'many';18719if (n == 2) return 'two';18720if (n == 1) return 'one';18721return 'other';18722},18723'2': function _(n) {18724if (n !== 0 && n % 10 === 0) return 'many';18725if (n == 2) return 'two';18726if (n == 1) return 'one';18727return 'other';18728},18729'3': function _(n) {18730if (n == 1) return 'one';18731return 'other';18732},18733'4': function _(n) {18734if (isBetween(n, 0, 1)) return 'one';18735return 'other';18736},18737'5': function _(n) {18738if (isBetween(n, 0, 2) && n != 2) return 'one';18739return 'other';18740},18741'6': function _(n) {18742if (n === 0) return 'zero';18743if (n % 10 == 1 && n % 100 != 11) return 'one';18744return 'other';18745},18746'7': function _(n) {18747if (n == 2) return 'two';18748if (n == 1) return 'one';18749return 'other';18750},18751'8': function _(n) {18752if (isBetween(n, 3, 6)) return 'few';18753if (isBetween(n, 7, 10)) return 'many';18754if (n == 2) return 'two';18755if (n == 1) return 'one';18756return 'other';18757},18758'9': function _(n) {18759if (n === 0 || n != 1 && isBetween(n % 100, 1, 19)) return 'few';18760if (n == 1) return 'one';18761return 'other';18762},18763'10': function _(n) {18764if (isBetween(n % 10, 2, 9) && !isBetween(n % 100, 11, 19)) return 'few';18765if (n % 10 == 1 && !isBetween(n % 100, 11, 19)) return 'one';18766return 'other';18767},18768'11': function _(n) {18769if (isBetween(n % 10, 2, 4) && !isBetween(n % 100, 12, 14)) return 'few';18770if (n % 10 === 0 || isBetween(n % 10, 5, 9) || isBetween(n % 100, 11, 14)) return 'many';18771if (n % 10 == 1 && n % 100 != 11) return 'one';18772return 'other';18773},18774'12': function _(n) {18775if (isBetween(n, 2, 4)) return 'few';18776if (n == 1) return 'one';18777return 'other';18778},18779'13': function _(n) {18780if (isBetween(n % 10, 2, 4) && !isBetween(n % 100, 12, 14)) return 'few';18781if (n != 1 && isBetween(n % 10, 0, 1) || isBetween(n % 10, 5, 9) || isBetween(n % 100, 12, 14)) return 'many';18782if (n == 1) return 'one';18783return 'other';18784},18785'14': function _(n) {18786if (isBetween(n % 100, 3, 4)) return 'few';18787if (n % 100 == 2) return 'two';18788if (n % 100 == 1) return 'one';18789return 'other';18790},18791'15': function _(n) {18792if (n === 0 || isBetween(n % 100, 2, 10)) return 'few';18793if (isBetween(n % 100, 11, 19)) return 'many';18794if (n == 1) return 'one';18795return 'other';18796},18797'16': function _(n) {18798if (n % 10 == 1 && n != 11) return 'one';18799return 'other';18800},18801'17': function _(n) {18802if (n == 3) return 'few';18803if (n === 0) return 'zero';18804if (n == 6) return 'many';18805if (n == 2) return 'two';18806if (n == 1) return 'one';18807return 'other';18808},18809'18': function _(n) {18810if (n === 0) return 'zero';18811if (isBetween(n, 0, 2) && n !== 0 && n != 2) return 'one';18812return 'other';18813},18814'19': function _(n) {18815if (isBetween(n, 2, 10)) return 'few';18816if (isBetween(n, 0, 1)) return 'one';18817return 'other';18818},18819'20': function _(n) {18820if ((isBetween(n % 10, 3, 4) || n % 10 == 9) && !(isBetween(n % 100, 10, 19) || isBetween(n % 100, 70, 79) || isBetween(n % 100, 90, 99))) return 'few';18821if (n % 1000000 === 0 && n !== 0) return 'many';18822if (n % 10 == 2 && !isIn(n % 100, [12, 72, 92])) return 'two';18823if (n % 10 == 1 && !isIn(n % 100, [11, 71, 91])) return 'one';18824return 'other';18825},18826'21': function _(n) {18827if (n === 0) return 'zero';18828if (n == 1) return 'one';18829return 'other';18830},18831'22': function _(n) {18832if (isBetween(n, 0, 1) || isBetween(n, 11, 99)) return 'one';18833return 'other';18834},18835'23': function _(n) {18836if (isBetween(n % 10, 1, 2) || n % 20 === 0) return 'one';18837return 'other';18838},18839'24': function _(n) {18840if (isBetween(n, 3, 10) || isBetween(n, 13, 19)) return 'few';18841if (isIn(n, [2, 12])) return 'two';18842if (isIn(n, [1, 11])) return 'one';18843return 'other';18844}18845};18846var index = locales2rules[lang.replace(/-.*$/, '')];1884718848if (!(index in pluralRules)) {18849console.warn('plural form unknown for [' + lang + ']');18850return function () {18851return 'other';18852};18853}1885418855return pluralRules[index];18856}1885718858gMacros.plural = function (str, param, key, prop) {18859var n = parseFloat(param);18860if (isNaN(n)) return str;18861if (prop != gTextProp) return str;1886218863if (!gMacros._pluralRules) {18864gMacros._pluralRules = getPluralRules(gLanguage);18865}1886618867var index = '[' + gMacros._pluralRules(n) + ']';1886818869if (n === 0 && key + '[zero]' in gL10nData) {18870str = gL10nData[key + '[zero]'][prop];18871} else if (n == 1 && key + '[one]' in gL10nData) {18872str = gL10nData[key + '[one]'][prop];18873} else if (n == 2 && key + '[two]' in gL10nData) {18874str = gL10nData[key + '[two]'][prop];18875} else if (key + index in gL10nData) {18876str = gL10nData[key + index][prop];18877} else if (key + '[other]' in gL10nData) {18878str = gL10nData[key + '[other]'][prop];18879}1888018881return str;18882};1888318884function getL10nData(key, args, fallback) {18885var data = gL10nData[key];1888618887if (!data) {18888console.warn('#' + key + ' is undefined.');1888918890if (!fallback) {18891return null;18892}1889318894data = fallback;18895}1889618897var rv = {};1889818899for (var prop in data) {18900var str = data[prop];18901str = substIndexes(str, args, key, prop);18902str = substArguments(str, args, key);18903rv[prop] = str;18904}1890518906return rv;18907}1890818909function substIndexes(str, args, key, prop) {18910var reIndex = /\{\[\s*([a-zA-Z]+)\(([a-zA-Z]+)\)\s*\]\}/;18911var reMatch = reIndex.exec(str);18912if (!reMatch || !reMatch.length) return str;18913var macroName = reMatch[1];18914var paramName = reMatch[2];18915var param;1891618917if (args && paramName in args) {18918param = args[paramName];18919} else if (paramName in gL10nData) {18920param = gL10nData[paramName];18921}1892218923if (macroName in gMacros) {18924var macro = gMacros[macroName];18925str = macro(str, param, key, prop);18926}1892718928return str;18929}1893018931function substArguments(str, args, key) {18932var reArgs = /\{\{\s*(.+?)\s*\}\}/g;18933return str.replace(reArgs, function (matched_text, arg) {18934if (args && arg in args) {18935return args[arg];18936}1893718938if (arg in gL10nData) {18939return gL10nData[arg];18940}1894118942console.log('argument {{' + arg + '}} for #' + key + ' is undefined.');18943return matched_text;18944});18945}1894618947function translateElement(element) {18948var l10n = getL10nAttributes(element);18949if (!l10n.id) return;18950var data = getL10nData(l10n.id, l10n.args);1895118952if (!data) {18953console.warn('#' + l10n.id + ' is undefined.');18954return;18955}1895618957if (data[gTextProp]) {18958if (getChildElementCount(element) === 0) {18959element[gTextProp] = data[gTextProp];18960} else {18961var children = element.childNodes;18962var found = false;1896318964for (var i = 0, l = children.length; i < l; i++) {18965if (children[i].nodeType === 3 && /\S/.test(children[i].nodeValue)) {18966if (found) {18967children[i].nodeValue = '';18968} else {18969children[i].nodeValue = data[gTextProp];18970found = true;18971}18972}18973}1897418975if (!found) {18976var textNode = document.createTextNode(data[gTextProp]);18977element.insertBefore(textNode, element.firstChild);18978}18979}1898018981delete data[gTextProp];18982}1898318984for (var k in data) {18985element[k] = data[k];18986}18987}1898818989function getChildElementCount(element) {18990if (element.children) {18991return element.children.length;18992}1899318994if (typeof element.childElementCount !== 'undefined') {18995return element.childElementCount;18996}1899718998var count = 0;1899919000for (var i = 0; i < element.childNodes.length; i++) {19001count += element.nodeType === 1 ? 1 : 0;19002}1900319004return count;19005}1900619007function translateFragment(element) {19008element = element || document.documentElement;19009var children = getTranslatableChildren(element);19010var elementCount = children.length;1901119012for (var i = 0; i < elementCount; i++) {19013translateElement(children[i]);19014}1901519016translateElement(element);19017}1901819019return {19020get: function get(key, args, fallbackString) {19021var index = key.lastIndexOf('.');19022var prop = gTextProp;1902319024if (index > 0) {19025prop = key.substring(index + 1);19026key = key.substring(0, index);19027}1902819029var fallback;1903019031if (fallbackString) {19032fallback = {};19033fallback[prop] = fallbackString;19034}1903519036var data = getL10nData(key, args, fallback);1903719038if (data && prop in data) {19039return data[prop];19040}1904119042return '{{' + key + '}}';19043},19044getData: function getData() {19045return gL10nData;19046},19047getText: function getText() {19048return gTextData;19049},19050getLanguage: function getLanguage() {19051return gLanguage;19052},19053setLanguage: function setLanguage(lang, callback) {19054loadLocale(lang, function () {19055if (callback) callback();19056});19057},19058getDirection: function getDirection() {19059var rtlList = ['ar', 'he', 'fa', 'ps', 'ur'];19060var shortCode = gLanguage.split('-', 1)[0];19061return rtlList.indexOf(shortCode) >= 0 ? 'rtl' : 'ltr';19062},19063translate: translateFragment,19064getReadyState: function getReadyState() {19065return gReadyState;19066},19067ready: function ready(callback) {19068if (!callback) {19069return;19070} else if (gReadyState == 'complete' || gReadyState == 'interactive') {19071window.setTimeout(function () {19072callback();19073});19074} else if (document.addEventListener) {19075document.addEventListener('localized', function once() {19076document.removeEventListener('localized', once);19077callback();19078});19079}19080}19081};19082}(window, document);1908319084/***/ }),19085/* 45 */19086/***/ ((__unused_webpack_module, exports, __webpack_require__) => {19087190881908919090Object.defineProperty(exports, "__esModule", ({19091value: true19092}));19093exports.docPropertiesLookup = docPropertiesLookup;19094exports.GenericScripting = void 0;1909519096var _regenerator = _interopRequireDefault(__webpack_require__(4));1909719098var _pdfjsLib = __webpack_require__(7);1909919100function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }1910119102function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }1910319104function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }1910519106function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }1910719108function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }1910919110function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }1911119112function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }1911319114function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }1911519116function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }1911719118function docPropertiesLookup(_x) {19119return _docPropertiesLookup.apply(this, arguments);19120}1912119122function _docPropertiesLookup() {19123_docPropertiesLookup = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee4(pdfDocument) {19124var url, baseUrl, _yield$pdfDocument$ge, info, metadata, contentDispositionFilename, contentLength, _yield$pdfDocument$ge2, length;1912519126return _regenerator["default"].wrap(function _callee4$(_context4) {19127while (1) {19128switch (_context4.prev = _context4.next) {19129case 0:19130url = "", baseUrl = url.split("#")[0];19131_context4.next = 3;19132return pdfDocument.getMetadata();1913319134case 3:19135_yield$pdfDocument$ge = _context4.sent;19136info = _yield$pdfDocument$ge.info;19137metadata = _yield$pdfDocument$ge.metadata;19138contentDispositionFilename = _yield$pdfDocument$ge.contentDispositionFilename;19139contentLength = _yield$pdfDocument$ge.contentLength;1914019141if (contentLength) {19142_context4.next = 14;19143break;19144}1914519146_context4.next = 11;19147return pdfDocument.getDownloadInfo();1914819149case 11:19150_yield$pdfDocument$ge2 = _context4.sent;19151length = _yield$pdfDocument$ge2.length;19152contentLength = length;1915319154case 14:19155return _context4.abrupt("return", _objectSpread(_objectSpread({}, info), {}, {19156baseURL: baseUrl,19157filesize: contentLength,19158filename: contentDispositionFilename || (0, _pdfjsLib.getPdfFilenameFromUrl)(url),19159metadata: metadata === null || metadata === void 0 ? void 0 : metadata.getRaw(),19160authors: metadata === null || metadata === void 0 ? void 0 : metadata.get("dc:creator"),19161numPages: pdfDocument.numPages,19162URL: url19163}));1916419165case 15:19166case "end":19167return _context4.stop();19168}19169}19170}, _callee4);19171}));19172return _docPropertiesLookup.apply(this, arguments);19173}1917419175var GenericScripting = /*#__PURE__*/function () {19176function GenericScripting(sandboxBundleSrc) {19177_classCallCheck(this, GenericScripting);1917819179this._ready = (0, _pdfjsLib.loadScript)(sandboxBundleSrc, true).then(function () {19180return window.pdfjsSandbox.QuickJSSandbox();19181});19182}1918319184_createClass(GenericScripting, [{19185key: "createSandbox",19186value: function () {19187var _createSandbox = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee(data) {19188var sandbox;19189return _regenerator["default"].wrap(function _callee$(_context) {19190while (1) {19191switch (_context.prev = _context.next) {19192case 0:19193_context.next = 2;19194return this._ready;1919519196case 2:19197sandbox = _context.sent;19198sandbox.create(data);1919919200case 4:19201case "end":19202return _context.stop();19203}19204}19205}, _callee, this);19206}));1920719208function createSandbox(_x2) {19209return _createSandbox.apply(this, arguments);19210}1921119212return createSandbox;19213}()19214}, {19215key: "dispatchEventInSandbox",19216value: function () {19217var _dispatchEventInSandbox = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee2(event) {19218var sandbox;19219return _regenerator["default"].wrap(function _callee2$(_context2) {19220while (1) {19221switch (_context2.prev = _context2.next) {19222case 0:19223_context2.next = 2;19224return this._ready;1922519226case 2:19227sandbox = _context2.sent;19228sandbox.dispatchEvent(event);1922919230case 4:19231case "end":19232return _context2.stop();19233}19234}19235}, _callee2, this);19236}));1923719238function dispatchEventInSandbox(_x3) {19239return _dispatchEventInSandbox.apply(this, arguments);19240}1924119242return dispatchEventInSandbox;19243}()19244}, {19245key: "destroySandbox",19246value: function () {19247var _destroySandbox = _asyncToGenerator( /*#__PURE__*/_regenerator["default"].mark(function _callee3() {19248var sandbox;19249return _regenerator["default"].wrap(function _callee3$(_context3) {19250while (1) {19251switch (_context3.prev = _context3.next) {19252case 0:19253_context3.next = 2;19254return this._ready;1925519256case 2:19257sandbox = _context3.sent;19258sandbox.nukeSandbox();1925919260case 4:19261case "end":19262return _context3.stop();19263}19264}19265}, _callee3, this);19266}));1926719268function destroySandbox() {19269return _destroySandbox.apply(this, arguments);19270}1927119272return destroySandbox;19273}()19274}]);1927519276return GenericScripting;19277}();1927819279exports.GenericScripting = GenericScripting;1928019281/***/ }),19282/* 46 */19283/***/ ((__unused_webpack_module, exports, __webpack_require__) => {19284192851928619287Object.defineProperty(exports, "__esModule", ({19288value: true19289}));19290exports.PDFPrintService = PDFPrintService;1929119292var _app = __webpack_require__(3);1929319294var _viewer_compatibility = __webpack_require__(2);1929519296var activeService = null;19297var overlayManager = null;1929819299function renderPage(activeServiceOnEntry, pdfDocument, pageNumber, size, printResolution, optionalContentConfigPromise) {19300var scratchCanvas = activeService.scratchCanvas;19301var PRINT_UNITS = printResolution / 72.0;19302scratchCanvas.width = Math.floor(size.width * PRINT_UNITS);19303scratchCanvas.height = Math.floor(size.height * PRINT_UNITS);19304var ctx = scratchCanvas.getContext("2d");19305ctx.save();19306ctx.fillStyle = "rgb(255, 255, 255)";19307ctx.fillRect(0, 0, scratchCanvas.width, scratchCanvas.height);19308ctx.restore();19309return pdfDocument.getPage(pageNumber).then(function (pdfPage) {19310var renderContext = {19311canvasContext: ctx,19312transform: [PRINT_UNITS, 0, 0, PRINT_UNITS, 0, 0],19313viewport: pdfPage.getViewport({19314scale: 1,19315rotation: size.rotation19316}),19317intent: "print",19318annotationStorage: pdfDocument.annotationStorage,19319optionalContentConfigPromise: optionalContentConfigPromise19320};19321return pdfPage.render(renderContext).promise;19322});19323}1932419325function PDFPrintService(pdfDocument, pagesOverview, printContainer, printResolution) {19326var optionalContentConfigPromise = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : null;19327var l10n = arguments.length > 5 ? arguments[5] : undefined;19328this.pdfDocument = pdfDocument;19329this.pagesOverview = pagesOverview;19330this.printContainer = printContainer;19331this._printResolution = printResolution || 150;19332this._optionalContentConfigPromise = optionalContentConfigPromise || pdfDocument.getOptionalContentConfig();19333this.l10n = l10n;19334this.currentPage = -1;19335this.scratchCanvas = document.createElement("canvas");19336}1933719338PDFPrintService.prototype = {19339layout: function layout() {19340this.throwIfInactive();19341var body = document.querySelector("body");19342body.setAttribute("data-pdfjsprinting", true);19343var hasEqualPageSizes = this.pagesOverview.every(function (size) {19344return size.width === this.pagesOverview[0].width && size.height === this.pagesOverview[0].height;19345}, this);1934619347if (!hasEqualPageSizes) {19348console.warn("Not all pages have the same size. The printed " + "result may be incorrect!");19349}1935019351this.pageStyleSheet = document.createElement("style");19352var pageSize = this.pagesOverview[0];19353this.pageStyleSheet.textContent = "@page { size: " + pageSize.width + "pt " + pageSize.height + "pt;}";19354body.appendChild(this.pageStyleSheet);19355},19356destroy: function destroy() {19357if (activeService !== this) {19358return;19359}1936019361this.printContainer.textContent = "";19362var body = document.querySelector("body");19363body.removeAttribute("data-pdfjsprinting");1936419365if (this.pageStyleSheet) {19366this.pageStyleSheet.remove();19367this.pageStyleSheet = null;19368}1936919370this.scratchCanvas.width = this.scratchCanvas.height = 0;19371this.scratchCanvas = null;19372activeService = null;19373ensureOverlay().then(function () {19374if (overlayManager.active !== "printServiceOverlay") {19375return;19376}1937719378overlayManager.close("printServiceOverlay");19379});19380},19381renderPages: function renderPages() {19382var _this = this;1938319384var pageCount = this.pagesOverview.length;1938519386var renderNextPage = function renderNextPage(resolve, reject) {19387_this.throwIfInactive();1938819389if (++_this.currentPage >= pageCount) {19390renderProgress(pageCount, pageCount, _this.l10n);19391resolve();19392return;19393}1939419395var index = _this.currentPage;19396renderProgress(index, pageCount, _this.l10n);19397renderPage(_this, _this.pdfDocument, index + 1, _this.pagesOverview[index], _this._printResolution, _this._optionalContentConfigPromise).then(_this.useRenderedPage.bind(_this)).then(function () {19398renderNextPage(resolve, reject);19399}, reject);19400};1940119402return new Promise(renderNextPage);19403},19404useRenderedPage: function useRenderedPage() {19405this.throwIfInactive();19406var img = document.createElement("img");19407var scratchCanvas = this.scratchCanvas;1940819409if ("toBlob" in scratchCanvas && !_viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL) {19410scratchCanvas.toBlob(function (blob) {19411img.src = URL.createObjectURL(blob);19412});19413} else {19414img.src = scratchCanvas.toDataURL();19415}1941619417var wrapper = document.createElement("div");19418wrapper.appendChild(img);19419this.printContainer.appendChild(wrapper);19420return new Promise(function (resolve, reject) {19421img.onload = resolve;19422img.onerror = reject;19423});19424},19425performPrint: function performPrint() {19426var _this2 = this;1942719428this.throwIfInactive();19429return new Promise(function (resolve) {19430setTimeout(function () {19431if (!_this2.active) {19432resolve();19433return;19434}1943519436print.call(window);19437setTimeout(resolve, 20);19438}, 0);19439});19440},1944119442get active() {19443return this === activeService;19444},1944519446throwIfInactive: function throwIfInactive() {19447if (!this.active) {19448throw new Error("This print request was cancelled or completed.");19449}19450}19451};19452var print = window.print;1945319454window.print = function () {19455if (activeService) {19456console.warn("Ignored window.print() because of a pending print job.");19457return;19458}1945919460ensureOverlay().then(function () {19461if (activeService) {19462overlayManager.open("printServiceOverlay");19463}19464});1946519466try {19467dispatchEvent("beforeprint");19468} finally {19469if (!activeService) {19470console.error("Expected print service to be initialized.");19471ensureOverlay().then(function () {19472if (overlayManager.active === "printServiceOverlay") {19473overlayManager.close("printServiceOverlay");19474}19475});19476return;19477}1947819479var activeServiceOnEntry = activeService;19480activeService.renderPages().then(function () {19481return activeServiceOnEntry.performPrint();19482})["catch"](function () {}).then(function () {19483if (activeServiceOnEntry.active) {19484abort();19485}19486});19487}19488};1948919490function dispatchEvent(eventType) {19491var event = document.createEvent("CustomEvent");19492event.initCustomEvent(eventType, false, false, "custom");19493window.dispatchEvent(event);19494}1949519496function abort() {19497if (activeService) {19498activeService.destroy();19499dispatchEvent("afterprint");19500}19501}1950219503function renderProgress(index, total, l10n) {19504var progressContainer = document.getElementById("printServiceOverlay");19505var progress = Math.round(100 * index / total);19506var progressBar = progressContainer.querySelector("progress");19507var progressPerc = progressContainer.querySelector(".relative-progress");19508progressBar.value = progress;19509l10n.get("print_progress_percent", {19510progress: progress19511}).then(function (msg) {19512progressPerc.textContent = msg;19513});19514}1951519516window.addEventListener("keydown", function (event) {19517if (event.keyCode === 80 && (event.ctrlKey || event.metaKey) && !event.altKey && (!event.shiftKey || window.chrome || window.opera)) {19518window.print();19519event.preventDefault();1952019521if (event.stopImmediatePropagation) {19522event.stopImmediatePropagation();19523} else {19524event.stopPropagation();19525}19526}19527}, true);1952819529if ("onbeforeprint" in window) {19530var stopPropagationIfNeeded = function stopPropagationIfNeeded(event) {19531if (event.detail !== "custom" && event.stopImmediatePropagation) {19532event.stopImmediatePropagation();19533}19534};1953519536window.addEventListener("beforeprint", stopPropagationIfNeeded);19537window.addEventListener("afterprint", stopPropagationIfNeeded);19538}1953919540var overlayPromise;1954119542function ensureOverlay() {19543if (!overlayPromise) {19544overlayManager = _app.PDFViewerApplication.overlayManager;1954519546if (!overlayManager) {19547throw new Error("The overlay manager has not yet been initialized.");19548}1954919550overlayPromise = overlayManager.register("printServiceOverlay", document.getElementById("printServiceOverlay"), abort, true);19551document.getElementById("printCancel").onclick = abort;19552}1955319554return overlayPromise;19555}1955619557_app.PDFPrintServiceFactory.instance = {19558supportsPrinting: true,19559createPrintService: function createPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise, l10n) {19560if (activeService) {19561throw new Error("The print service is created and active.");19562}1956319564activeService = new PDFPrintService(pdfDocument, pagesOverview, printContainer, printResolution, optionalContentConfigPromise, l10n);19565return activeService;19566}19567};1956819569/***/ })19570/******/ ]);19571/************************************************************************/19572/******/ // The module cache19573/******/ var __webpack_module_cache__ = {};19574/******/19575/******/ // The require function19576/******/ function __webpack_require__(moduleId) {19577/******/ // Check if module is in cache19578/******/ var cachedModule = __webpack_module_cache__[moduleId];19579/******/ if (cachedModule !== undefined) {19580/******/ return cachedModule.exports;19581/******/ }19582/******/ // Create a new module (and put it into the cache)19583/******/ var module = __webpack_module_cache__[moduleId] = {19584/******/ id: moduleId,19585/******/ loaded: false,19586/******/ exports: {}19587/******/ };19588/******/19589/******/ // Execute the module function19590/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);19591/******/19592/******/ // Flag the module as loaded19593/******/ module.loaded = true;19594/******/19595/******/ // Return the exports of the module19596/******/ return module.exports;19597/******/ }19598/******/19599/************************************************************************/19600/******/ /* webpack/runtime/node module decorator */19601/******/ (() => {19602/******/ __webpack_require__.nmd = (module) => {19603/******/ module.paths = [];19604/******/ if (!module.children) module.children = [];19605/******/ return module;19606/******/ };19607/******/ })();19608/******/19609/************************************************************************/19610var __webpack_exports__ = {};19611// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.19612(() => {19613var exports = __webpack_exports__;196141961519616Object.defineProperty(exports, "__esModule", ({19617value: true19618}));19619Object.defineProperty(exports, "PDFViewerApplicationOptions", ({19620enumerable: true,19621get: function get() {19622return _app_options.AppOptions;19623}19624}));19625Object.defineProperty(exports, "PDFViewerApplication", ({19626enumerable: true,19627get: function get() {19628return _app.PDFViewerApplication;19629}19630}));1963119632var _app_options = __webpack_require__(1);1963319634var _app = __webpack_require__(3);1963519636var pdfjsVersion = '2.8.335';19637var pdfjsBuild = '228adbf67';19638window.PDFViewerApplication = _app.PDFViewerApplication;19639window.PDFViewerApplicationOptions = _app_options.AppOptions;19640;19641;19642{19643__webpack_require__(40);19644}19645;19646{19647__webpack_require__(46);19648}1964919650function getViewerConfiguration() {19651var errorWrapper = null;19652errorWrapper = {19653container: document.getElementById("errorWrapper"),19654errorMessage: document.getElementById("errorMessage"),19655closeButton: document.getElementById("errorClose"),19656errorMoreInfo: document.getElementById("errorMoreInfo"),19657moreInfoButton: document.getElementById("errorShowMore"),19658lessInfoButton: document.getElementById("errorShowLess")19659};19660return {19661appContainer: document.body,19662mainContainer: document.getElementById("viewerContainer"),19663viewerContainer: document.getElementById("viewer"),19664eventBus: null,19665toolbar: {19666container: document.getElementById("toolbarViewer"),19667numPages: document.getElementById("numPages"),19668pageNumber: document.getElementById("pageNumber"),19669scaleSelectContainer: document.getElementById("scaleSelectContainer"),19670scaleSelect: document.getElementById("scaleSelect"),19671customScaleOption: document.getElementById("customScaleOption"),19672previous: document.getElementById("previous"),19673next: document.getElementById("next"),19674zoomIn: document.getElementById("zoomIn"),19675zoomOut: document.getElementById("zoomOut"),19676viewFind: document.getElementById("viewFind"),19677openFile: document.getElementById("openFile"),19678print: document.getElementById("print"),19679presentationModeButton: document.getElementById("presentationMode"),19680download: document.getElementById("download"),19681viewBookmark: document.getElementById("viewBookmark")19682},19683secondaryToolbar: {19684toolbar: document.getElementById("secondaryToolbar"),19685toggleButton: document.getElementById("secondaryToolbarToggle"),19686toolbarButtonContainer: document.getElementById("secondaryToolbarButtonContainer"),19687presentationModeButton: document.getElementById("secondaryPresentationMode"),19688openFileButton: document.getElementById("secondaryOpenFile"),19689printButton: document.getElementById("secondaryPrint"),19690downloadButton: document.getElementById("secondaryDownload"),19691viewBookmarkButton: document.getElementById("secondaryViewBookmark"),19692firstPageButton: document.getElementById("firstPage"),19693lastPageButton: document.getElementById("lastPage"),19694pageRotateCwButton: document.getElementById("pageRotateCw"),19695pageRotateCcwButton: document.getElementById("pageRotateCcw"),19696cursorSelectToolButton: document.getElementById("cursorSelectTool"),19697cursorHandToolButton: document.getElementById("cursorHandTool"),19698scrollVerticalButton: document.getElementById("scrollVertical"),19699scrollHorizontalButton: document.getElementById("scrollHorizontal"),19700scrollWrappedButton: document.getElementById("scrollWrapped"),19701spreadNoneButton: document.getElementById("spreadNone"),19702spreadOddButton: document.getElementById("spreadOdd"),19703spreadEvenButton: document.getElementById("spreadEven"),19704documentPropertiesButton: document.getElementById("documentProperties")19705},19706sidebar: {19707outerContainer: document.getElementById("outerContainer"),19708viewerContainer: document.getElementById("viewerContainer"),19709toggleButton: document.getElementById("sidebarToggle"),19710thumbnailButton: document.getElementById("viewThumbnail"),19711outlineButton: document.getElementById("viewOutline"),19712attachmentsButton: document.getElementById("viewAttachments"),19713layersButton: document.getElementById("viewLayers"),19714thumbnailView: document.getElementById("thumbnailView"),19715outlineView: document.getElementById("outlineView"),19716attachmentsView: document.getElementById("attachmentsView"),19717layersView: document.getElementById("layersView"),19718outlineOptionsContainer: document.getElementById("outlineOptionsContainer"),19719currentOutlineItemButton: document.getElementById("currentOutlineItem")19720},19721sidebarResizer: {19722outerContainer: document.getElementById("outerContainer"),19723resizer: document.getElementById("sidebarResizer")19724},19725findBar: {19726bar: document.getElementById("findbar"),19727toggleButton: document.getElementById("viewFind"),19728findField: document.getElementById("findInput"),19729highlightAllCheckbox: document.getElementById("findHighlightAll"),19730caseSensitiveCheckbox: document.getElementById("findMatchCase"),19731entireWordCheckbox: document.getElementById("findEntireWord"),19732findMsg: document.getElementById("findMsg"),19733findResultsCount: document.getElementById("findResultsCount"),19734findPreviousButton: document.getElementById("findPrevious"),19735findNextButton: document.getElementById("findNext")19736},19737passwordOverlay: {19738overlayName: "passwordOverlay",19739container: document.getElementById("passwordOverlay"),19740label: document.getElementById("passwordText"),19741input: document.getElementById("password"),19742submitButton: document.getElementById("passwordSubmit"),19743cancelButton: document.getElementById("passwordCancel")19744},19745documentProperties: {19746overlayName: "documentPropertiesOverlay",19747container: document.getElementById("documentPropertiesOverlay"),19748closeButton: document.getElementById("documentPropertiesClose"),19749fields: {19750fileName: document.getElementById("fileNameField"),19751fileSize: document.getElementById("fileSizeField"),19752title: document.getElementById("titleField"),19753author: document.getElementById("authorField"),19754subject: document.getElementById("subjectField"),19755keywords: document.getElementById("keywordsField"),19756creationDate: document.getElementById("creationDateField"),19757modificationDate: document.getElementById("modificationDateField"),19758creator: document.getElementById("creatorField"),19759producer: document.getElementById("producerField"),19760version: document.getElementById("versionField"),19761pageCount: document.getElementById("pageCountField"),19762pageSize: document.getElementById("pageSizeField"),19763linearized: document.getElementById("linearizedField")19764}19765},19766errorWrapper: errorWrapper,19767printContainer: document.getElementById("printContainer"),19768openFileInputName: "fileInput",19769debuggerScriptPath: "./debugger.js"19770};19771}1977219773function webViewerLoad() {19774var config = getViewerConfiguration();19775var event = document.createEvent("CustomEvent");19776event.initCustomEvent("webviewerloaded", true, true, {19777source: window19778});1977919780try {19781parent.document.dispatchEvent(event);19782} catch (ex) {19783console.error("webviewerloaded: ".concat(ex));19784document.dispatchEvent(event);19785}1978619787_app.PDFViewerApplication.run(config);19788}1978919790if (document.blockUnblockOnload) {19791document.blockUnblockOnload(true);19792}1979319794if (document.readyState === "interactive" || document.readyState === "complete") {19795webViewerLoad();19796} else {19797document.addEventListener("DOMContentLoaded", webViewerLoad, true);19798}19799})();1980019801/******/ })()19802;19803//# sourceMappingURL=viewer.js.map1980419805