pdfjs-dist 2.4.456 → 2.5.207

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pdfjs-dist might be problematic. Click here for more details.

Files changed (101) hide show
  1. package/bower.json +1 -1
  2. package/build/pdf.js +4447 -4379
  3. package/build/pdf.js.map +1 -1
  4. package/build/pdf.min.js +1 -1
  5. package/build/pdf.worker.js +8549 -8507
  6. package/build/pdf.worker.js.map +1 -1
  7. package/build/pdf.worker.min.js +1 -1
  8. package/es5/build/pdf.js +14755 -14540
  9. package/es5/build/pdf.js.map +1 -1
  10. package/es5/build/pdf.worker.js +9830 -9469
  11. package/es5/build/pdf.worker.js.map +1 -1
  12. package/es5/web/pdf_viewer.css +5 -9
  13. package/es5/web/pdf_viewer.js +157 -172
  14. package/es5/web/pdf_viewer.js.map +1 -1
  15. package/image_decoders/pdf.image_decoders.js +107 -93
  16. package/image_decoders/pdf.image_decoders.js.map +1 -1
  17. package/image_decoders/pdf.image_decoders.min.js +1 -1
  18. package/lib/README.md +2 -2
  19. package/lib/core/ccitt.js +7 -7
  20. package/lib/core/cff_parser.js +1 -1
  21. package/lib/core/chunked_stream.js +5 -5
  22. package/lib/core/cmap.js +13 -0
  23. package/lib/core/document.js +22 -18
  24. package/lib/core/evaluator.js +285 -247
  25. package/lib/core/font_renderer.js +7 -7
  26. package/lib/core/fonts.js +163 -147
  27. package/lib/core/function.js +4 -5
  28. package/lib/core/glyphlist.js +4523 -4523
  29. package/lib/core/image.js +19 -44
  30. package/lib/core/image_utils.js +123 -47
  31. package/lib/core/jpeg_stream.js +2 -116
  32. package/lib/core/jpg.js +47 -55
  33. package/lib/core/jpx.js +6 -6
  34. package/lib/core/metrics.js +2916 -2916
  35. package/lib/core/obj.js +18 -7
  36. package/lib/core/operator_list.js +5 -0
  37. package/lib/core/parser.js +1 -1
  38. package/lib/core/pdf_manager.js +2 -2
  39. package/lib/core/primitives.js +4 -0
  40. package/lib/core/standard_fonts.js +103 -103
  41. package/lib/core/type1_parser.js +6 -6
  42. package/lib/core/worker.js +31 -24
  43. package/lib/core/worker_stream.js +1 -1
  44. package/lib/display/annotation_layer.js +3 -0
  45. package/lib/display/api.js +29 -137
  46. package/lib/display/api_compatibility.js +11 -18
  47. package/lib/display/canvas.js +7 -34
  48. package/lib/display/content_disposition.js +4 -4
  49. package/lib/display/display_utils.js +6 -15
  50. package/lib/display/fetch_stream.js +3 -1
  51. package/lib/display/font_loader.js +2 -2
  52. package/lib/display/network.js +1 -1
  53. package/lib/display/node_stream.js +10 -8
  54. package/lib/display/pattern_helper.js +1 -1
  55. package/lib/display/svg.js +61 -31
  56. package/lib/display/text_layer.js +44 -32
  57. package/lib/display/transport_stream.js +3 -3
  58. package/lib/pdf.js +210 -48
  59. package/lib/pdf.worker.js +12 -4
  60. package/lib/shared/compatibility.js +2 -0
  61. package/lib/shared/is_node.js +1 -1
  62. package/lib/shared/message_handler.js +6 -6
  63. package/lib/shared/util.js +15 -9
  64. package/lib/test/unit/api_spec.js +165 -95
  65. package/lib/test/unit/cff_parser_spec.js +12 -12
  66. package/lib/test/unit/clitests_helper.js +1 -1
  67. package/lib/test/unit/display_svg_spec.js +1 -5
  68. package/lib/test/unit/jasmine-boot.js +2 -2
  69. package/lib/test/unit/node_stream_spec.js +5 -3
  70. package/lib/test/unit/parser_spec.js +3 -3
  71. package/lib/test/unit/test_utils.js +1 -1
  72. package/lib/test/unit/testreporter.js +4 -4
  73. package/lib/test/unit/ui_utils_spec.js +1 -55
  74. package/lib/test/unit/unicode_spec.js +1 -1
  75. package/lib/web/app.js +247 -159
  76. package/lib/web/app_options.js +16 -10
  77. package/lib/web/base_viewer.js +14 -6
  78. package/lib/web/download_manager.js +3 -1
  79. package/lib/web/firefox_print_service.js +1 -1
  80. package/lib/web/firefoxcom.js +16 -4
  81. package/lib/web/pdf_attachment_viewer.js +14 -7
  82. package/lib/web/pdf_document_properties.js +11 -16
  83. package/lib/web/pdf_find_bar.js +3 -3
  84. package/lib/web/pdf_find_controller.js +3 -3
  85. package/lib/web/pdf_history.js +7 -5
  86. package/lib/web/pdf_link_service.js +7 -8
  87. package/lib/web/pdf_page_view.js +1 -1
  88. package/lib/web/pdf_presentation_mode.js +6 -2
  89. package/lib/web/pdf_print_service.js +1 -1
  90. package/lib/web/pdf_single_page_viewer.js +2 -2
  91. package/lib/web/pdf_viewer.component.js +2 -2
  92. package/lib/web/pdf_viewer.js +2 -2
  93. package/lib/web/preferences.js +4 -1
  94. package/lib/web/text_layer_builder.js +1 -3
  95. package/lib/web/ui_utils.js +3 -55
  96. package/lib/web/view_history.js +8 -9
  97. package/lib/web/viewer_compatibility.js +14 -1
  98. package/package.json +1 -1
  99. package/web/pdf_viewer.css +5 -9
  100. package/web/pdf_viewer.js +97 -127
  101. package/web/pdf_viewer.js.map +1 -1
@@ -233,20 +233,20 @@ var _pdf_link_service = __w_pdfjs_require__(7);
233
233
 
234
234
  var _download_manager = __w_pdfjs_require__(9);
235
235
 
236
- var _genericl10n = __w_pdfjs_require__(10);
236
+ var _genericl10n = __w_pdfjs_require__(11);
237
237
 
238
- var _pdf_find_controller = __w_pdfjs_require__(12);
238
+ var _pdf_find_controller = __w_pdfjs_require__(13);
239
239
 
240
- var _pdf_history = __w_pdfjs_require__(14);
240
+ var _pdf_history = __w_pdfjs_require__(15);
241
241
 
242
- var _pdf_page_view = __w_pdfjs_require__(15);
242
+ var _pdf_page_view = __w_pdfjs_require__(16);
243
243
 
244
244
  var _pdf_single_page_viewer = __w_pdfjs_require__(18);
245
245
 
246
246
  var _pdf_viewer = __w_pdfjs_require__(20);
247
247
 
248
- var pdfjsVersion = '2.4.456';
249
- var pdfjsBuild = '228a591c';
248
+ var pdfjsVersion = '2.5.207';
249
+ var pdfjsBuild = '0974d605';
250
250
 
251
251
  /***/ }),
252
252
  /* 1 */
@@ -423,7 +423,6 @@ exports.isValidRotation = isValidRotation;
423
423
  exports.isValidScrollMode = isValidScrollMode;
424
424
  exports.isValidSpreadMode = isValidSpreadMode;
425
425
  exports.isPortraitOrientation = isPortraitOrientation;
426
- exports.getGlobalEventBus = getGlobalEventBus;
427
426
  exports.clamp = clamp;
428
427
  exports.getPDFFileNameFromURL = getPDFFileNameFromURL;
429
428
  exports.noContextMenuHandler = noContextMenuHandler;
@@ -454,11 +453,15 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
454
453
 
455
454
  function _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); }
456
455
 
457
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
456
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
458
457
 
459
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
458
+ function _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."); }
460
459
 
461
- function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { 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; }
460
+ function _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); }
461
+
462
+ function _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; }
463
+
464
+ function _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; }
462
465
 
463
466
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
464
467
 
@@ -704,7 +707,7 @@ function binarySearchFirstItem(items, condition) {
704
707
  var minIndex = 0;
705
708
  var maxIndex = items.length - 1;
706
709
 
707
- if (items.length === 0 || !condition(items[maxIndex])) {
710
+ if (maxIndex < 0 || !condition(items[maxIndex])) {
708
711
  return items.length;
709
712
  }
710
713
 
@@ -1044,45 +1047,14 @@ exports.animationStarted = animationStarted;
1044
1047
 
1045
1048
  function dispatchDOMEvent(eventName) {
1046
1049
  var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1047
- var details = Object.create(null);
1048
-
1049
- if (args && args.length > 0) {
1050
- var obj = args[0];
1051
-
1052
- for (var key in obj) {
1053
- var value = obj[key];
1054
-
1055
- if (key === "source") {
1056
- if (value === window || value === document) {
1057
- return;
1058
- }
1059
-
1060
- continue;
1061
- }
1062
-
1063
- details[key] = value;
1064
- }
1065
- }
1066
-
1067
- var event = document.createEvent("CustomEvent");
1068
- event.initCustomEvent(eventName, true, true, details);
1069
- document.dispatchEvent(event);
1050
+ throw new Error("Not implemented: dispatchDOMEvent");
1070
1051
  }
1071
1052
 
1072
1053
  var EventBus = /*#__PURE__*/function () {
1073
- function EventBus() {
1074
- var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1075
- _ref3$dispatchToDOM = _ref3.dispatchToDOM,
1076
- dispatchToDOM = _ref3$dispatchToDOM === void 0 ? false : _ref3$dispatchToDOM;
1077
-
1054
+ function EventBus(options) {
1078
1055
  _classCallCheck(this, EventBus);
1079
1056
 
1080
1057
  this._listeners = Object.create(null);
1081
- this._dispatchToDOM = dispatchToDOM === true;
1082
-
1083
- if (dispatchToDOM) {
1084
- console.error("The `eventBusDispatchToDOM` option/preference is deprecated, " + "add event listeners to the EventBus instance rather than the DOM.");
1085
- }
1086
1058
  }
1087
1059
 
1088
1060
  _createClass(EventBus, [{
@@ -1105,20 +1077,14 @@ var EventBus = /*#__PURE__*/function () {
1105
1077
  var eventListeners = this._listeners[eventName];
1106
1078
 
1107
1079
  if (!eventListeners || eventListeners.length === 0) {
1108
- if (this._dispatchToDOM) {
1109
- var _args5 = Array.prototype.slice.call(arguments, 1);
1110
-
1111
- dispatchDOMEvent(eventName, _args5);
1112
- }
1113
-
1114
1080
  return;
1115
1081
  }
1116
1082
 
1117
1083
  var args = Array.prototype.slice.call(arguments, 1);
1118
1084
  var externalListeners;
1119
- eventListeners.slice(0).forEach(function (_ref4) {
1120
- var listener = _ref4.listener,
1121
- external = _ref4.external;
1085
+ eventListeners.slice(0).forEach(function (_ref3) {
1086
+ var listener = _ref3.listener,
1087
+ external = _ref3.external;
1122
1088
 
1123
1089
  if (external) {
1124
1090
  if (!externalListeners) {
@@ -1138,10 +1104,6 @@ var EventBus = /*#__PURE__*/function () {
1138
1104
  });
1139
1105
  externalListeners = null;
1140
1106
  }
1141
-
1142
- if (this._dispatchToDOM) {
1143
- dispatchDOMEvent(eventName, args);
1144
- }
1145
1107
  }
1146
1108
  }, {
1147
1109
  key: "_on",
@@ -1181,20 +1143,6 @@ var EventBus = /*#__PURE__*/function () {
1181
1143
  }();
1182
1144
 
1183
1145
  exports.EventBus = EventBus;
1184
- var globalEventBus = null;
1185
-
1186
- function getGlobalEventBus() {
1187
- var dispatchToDOM = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
1188
- console.error("getGlobalEventBus is deprecated, use a manually created EventBus instance instead.");
1189
-
1190
- if (!globalEventBus) {
1191
- globalEventBus = new EventBus({
1192
- dispatchToDOM: dispatchToDOM
1193
- });
1194
- }
1195
-
1196
- return globalEventBus;
1197
- }
1198
1146
 
1199
1147
  function clamp(v, min, max) {
1200
1148
  return Math.min(Math.max(v, min), max);
@@ -1202,10 +1150,10 @@ function clamp(v, min, max) {
1202
1150
 
1203
1151
  var ProgressBar = /*#__PURE__*/function () {
1204
1152
  function ProgressBar(id) {
1205
- var _ref5 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
1206
- height = _ref5.height,
1207
- width = _ref5.width,
1208
- units = _ref5.units;
1153
+ var _ref4 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
1154
+ height = _ref4.height,
1155
+ width = _ref4.width,
1156
+ units = _ref4.units;
1209
1157
 
1210
1158
  _classCallCheck(this, ProgressBar);
1211
1159
 
@@ -1964,7 +1912,7 @@ var PDFLinkService = /*#__PURE__*/function () {
1964
1912
 
1965
1913
  _classCallCheck(this, PDFLinkService);
1966
1914
 
1967
- this.eventBus = eventBus || (0, _ui_utils.getGlobalEventBus)();
1915
+ this.eventBus = eventBus;
1968
1916
  this.externalLinkTarget = externalLinkTarget;
1969
1917
  this.externalLinkRel = externalLinkRel;
1970
1918
  this.externalLinkEnabled = externalLinkEnabled;
@@ -2106,16 +2054,11 @@ var PDFLinkService = /*#__PURE__*/function () {
2106
2054
  if ("search" in params) {
2107
2055
  this.eventBus.dispatch("findfromurlhash", {
2108
2056
  source: this,
2109
- query: params["search"].replace(/"/g, ""),
2110
- phraseSearch: params["phrase"] === "true"
2057
+ query: params.search.replace(/"/g, ""),
2058
+ phraseSearch: params.phrase === "true"
2111
2059
  });
2112
2060
  }
2113
2061
 
2114
- if ("nameddest" in params) {
2115
- this.navigateTo(params.nameddest);
2116
- return;
2117
- }
2118
-
2119
2062
  if ("page" in params) {
2120
2063
  pageNumber = params.page | 0 || 1;
2121
2064
  }
@@ -2168,6 +2111,10 @@ var PDFLinkService = /*#__PURE__*/function () {
2168
2111
  mode: params.pagemode
2169
2112
  });
2170
2113
  }
2114
+
2115
+ if ("nameddest" in params) {
2116
+ this.navigateTo(params.nameddest);
2117
+ }
2171
2118
  } else {
2172
2119
  dest = unescape(hash);
2173
2120
 
@@ -2428,8 +2375,6 @@ Object.defineProperty(exports, "__esModule", {
2428
2375
  });
2429
2376
  exports.DefaultTextLayerFactory = exports.TextLayerBuilder = void 0;
2430
2377
 
2431
- var _ui_utils = __w_pdfjs_require__(3);
2432
-
2433
2378
  var _pdfjsLib = __w_pdfjs_require__(2);
2434
2379
 
2435
2380
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
@@ -2454,7 +2399,7 @@ var TextLayerBuilder = /*#__PURE__*/function () {
2454
2399
  _classCallCheck(this, TextLayerBuilder);
2455
2400
 
2456
2401
  this.textLayerDiv = textLayerDiv;
2457
- this.eventBus = eventBus || (0, _ui_utils.getGlobalEventBus)();
2402
+ this.eventBus = eventBus;
2458
2403
  this.textContent = null;
2459
2404
  this.textContentItemsStr = [];
2460
2405
  this.textContentStream = null;
@@ -2848,6 +2793,8 @@ exports.DownloadManager = void 0;
2848
2793
 
2849
2794
  var _pdfjsLib = __w_pdfjs_require__(2);
2850
2795
 
2796
+ var _viewer_compatibility = __w_pdfjs_require__(10);
2797
+
2851
2798
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2852
2799
 
2853
2800
  function _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); } }
@@ -2855,7 +2802,7 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
2855
2802
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
2856
2803
 
2857
2804
  ;
2858
- var DISABLE_CREATE_OBJECT_URL = _pdfjsLib.apiCompatibilityParams.disableCreateObjectURL || false;
2805
+ var DISABLE_CREATE_OBJECT_URL = _viewer_compatibility.viewerCompatibilityParams.disableCreateObjectURL || false;
2859
2806
 
2860
2807
  function _download(blobUrl, filename) {
2861
2808
  var a = document.createElement("a");
@@ -2943,6 +2890,42 @@ exports.DownloadManager = DownloadManager;
2943
2890
  "use strict";
2944
2891
 
2945
2892
 
2893
+ Object.defineProperty(exports, "__esModule", {
2894
+ value: true
2895
+ });
2896
+ exports.viewerCompatibilityParams = void 0;
2897
+ var compatibilityParams = Object.create(null);
2898
+ {
2899
+ var userAgent = typeof navigator !== "undefined" && navigator.userAgent || "";
2900
+ var platform = typeof navigator !== "undefined" && navigator.platform || "";
2901
+ var maxTouchPoints = typeof navigator !== "undefined" && navigator.maxTouchPoints || 1;
2902
+ var isAndroid = /Android/.test(userAgent);
2903
+ var isIE = /Trident/.test(userAgent);
2904
+ var isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) || platform === "MacIntel" && maxTouchPoints > 1;
2905
+ var isIOSChrome = /CriOS/.test(userAgent);
2906
+
2907
+ (function checkOnBlobSupport() {
2908
+ if (isIE || isIOSChrome) {
2909
+ compatibilityParams.disableCreateObjectURL = true;
2910
+ }
2911
+ })();
2912
+
2913
+ (function checkCanvasSizeLimitation() {
2914
+ if (isIOS || isAndroid) {
2915
+ compatibilityParams.maxCanvasPixels = 5242880;
2916
+ }
2917
+ })();
2918
+ }
2919
+ var viewerCompatibilityParams = Object.freeze(compatibilityParams);
2920
+ exports.viewerCompatibilityParams = viewerCompatibilityParams;
2921
+
2922
+ /***/ }),
2923
+ /* 11 */
2924
+ /***/ (function(module, exports, __w_pdfjs_require__) {
2925
+
2926
+ "use strict";
2927
+
2928
+
2946
2929
  Object.defineProperty(exports, "__esModule", {
2947
2930
  value: true
2948
2931
  });
@@ -2950,7 +2933,7 @@ exports.GenericL10n = void 0;
2950
2933
 
2951
2934
  var _regenerator = _interopRequireDefault(__w_pdfjs_require__(4));
2952
2935
 
2953
- __w_pdfjs_require__(11);
2936
+ __w_pdfjs_require__(12);
2954
2937
 
2955
2938
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
2956
2939
 
@@ -3106,7 +3089,7 @@ var GenericL10n = /*#__PURE__*/function () {
3106
3089
  exports.GenericL10n = GenericL10n;
3107
3090
 
3108
3091
  /***/ }),
3109
- /* 11 */
3092
+ /* 12 */
3110
3093
  /***/ (function(module, exports, __w_pdfjs_require__) {
3111
3094
 
3112
3095
  "use strict";
@@ -3929,7 +3912,7 @@ document.webL10n = function (window, document, undefined) {
3929
3912
  }(window, document);
3930
3913
 
3931
3914
  /***/ }),
3932
- /* 12 */
3915
+ /* 13 */
3933
3916
  /***/ (function(module, exports, __w_pdfjs_require__) {
3934
3917
 
3935
3918
  "use strict";
@@ -3940,11 +3923,11 @@ Object.defineProperty(exports, "__esModule", {
3940
3923
  });
3941
3924
  exports.PDFFindController = exports.FindState = void 0;
3942
3925
 
3943
- var _ui_utils = __w_pdfjs_require__(3);
3944
-
3945
3926
  var _pdfjsLib = __w_pdfjs_require__(2);
3946
3927
 
3947
- var _pdf_find_utils = __w_pdfjs_require__(13);
3928
+ var _pdf_find_utils = __w_pdfjs_require__(14);
3929
+
3930
+ var _ui_utils = __w_pdfjs_require__(3);
3948
3931
 
3949
3932
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
3950
3933
 
@@ -3996,7 +3979,7 @@ var PDFFindController = /*#__PURE__*/function () {
3996
3979
  _classCallCheck(this, PDFFindController);
3997
3980
 
3998
3981
  this._linkService = linkService;
3999
- this._eventBus = eventBus || (0, _ui_utils.getGlobalEventBus)();
3982
+ this._eventBus = eventBus;
4000
3983
 
4001
3984
  this._reset();
4002
3985
 
@@ -4664,7 +4647,7 @@ var PDFFindController = /*#__PURE__*/function () {
4664
4647
  exports.PDFFindController = PDFFindController;
4665
4648
 
4666
4649
  /***/ }),
4667
- /* 13 */
4650
+ /* 14 */
4668
4651
  /***/ (function(module, exports, __w_pdfjs_require__) {
4669
4652
 
4670
4653
  "use strict";
@@ -4760,7 +4743,7 @@ function getCharacterType(charCode) {
4760
4743
  }
4761
4744
 
4762
4745
  /***/ }),
4763
- /* 14 */
4746
+ /* 15 */
4764
4747
  /***/ (function(module, exports, __w_pdfjs_require__) {
4765
4748
 
4766
4749
  "use strict";
@@ -4777,11 +4760,15 @@ var _ui_utils = __w_pdfjs_require__(3);
4777
4760
 
4778
4761
  function _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); }
4779
4762
 
4780
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest(); }
4763
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
4764
+
4765
+ function _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."); }
4781
4766
 
4782
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
4767
+ function _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); }
4783
4768
 
4784
- function _iterableToArrayLimit(arr, i) { if (!(Symbol.iterator in Object(arr) || Object.prototype.toString.call(arr) === "[object Arguments]")) { 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; }
4769
+ function _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; }
4770
+
4771
+ function _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; }
4785
4772
 
4786
4773
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
4787
4774
 
@@ -4809,7 +4796,7 @@ var PDFHistory = /*#__PURE__*/function () {
4809
4796
  _classCallCheck(this, PDFHistory);
4810
4797
 
4811
4798
  this.linkService = linkService;
4812
- this.eventBus = eventBus || (0, _ui_utils.getGlobalEventBus)();
4799
+ this.eventBus = eventBus;
4813
4800
  this._initialized = false;
4814
4801
  this._fingerprint = "";
4815
4802
  this.reset();
@@ -4868,7 +4855,7 @@ var PDFHistory = /*#__PURE__*/function () {
4868
4855
  this._position = null;
4869
4856
 
4870
4857
  if (!this._isValidState(state, true) || resetHistory) {
4871
- var _this$_parseCurrentHa = this._parseCurrentHash(),
4858
+ var _this$_parseCurrentHa = this._parseCurrentHash(true),
4872
4859
  hash = _this$_parseCurrentHa.hash,
4873
4860
  page = _this$_parseCurrentHa.page,
4874
4861
  rotation = _this$_parseCurrentHa.rotation;
@@ -5160,10 +5147,13 @@ var PDFHistory = /*#__PURE__*/function () {
5160
5147
  }, {
5161
5148
  key: "_parseCurrentHash",
5162
5149
  value: function _parseCurrentHash() {
5150
+ var checkNameddest = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
5163
5151
  var hash = unescape(getCurrentHash()).substring(1);
5164
- var page = (0, _ui_utils.parseQueryString)(hash).page | 0;
5152
+ var params = (0, _ui_utils.parseQueryString)(hash);
5153
+ var nameddest = params.nameddest || "";
5154
+ var page = params.page | 0;
5165
5155
 
5166
- if (!(Number.isInteger(page) && page > 0 && page <= this.linkService.pagesCount)) {
5156
+ if (!(Number.isInteger(page) && page > 0 && page <= this.linkService.pagesCount) || checkNameddest && nameddest.length > 0) {
5167
5157
  page = null;
5168
5158
  }
5169
5159
 
@@ -5402,7 +5392,7 @@ function isDestArraysEqual(firstDest, secondDest) {
5402
5392
  }
5403
5393
 
5404
5394
  /***/ }),
5405
- /* 15 */
5395
+ /* 16 */
5406
5396
  /***/ (function(module, exports, __w_pdfjs_require__) {
5407
5397
 
5408
5398
  "use strict";
@@ -5419,9 +5409,9 @@ var _ui_utils = __w_pdfjs_require__(3);
5419
5409
 
5420
5410
  var _pdfjsLib = __w_pdfjs_require__(2);
5421
5411
 
5422
- var _pdf_rendering_queue = __w_pdfjs_require__(16);
5412
+ var _pdf_rendering_queue = __w_pdfjs_require__(17);
5423
5413
 
5424
- var _viewer_compatibility = __w_pdfjs_require__(17);
5414
+ var _viewer_compatibility = __w_pdfjs_require__(10);
5425
5415
 
5426
5416
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
5427
5417
 
@@ -5457,7 +5447,7 @@ var PDFPageView = /*#__PURE__*/function () {
5457
5447
  this.renderInteractiveForms = options.renderInteractiveForms || false;
5458
5448
  this.useOnlyCssZoom = options.useOnlyCssZoom || false;
5459
5449
  this.maxCanvasPixels = options.maxCanvasPixels || MAX_CANVAS_PIXELS;
5460
- this.eventBus = options.eventBus || (0, _ui_utils.getGlobalEventBus)();
5450
+ this.eventBus = options.eventBus;
5461
5451
  this.renderingQueue = options.renderingQueue;
5462
5452
  this.textLayerFactory = options.textLayerFactory;
5463
5453
  this.annotationLayerFactory = options.annotationLayerFactory;
@@ -6063,7 +6053,7 @@ var PDFPageView = /*#__PURE__*/function () {
6063
6053
  exports.PDFPageView = PDFPageView;
6064
6054
 
6065
6055
  /***/ }),
6066
- /* 16 */
6056
+ /* 17 */
6067
6057
  /***/ (function(module, exports, __w_pdfjs_require__) {
6068
6058
 
6069
6059
  "use strict";
@@ -6219,29 +6209,6 @@ var PDFRenderingQueue = /*#__PURE__*/function () {
6219
6209
 
6220
6210
  exports.PDFRenderingQueue = PDFRenderingQueue;
6221
6211
 
6222
- /***/ }),
6223
- /* 17 */
6224
- /***/ (function(module, exports, __w_pdfjs_require__) {
6225
-
6226
- "use strict";
6227
-
6228
-
6229
- var compatibilityParams = Object.create(null);
6230
- {
6231
- var userAgent = typeof navigator !== "undefined" && navigator.userAgent || "";
6232
- var platform = typeof navigator !== "undefined" && navigator.platform || "";
6233
- var maxTouchPoints = typeof navigator !== "undefined" && navigator.maxTouchPoints || 1;
6234
- var isAndroid = /Android/.test(userAgent);
6235
- var isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) || platform === "MacIntel" && maxTouchPoints > 1;
6236
-
6237
- (function checkCanvasSizeLimitation() {
6238
- if (isIOS || isAndroid) {
6239
- compatibilityParams.maxCanvasPixels = 5242880;
6240
- }
6241
- })();
6242
- }
6243
- exports.viewerCompatibilityParams = Object.freeze(compatibilityParams);
6244
-
6245
6212
  /***/ }),
6246
6213
  /* 18 */
6247
6214
  /***/ (function(module, exports, __w_pdfjs_require__) {
@@ -6266,29 +6233,35 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
6266
6233
 
6267
6234
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
6268
6235
 
6269
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
6270
-
6271
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
6272
-
6273
6236
  function _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); }
6274
6237
 
6275
6238
  function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
6276
6239
 
6277
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
6278
-
6279
6240
  function _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); }
6280
6241
 
6281
6242
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
6282
6243
 
6244
+ function _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); }; }
6245
+
6246
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
6247
+
6248
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
6249
+
6250
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
6251
+
6252
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
6253
+
6283
6254
  var PDFSinglePageViewer = /*#__PURE__*/function (_BaseViewer) {
6284
6255
  _inherits(PDFSinglePageViewer, _BaseViewer);
6285
6256
 
6257
+ var _super = _createSuper(PDFSinglePageViewer);
6258
+
6286
6259
  function PDFSinglePageViewer(options) {
6287
6260
  var _this;
6288
6261
 
6289
6262
  _classCallCheck(this, PDFSinglePageViewer);
6290
6263
 
6291
- _this = _possibleConstructorReturn(this, _getPrototypeOf(PDFSinglePageViewer).call(this, options));
6264
+ _this = _super.call(this, options);
6292
6265
 
6293
6266
  _this.eventBus._on("pagesinit", function (evt) {
6294
6267
  _this._ensurePageViewVisible();
@@ -6395,9 +6368,9 @@ var PDFSinglePageViewer = /*#__PURE__*/function (_BaseViewer) {
6395
6368
  key: "_updateSpreadMode",
6396
6369
  value: function _updateSpreadMode() {}
6397
6370
  }, {
6398
- key: "_setDocumentViewerElement",
6371
+ key: "_viewerElement",
6399
6372
  get: function get() {
6400
- return (0, _pdfjsLib.shadow)(this, "_setDocumentViewerElement", this._shadowViewer);
6373
+ return (0, _pdfjsLib.shadow)(this, "_viewerElement", this._shadowViewer);
6401
6374
  }
6402
6375
  }, {
6403
6376
  key: "_isScrollModeHorizontal",
@@ -6425,13 +6398,13 @@ exports.BaseViewer = void 0;
6425
6398
 
6426
6399
  var _ui_utils = __w_pdfjs_require__(3);
6427
6400
 
6428
- var _pdf_rendering_queue = __w_pdfjs_require__(16);
6401
+ var _pdf_rendering_queue = __w_pdfjs_require__(17);
6429
6402
 
6430
6403
  var _annotation_layer_builder = __w_pdfjs_require__(1);
6431
6404
 
6432
6405
  var _pdfjsLib = __w_pdfjs_require__(2);
6433
6406
 
6434
- var _pdf_page_view = __w_pdfjs_require__(15);
6407
+ var _pdf_page_view = __w_pdfjs_require__(16);
6435
6408
 
6436
6409
  var _pdf_link_service = __w_pdfjs_require__(7);
6437
6410
 
@@ -6508,7 +6481,7 @@ var BaseViewer = /*#__PURE__*/function () {
6508
6481
  this._name = this.constructor.name;
6509
6482
  this.container = options.container;
6510
6483
  this.viewer = options.viewer || options.container.firstElementChild;
6511
- this.eventBus = options.eventBus || (0, _ui_utils.getGlobalEventBus)();
6484
+ this.eventBus = options.eventBus;
6512
6485
  this.linkService = options.linkService || new _pdf_link_service.SimpleLinkService();
6513
6486
  this.downloadManager = options.downloadManager || null;
6514
6487
  this.findController = options.findController || null;
@@ -6583,6 +6556,15 @@ var BaseViewer = /*#__PURE__*/function () {
6583
6556
 
6584
6557
  return true;
6585
6558
  }
6559
+ }, {
6560
+ key: "_onePageRenderedOrForceFetch",
6561
+ value: function _onePageRenderedOrForceFetch() {
6562
+ if (!this.container.offsetParent || this._getVisiblePages().views.length === 0) {
6563
+ return Promise.resolve();
6564
+ }
6565
+
6566
+ return this._onePageRenderedCapability.promise;
6567
+ }
6586
6568
  }, {
6587
6569
  key: "setDocument",
6588
6570
  value: function setDocument(pdfDocument) {
@@ -6651,7 +6633,7 @@ var BaseViewer = /*#__PURE__*/function () {
6651
6633
 
6652
6634
  for (var pageNum = 1; pageNum <= pagesCount; ++pageNum) {
6653
6635
  var pageView = new _pdf_page_view.PDFPageView({
6654
- container: _this2._setDocumentViewerElement,
6636
+ container: _this2._viewerElement,
6655
6637
  eventBus: _this2.eventBus,
6656
6638
  id: pageNum,
6657
6639
  scale: scale,
@@ -6684,12 +6666,12 @@ var BaseViewer = /*#__PURE__*/function () {
6684
6666
  _this2._updateSpreadMode();
6685
6667
  }
6686
6668
 
6687
- _this2._onePageRenderedCapability.promise.then(function () {
6669
+ _this2._onePageRenderedOrForceFetch().then(function () {
6688
6670
  if (_this2.findController) {
6689
6671
  _this2.findController.setDocument(pdfDocument);
6690
6672
  }
6691
6673
 
6692
- if (pdfDocument.loadingParams["disableAutoFetch"] || pagesCount > 7500) {
6674
+ if (pdfDocument.loadingParams.disableAutoFetch || pagesCount > 7500) {
6693
6675
  _this2._pagesCapability.resolve();
6694
6676
 
6695
6677
  return;
@@ -7511,9 +7493,9 @@ var BaseViewer = /*#__PURE__*/function () {
7511
7493
  return this.pdfDocument ? this._pagesCapability.promise : null;
7512
7494
  }
7513
7495
  }, {
7514
- key: "_setDocumentViewerElement",
7496
+ key: "_viewerElement",
7515
7497
  get: function get() {
7516
- throw new Error("Not implemented: _setDocumentViewerElement");
7498
+ throw new Error("Not implemented: _viewerElement");
7517
7499
  }
7518
7500
  }, {
7519
7501
  key: "_isScrollModeHorizontal",
@@ -7624,33 +7606,45 @@ var _pdfjsLib = __w_pdfjs_require__(2);
7624
7606
 
7625
7607
  function _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); }
7626
7608
 
7609
+ function _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; } } }; }
7610
+
7611
+ function _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); }
7612
+
7613
+ function _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; }
7614
+
7627
7615
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
7628
7616
 
7629
7617
  function _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); } }
7630
7618
 
7631
7619
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
7632
7620
 
7633
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
7634
-
7635
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
7636
-
7637
7621
  function _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); }
7638
7622
 
7639
7623
  function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
7640
7624
 
7641
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
7642
-
7643
7625
  function _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); }
7644
7626
 
7645
7627
  function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
7646
7628
 
7629
+ function _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); }; }
7630
+
7631
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
7632
+
7633
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
7634
+
7635
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
7636
+
7637
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
7638
+
7647
7639
  var PDFViewer = /*#__PURE__*/function (_BaseViewer) {
7648
7640
  _inherits(PDFViewer, _BaseViewer);
7649
7641
 
7642
+ var _super = _createSuper(PDFViewer);
7643
+
7650
7644
  function PDFViewer() {
7651
7645
  _classCallCheck(this, PDFViewer);
7652
7646
 
7653
- return _possibleConstructorReturn(this, _getPrototypeOf(PDFViewer).apply(this, arguments));
7647
+ return _super.apply(this, arguments);
7654
7648
  }
7655
7649
 
7656
7650
  _createClass(PDFViewer, [{
@@ -7701,12 +7695,12 @@ var PDFViewer = /*#__PURE__*/function (_BaseViewer) {
7701
7695
 
7702
7696
  var currentId = this._currentPageNumber;
7703
7697
  var stillFullyVisible = false;
7704
- var _iteratorNormalCompletion = true;
7705
- var _didIteratorError = false;
7706
- var _iteratorError = undefined;
7698
+
7699
+ var _iterator = _createForOfIteratorHelper(visiblePages),
7700
+ _step;
7707
7701
 
7708
7702
  try {
7709
- for (var _iterator = visiblePages[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
7703
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
7710
7704
  var page = _step.value;
7711
7705
 
7712
7706
  if (page.percent < 100) {
@@ -7719,18 +7713,9 @@ var PDFViewer = /*#__PURE__*/function (_BaseViewer) {
7719
7713
  }
7720
7714
  }
7721
7715
  } catch (err) {
7722
- _didIteratorError = true;
7723
- _iteratorError = err;
7716
+ _iterator.e(err);
7724
7717
  } finally {
7725
- try {
7726
- if (!_iteratorNormalCompletion && _iterator["return"] != null) {
7727
- _iterator["return"]();
7728
- }
7729
- } finally {
7730
- if (_didIteratorError) {
7731
- throw _iteratorError;
7732
- }
7733
- }
7718
+ _iterator.f();
7734
7719
  }
7735
7720
 
7736
7721
  if (!stillFullyVisible) {
@@ -7740,9 +7725,9 @@ var PDFViewer = /*#__PURE__*/function (_BaseViewer) {
7740
7725
  this._setCurrentPageNumber(currentId);
7741
7726
  }
7742
7727
  }, {
7743
- key: "_setDocumentViewerElement",
7728
+ key: "_viewerElement",
7744
7729
  get: function get() {
7745
- return (0, _pdfjsLib.shadow)(this, "_setDocumentViewerElement", this.viewer);
7730
+ return (0, _pdfjsLib.shadow)(this, "_viewerElement", this.viewer);
7746
7731
  }
7747
7732
  }]);
7748
7733