pdfjs-dist 2.1.266 → 2.2.228

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 (166) hide show
  1. package/CODE_OF_CONDUCT.md +15 -0
  2. package/bower.json +1 -1
  3. package/build/pdf.js +3349 -2324
  4. package/build/pdf.js.map +1 -1
  5. package/build/pdf.min.js +1 -1
  6. package/build/pdf.worker.js +2804 -1975
  7. package/build/pdf.worker.js.map +1 -1
  8. package/build/pdf.worker.min.js +1 -1
  9. package/image_decoders/pdf.image_decoders.js +431 -511
  10. package/image_decoders/pdf.image_decoders.js.map +1 -1
  11. package/image_decoders/pdf.image_decoders.min.js +1 -1
  12. package/lib/core/annotation.js +294 -224
  13. package/lib/core/arithmetic_decoder.js +1 -1
  14. package/lib/core/bidi.js +1 -1
  15. package/lib/core/ccitt.js +1 -1
  16. package/lib/core/ccitt_stream.js +1 -1
  17. package/lib/core/cff_parser.js +61 -12
  18. package/lib/core/charsets.js +1 -1
  19. package/lib/core/chunked_stream.js +24 -14
  20. package/lib/core/cmap.js +17 -13
  21. package/lib/core/colorspace.js +1 -1
  22. package/lib/core/core_utils.js +147 -0
  23. package/lib/core/crypto.js +1 -1
  24. package/lib/core/document.js +47 -40
  25. package/lib/core/encodings.js +1 -1
  26. package/lib/core/evaluator.js +346 -279
  27. package/lib/core/font_renderer.js +1 -1
  28. package/lib/core/fonts.js +23 -11
  29. package/lib/core/function.js +1 -1
  30. package/lib/core/glyphlist.js +2 -2
  31. package/lib/core/image.js +2 -2
  32. package/lib/core/image_utils.js +111 -0
  33. package/lib/core/jbig2.js +1 -1
  34. package/lib/core/jbig2_stream.js +1 -1
  35. package/lib/core/jpeg_stream.js +1 -1
  36. package/lib/core/jpg.js +2 -1
  37. package/lib/core/jpx.js +1 -1
  38. package/lib/core/jpx_stream.js +1 -1
  39. package/lib/core/metrics.js +13 -13
  40. package/lib/core/murmurhash3.js +37 -33
  41. package/lib/core/obj.js +245 -41
  42. package/lib/core/operator_list.js +43 -32
  43. package/lib/core/parser.js +228 -133
  44. package/lib/core/pattern.js +4 -2
  45. package/lib/core/pdf_manager.js +17 -15
  46. package/lib/core/primitives.js +40 -6
  47. package/lib/core/ps_parser.js +1 -1
  48. package/lib/core/standard_fonts.js +9 -9
  49. package/lib/core/stream.js +1 -1
  50. package/lib/core/type1_parser.js +1 -1
  51. package/lib/core/unicode.js +2 -2
  52. package/lib/core/worker.js +54 -171
  53. package/lib/core/worker_stream.js +277 -0
  54. package/lib/display/annotation_layer.js +112 -33
  55. package/lib/display/api.js +211 -123
  56. package/lib/display/api_compatibility.js +1 -1
  57. package/lib/display/canvas.js +40 -19
  58. package/lib/display/content_disposition.js +1 -1
  59. package/lib/display/display_utils.js +747 -0
  60. package/lib/display/fetch_stream.js +19 -12
  61. package/lib/display/font_loader.js +11 -8
  62. package/lib/display/metadata.js +1 -1
  63. package/lib/display/network.js +563 -521
  64. package/lib/display/network_utils.js +1 -1
  65. package/lib/display/node_stream.js +21 -12
  66. package/lib/display/pattern_helper.js +24 -25
  67. package/lib/display/svg.js +1068 -565
  68. package/lib/display/text_layer.js +24 -14
  69. package/lib/display/transport_stream.js +192 -70
  70. package/lib/display/webgl.js +1 -1
  71. package/lib/display/worker_options.js +1 -1
  72. package/lib/display/xml_parser.js +1 -1
  73. package/lib/examples/node/domstubs.js +4 -1
  74. package/lib/pdf.js +20 -15
  75. package/lib/pdf.worker.js +3 -3
  76. package/lib/shared/compatibility.js +6 -6
  77. package/lib/shared/global_scope.js +1 -1
  78. package/lib/shared/is_node.js +2 -2
  79. package/lib/shared/message_handler.js +7 -7
  80. package/lib/shared/streams_polyfill.js +1 -1
  81. package/lib/shared/url_polyfill.js +1 -1
  82. package/lib/shared/util.js +13 -125
  83. package/lib/test/unit/annotation_spec.js +278 -93
  84. package/lib/test/unit/api_spec.js +198 -188
  85. package/lib/test/unit/bidi_spec.js +1 -1
  86. package/lib/test/unit/cff_parser_spec.js +15 -1
  87. package/lib/test/unit/clitests_helper.js +3 -3
  88. package/lib/test/unit/cmap_spec.js +20 -20
  89. package/lib/test/unit/colorspace_spec.js +17 -12
  90. package/lib/test/unit/core_utils_spec.js +191 -0
  91. package/lib/test/unit/crypto_spec.js +1 -1
  92. package/lib/test/unit/custom_spec.js +8 -8
  93. package/lib/test/unit/display_svg_spec.js +8 -8
  94. package/lib/test/unit/display_utils_spec.js +273 -0
  95. package/lib/test/unit/document_spec.js +7 -12
  96. package/lib/test/unit/encodings_spec.js +5 -5
  97. package/lib/test/unit/evaluator_spec.js +8 -10
  98. package/lib/test/unit/fetch_stream_spec.js +109 -0
  99. package/lib/test/unit/function_spec.js +1 -1
  100. package/lib/test/unit/jasmine-boot.js +4 -4
  101. package/lib/test/unit/message_handler_spec.js +1 -1
  102. package/lib/test/unit/metadata_spec.js +1 -1
  103. package/lib/test/unit/murmurhash3_spec.js +1 -1
  104. package/lib/test/unit/network_spec.js +5 -55
  105. package/lib/test/unit/network_utils_spec.js +51 -1
  106. package/lib/test/unit/node_stream_spec.js +8 -8
  107. package/lib/test/unit/parser_spec.js +150 -86
  108. package/lib/test/unit/pdf_find_controller_spec.js +1 -1
  109. package/lib/test/unit/pdf_find_utils_spec.js +1 -1
  110. package/lib/test/unit/pdf_history_spec.js +1 -1
  111. package/lib/test/unit/primitives_spec.js +30 -17
  112. package/lib/test/unit/stream_spec.js +1 -1
  113. package/lib/test/unit/test_utils.js +197 -43
  114. package/lib/test/unit/testreporter.js +1 -1
  115. package/lib/test/unit/type1_parser_spec.js +1 -1
  116. package/lib/test/unit/ui_utils_spec.js +20 -20
  117. package/lib/test/unit/unicode_spec.js +5 -5
  118. package/lib/test/unit/util_spec.js +1 -164
  119. package/lib/web/annotation_layer_builder.js +1 -1
  120. package/lib/web/app.js +104 -60
  121. package/lib/web/app_options.js +45 -37
  122. package/lib/web/base_viewer.js +7 -7
  123. package/lib/web/chromecom.js +8 -8
  124. package/lib/web/debugger.js +7 -7
  125. package/lib/web/download_manager.js +3 -2
  126. package/lib/web/firefox_print_service.js +4 -2
  127. package/lib/web/firefoxcom.js +50 -19
  128. package/lib/web/genericcom.js +8 -8
  129. package/lib/web/genericl10n.js +10 -10
  130. package/lib/web/grab_to_pan.js +3 -1
  131. package/lib/web/interfaces.js +13 -13
  132. package/lib/web/overlay_manager.js +10 -10
  133. package/lib/web/password_prompt.js +2 -2
  134. package/lib/web/pdf_attachment_viewer.js +1 -1
  135. package/lib/web/pdf_cursor_tools.js +1 -1
  136. package/lib/web/pdf_document_properties.js +188 -119
  137. package/lib/web/pdf_find_bar.js +1 -1
  138. package/lib/web/pdf_find_controller.js +3 -3
  139. package/lib/web/pdf_find_utils.js +1 -1
  140. package/lib/web/pdf_history.js +1 -1
  141. package/lib/web/pdf_link_service.js +2 -2
  142. package/lib/web/pdf_outline_viewer.js +53 -28
  143. package/lib/web/pdf_page_view.js +9 -18
  144. package/lib/web/pdf_presentation_mode.js +1 -1
  145. package/lib/web/pdf_print_service.js +5 -3
  146. package/lib/web/pdf_rendering_queue.js +4 -7
  147. package/lib/web/pdf_sidebar.js +24 -17
  148. package/lib/web/pdf_sidebar_resizer.js +1 -1
  149. package/lib/web/pdf_single_page_viewer.js +1 -1
  150. package/lib/web/pdf_thumbnail_view.js +2 -2
  151. package/lib/web/pdf_thumbnail_viewer.js +3 -3
  152. package/lib/web/pdf_viewer.component.js +3 -3
  153. package/lib/web/pdf_viewer.js +3 -3
  154. package/lib/web/preferences.js +30 -30
  155. package/lib/web/secondary_toolbar.js +1 -1
  156. package/lib/web/text_layer_builder.js +23 -45
  157. package/lib/web/toolbar.js +1 -1
  158. package/lib/web/ui_utils.js +14 -14
  159. package/lib/web/view_history.js +15 -15
  160. package/lib/web/viewer_compatibility.js +1 -1
  161. package/package.json +1 -1
  162. package/web/pdf_viewer.css +21 -10
  163. package/web/pdf_viewer.js +126 -194
  164. package/web/pdf_viewer.js.map +1 -1
  165. package/lib/display/dom_utils.js +0 -494
  166. package/lib/test/unit/dom_utils_spec.js +0 -89
@@ -2,7 +2,7 @@
2
2
  * @licstart The following is the entire license notice for the
3
3
  * Javascript code in this page
4
4
  *
5
- * Copyright 2018 Mozilla Foundation
5
+ * Copyright 2019 Mozilla Foundation
6
6
  *
7
7
  * Licensed under the Apache License, Version 2.0 (the "License");
8
8
  * you may not use this file except in compliance with the License.
@@ -24,7 +24,7 @@
24
24
  Object.defineProperty(exports, "__esModule", {
25
25
  value: true
26
26
  });
27
- exports.AnnotationFactory = exports.AnnotationBorderStyle = exports.Annotation = void 0;
27
+ exports.MarkupAnnotation = exports.AnnotationFactory = exports.AnnotationBorderStyle = exports.Annotation = void 0;
28
28
 
29
29
  var _util = require("../shared/util");
30
30
 
@@ -34,20 +34,22 @@ var _primitives = require("./primitives");
34
34
 
35
35
  var _colorspace = require("./colorspace");
36
36
 
37
+ var _core_utils = require("./core_utils");
38
+
37
39
  var _operator_list = require("./operator_list");
38
40
 
39
41
  var _stream = require("./stream");
40
42
 
43
+ 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); }
44
+
45
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
46
+
41
47
  function _typeof(obj) { 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); }
42
48
 
43
49
  function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
44
50
 
45
51
  function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
46
52
 
47
- 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); }
48
-
49
- function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
50
-
51
53
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
52
54
 
53
55
  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); }
@@ -78,16 +80,15 @@ function () {
78
80
  var dict = xref.fetchIfRef(ref);
79
81
 
80
82
  if (!(0, _primitives.isDict)(dict)) {
81
- return;
83
+ return undefined;
82
84
  }
83
85
 
84
- var id = (0, _primitives.isRef)(ref) ? ref.toString() : 'annot_' + idFactory.createObjId();
86
+ var id = (0, _primitives.isRef)(ref) ? ref.toString() : "annot_".concat(idFactory.createObjId());
85
87
  var subtype = dict.get('Subtype');
86
88
  subtype = (0, _primitives.isName)(subtype) ? subtype.name : null;
87
89
  var parameters = {
88
90
  xref: xref,
89
91
  dict: dict,
90
- ref: (0, _primitives.isRef)(ref) ? ref : null,
91
92
  subtype: subtype,
92
93
  id: id,
93
94
  pdfManager: pdfManager
@@ -101,7 +102,7 @@ function () {
101
102
  return new TextAnnotation(parameters);
102
103
 
103
104
  case 'Widget':
104
- var fieldType = (0, _util.getInheritableProperty)({
105
+ var fieldType = (0, _core_utils.getInheritableProperty)({
105
106
  dict: dict,
106
107
  key: 'FT'
107
108
  });
@@ -124,6 +125,9 @@ function () {
124
125
  case 'Popup':
125
126
  return new PopupAnnotation(parameters);
126
127
 
128
+ case 'FreeText':
129
+ return new FreeTextAnnotation(parameters);
130
+
127
131
  case 'Line':
128
132
  return new LineAnnotation(parameters);
129
133
 
@@ -139,6 +143,9 @@ function () {
139
143
  case 'Polygon':
140
144
  return new PolygonAnnotation(parameters);
141
145
 
146
+ case 'Caret':
147
+ return new CaretAnnotation(parameters);
148
+
142
149
  case 'Ink':
143
150
  return new InkAnnotation(parameters);
144
151
 
@@ -201,6 +208,8 @@ function () {
201
208
  _classCallCheck(this, Annotation);
202
209
 
203
210
  var dict = params.dict;
211
+ this.setContents(dict.get('Contents'));
212
+ this.setModificationDate(dict.get('M'));
204
213
  this.setFlags(dict.get('F'));
205
214
  this.setRectangle(dict.getArray('Rect'));
206
215
  this.setColor(dict.getArray('C'));
@@ -210,8 +219,10 @@ function () {
210
219
  annotationFlags: this.flags,
211
220
  borderStyle: this.borderStyle,
212
221
  color: this.color,
222
+ contents: this.contents,
213
223
  hasAppearance: !!this.appearance,
214
224
  id: params.id,
225
+ modificationDate: this.modificationDate,
215
226
  rect: this.rectangle,
216
227
  subtype: params.subtype
217
228
  };
@@ -232,6 +243,16 @@ function () {
232
243
  value: function _isPrintable(flags) {
233
244
  return this._hasFlag(flags, _util.AnnotationFlag.PRINT) && !this._hasFlag(flags, _util.AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, _util.AnnotationFlag.HIDDEN);
234
245
  }
246
+ }, {
247
+ key: "setContents",
248
+ value: function setContents(contents) {
249
+ this.contents = (0, _util.stringToPDFString)(contents || '');
250
+ }
251
+ }, {
252
+ key: "setModificationDate",
253
+ value: function setModificationDate(modificationDate) {
254
+ this.modificationDate = (0, _util.isString)(modificationDate) ? modificationDate : null;
255
+ }
235
256
  }, {
236
257
  key: "setFlags",
237
258
  value: function setFlags(flags) {
@@ -303,7 +324,7 @@ function () {
303
324
  var dictType = dict.get('Type');
304
325
 
305
326
  if (!dictType || (0, _primitives.isName)(dictType, 'Border')) {
306
- this.borderStyle.setWidth(dict.get('W'));
327
+ this.borderStyle.setWidth(dict.get('W'), this.rectangle);
307
328
  this.borderStyle.setStyle(dict.get('S'));
308
329
  this.borderStyle.setDashArray(dict.getArray('D'));
309
330
  }
@@ -313,7 +334,7 @@ function () {
313
334
  if (Array.isArray(array) && array.length >= 3) {
314
335
  this.borderStyle.setHorizontalCornerRadius(array[0]);
315
336
  this.borderStyle.setVerticalCornerRadius(array[1]);
316
- this.borderStyle.setWidth(array[2]);
337
+ this.borderStyle.setWidth(array[2], this.rectangle);
317
338
 
318
339
  if (array.length === 4) {
319
340
  this.borderStyle.setDashArray(array[3]);
@@ -352,23 +373,12 @@ function () {
352
373
 
353
374
  this.appearance = normalAppearanceState.get(as.name);
354
375
  }
355
- }, {
356
- key: "_preparePopup",
357
- value: function _preparePopup(dict) {
358
- if (!dict.has('C')) {
359
- this.data.color = null;
360
- }
361
-
362
- this.data.hasPopup = dict.has('Popup');
363
- this.data.title = (0, _util.stringToPDFString)(dict.get('T') || '');
364
- this.data.contents = (0, _util.stringToPDFString)(dict.get('Contents') || '');
365
- }
366
376
  }, {
367
377
  key: "loadResources",
368
378
  value: function loadResources(keys) {
369
379
  return this.appearance.dict.getAsync('Resources').then(function (resources) {
370
380
  if (!resources) {
371
- return;
381
+ return undefined;
372
382
  }
373
383
 
374
384
  var objectLoader = new _obj.ObjectLoader(resources, keys, resources.xref);
@@ -450,12 +460,24 @@ function () {
450
460
  _createClass(AnnotationBorderStyle, [{
451
461
  key: "setWidth",
452
462
  value: function setWidth(width) {
463
+ var rect = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0, 0];
464
+
453
465
  if ((0, _primitives.isName)(width)) {
454
466
  this.width = 0;
455
467
  return;
456
468
  }
457
469
 
458
470
  if (Number.isInteger(width)) {
471
+ if (width > 0) {
472
+ var maxWidth = (rect[2] - rect[0]) / 2;
473
+ var maxHeight = (rect[3] - rect[1]) / 2;
474
+
475
+ if (maxWidth > 0 && maxHeight > 0 && (width > maxWidth || width > maxHeight)) {
476
+ (0, _util.warn)("AnnotationBorderStyle.setWidth - ignoring width: ".concat(width));
477
+ width = 1;
478
+ }
479
+ }
480
+
459
481
  this.width = width;
460
482
  }
461
483
  }
@@ -540,41 +562,78 @@ function () {
540
562
 
541
563
  exports.AnnotationBorderStyle = AnnotationBorderStyle;
542
564
 
543
- var WidgetAnnotation =
565
+ var MarkupAnnotation =
544
566
  /*#__PURE__*/
545
567
  function (_Annotation) {
546
- _inherits(WidgetAnnotation, _Annotation);
568
+ _inherits(MarkupAnnotation, _Annotation);
547
569
 
548
- function WidgetAnnotation(params) {
570
+ function MarkupAnnotation(parameters) {
549
571
  var _this2;
550
572
 
573
+ _classCallCheck(this, MarkupAnnotation);
574
+
575
+ _this2 = _possibleConstructorReturn(this, _getPrototypeOf(MarkupAnnotation).call(this, parameters));
576
+ var dict = parameters.dict;
577
+
578
+ if (!dict.has('C')) {
579
+ _this2.data.color = null;
580
+ }
581
+
582
+ _this2.setCreationDate(dict.get('CreationDate'));
583
+
584
+ _this2.data.creationDate = _this2.creationDate;
585
+ _this2.data.hasPopup = dict.has('Popup');
586
+ _this2.data.title = (0, _util.stringToPDFString)(dict.get('T') || '');
587
+ return _this2;
588
+ }
589
+
590
+ _createClass(MarkupAnnotation, [{
591
+ key: "setCreationDate",
592
+ value: function setCreationDate(creationDate) {
593
+ this.creationDate = (0, _util.isString)(creationDate) ? creationDate : null;
594
+ }
595
+ }]);
596
+
597
+ return MarkupAnnotation;
598
+ }(Annotation);
599
+
600
+ exports.MarkupAnnotation = MarkupAnnotation;
601
+
602
+ var WidgetAnnotation =
603
+ /*#__PURE__*/
604
+ function (_Annotation2) {
605
+ _inherits(WidgetAnnotation, _Annotation2);
606
+
607
+ function WidgetAnnotation(params) {
608
+ var _this3;
609
+
551
610
  _classCallCheck(this, WidgetAnnotation);
552
611
 
553
- _this2 = _possibleConstructorReturn(this, _getPrototypeOf(WidgetAnnotation).call(this, params));
612
+ _this3 = _possibleConstructorReturn(this, _getPrototypeOf(WidgetAnnotation).call(this, params));
554
613
  var dict = params.dict;
555
- var data = _this2.data;
614
+ var data = _this3.data;
556
615
  data.annotationType = _util.AnnotationType.WIDGET;
557
- data.fieldName = _this2._constructFieldName(dict);
558
- data.fieldValue = (0, _util.getInheritableProperty)({
616
+ data.fieldName = _this3._constructFieldName(dict);
617
+ data.fieldValue = (0, _core_utils.getInheritableProperty)({
559
618
  dict: dict,
560
619
  key: 'V',
561
620
  getArray: true
562
621
  });
563
622
  data.alternativeText = (0, _util.stringToPDFString)(dict.get('TU') || '');
564
- data.defaultAppearance = (0, _util.getInheritableProperty)({
623
+ data.defaultAppearance = (0, _core_utils.getInheritableProperty)({
565
624
  dict: dict,
566
625
  key: 'DA'
567
626
  }) || '';
568
- var fieldType = (0, _util.getInheritableProperty)({
627
+ var fieldType = (0, _core_utils.getInheritableProperty)({
569
628
  dict: dict,
570
629
  key: 'FT'
571
630
  });
572
631
  data.fieldType = (0, _primitives.isName)(fieldType) ? fieldType.name : null;
573
- _this2.fieldResources = (0, _util.getInheritableProperty)({
632
+ _this3.fieldResources = (0, _core_utils.getInheritableProperty)({
574
633
  dict: dict,
575
634
  key: 'DR'
576
635
  }) || _primitives.Dict.empty;
577
- data.fieldFlags = (0, _util.getInheritableProperty)({
636
+ data.fieldFlags = (0, _core_utils.getInheritableProperty)({
578
637
  dict: dict,
579
638
  key: 'Ff'
580
639
  });
@@ -583,15 +642,15 @@ function (_Annotation) {
583
642
  data.fieldFlags = 0;
584
643
  }
585
644
 
586
- data.readOnly = _this2.hasFieldFlag(_util.AnnotationFieldFlag.READONLY);
645
+ data.readOnly = _this3.hasFieldFlag(_util.AnnotationFieldFlag.READONLY);
587
646
 
588
647
  if (data.fieldType === 'Sig') {
589
648
  data.fieldValue = null;
590
649
 
591
- _this2.setFlags(_util.AnnotationFlag.HIDDEN);
650
+ _this3.setFlags(_util.AnnotationFlag.HIDDEN);
592
651
  }
593
652
 
594
- return _this2;
653
+ return _this3;
595
654
  }
596
655
 
597
656
  _createClass(WidgetAnnotation, [{
@@ -653,14 +712,14 @@ function (_WidgetAnnotation) {
653
712
  _inherits(TextWidgetAnnotation, _WidgetAnnotation);
654
713
 
655
714
  function TextWidgetAnnotation(params) {
656
- var _this3;
715
+ var _this4;
657
716
 
658
717
  _classCallCheck(this, TextWidgetAnnotation);
659
718
 
660
- _this3 = _possibleConstructorReturn(this, _getPrototypeOf(TextWidgetAnnotation).call(this, params));
719
+ _this4 = _possibleConstructorReturn(this, _getPrototypeOf(TextWidgetAnnotation).call(this, params));
661
720
  var dict = params.dict;
662
- _this3.data.fieldValue = (0, _util.stringToPDFString)(_this3.data.fieldValue || '');
663
- var alignment = (0, _util.getInheritableProperty)({
721
+ _this4.data.fieldValue = (0, _util.stringToPDFString)(_this4.data.fieldValue || '');
722
+ var alignment = (0, _core_utils.getInheritableProperty)({
664
723
  dict: dict,
665
724
  key: 'Q'
666
725
  });
@@ -669,8 +728,8 @@ function (_WidgetAnnotation) {
669
728
  alignment = null;
670
729
  }
671
730
 
672
- _this3.data.textAlignment = alignment;
673
- var maximumLength = (0, _util.getInheritableProperty)({
731
+ _this4.data.textAlignment = alignment;
732
+ var maximumLength = (0, _core_utils.getInheritableProperty)({
674
733
  dict: dict,
675
734
  key: 'MaxLen'
676
735
  });
@@ -679,10 +738,10 @@ function (_WidgetAnnotation) {
679
738
  maximumLength = null;
680
739
  }
681
740
 
682
- _this3.data.maxLen = maximumLength;
683
- _this3.data.multiLine = _this3.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE);
684
- _this3.data.comb = _this3.hasFieldFlag(_util.AnnotationFieldFlag.COMB) && !_this3.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE) && !_this3.hasFieldFlag(_util.AnnotationFieldFlag.PASSWORD) && !_this3.hasFieldFlag(_util.AnnotationFieldFlag.FILESELECT) && _this3.data.maxLen !== null;
685
- return _this3;
741
+ _this4.data.maxLen = maximumLength;
742
+ _this4.data.multiLine = _this4.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE);
743
+ _this4.data.comb = _this4.hasFieldFlag(_util.AnnotationFieldFlag.COMB) && !_this4.hasFieldFlag(_util.AnnotationFieldFlag.MULTILINE) && !_this4.hasFieldFlag(_util.AnnotationFieldFlag.PASSWORD) && !_this4.hasFieldFlag(_util.AnnotationFieldFlag.FILESELECT) && _this4.data.maxLen !== null;
744
+ return _this4;
686
745
  }
687
746
 
688
747
  _createClass(TextWidgetAnnotation, [{
@@ -719,26 +778,26 @@ function (_WidgetAnnotation2) {
719
778
  _inherits(ButtonWidgetAnnotation, _WidgetAnnotation2);
720
779
 
721
780
  function ButtonWidgetAnnotation(params) {
722
- var _this4;
781
+ var _this5;
723
782
 
724
783
  _classCallCheck(this, ButtonWidgetAnnotation);
725
784
 
726
- _this4 = _possibleConstructorReturn(this, _getPrototypeOf(ButtonWidgetAnnotation).call(this, params));
727
- _this4.data.checkBox = !_this4.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !_this4.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
728
- _this4.data.radioButton = _this4.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !_this4.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
729
- _this4.data.pushButton = _this4.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
730
-
731
- if (_this4.data.checkBox) {
732
- _this4._processCheckBox(params);
733
- } else if (_this4.data.radioButton) {
734
- _this4._processRadioButton(params);
735
- } else if (_this4.data.pushButton) {
736
- _this4._processPushButton(params);
785
+ _this5 = _possibleConstructorReturn(this, _getPrototypeOf(ButtonWidgetAnnotation).call(this, params));
786
+ _this5.data.checkBox = !_this5.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !_this5.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
787
+ _this5.data.radioButton = _this5.hasFieldFlag(_util.AnnotationFieldFlag.RADIO) && !_this5.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
788
+ _this5.data.pushButton = _this5.hasFieldFlag(_util.AnnotationFieldFlag.PUSHBUTTON);
789
+
790
+ if (_this5.data.checkBox) {
791
+ _this5._processCheckBox(params);
792
+ } else if (_this5.data.radioButton) {
793
+ _this5._processRadioButton(params);
794
+ } else if (_this5.data.pushButton) {
795
+ _this5._processPushButton(params);
737
796
  } else {
738
797
  (0, _util.warn)('Invalid field flags for button widget annotation');
739
798
  }
740
799
 
741
- return _this4;
800
+ return _this5;
742
801
  }
743
802
 
744
803
  _createClass(ButtonWidgetAnnotation, [{
@@ -829,13 +888,13 @@ function (_WidgetAnnotation3) {
829
888
  _inherits(ChoiceWidgetAnnotation, _WidgetAnnotation3);
830
889
 
831
890
  function ChoiceWidgetAnnotation(params) {
832
- var _this5;
891
+ var _this6;
833
892
 
834
893
  _classCallCheck(this, ChoiceWidgetAnnotation);
835
894
 
836
- _this5 = _possibleConstructorReturn(this, _getPrototypeOf(ChoiceWidgetAnnotation).call(this, params));
837
- _this5.data.options = [];
838
- var options = (0, _util.getInheritableProperty)({
895
+ _this6 = _possibleConstructorReturn(this, _getPrototypeOf(ChoiceWidgetAnnotation).call(this, params));
896
+ _this6.data.options = [];
897
+ var options = (0, _core_utils.getInheritableProperty)({
839
898
  dict: params.dict,
840
899
  key: 'Opt'
841
900
  });
@@ -846,20 +905,20 @@ function (_WidgetAnnotation3) {
846
905
  for (var i = 0, ii = options.length; i < ii; i++) {
847
906
  var option = xref.fetchIfRef(options[i]);
848
907
  var isOptionArray = Array.isArray(option);
849
- _this5.data.options[i] = {
908
+ _this6.data.options[i] = {
850
909
  exportValue: isOptionArray ? xref.fetchIfRef(option[0]) : option,
851
910
  displayValue: (0, _util.stringToPDFString)(isOptionArray ? xref.fetchIfRef(option[1]) : option)
852
911
  };
853
912
  }
854
913
  }
855
914
 
856
- if (!Array.isArray(_this5.data.fieldValue)) {
857
- _this5.data.fieldValue = [_this5.data.fieldValue];
915
+ if (!Array.isArray(_this6.data.fieldValue)) {
916
+ _this6.data.fieldValue = [_this6.data.fieldValue];
858
917
  }
859
918
 
860
- _this5.data.combo = _this5.hasFieldFlag(_util.AnnotationFieldFlag.COMBO);
861
- _this5.data.multiSelect = _this5.hasFieldFlag(_util.AnnotationFieldFlag.MULTISELECT);
862
- return _this5;
919
+ _this6.data.combo = _this6.hasFieldFlag(_util.AnnotationFieldFlag.COMBO);
920
+ _this6.data.multiSelect = _this6.hasFieldFlag(_util.AnnotationFieldFlag.MULTISELECT);
921
+ return _this6;
863
922
  }
864
923
 
865
924
  return ChoiceWidgetAnnotation;
@@ -867,33 +926,31 @@ function (_WidgetAnnotation3) {
867
926
 
868
927
  var TextAnnotation =
869
928
  /*#__PURE__*/
870
- function (_Annotation2) {
871
- _inherits(TextAnnotation, _Annotation2);
929
+ function (_MarkupAnnotation) {
930
+ _inherits(TextAnnotation, _MarkupAnnotation);
872
931
 
873
932
  function TextAnnotation(parameters) {
874
- var _this6;
933
+ var _this7;
875
934
 
876
935
  _classCallCheck(this, TextAnnotation);
877
936
 
878
937
  var DEFAULT_ICON_SIZE = 22;
879
- _this6 = _possibleConstructorReturn(this, _getPrototypeOf(TextAnnotation).call(this, parameters));
880
- _this6.data.annotationType = _util.AnnotationType.TEXT;
938
+ _this7 = _possibleConstructorReturn(this, _getPrototypeOf(TextAnnotation).call(this, parameters));
939
+ _this7.data.annotationType = _util.AnnotationType.TEXT;
881
940
 
882
- if (_this6.data.hasAppearance) {
883
- _this6.data.name = 'NoIcon';
941
+ if (_this7.data.hasAppearance) {
942
+ _this7.data.name = 'NoIcon';
884
943
  } else {
885
- _this6.data.rect[1] = _this6.data.rect[3] - DEFAULT_ICON_SIZE;
886
- _this6.data.rect[2] = _this6.data.rect[0] + DEFAULT_ICON_SIZE;
887
- _this6.data.name = parameters.dict.has('Name') ? parameters.dict.get('Name').name : 'Note';
944
+ _this7.data.rect[1] = _this7.data.rect[3] - DEFAULT_ICON_SIZE;
945
+ _this7.data.rect[2] = _this7.data.rect[0] + DEFAULT_ICON_SIZE;
946
+ _this7.data.name = parameters.dict.has('Name') ? parameters.dict.get('Name').name : 'Note';
888
947
  }
889
948
 
890
- _this6._preparePopup(parameters.dict);
891
-
892
- return _this6;
949
+ return _this7;
893
950
  }
894
951
 
895
952
  return TextAnnotation;
896
- }(Annotation);
953
+ }(MarkupAnnotation);
897
954
 
898
955
  var LinkAnnotation =
899
956
  /*#__PURE__*/
@@ -901,20 +958,20 @@ function (_Annotation3) {
901
958
  _inherits(LinkAnnotation, _Annotation3);
902
959
 
903
960
  function LinkAnnotation(params) {
904
- var _this7;
961
+ var _this8;
905
962
 
906
963
  _classCallCheck(this, LinkAnnotation);
907
964
 
908
- _this7 = _possibleConstructorReturn(this, _getPrototypeOf(LinkAnnotation).call(this, params));
909
- _this7.data.annotationType = _util.AnnotationType.LINK;
965
+ _this8 = _possibleConstructorReturn(this, _getPrototypeOf(LinkAnnotation).call(this, params));
966
+ _this8.data.annotationType = _util.AnnotationType.LINK;
910
967
 
911
968
  _obj.Catalog.parseDestDictionary({
912
969
  destDict: params.dict,
913
- resultObj: _this7.data,
970
+ resultObj: _this8.data,
914
971
  docBaseUrl: params.pdfManager.docBaseUrl
915
972
  });
916
973
 
917
- return _this7;
974
+ return _this8;
918
975
  }
919
976
 
920
977
  return LinkAnnotation;
@@ -926,143 +983,158 @@ function (_Annotation4) {
926
983
  _inherits(PopupAnnotation, _Annotation4);
927
984
 
928
985
  function PopupAnnotation(parameters) {
929
- var _this8;
986
+ var _this9;
930
987
 
931
988
  _classCallCheck(this, PopupAnnotation);
932
989
 
933
- _this8 = _possibleConstructorReturn(this, _getPrototypeOf(PopupAnnotation).call(this, parameters));
934
- _this8.data.annotationType = _util.AnnotationType.POPUP;
990
+ _this9 = _possibleConstructorReturn(this, _getPrototypeOf(PopupAnnotation).call(this, parameters));
991
+ _this9.data.annotationType = _util.AnnotationType.POPUP;
935
992
  var dict = parameters.dict;
936
993
  var parentItem = dict.get('Parent');
937
994
 
938
995
  if (!parentItem) {
939
996
  (0, _util.warn)('Popup annotation has a missing or invalid parent annotation.');
940
- return _possibleConstructorReturn(_this8);
997
+ return _possibleConstructorReturn(_this9);
941
998
  }
942
999
 
943
1000
  var parentSubtype = parentItem.get('Subtype');
944
- _this8.data.parentType = (0, _primitives.isName)(parentSubtype) ? parentSubtype.name : null;
945
- _this8.data.parentId = dict.getRaw('Parent').toString();
946
- _this8.data.title = (0, _util.stringToPDFString)(parentItem.get('T') || '');
947
- _this8.data.contents = (0, _util.stringToPDFString)(parentItem.get('Contents') || '');
1001
+ _this9.data.parentType = (0, _primitives.isName)(parentSubtype) ? parentSubtype.name : null;
1002
+ _this9.data.parentId = dict.getRaw('Parent').toString();
1003
+ _this9.data.title = (0, _util.stringToPDFString)(parentItem.get('T') || '');
1004
+ _this9.data.contents = (0, _util.stringToPDFString)(parentItem.get('Contents') || '');
1005
+
1006
+ if (!parentItem.has('M')) {
1007
+ _this9.data.modificationDate = null;
1008
+ } else {
1009
+ _this9.setModificationDate(parentItem.get('M'));
1010
+
1011
+ _this9.data.modificationDate = _this9.modificationDate;
1012
+ }
948
1013
 
949
1014
  if (!parentItem.has('C')) {
950
- _this8.data.color = null;
1015
+ _this9.data.color = null;
951
1016
  } else {
952
- _this8.setColor(parentItem.getArray('C'));
1017
+ _this9.setColor(parentItem.getArray('C'));
953
1018
 
954
- _this8.data.color = _this8.color;
1019
+ _this9.data.color = _this9.color;
955
1020
  }
956
1021
 
957
- if (!_this8.viewable) {
1022
+ if (!_this9.viewable) {
958
1023
  var parentFlags = parentItem.get('F');
959
1024
 
960
- if (_this8._isViewable(parentFlags)) {
961
- _this8.setFlags(parentFlags);
1025
+ if (_this9._isViewable(parentFlags)) {
1026
+ _this9.setFlags(parentFlags);
962
1027
  }
963
1028
  }
964
1029
 
965
- return _this8;
1030
+ return _this9;
966
1031
  }
967
1032
 
968
1033
  return PopupAnnotation;
969
1034
  }(Annotation);
970
1035
 
1036
+ var FreeTextAnnotation =
1037
+ /*#__PURE__*/
1038
+ function (_MarkupAnnotation2) {
1039
+ _inherits(FreeTextAnnotation, _MarkupAnnotation2);
1040
+
1041
+ function FreeTextAnnotation(parameters) {
1042
+ var _this10;
1043
+
1044
+ _classCallCheck(this, FreeTextAnnotation);
1045
+
1046
+ _this10 = _possibleConstructorReturn(this, _getPrototypeOf(FreeTextAnnotation).call(this, parameters));
1047
+ _this10.data.annotationType = _util.AnnotationType.FREETEXT;
1048
+ return _this10;
1049
+ }
1050
+
1051
+ return FreeTextAnnotation;
1052
+ }(MarkupAnnotation);
1053
+
971
1054
  var LineAnnotation =
972
1055
  /*#__PURE__*/
973
- function (_Annotation5) {
974
- _inherits(LineAnnotation, _Annotation5);
1056
+ function (_MarkupAnnotation3) {
1057
+ _inherits(LineAnnotation, _MarkupAnnotation3);
975
1058
 
976
1059
  function LineAnnotation(parameters) {
977
- var _this9;
1060
+ var _this11;
978
1061
 
979
1062
  _classCallCheck(this, LineAnnotation);
980
1063
 
981
- _this9 = _possibleConstructorReturn(this, _getPrototypeOf(LineAnnotation).call(this, parameters));
982
- _this9.data.annotationType = _util.AnnotationType.LINE;
1064
+ _this11 = _possibleConstructorReturn(this, _getPrototypeOf(LineAnnotation).call(this, parameters));
1065
+ _this11.data.annotationType = _util.AnnotationType.LINE;
983
1066
  var dict = parameters.dict;
984
- _this9.data.lineCoordinates = _util.Util.normalizeRect(dict.getArray('L'));
985
-
986
- _this9._preparePopup(dict);
987
-
988
- return _this9;
1067
+ _this11.data.lineCoordinates = _util.Util.normalizeRect(dict.getArray('L'));
1068
+ return _this11;
989
1069
  }
990
1070
 
991
1071
  return LineAnnotation;
992
- }(Annotation);
1072
+ }(MarkupAnnotation);
993
1073
 
994
1074
  var SquareAnnotation =
995
1075
  /*#__PURE__*/
996
- function (_Annotation6) {
997
- _inherits(SquareAnnotation, _Annotation6);
1076
+ function (_MarkupAnnotation4) {
1077
+ _inherits(SquareAnnotation, _MarkupAnnotation4);
998
1078
 
999
1079
  function SquareAnnotation(parameters) {
1000
- var _this10;
1080
+ var _this12;
1001
1081
 
1002
1082
  _classCallCheck(this, SquareAnnotation);
1003
1083
 
1004
- _this10 = _possibleConstructorReturn(this, _getPrototypeOf(SquareAnnotation).call(this, parameters));
1005
- _this10.data.annotationType = _util.AnnotationType.SQUARE;
1006
-
1007
- _this10._preparePopup(parameters.dict);
1008
-
1009
- return _this10;
1084
+ _this12 = _possibleConstructorReturn(this, _getPrototypeOf(SquareAnnotation).call(this, parameters));
1085
+ _this12.data.annotationType = _util.AnnotationType.SQUARE;
1086
+ return _this12;
1010
1087
  }
1011
1088
 
1012
1089
  return SquareAnnotation;
1013
- }(Annotation);
1090
+ }(MarkupAnnotation);
1014
1091
 
1015
1092
  var CircleAnnotation =
1016
1093
  /*#__PURE__*/
1017
- function (_Annotation7) {
1018
- _inherits(CircleAnnotation, _Annotation7);
1094
+ function (_MarkupAnnotation5) {
1095
+ _inherits(CircleAnnotation, _MarkupAnnotation5);
1019
1096
 
1020
1097
  function CircleAnnotation(parameters) {
1021
- var _this11;
1098
+ var _this13;
1022
1099
 
1023
1100
  _classCallCheck(this, CircleAnnotation);
1024
1101
 
1025
- _this11 = _possibleConstructorReturn(this, _getPrototypeOf(CircleAnnotation).call(this, parameters));
1026
- _this11.data.annotationType = _util.AnnotationType.CIRCLE;
1027
-
1028
- _this11._preparePopup(parameters.dict);
1029
-
1030
- return _this11;
1102
+ _this13 = _possibleConstructorReturn(this, _getPrototypeOf(CircleAnnotation).call(this, parameters));
1103
+ _this13.data.annotationType = _util.AnnotationType.CIRCLE;
1104
+ return _this13;
1031
1105
  }
1032
1106
 
1033
1107
  return CircleAnnotation;
1034
- }(Annotation);
1108
+ }(MarkupAnnotation);
1035
1109
 
1036
1110
  var PolylineAnnotation =
1037
1111
  /*#__PURE__*/
1038
- function (_Annotation8) {
1039
- _inherits(PolylineAnnotation, _Annotation8);
1112
+ function (_MarkupAnnotation6) {
1113
+ _inherits(PolylineAnnotation, _MarkupAnnotation6);
1040
1114
 
1041
1115
  function PolylineAnnotation(parameters) {
1042
- var _this12;
1116
+ var _this14;
1043
1117
 
1044
1118
  _classCallCheck(this, PolylineAnnotation);
1045
1119
 
1046
- _this12 = _possibleConstructorReturn(this, _getPrototypeOf(PolylineAnnotation).call(this, parameters));
1047
- _this12.data.annotationType = _util.AnnotationType.POLYLINE;
1120
+ _this14 = _possibleConstructorReturn(this, _getPrototypeOf(PolylineAnnotation).call(this, parameters));
1121
+ _this14.data.annotationType = _util.AnnotationType.POLYLINE;
1048
1122
  var dict = parameters.dict;
1049
1123
  var rawVertices = dict.getArray('Vertices');
1050
- _this12.data.vertices = [];
1124
+ _this14.data.vertices = [];
1051
1125
 
1052
1126
  for (var i = 0, ii = rawVertices.length; i < ii; i += 2) {
1053
- _this12.data.vertices.push({
1127
+ _this14.data.vertices.push({
1054
1128
  x: rawVertices[i],
1055
1129
  y: rawVertices[i + 1]
1056
1130
  });
1057
1131
  }
1058
1132
 
1059
- _this12._preparePopup(dict);
1060
-
1061
- return _this12;
1133
+ return _this14;
1062
1134
  }
1063
1135
 
1064
1136
  return PolylineAnnotation;
1065
- }(Annotation);
1137
+ }(MarkupAnnotation);
1066
1138
 
1067
1139
  var PolygonAnnotation =
1068
1140
  /*#__PURE__*/
@@ -1070,178 +1142,176 @@ function (_PolylineAnnotation) {
1070
1142
  _inherits(PolygonAnnotation, _PolylineAnnotation);
1071
1143
 
1072
1144
  function PolygonAnnotation(parameters) {
1073
- var _this13;
1145
+ var _this15;
1074
1146
 
1075
1147
  _classCallCheck(this, PolygonAnnotation);
1076
1148
 
1077
- _this13 = _possibleConstructorReturn(this, _getPrototypeOf(PolygonAnnotation).call(this, parameters));
1078
- _this13.data.annotationType = _util.AnnotationType.POLYGON;
1079
- return _this13;
1149
+ _this15 = _possibleConstructorReturn(this, _getPrototypeOf(PolygonAnnotation).call(this, parameters));
1150
+ _this15.data.annotationType = _util.AnnotationType.POLYGON;
1151
+ return _this15;
1080
1152
  }
1081
1153
 
1082
1154
  return PolygonAnnotation;
1083
1155
  }(PolylineAnnotation);
1084
1156
 
1157
+ var CaretAnnotation =
1158
+ /*#__PURE__*/
1159
+ function (_MarkupAnnotation7) {
1160
+ _inherits(CaretAnnotation, _MarkupAnnotation7);
1161
+
1162
+ function CaretAnnotation(parameters) {
1163
+ var _this16;
1164
+
1165
+ _classCallCheck(this, CaretAnnotation);
1166
+
1167
+ _this16 = _possibleConstructorReturn(this, _getPrototypeOf(CaretAnnotation).call(this, parameters));
1168
+ _this16.data.annotationType = _util.AnnotationType.CARET;
1169
+ return _this16;
1170
+ }
1171
+
1172
+ return CaretAnnotation;
1173
+ }(MarkupAnnotation);
1174
+
1085
1175
  var InkAnnotation =
1086
1176
  /*#__PURE__*/
1087
- function (_Annotation9) {
1088
- _inherits(InkAnnotation, _Annotation9);
1177
+ function (_MarkupAnnotation8) {
1178
+ _inherits(InkAnnotation, _MarkupAnnotation8);
1089
1179
 
1090
1180
  function InkAnnotation(parameters) {
1091
- var _this14;
1181
+ var _this17;
1092
1182
 
1093
1183
  _classCallCheck(this, InkAnnotation);
1094
1184
 
1095
- _this14 = _possibleConstructorReturn(this, _getPrototypeOf(InkAnnotation).call(this, parameters));
1096
- _this14.data.annotationType = _util.AnnotationType.INK;
1185
+ _this17 = _possibleConstructorReturn(this, _getPrototypeOf(InkAnnotation).call(this, parameters));
1186
+ _this17.data.annotationType = _util.AnnotationType.INK;
1097
1187
  var dict = parameters.dict;
1098
1188
  var xref = parameters.xref;
1099
1189
  var originalInkLists = dict.getArray('InkList');
1100
- _this14.data.inkLists = [];
1190
+ _this17.data.inkLists = [];
1101
1191
 
1102
1192
  for (var i = 0, ii = originalInkLists.length; i < ii; ++i) {
1103
- _this14.data.inkLists.push([]);
1193
+ _this17.data.inkLists.push([]);
1104
1194
 
1105
1195
  for (var j = 0, jj = originalInkLists[i].length; j < jj; j += 2) {
1106
- _this14.data.inkLists[i].push({
1196
+ _this17.data.inkLists[i].push({
1107
1197
  x: xref.fetchIfRef(originalInkLists[i][j]),
1108
1198
  y: xref.fetchIfRef(originalInkLists[i][j + 1])
1109
1199
  });
1110
1200
  }
1111
1201
  }
1112
1202
 
1113
- _this14._preparePopup(dict);
1114
-
1115
- return _this14;
1203
+ return _this17;
1116
1204
  }
1117
1205
 
1118
1206
  return InkAnnotation;
1119
- }(Annotation);
1207
+ }(MarkupAnnotation);
1120
1208
 
1121
1209
  var HighlightAnnotation =
1122
1210
  /*#__PURE__*/
1123
- function (_Annotation10) {
1124
- _inherits(HighlightAnnotation, _Annotation10);
1211
+ function (_MarkupAnnotation9) {
1212
+ _inherits(HighlightAnnotation, _MarkupAnnotation9);
1125
1213
 
1126
1214
  function HighlightAnnotation(parameters) {
1127
- var _this15;
1215
+ var _this18;
1128
1216
 
1129
1217
  _classCallCheck(this, HighlightAnnotation);
1130
1218
 
1131
- _this15 = _possibleConstructorReturn(this, _getPrototypeOf(HighlightAnnotation).call(this, parameters));
1132
- _this15.data.annotationType = _util.AnnotationType.HIGHLIGHT;
1133
-
1134
- _this15._preparePopup(parameters.dict);
1135
-
1136
- return _this15;
1219
+ _this18 = _possibleConstructorReturn(this, _getPrototypeOf(HighlightAnnotation).call(this, parameters));
1220
+ _this18.data.annotationType = _util.AnnotationType.HIGHLIGHT;
1221
+ return _this18;
1137
1222
  }
1138
1223
 
1139
1224
  return HighlightAnnotation;
1140
- }(Annotation);
1225
+ }(MarkupAnnotation);
1141
1226
 
1142
1227
  var UnderlineAnnotation =
1143
1228
  /*#__PURE__*/
1144
- function (_Annotation11) {
1145
- _inherits(UnderlineAnnotation, _Annotation11);
1229
+ function (_MarkupAnnotation10) {
1230
+ _inherits(UnderlineAnnotation, _MarkupAnnotation10);
1146
1231
 
1147
1232
  function UnderlineAnnotation(parameters) {
1148
- var _this16;
1233
+ var _this19;
1149
1234
 
1150
1235
  _classCallCheck(this, UnderlineAnnotation);
1151
1236
 
1152
- _this16 = _possibleConstructorReturn(this, _getPrototypeOf(UnderlineAnnotation).call(this, parameters));
1153
- _this16.data.annotationType = _util.AnnotationType.UNDERLINE;
1154
-
1155
- _this16._preparePopup(parameters.dict);
1156
-
1157
- return _this16;
1237
+ _this19 = _possibleConstructorReturn(this, _getPrototypeOf(UnderlineAnnotation).call(this, parameters));
1238
+ _this19.data.annotationType = _util.AnnotationType.UNDERLINE;
1239
+ return _this19;
1158
1240
  }
1159
1241
 
1160
1242
  return UnderlineAnnotation;
1161
- }(Annotation);
1243
+ }(MarkupAnnotation);
1162
1244
 
1163
1245
  var SquigglyAnnotation =
1164
1246
  /*#__PURE__*/
1165
- function (_Annotation12) {
1166
- _inherits(SquigglyAnnotation, _Annotation12);
1247
+ function (_MarkupAnnotation11) {
1248
+ _inherits(SquigglyAnnotation, _MarkupAnnotation11);
1167
1249
 
1168
1250
  function SquigglyAnnotation(parameters) {
1169
- var _this17;
1251
+ var _this20;
1170
1252
 
1171
1253
  _classCallCheck(this, SquigglyAnnotation);
1172
1254
 
1173
- _this17 = _possibleConstructorReturn(this, _getPrototypeOf(SquigglyAnnotation).call(this, parameters));
1174
- _this17.data.annotationType = _util.AnnotationType.SQUIGGLY;
1175
-
1176
- _this17._preparePopup(parameters.dict);
1177
-
1178
- return _this17;
1255
+ _this20 = _possibleConstructorReturn(this, _getPrototypeOf(SquigglyAnnotation).call(this, parameters));
1256
+ _this20.data.annotationType = _util.AnnotationType.SQUIGGLY;
1257
+ return _this20;
1179
1258
  }
1180
1259
 
1181
1260
  return SquigglyAnnotation;
1182
- }(Annotation);
1261
+ }(MarkupAnnotation);
1183
1262
 
1184
1263
  var StrikeOutAnnotation =
1185
1264
  /*#__PURE__*/
1186
- function (_Annotation13) {
1187
- _inherits(StrikeOutAnnotation, _Annotation13);
1265
+ function (_MarkupAnnotation12) {
1266
+ _inherits(StrikeOutAnnotation, _MarkupAnnotation12);
1188
1267
 
1189
1268
  function StrikeOutAnnotation(parameters) {
1190
- var _this18;
1269
+ var _this21;
1191
1270
 
1192
1271
  _classCallCheck(this, StrikeOutAnnotation);
1193
1272
 
1194
- _this18 = _possibleConstructorReturn(this, _getPrototypeOf(StrikeOutAnnotation).call(this, parameters));
1195
- _this18.data.annotationType = _util.AnnotationType.STRIKEOUT;
1196
-
1197
- _this18._preparePopup(parameters.dict);
1198
-
1199
- return _this18;
1273
+ _this21 = _possibleConstructorReturn(this, _getPrototypeOf(StrikeOutAnnotation).call(this, parameters));
1274
+ _this21.data.annotationType = _util.AnnotationType.STRIKEOUT;
1275
+ return _this21;
1200
1276
  }
1201
1277
 
1202
1278
  return StrikeOutAnnotation;
1203
- }(Annotation);
1279
+ }(MarkupAnnotation);
1204
1280
 
1205
1281
  var StampAnnotation =
1206
1282
  /*#__PURE__*/
1207
- function (_Annotation14) {
1208
- _inherits(StampAnnotation, _Annotation14);
1283
+ function (_MarkupAnnotation13) {
1284
+ _inherits(StampAnnotation, _MarkupAnnotation13);
1209
1285
 
1210
1286
  function StampAnnotation(parameters) {
1211
- var _this19;
1287
+ var _this22;
1212
1288
 
1213
1289
  _classCallCheck(this, StampAnnotation);
1214
1290
 
1215
- _this19 = _possibleConstructorReturn(this, _getPrototypeOf(StampAnnotation).call(this, parameters));
1216
- _this19.data.annotationType = _util.AnnotationType.STAMP;
1217
-
1218
- _this19._preparePopup(parameters.dict);
1219
-
1220
- return _this19;
1291
+ _this22 = _possibleConstructorReturn(this, _getPrototypeOf(StampAnnotation).call(this, parameters));
1292
+ _this22.data.annotationType = _util.AnnotationType.STAMP;
1293
+ return _this22;
1221
1294
  }
1222
1295
 
1223
1296
  return StampAnnotation;
1224
- }(Annotation);
1297
+ }(MarkupAnnotation);
1225
1298
 
1226
1299
  var FileAttachmentAnnotation =
1227
1300
  /*#__PURE__*/
1228
- function (_Annotation15) {
1229
- _inherits(FileAttachmentAnnotation, _Annotation15);
1301
+ function (_MarkupAnnotation14) {
1302
+ _inherits(FileAttachmentAnnotation, _MarkupAnnotation14);
1230
1303
 
1231
1304
  function FileAttachmentAnnotation(parameters) {
1232
- var _this20;
1305
+ var _this23;
1233
1306
 
1234
1307
  _classCallCheck(this, FileAttachmentAnnotation);
1235
1308
 
1236
- _this20 = _possibleConstructorReturn(this, _getPrototypeOf(FileAttachmentAnnotation).call(this, parameters));
1309
+ _this23 = _possibleConstructorReturn(this, _getPrototypeOf(FileAttachmentAnnotation).call(this, parameters));
1237
1310
  var file = new _obj.FileSpec(parameters.dict.get('FS'), parameters.xref);
1238
- _this20.data.annotationType = _util.AnnotationType.FILEATTACHMENT;
1239
- _this20.data.file = file.serializable;
1240
-
1241
- _this20._preparePopup(parameters.dict);
1242
-
1243
- return _this20;
1311
+ _this23.data.annotationType = _util.AnnotationType.FILEATTACHMENT;
1312
+ _this23.data.file = file.serializable;
1313
+ return _this23;
1244
1314
  }
1245
1315
 
1246
1316
  return FileAttachmentAnnotation;
1247
- }(Annotation);
1317
+ }(MarkupAnnotation);