pdfjs-dist 2.0.943 → 2.1.266

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 (159) hide show
  1. package/bower.json +1 -1
  2. package/build/pdf.js +15329 -11095
  3. package/build/pdf.js.map +1 -1
  4. package/build/pdf.min.js +1 -1
  5. package/build/pdf.worker.js +12497 -4184
  6. package/build/pdf.worker.js.map +1 -1
  7. package/build/pdf.worker.min.js +1 -1
  8. package/image_decoders/pdf.image_decoders.js +3438 -1209
  9. package/image_decoders/pdf.image_decoders.js.map +1 -1
  10. package/image_decoders/pdf.image_decoders.min.js +1 -1
  11. package/lib/core/annotation.js +335 -109
  12. package/lib/core/arithmetic_decoder.js +274 -244
  13. package/lib/core/bidi.js +64 -5
  14. package/lib/core/ccitt.js +172 -17
  15. package/lib/core/ccitt_stream.js +14 -5
  16. package/lib/core/cff_parser.js +304 -28
  17. package/lib/core/charsets.js +4 -3
  18. package/lib/core/chunked_stream.js +379 -149
  19. package/lib/core/cmap.js +210 -40
  20. package/lib/core/colorspace.js +332 -187
  21. package/lib/core/crypto.js +289 -44
  22. package/lib/core/document.js +508 -249
  23. package/lib/core/encodings.js +18 -9
  24. package/lib/core/evaluator.js +657 -119
  25. package/lib/core/font_renderer.js +217 -34
  26. package/lib/core/fonts.js +632 -41
  27. package/lib/core/function.js +252 -26
  28. package/lib/core/glyphlist.js +2 -1
  29. package/lib/core/image.js +124 -27
  30. package/lib/core/jbig2.js +425 -65
  31. package/lib/core/jbig2_stream.js +18 -7
  32. package/lib/core/jpeg_stream.js +24 -8
  33. package/lib/core/jpg.js +208 -16
  34. package/lib/core/jpx.js +395 -5
  35. package/lib/core/jpx_stream.js +17 -5
  36. package/lib/core/metrics.js +3 -3
  37. package/lib/core/murmurhash3.js +23 -5
  38. package/lib/core/obj.js +625 -132
  39. package/lib/core/operator_list.js +104 -3
  40. package/lib/core/parser.js +262 -25
  41. package/lib/core/pattern.js +144 -12
  42. package/lib/core/pdf_manager.js +104 -70
  43. package/lib/core/primitives.js +74 -21
  44. package/lib/core/ps_parser.js +133 -44
  45. package/lib/core/standard_fonts.js +9 -9
  46. package/lib/core/stream.js +283 -31
  47. package/lib/core/type1_parser.js +138 -6
  48. package/lib/core/unicode.js +28 -1
  49. package/lib/core/worker.js +192 -57
  50. package/lib/display/annotation_layer.js +303 -123
  51. package/lib/display/api.js +1073 -574
  52. package/lib/display/api_compatibility.js +4 -1
  53. package/lib/display/canvas.js +314 -18
  54. package/lib/display/content_disposition.js +70 -23
  55. package/lib/display/dom_utils.js +112 -59
  56. package/lib/display/fetch_stream.js +95 -50
  57. package/lib/display/font_loader.js +250 -132
  58. package/lib/display/metadata.js +37 -15
  59. package/lib/display/network.js +123 -34
  60. package/lib/display/network_utils.js +23 -10
  61. package/lib/display/node_stream.js +162 -65
  62. package/lib/display/pattern_helper.js +57 -6
  63. package/lib/display/svg.js +194 -18
  64. package/lib/display/text_layer.js +128 -14
  65. package/lib/display/transport_stream.js +83 -27
  66. package/lib/display/webgl.js +63 -17
  67. package/lib/display/worker_options.js +4 -3
  68. package/lib/display/xml_parser.js +162 -52
  69. package/lib/examples/node/domstubs.js +56 -3
  70. package/lib/pdf.js +15 -2
  71. package/lib/pdf.worker.js +4 -2
  72. package/lib/shared/compatibility.js +129 -26
  73. package/lib/shared/global_scope.js +1 -1
  74. package/lib/shared/is_node.js +3 -3
  75. package/lib/shared/message_handler.js +103 -45
  76. package/lib/shared/streams_polyfill.js +20 -16
  77. package/lib/shared/url_polyfill.js +8 -2
  78. package/lib/shared/util.js +246 -84
  79. package/lib/test/unit/annotation_spec.js +99 -73
  80. package/lib/test/unit/api_spec.js +347 -113
  81. package/lib/test/unit/bidi_spec.js +6 -6
  82. package/lib/test/unit/cff_parser_spec.js +17 -5
  83. package/lib/test/unit/clitests_helper.js +7 -8
  84. package/lib/test/unit/cmap_spec.js +79 -25
  85. package/lib/test/unit/colorspace_spec.js +65 -18
  86. package/lib/test/unit/crypto_spec.js +16 -4
  87. package/lib/test/unit/custom_spec.js +40 -52
  88. package/lib/test/unit/display_svg_spec.js +32 -16
  89. package/lib/test/unit/document_spec.js +2 -2
  90. package/lib/test/unit/dom_utils_spec.js +8 -8
  91. package/lib/test/unit/encodings_spec.js +24 -44
  92. package/lib/test/unit/evaluator_spec.js +15 -8
  93. package/lib/test/unit/function_spec.js +16 -4
  94. package/lib/test/unit/jasmine-boot.js +29 -16
  95. package/lib/test/unit/message_handler_spec.js +19 -6
  96. package/lib/test/unit/metadata_spec.js +64 -11
  97. package/lib/test/unit/murmurhash3_spec.js +2 -2
  98. package/lib/test/unit/network_spec.js +19 -4
  99. package/lib/test/unit/network_utils_spec.js +6 -4
  100. package/lib/test/unit/node_stream_spec.js +50 -26
  101. package/lib/test/unit/parser_spec.js +13 -29
  102. package/lib/test/unit/pdf_find_controller_spec.js +144 -32
  103. package/lib/test/unit/pdf_find_utils_spec.js +10 -9
  104. package/lib/test/unit/pdf_history_spec.js +20 -8
  105. package/lib/test/unit/primitives_spec.js +23 -3
  106. package/lib/test/unit/stream_spec.js +8 -3
  107. package/lib/test/unit/test_utils.js +89 -26
  108. package/lib/test/unit/testreporter.js +19 -1
  109. package/lib/test/unit/type1_parser_spec.js +7 -5
  110. package/lib/test/unit/ui_utils_spec.js +162 -38
  111. package/lib/test/unit/unicode_spec.js +13 -10
  112. package/lib/test/unit/util_spec.js +89 -9
  113. package/lib/web/annotation_layer_builder.js +38 -21
  114. package/lib/web/app.js +610 -245
  115. package/lib/web/app_options.js +54 -34
  116. package/lib/web/base_viewer.js +359 -162
  117. package/lib/web/chromecom.js +159 -80
  118. package/lib/web/debugger.js +161 -17
  119. package/lib/web/download_manager.js +29 -11
  120. package/lib/web/firefox_print_service.js +16 -8
  121. package/lib/web/firefoxcom.js +127 -91
  122. package/lib/web/genericcom.js +50 -31
  123. package/lib/web/genericl10n.js +46 -34
  124. package/lib/web/grab_to_pan.js +25 -3
  125. package/lib/web/interfaces.js +108 -61
  126. package/lib/web/overlay_manager.js +67 -45
  127. package/lib/web/password_prompt.js +20 -12
  128. package/lib/web/pdf_attachment_viewer.js +37 -17
  129. package/lib/web/pdf_cursor_tools.js +38 -15
  130. package/lib/web/pdf_document_properties.js +65 -24
  131. package/lib/web/pdf_find_bar.js +48 -20
  132. package/lib/web/pdf_find_controller.js +290 -89
  133. package/lib/web/pdf_find_utils.js +19 -3
  134. package/lib/web/pdf_history.js +186 -49
  135. package/lib/web/pdf_link_service.js +127 -52
  136. package/lib/web/pdf_outline_viewer.js +71 -21
  137. package/lib/web/pdf_page_view.js +188 -63
  138. package/lib/web/pdf_presentation_mode.js +98 -33
  139. package/lib/web/pdf_print_service.js +54 -10
  140. package/lib/web/pdf_rendering_queue.js +26 -4
  141. package/lib/web/pdf_sidebar.js +116 -62
  142. package/lib/web/pdf_sidebar_resizer.js +41 -15
  143. package/lib/web/pdf_single_page_viewer.js +65 -68
  144. package/lib/web/pdf_thumbnail_view.js +102 -31
  145. package/lib/web/pdf_thumbnail_viewer.js +62 -22
  146. package/lib/web/pdf_viewer.component.js +111 -31
  147. package/lib/web/pdf_viewer.js +80 -60
  148. package/lib/web/preferences.js +61 -39
  149. package/lib/web/secondary_toolbar.js +101 -82
  150. package/lib/web/text_layer_builder.js +124 -69
  151. package/lib/web/toolbar.js +67 -27
  152. package/lib/web/ui_utils.js +284 -128
  153. package/lib/web/view_history.js +75 -51
  154. package/lib/web/viewer_compatibility.js +2 -1
  155. package/package.json +1 -1
  156. package/web/pdf_viewer.css +1 -1
  157. package/web/pdf_viewer.js +2200 -973
  158. package/web/pdf_viewer.js.map +1 -1
  159. package/lib/web/dom_events.js +0 -140
@@ -19,52 +19,66 @@
19
19
  * @licend The above is the entire license notice for the
20
20
  * Javascript code in this page
21
21
  */
22
- 'use strict';
22
+ "use strict";
23
23
 
24
24
  function xmlEncode(s) {
25
25
  var i = 0,
26
26
  ch;
27
27
  s = String(s);
28
+
28
29
  while (i < s.length && (ch = s[i]) !== '&' && ch !== '<' && ch !== '\"' && ch !== '\n' && ch !== '\r' && ch !== '\t') {
29
30
  i++;
30
31
  }
32
+
31
33
  if (i >= s.length) {
32
34
  return s;
33
35
  }
36
+
34
37
  var buf = s.substring(0, i);
38
+
35
39
  while (i < s.length) {
36
40
  ch = s[i++];
41
+
37
42
  switch (ch) {
38
43
  case '&':
39
44
  buf += '&amp;';
40
45
  break;
46
+
41
47
  case '<':
42
48
  buf += '&lt;';
43
49
  break;
50
+
44
51
  case '\"':
45
52
  buf += '&quot;';
46
53
  break;
54
+
47
55
  case '\n':
48
56
  buf += '&#xA;';
49
57
  break;
58
+
50
59
  case '\r':
51
60
  buf += '&#xD;';
52
61
  break;
62
+
53
63
  case '\t':
54
64
  buf += '&#x9;';
55
65
  break;
66
+
56
67
  default:
57
68
  buf += ch;
58
69
  break;
59
70
  }
60
71
  }
72
+
61
73
  return buf;
62
74
  }
75
+
63
76
  function DOMElement(name) {
64
77
  this.nodeName = name;
65
78
  this.childNodes = [];
66
79
  this.attributes = {};
67
80
  this.textContent = '';
81
+
68
82
  if (name === 'style') {
69
83
  this.sheet = {
70
84
  cssRules: [],
@@ -74,25 +88,30 @@ function DOMElement(name) {
74
88
  };
75
89
  }
76
90
  }
91
+
77
92
  DOMElement.prototype = {
78
93
  getAttribute: function DOMElement_getAttribute(name) {
79
94
  if (name in this.attributes) {
80
95
  return this.attributes[name];
81
96
  }
97
+
82
98
  return null;
83
99
  },
84
100
  getAttributeNS: function DOMElement_getAttributeNS(NS, name) {
85
101
  if (name in this.attributes) {
86
102
  return this.attributes[name];
87
103
  }
104
+
88
105
  if (NS) {
89
106
  var suffix = ':' + name;
107
+
90
108
  for (var fullName in this.attributes) {
91
109
  if (fullName.slice(-suffix.length) === suffix) {
92
110
  return this.attributes[fullName];
93
111
  }
94
112
  }
95
113
  }
114
+
96
115
  return null;
97
116
  },
98
117
  setAttribute: function DOMElement_setAttribute(name, value) {
@@ -105,7 +124,8 @@ DOMElement.prototype = {
105
124
  },
106
125
  appendChild: function DOMElement_appendChild(element) {
107
126
  var childNodes = this.childNodes;
108
- if (childNodes.indexOf(element) === -1) {
127
+
128
+ if (!childNodes.includes(element)) {
109
129
  childNodes.push(element);
110
130
  }
111
131
  },
@@ -120,15 +140,18 @@ DOMElement.prototype = {
120
140
  var buf = [];
121
141
  var serializer = this.getSerializer();
122
142
  var chunk;
143
+
123
144
  while ((chunk = serializer.getNext()) !== null) {
124
145
  buf.push(chunk);
125
146
  }
147
+
126
148
  return buf.join('');
127
149
  },
128
150
  getSerializer: function DOMElement_getSerializer() {
129
151
  return new DOMElementSerializer(this);
130
152
  }
131
153
  };
154
+
132
155
  function DOMElementSerializer(node) {
133
156
  this._node = node;
134
157
  this._state = 0;
@@ -136,44 +159,58 @@ function DOMElementSerializer(node) {
136
159
  this._attributeKeys = null;
137
160
  this._childSerializer = null;
138
161
  }
162
+
139
163
  DOMElementSerializer.prototype = {
140
164
  getNext: function DOMElementSerializer_getNext() {
141
165
  var node = this._node;
166
+
142
167
  switch (this._state) {
143
168
  case 0:
144
169
  ++this._state;
145
170
  return '<' + node.nodeName;
171
+
146
172
  case 1:
147
173
  ++this._state;
174
+
148
175
  if (node.nodeName === 'svg:svg') {
149
176
  return ' xmlns:xlink="http://www.w3.org/1999/xlink"' + ' xmlns:svg="http://www.w3.org/2000/svg"';
150
177
  }
178
+
151
179
  case 2:
152
180
  ++this._state;
153
181
  this._loopIndex = 0;
154
182
  this._attributeKeys = Object.keys(node.attributes);
183
+
155
184
  case 3:
156
185
  if (this._loopIndex < this._attributeKeys.length) {
157
186
  var name = this._attributeKeys[this._loopIndex++];
158
187
  return ' ' + name + '="' + xmlEncode(node.attributes[name]) + '"';
159
188
  }
189
+
160
190
  ++this._state;
161
191
  return '>';
192
+
162
193
  case 4:
163
194
  if (node.nodeName === 'svg:tspan' || node.nodeName === 'svg:style') {
164
195
  this._state = 6;
165
196
  return xmlEncode(node.textContent);
166
197
  }
198
+
167
199
  ++this._state;
168
200
  this._loopIndex = 0;
201
+
169
202
  case 5:
170
203
  var value;
204
+
171
205
  while (true) {
172
206
  value = this._childSerializer && this._childSerializer.getNext();
207
+
173
208
  if (value !== null) {
174
209
  return value;
175
210
  }
211
+
176
212
  var nextChild = node.childNodes[this._loopIndex++];
213
+
177
214
  if (nextChild) {
178
215
  this._childSerializer = new DOMElementSerializer(nextChild);
179
216
  } else {
@@ -182,11 +219,14 @@ DOMElementSerializer.prototype = {
182
219
  break;
183
220
  }
184
221
  }
222
+
185
223
  case 6:
186
224
  ++this._state;
187
225
  return '</' + node.nodeName + '>';
226
+
188
227
  case 7:
189
228
  return null;
229
+
190
230
  default:
191
231
  throw new Error('Unexpected serialization state: ' + this._state);
192
232
  }
@@ -194,12 +234,17 @@ DOMElementSerializer.prototype = {
194
234
  };
195
235
  var document = {
196
236
  childNodes: [],
237
+
197
238
  get currentScript() {
198
- return { src: '' };
239
+ return {
240
+ src: ''
241
+ };
199
242
  },
243
+
200
244
  get documentElement() {
201
245
  return this;
202
246
  },
247
+
203
248
  createElementNS: function createElementNS(NS, element) {
204
249
  var elObject = new DOMElement(element);
205
250
  return elObject;
@@ -211,33 +256,41 @@ var document = {
211
256
  if (element === 'head') {
212
257
  return [this.head || (this.head = new DOMElement('head'))];
213
258
  }
259
+
214
260
  return [];
215
261
  }
216
262
  };
263
+
217
264
  function Image() {
218
265
  this._src = null;
219
266
  this.onload = null;
220
267
  }
268
+
221
269
  Image.prototype = {
222
270
  get src() {
223
271
  return this._src;
224
272
  },
273
+
225
274
  set src(value) {
226
275
  this._src = value;
276
+
227
277
  if (this.onload) {
228
278
  this.onload();
229
279
  }
230
280
  }
281
+
231
282
  };
232
283
  exports.document = document;
233
284
  exports.Image = Image;
234
285
  var exported_symbols = Object.keys(exports);
286
+
235
287
  exports.setStubs = function (namespace) {
236
288
  exported_symbols.forEach(function (key) {
237
289
  console.assert(!(key in namespace), 'property should not be set: ' + key);
238
290
  namespace[key] = exports[key];
239
291
  });
240
292
  };
293
+
241
294
  exports.unsetStubs = function (namespace) {
242
295
  exported_symbols.forEach(function (key) {
243
296
  console.assert(key in namespace, 'property should be set: ' + key);
package/lib/pdf.js CHANGED
@@ -21,30 +21,43 @@
21
21
  */
22
22
  'use strict';
23
23
 
24
- var pdfjsVersion = '2.0.943';
25
- var pdfjsBuild = 'dc98bf76';
24
+ var pdfjsVersion = '2.1.266';
25
+ var pdfjsBuild = '81f5835c';
26
+
26
27
  var pdfjsSharedUtil = require('./shared/util.js');
28
+
27
29
  var pdfjsDisplayAPI = require('./display/api.js');
30
+
28
31
  var pdfjsDisplayTextLayer = require('./display/text_layer.js');
32
+
29
33
  var pdfjsDisplayAnnotationLayer = require('./display/annotation_layer.js');
34
+
30
35
  var pdfjsDisplayDOMUtils = require('./display/dom_utils.js');
36
+
31
37
  var pdfjsDisplaySVG = require('./display/svg.js');
38
+
32
39
  var pdfjsDisplayWorkerOptions = require('./display/worker_options.js');
40
+
33
41
  var pdfjsDisplayAPICompatibility = require('./display/api_compatibility.js');
42
+
34
43
  {
35
44
  var isNodeJS = require('./shared/is_node.js');
45
+
36
46
  if (isNodeJS()) {
37
47
  var PDFNodeStream = require('./display/node_stream.js').PDFNodeStream;
48
+
38
49
  pdfjsDisplayAPI.setPDFNetworkStreamFactory(function (params) {
39
50
  return new PDFNodeStream(params);
40
51
  });
41
52
  } else if (typeof Response !== 'undefined' && 'body' in Response.prototype && typeof ReadableStream !== 'undefined') {
42
53
  var PDFFetchStream = require('./display/fetch_stream.js').PDFFetchStream;
54
+
43
55
  pdfjsDisplayAPI.setPDFNetworkStreamFactory(function (params) {
44
56
  return new PDFFetchStream(params);
45
57
  });
46
58
  } else {
47
59
  var PDFNetworkStream = require('./display/network.js').PDFNetworkStream;
60
+
48
61
  pdfjsDisplayAPI.setPDFNetworkStreamFactory(function (params) {
49
62
  return new PDFNetworkStream(params);
50
63
  });
package/lib/pdf.worker.js CHANGED
@@ -21,7 +21,9 @@
21
21
  */
22
22
  'use strict';
23
23
 
24
- var pdfjsVersion = '2.0.943';
25
- var pdfjsBuild = 'dc98bf76';
24
+ var pdfjsVersion = '2.1.266';
25
+ var pdfjsBuild = '81f5835c';
26
+
26
27
  var pdfjsCoreWorker = require('./core/worker.js');
28
+
27
29
  exports.WorkerMessageHandler = pdfjsCoreWorker.WorkerMessageHandler;
@@ -19,148 +19,251 @@
19
19
  * @licend The above is the entire license notice for the
20
20
  * Javascript code in this page
21
21
  */
22
- 'use strict';
22
+ "use strict";
23
23
 
24
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
24
+ 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); }
25
25
 
26
26
  var globalScope = require('./global_scope');
27
+
27
28
  if (!globalScope._pdfjsCompatibilityChecked) {
28
29
  globalScope._pdfjsCompatibilityChecked = true;
30
+
29
31
  var isNodeJS = require('./is_node');
30
- var hasDOM = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && (typeof document === 'undefined' ? 'undefined' : _typeof(document)) === 'object';
32
+
33
+ var hasDOM = (typeof window === "undefined" ? "undefined" : _typeof(window)) === 'object' && (typeof document === "undefined" ? "undefined" : _typeof(document)) === 'object';
34
+
31
35
  (function checkNodeBtoa() {
32
36
  if (globalScope.btoa || !isNodeJS()) {
33
37
  return;
34
38
  }
39
+
35
40
  globalScope.btoa = function (chars) {
36
41
  return Buffer.from(chars, 'binary').toString('base64');
37
42
  };
38
43
  })();
44
+
39
45
  (function checkNodeAtob() {
40
46
  if (globalScope.atob || !isNodeJS()) {
41
47
  return;
42
48
  }
49
+
43
50
  globalScope.atob = function (input) {
44
51
  return Buffer.from(input, 'base64').toString('binary');
45
52
  };
46
53
  })();
47
- (function checkCurrentScript() {
48
- if (!hasDOM) {
49
- return;
50
- }
51
- if ('currentScript' in document) {
52
- return;
53
- }
54
- Object.defineProperty(document, 'currentScript', {
55
- get: function get() {
56
- var scripts = document.getElementsByTagName('script');
57
- return scripts[scripts.length - 1];
58
- },
59
54
 
60
- enumerable: true,
61
- configurable: true
62
- });
63
- })();
64
55
  (function checkChildNodeRemove() {
65
56
  if (!hasDOM) {
66
57
  return;
67
58
  }
59
+
68
60
  if (typeof Element.prototype.remove !== 'undefined') {
69
61
  return;
70
62
  }
63
+
71
64
  Element.prototype.remove = function () {
72
65
  if (this.parentNode) {
73
66
  this.parentNode.removeChild(this);
74
67
  }
75
68
  };
76
69
  })();
70
+
71
+ (function checkDOMTokenListAddRemove() {
72
+ if (!hasDOM || isNodeJS()) {
73
+ return;
74
+ }
75
+
76
+ var div = document.createElement('div');
77
+ div.classList.add('testOne', 'testTwo');
78
+
79
+ if (div.classList.contains('testOne') === true && div.classList.contains('testTwo') === true) {
80
+ return;
81
+ }
82
+
83
+ var OriginalDOMTokenListAdd = DOMTokenList.prototype.add;
84
+ var OriginalDOMTokenListRemove = DOMTokenList.prototype.remove;
85
+
86
+ DOMTokenList.prototype.add = function () {
87
+ for (var _len = arguments.length, tokens = new Array(_len), _key = 0; _key < _len; _key++) {
88
+ tokens[_key] = arguments[_key];
89
+ }
90
+
91
+ for (var _i = 0; _i < tokens.length; _i++) {
92
+ var token = tokens[_i];
93
+ OriginalDOMTokenListAdd.call(this, token);
94
+ }
95
+ };
96
+
97
+ DOMTokenList.prototype.remove = function () {
98
+ for (var _len2 = arguments.length, tokens = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
99
+ tokens[_key2] = arguments[_key2];
100
+ }
101
+
102
+ for (var _i2 = 0; _i2 < tokens.length; _i2++) {
103
+ var token = tokens[_i2];
104
+ OriginalDOMTokenListRemove.call(this, token);
105
+ }
106
+ };
107
+ })();
108
+
77
109
  (function checkDOMTokenListToggle() {
78
110
  if (!hasDOM || isNodeJS()) {
79
111
  return;
80
112
  }
113
+
81
114
  var div = document.createElement('div');
115
+
82
116
  if (div.classList.toggle('test', 0) === false) {
83
117
  return;
84
118
  }
85
- var originalDOMTokenListToggle = DOMTokenList.prototype.toggle;
119
+
86
120
  DOMTokenList.prototype.toggle = function (token) {
87
- if (arguments.length > 1) {
88
- var force = !!arguments[1];
89
- return this[force ? 'add' : 'remove'](token), force;
90
- }
91
- return originalDOMTokenListToggle(token);
121
+ var force = arguments.length > 1 ? !!arguments[1] : !this.contains(token);
122
+ return this[force ? 'add' : 'remove'](token), force;
92
123
  };
93
124
  })();
125
+
126
+ (function checkStringStartsWith() {
127
+ if (String.prototype.startsWith) {
128
+ return;
129
+ }
130
+
131
+ require('core-js/fn/string/starts-with');
132
+ })();
133
+
134
+ (function checkStringEndsWith() {
135
+ if (String.prototype.endsWith) {
136
+ return;
137
+ }
138
+
139
+ require('core-js/fn/string/ends-with');
140
+ })();
141
+
94
142
  (function checkStringIncludes() {
95
143
  if (String.prototype.includes) {
96
144
  return;
97
145
  }
146
+
98
147
  require('core-js/fn/string/includes');
99
148
  })();
149
+
100
150
  (function checkArrayIncludes() {
101
151
  if (Array.prototype.includes) {
102
152
  return;
103
153
  }
154
+
104
155
  require('core-js/fn/array/includes');
105
156
  })();
157
+
158
+ (function checkArrayFrom() {
159
+ if (Array.from) {
160
+ return;
161
+ }
162
+
163
+ require('core-js/fn/array/from');
164
+ })();
165
+
106
166
  (function checkObjectAssign() {
107
167
  if (Object.assign) {
108
168
  return;
109
169
  }
170
+
110
171
  require('core-js/fn/object/assign');
111
172
  })();
173
+
112
174
  (function checkMathLog2() {
113
175
  if (Math.log2) {
114
176
  return;
115
177
  }
178
+
116
179
  Math.log2 = require('core-js/fn/math/log2');
117
180
  })();
181
+
118
182
  (function checkNumberIsNaN() {
119
183
  if (Number.isNaN) {
120
184
  return;
121
185
  }
186
+
122
187
  Number.isNaN = require('core-js/fn/number/is-nan');
123
188
  })();
189
+
124
190
  (function checkNumberIsInteger() {
125
191
  if (Number.isInteger) {
126
192
  return;
127
193
  }
194
+
128
195
  Number.isInteger = require('core-js/fn/number/is-integer');
129
196
  })();
197
+
130
198
  (function checkPromise() {
131
- if (globalScope.Promise) {
199
+ if (globalScope.Promise && globalScope.Promise.prototype && globalScope.Promise.prototype.finally) {
132
200
  return;
133
201
  }
202
+
134
203
  globalScope.Promise = require('core-js/fn/promise');
135
204
  })();
205
+
136
206
  (function checkWeakMap() {
137
207
  if (globalScope.WeakMap) {
138
208
  return;
139
209
  }
210
+
140
211
  globalScope.WeakMap = require('core-js/fn/weak-map');
141
212
  })();
213
+
214
+ (function checkWeakSet() {
215
+ if (globalScope.WeakSet) {
216
+ return;
217
+ }
218
+
219
+ globalScope.WeakSet = require('core-js/fn/weak-set');
220
+ })();
221
+
142
222
  (function checkStringCodePointAt() {
143
223
  if (String.codePointAt) {
144
224
  return;
145
225
  }
226
+
146
227
  String.codePointAt = require('core-js/fn/string/code-point-at');
147
228
  })();
229
+
148
230
  (function checkStringFromCodePoint() {
149
231
  if (String.fromCodePoint) {
150
232
  return;
151
233
  }
234
+
152
235
  String.fromCodePoint = require('core-js/fn/string/from-code-point');
153
236
  })();
237
+
154
238
  (function checkSymbol() {
155
239
  if (globalScope.Symbol) {
156
240
  return;
157
241
  }
242
+
158
243
  require('core-js/es6/symbol');
159
244
  })();
245
+
246
+ (function checkStringPadStart() {
247
+ if (String.prototype.padStart) {
248
+ return;
249
+ }
250
+
251
+ require('core-js/fn/string/pad-start');
252
+ })();
253
+
254
+ (function checkStringPadEnd() {
255
+ if (String.prototype.padEnd) {
256
+ return;
257
+ }
258
+
259
+ require('core-js/fn/string/pad-end');
260
+ })();
261
+
160
262
  (function checkObjectValues() {
161
263
  if (Object.values) {
162
264
  return;
163
265
  }
266
+
164
267
  Object.values = require('core-js/fn/object/values');
165
268
  })();
166
269
  }
@@ -19,6 +19,6 @@
19
19
  * @licend The above is the entire license notice for the
20
20
  * Javascript code in this page
21
21
  */
22
- 'use strict';
22
+ "use strict";
23
23
 
24
24
  module.exports = typeof window !== 'undefined' && window.Math === Math ? window : typeof global !== 'undefined' && global.Math === Math ? global : typeof self !== 'undefined' && self.Math === Math ? self : {};
@@ -19,10 +19,10 @@
19
19
  * @licend The above is the entire license notice for the
20
20
  * Javascript code in this page
21
21
  */
22
- 'use strict';
22
+ "use strict";
23
23
 
24
- var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
24
+ 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); }
25
25
 
26
26
  module.exports = function isNodeJS() {
27
- return (typeof process === 'undefined' ? 'undefined' : _typeof(process)) === 'object' && process + '' === '[object process]';
27
+ return (typeof process === "undefined" ? "undefined" : _typeof(process)) === 'object' && process + '' === '[object process]' && !process.versions['nw'];
28
28
  };