1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | var __webpack_modules__ = ({
|
24 |
|
25 | 9306:
|
26 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
27 |
|
28 |
|
29 | var isCallable = __webpack_require__(4901);
|
30 | var tryToString = __webpack_require__(6823);
|
31 |
|
32 | var $TypeError = TypeError;
|
33 |
|
34 |
|
35 | module.exports = function (argument) {
|
36 | if (isCallable(argument)) return argument;
|
37 | throw new $TypeError(tryToString(argument) + ' is not a function');
|
38 | };
|
39 |
|
40 |
|
41 | }),
|
42 |
|
43 | 7080:
|
44 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
45 |
|
46 |
|
47 | var has = (__webpack_require__(4402).has);
|
48 |
|
49 |
|
50 | module.exports = function (it) {
|
51 | has(it);
|
52 | return it;
|
53 | };
|
54 |
|
55 |
|
56 | }),
|
57 |
|
58 | 679:
|
59 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
60 |
|
61 |
|
62 | var isPrototypeOf = __webpack_require__(1625);
|
63 |
|
64 | var $TypeError = TypeError;
|
65 |
|
66 | module.exports = function (it, Prototype) {
|
67 | if (isPrototypeOf(Prototype, it)) return it;
|
68 | throw new $TypeError('Incorrect invocation');
|
69 | };
|
70 |
|
71 |
|
72 | }),
|
73 |
|
74 | 8551:
|
75 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
76 |
|
77 |
|
78 | var isObject = __webpack_require__(34);
|
79 |
|
80 | var $String = String;
|
81 | var $TypeError = TypeError;
|
82 |
|
83 |
|
84 | module.exports = function (argument) {
|
85 | if (isObject(argument)) return argument;
|
86 | throw new $TypeError($String(argument) + ' is not an object');
|
87 | };
|
88 |
|
89 |
|
90 | }),
|
91 |
|
92 | 9617:
|
93 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
94 |
|
95 |
|
96 | var toIndexedObject = __webpack_require__(5397);
|
97 | var toAbsoluteIndex = __webpack_require__(5610);
|
98 | var lengthOfArrayLike = __webpack_require__(6198);
|
99 |
|
100 |
|
101 | var createMethod = function (IS_INCLUDES) {
|
102 | return function ($this, el, fromIndex) {
|
103 | var O = toIndexedObject($this);
|
104 | var length = lengthOfArrayLike(O);
|
105 | if (length === 0) return !IS_INCLUDES && -1;
|
106 | var index = toAbsoluteIndex(fromIndex, length);
|
107 | var value;
|
108 |
|
109 |
|
110 | if (IS_INCLUDES && el !== el) while (length > index) {
|
111 | value = O[index++];
|
112 |
|
113 | if (value !== value) return true;
|
114 |
|
115 | } else for (;length > index; index++) {
|
116 | if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
|
117 | } return !IS_INCLUDES && -1;
|
118 | };
|
119 | };
|
120 |
|
121 | module.exports = {
|
122 |
|
123 |
|
124 | includes: createMethod(true),
|
125 |
|
126 |
|
127 | indexOf: createMethod(false)
|
128 | };
|
129 |
|
130 |
|
131 | }),
|
132 |
|
133 | 4527:
|
134 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
135 |
|
136 |
|
137 | var DESCRIPTORS = __webpack_require__(3724);
|
138 | var isArray = __webpack_require__(4376);
|
139 |
|
140 | var $TypeError = TypeError;
|
141 |
|
142 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
143 |
|
144 |
|
145 | var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {
|
146 |
|
147 | if (this !== undefined) return true;
|
148 | try {
|
149 |
|
150 | Object.defineProperty([], 'length', { writable: false }).length = 1;
|
151 | } catch (error) {
|
152 | return error instanceof TypeError;
|
153 | }
|
154 | }();
|
155 |
|
156 | module.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
|
157 | if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
|
158 | throw new $TypeError('Cannot set read only .length');
|
159 | } return O.length = length;
|
160 | } : function (O, length) {
|
161 | return O.length = length;
|
162 | };
|
163 |
|
164 |
|
165 | }),
|
166 |
|
167 | 6319:
|
168 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
169 |
|
170 |
|
171 | var anObject = __webpack_require__(8551);
|
172 | var iteratorClose = __webpack_require__(9539);
|
173 |
|
174 |
|
175 | module.exports = function (iterator, fn, value, ENTRIES) {
|
176 | try {
|
177 | return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
|
178 | } catch (error) {
|
179 | iteratorClose(iterator, 'throw', error);
|
180 | }
|
181 | };
|
182 |
|
183 |
|
184 | }),
|
185 |
|
186 | 4576:
|
187 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
188 |
|
189 |
|
190 | var uncurryThis = __webpack_require__(9504);
|
191 |
|
192 | var toString = uncurryThis({}.toString);
|
193 | var stringSlice = uncurryThis(''.slice);
|
194 |
|
195 | module.exports = function (it) {
|
196 | return stringSlice(toString(it), 8, -1);
|
197 | };
|
198 |
|
199 |
|
200 | }),
|
201 |
|
202 | 6955:
|
203 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
204 |
|
205 |
|
206 | var TO_STRING_TAG_SUPPORT = __webpack_require__(2140);
|
207 | var isCallable = __webpack_require__(4901);
|
208 | var classofRaw = __webpack_require__(4576);
|
209 | var wellKnownSymbol = __webpack_require__(8227);
|
210 |
|
211 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
212 | var $Object = Object;
|
213 |
|
214 |
|
215 | var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
|
216 |
|
217 |
|
218 | var tryGet = function (it, key) {
|
219 | try {
|
220 | return it[key];
|
221 | } catch (error) { }
|
222 | };
|
223 |
|
224 |
|
225 | module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
|
226 | var O, tag, result;
|
227 | return it === undefined ? 'Undefined' : it === null ? 'Null'
|
228 |
|
229 | : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
|
230 |
|
231 | : CORRECT_ARGUMENTS ? classofRaw(O)
|
232 |
|
233 | : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
|
234 | };
|
235 |
|
236 |
|
237 | }),
|
238 |
|
239 | 7740:
|
240 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
241 |
|
242 |
|
243 | var hasOwn = __webpack_require__(9297);
|
244 | var ownKeys = __webpack_require__(5031);
|
245 | var getOwnPropertyDescriptorModule = __webpack_require__(7347);
|
246 | var definePropertyModule = __webpack_require__(4913);
|
247 |
|
248 | module.exports = function (target, source, exceptions) {
|
249 | var keys = ownKeys(source);
|
250 | var defineProperty = definePropertyModule.f;
|
251 | var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
|
252 | for (var i = 0; i < keys.length; i++) {
|
253 | var key = keys[i];
|
254 | if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
|
255 | defineProperty(target, key, getOwnPropertyDescriptor(source, key));
|
256 | }
|
257 | }
|
258 | };
|
259 |
|
260 |
|
261 | }),
|
262 |
|
263 | 2211:
|
264 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
265 |
|
266 |
|
267 | var fails = __webpack_require__(9039);
|
268 |
|
269 | module.exports = !fails(function () {
|
270 | function F() { }
|
271 | F.prototype.constructor = null;
|
272 |
|
273 | return Object.getPrototypeOf(new F()) !== F.prototype;
|
274 | });
|
275 |
|
276 |
|
277 | }),
|
278 |
|
279 | 2529:
|
280 | ((module) => {
|
281 |
|
282 |
|
283 |
|
284 |
|
285 | module.exports = function (value, done) {
|
286 | return { value: value, done: done };
|
287 | };
|
288 |
|
289 |
|
290 | }),
|
291 |
|
292 | 6699:
|
293 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
294 |
|
295 |
|
296 | var DESCRIPTORS = __webpack_require__(3724);
|
297 | var definePropertyModule = __webpack_require__(4913);
|
298 | var createPropertyDescriptor = __webpack_require__(6980);
|
299 |
|
300 | module.exports = DESCRIPTORS ? function (object, key, value) {
|
301 | return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
|
302 | } : function (object, key, value) {
|
303 | object[key] = value;
|
304 | return object;
|
305 | };
|
306 |
|
307 |
|
308 | }),
|
309 |
|
310 | 6980:
|
311 | ((module) => {
|
312 |
|
313 |
|
314 | module.exports = function (bitmap, value) {
|
315 | return {
|
316 | enumerable: !(bitmap & 1),
|
317 | configurable: !(bitmap & 2),
|
318 | writable: !(bitmap & 4),
|
319 | value: value
|
320 | };
|
321 | };
|
322 |
|
323 |
|
324 | }),
|
325 |
|
326 | 4659:
|
327 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
328 |
|
329 |
|
330 | var DESCRIPTORS = __webpack_require__(3724);
|
331 | var definePropertyModule = __webpack_require__(4913);
|
332 | var createPropertyDescriptor = __webpack_require__(6980);
|
333 |
|
334 | module.exports = function (object, key, value) {
|
335 | if (DESCRIPTORS) definePropertyModule.f(object, key, createPropertyDescriptor(0, value));
|
336 | else object[key] = value;
|
337 | };
|
338 |
|
339 |
|
340 | }),
|
341 |
|
342 | 2106:
|
343 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
344 |
|
345 |
|
346 | var makeBuiltIn = __webpack_require__(283);
|
347 | var defineProperty = __webpack_require__(4913);
|
348 |
|
349 | module.exports = function (target, name, descriptor) {
|
350 | if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
|
351 | if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
|
352 | return defineProperty.f(target, name, descriptor);
|
353 | };
|
354 |
|
355 |
|
356 | }),
|
357 |
|
358 | 6840:
|
359 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
360 |
|
361 |
|
362 | var isCallable = __webpack_require__(4901);
|
363 | var definePropertyModule = __webpack_require__(4913);
|
364 | var makeBuiltIn = __webpack_require__(283);
|
365 | var defineGlobalProperty = __webpack_require__(9433);
|
366 |
|
367 | module.exports = function (O, key, value, options) {
|
368 | if (!options) options = {};
|
369 | var simple = options.enumerable;
|
370 | var name = options.name !== undefined ? options.name : key;
|
371 | if (isCallable(value)) makeBuiltIn(value, name, options);
|
372 | if (options.global) {
|
373 | if (simple) O[key] = value;
|
374 | else defineGlobalProperty(key, value);
|
375 | } else {
|
376 | try {
|
377 | if (!options.unsafe) delete O[key];
|
378 | else if (O[key]) simple = true;
|
379 | } catch (error) { }
|
380 | if (simple) O[key] = value;
|
381 | else definePropertyModule.f(O, key, {
|
382 | value: value,
|
383 | enumerable: false,
|
384 | configurable: !options.nonConfigurable,
|
385 | writable: !options.nonWritable
|
386 | });
|
387 | } return O;
|
388 | };
|
389 |
|
390 |
|
391 | }),
|
392 |
|
393 | 6279:
|
394 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
395 |
|
396 |
|
397 | var defineBuiltIn = __webpack_require__(6840);
|
398 |
|
399 | module.exports = function (target, src, options) {
|
400 | for (var key in src) defineBuiltIn(target, key, src[key], options);
|
401 | return target;
|
402 | };
|
403 |
|
404 |
|
405 | }),
|
406 |
|
407 | 9433:
|
408 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
409 |
|
410 |
|
411 | var global = __webpack_require__(4475);
|
412 |
|
413 |
|
414 | var defineProperty = Object.defineProperty;
|
415 |
|
416 | module.exports = function (key, value) {
|
417 | try {
|
418 | defineProperty(global, key, { value: value, configurable: true, writable: true });
|
419 | } catch (error) {
|
420 | global[key] = value;
|
421 | } return value;
|
422 | };
|
423 |
|
424 |
|
425 | }),
|
426 |
|
427 | 3724:
|
428 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
429 |
|
430 |
|
431 | var fails = __webpack_require__(9039);
|
432 |
|
433 |
|
434 | module.exports = !fails(function () {
|
435 |
|
436 | return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
|
437 | });
|
438 |
|
439 |
|
440 | }),
|
441 |
|
442 | 4055:
|
443 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
444 |
|
445 |
|
446 | var global = __webpack_require__(4475);
|
447 | var isObject = __webpack_require__(34);
|
448 |
|
449 | var document = global.document;
|
450 |
|
451 | var EXISTS = isObject(document) && isObject(document.createElement);
|
452 |
|
453 | module.exports = function (it) {
|
454 | return EXISTS ? document.createElement(it) : {};
|
455 | };
|
456 |
|
457 |
|
458 | }),
|
459 |
|
460 | 6837:
|
461 | ((module) => {
|
462 |
|
463 |
|
464 | var $TypeError = TypeError;
|
465 | var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF;
|
466 |
|
467 | module.exports = function (it) {
|
468 | if (it > MAX_SAFE_INTEGER) throw $TypeError('Maximum allowed index exceeded');
|
469 | return it;
|
470 | };
|
471 |
|
472 |
|
473 | }),
|
474 |
|
475 | 9392:
|
476 | ((module) => {
|
477 |
|
478 |
|
479 | module.exports = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
|
480 |
|
481 |
|
482 | }),
|
483 |
|
484 | 7388:
|
485 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
486 |
|
487 |
|
488 | var global = __webpack_require__(4475);
|
489 | var userAgent = __webpack_require__(9392);
|
490 |
|
491 | var process = global.process;
|
492 | var Deno = global.Deno;
|
493 | var versions = process && process.versions || Deno && Deno.version;
|
494 | var v8 = versions && versions.v8;
|
495 | var match, version;
|
496 |
|
497 | if (v8) {
|
498 | match = v8.split('.');
|
499 |
|
500 |
|
501 | version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
|
502 | }
|
503 |
|
504 |
|
505 |
|
506 | if (!version && userAgent) {
|
507 | match = userAgent.match(/Edge\/(\d+)/);
|
508 | if (!match || match[1] >= 74) {
|
509 | match = userAgent.match(/Chrome\/(\d+)/);
|
510 | if (match) version = +match[1];
|
511 | }
|
512 | }
|
513 |
|
514 | module.exports = version;
|
515 |
|
516 |
|
517 | }),
|
518 |
|
519 | 8727:
|
520 | ((module) => {
|
521 |
|
522 |
|
523 |
|
524 | module.exports = [
|
525 | 'constructor',
|
526 | 'hasOwnProperty',
|
527 | 'isPrototypeOf',
|
528 | 'propertyIsEnumerable',
|
529 | 'toLocaleString',
|
530 | 'toString',
|
531 | 'valueOf'
|
532 | ];
|
533 |
|
534 |
|
535 | }),
|
536 |
|
537 | 6518:
|
538 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
539 |
|
540 |
|
541 | var global = __webpack_require__(4475);
|
542 | var getOwnPropertyDescriptor = (__webpack_require__(7347).f);
|
543 | var createNonEnumerableProperty = __webpack_require__(6699);
|
544 | var defineBuiltIn = __webpack_require__(6840);
|
545 | var defineGlobalProperty = __webpack_require__(9433);
|
546 | var copyConstructorProperties = __webpack_require__(7740);
|
547 | var isForced = __webpack_require__(2796);
|
548 |
|
549 |
|
550 |
|
551 |
|
552 |
|
553 |
|
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 |
|
561 |
|
562 |
|
563 |
|
564 | module.exports = function (options, source) {
|
565 | var TARGET = options.target;
|
566 | var GLOBAL = options.global;
|
567 | var STATIC = options.stat;
|
568 | var FORCED, target, key, targetProperty, sourceProperty, descriptor;
|
569 | if (GLOBAL) {
|
570 | target = global;
|
571 | } else if (STATIC) {
|
572 | target = global[TARGET] || defineGlobalProperty(TARGET, {});
|
573 | } else {
|
574 | target = global[TARGET] && global[TARGET].prototype;
|
575 | }
|
576 | if (target) for (key in source) {
|
577 | sourceProperty = source[key];
|
578 | if (options.dontCallGetSet) {
|
579 | descriptor = getOwnPropertyDescriptor(target, key);
|
580 | targetProperty = descriptor && descriptor.value;
|
581 | } else targetProperty = target[key];
|
582 | FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
|
583 |
|
584 | if (!FORCED && targetProperty !== undefined) {
|
585 | if (typeof sourceProperty == typeof targetProperty) continue;
|
586 | copyConstructorProperties(sourceProperty, targetProperty);
|
587 | }
|
588 |
|
589 | if (options.sham || (targetProperty && targetProperty.sham)) {
|
590 | createNonEnumerableProperty(sourceProperty, 'sham', true);
|
591 | }
|
592 | defineBuiltIn(target, key, sourceProperty, options);
|
593 | }
|
594 | };
|
595 |
|
596 |
|
597 | }),
|
598 |
|
599 | 9039:
|
600 | ((module) => {
|
601 |
|
602 |
|
603 | module.exports = function (exec) {
|
604 | try {
|
605 | return !!exec();
|
606 | } catch (error) {
|
607 | return true;
|
608 | }
|
609 | };
|
610 |
|
611 |
|
612 | }),
|
613 |
|
614 | 6080:
|
615 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
616 |
|
617 |
|
618 | var uncurryThis = __webpack_require__(7476);
|
619 | var aCallable = __webpack_require__(9306);
|
620 | var NATIVE_BIND = __webpack_require__(616);
|
621 |
|
622 | var bind = uncurryThis(uncurryThis.bind);
|
623 |
|
624 |
|
625 | module.exports = function (fn, that) {
|
626 | aCallable(fn);
|
627 | return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {
|
628 | return fn.apply(that, arguments);
|
629 | };
|
630 | };
|
631 |
|
632 |
|
633 | }),
|
634 |
|
635 | 616:
|
636 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
637 |
|
638 |
|
639 | var fails = __webpack_require__(9039);
|
640 |
|
641 | module.exports = !fails(function () {
|
642 |
|
643 | var test = (function () { }).bind();
|
644 |
|
645 | return typeof test != 'function' || test.hasOwnProperty('prototype');
|
646 | });
|
647 |
|
648 |
|
649 | }),
|
650 |
|
651 | 9565:
|
652 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
653 |
|
654 |
|
655 | var NATIVE_BIND = __webpack_require__(616);
|
656 |
|
657 | var call = Function.prototype.call;
|
658 |
|
659 | module.exports = NATIVE_BIND ? call.bind(call) : function () {
|
660 | return call.apply(call, arguments);
|
661 | };
|
662 |
|
663 |
|
664 | }),
|
665 |
|
666 | 350:
|
667 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
668 |
|
669 |
|
670 | var DESCRIPTORS = __webpack_require__(3724);
|
671 | var hasOwn = __webpack_require__(9297);
|
672 |
|
673 | var FunctionPrototype = Function.prototype;
|
674 |
|
675 | var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
|
676 |
|
677 | var EXISTS = hasOwn(FunctionPrototype, 'name');
|
678 |
|
679 | var PROPER = EXISTS && (function something() { }).name === 'something';
|
680 | var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
|
681 |
|
682 | module.exports = {
|
683 | EXISTS: EXISTS,
|
684 | PROPER: PROPER,
|
685 | CONFIGURABLE: CONFIGURABLE
|
686 | };
|
687 |
|
688 |
|
689 | }),
|
690 |
|
691 | 6706:
|
692 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
693 |
|
694 |
|
695 | var uncurryThis = __webpack_require__(9504);
|
696 | var aCallable = __webpack_require__(9306);
|
697 |
|
698 | module.exports = function (object, key, method) {
|
699 | try {
|
700 |
|
701 | return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
|
702 | } catch (error) { }
|
703 | };
|
704 |
|
705 |
|
706 | }),
|
707 |
|
708 | 7476:
|
709 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
710 |
|
711 |
|
712 | var classofRaw = __webpack_require__(4576);
|
713 | var uncurryThis = __webpack_require__(9504);
|
714 |
|
715 | module.exports = function (fn) {
|
716 |
|
717 |
|
718 |
|
719 | if (classofRaw(fn) === 'Function') return uncurryThis(fn);
|
720 | };
|
721 |
|
722 |
|
723 | }),
|
724 |
|
725 | 9504:
|
726 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
727 |
|
728 |
|
729 | var NATIVE_BIND = __webpack_require__(616);
|
730 |
|
731 | var FunctionPrototype = Function.prototype;
|
732 | var call = FunctionPrototype.call;
|
733 | var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
|
734 |
|
735 | module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
|
736 | return function () {
|
737 | return call.apply(fn, arguments);
|
738 | };
|
739 | };
|
740 |
|
741 |
|
742 | }),
|
743 |
|
744 | 7751:
|
745 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
746 |
|
747 |
|
748 | var global = __webpack_require__(4475);
|
749 | var isCallable = __webpack_require__(4901);
|
750 |
|
751 | var aFunction = function (argument) {
|
752 | return isCallable(argument) ? argument : undefined;
|
753 | };
|
754 |
|
755 | module.exports = function (namespace, method) {
|
756 | return arguments.length < 2 ? aFunction(global[namespace]) : global[namespace] && global[namespace][method];
|
757 | };
|
758 |
|
759 |
|
760 | }),
|
761 |
|
762 | 1767:
|
763 | ((module) => {
|
764 |
|
765 |
|
766 |
|
767 |
|
768 | module.exports = function (obj) {
|
769 | return {
|
770 | iterator: obj,
|
771 | next: obj.next,
|
772 | done: false
|
773 | };
|
774 | };
|
775 |
|
776 |
|
777 | }),
|
778 |
|
779 | 851:
|
780 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
781 |
|
782 |
|
783 | var classof = __webpack_require__(6955);
|
784 | var getMethod = __webpack_require__(5966);
|
785 | var isNullOrUndefined = __webpack_require__(4117);
|
786 | var Iterators = __webpack_require__(6269);
|
787 | var wellKnownSymbol = __webpack_require__(8227);
|
788 |
|
789 | var ITERATOR = wellKnownSymbol('iterator');
|
790 |
|
791 | module.exports = function (it) {
|
792 | if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)
|
793 | || getMethod(it, '@@iterator')
|
794 | || Iterators[classof(it)];
|
795 | };
|
796 |
|
797 |
|
798 | }),
|
799 |
|
800 | 81:
|
801 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
802 |
|
803 |
|
804 | var call = __webpack_require__(9565);
|
805 | var aCallable = __webpack_require__(9306);
|
806 | var anObject = __webpack_require__(8551);
|
807 | var tryToString = __webpack_require__(6823);
|
808 | var getIteratorMethod = __webpack_require__(851);
|
809 |
|
810 | var $TypeError = TypeError;
|
811 |
|
812 | module.exports = function (argument, usingIterator) {
|
813 | var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
|
814 | if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
|
815 | throw new $TypeError(tryToString(argument) + ' is not iterable');
|
816 | };
|
817 |
|
818 |
|
819 | }),
|
820 |
|
821 | 5966:
|
822 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
823 |
|
824 |
|
825 | var aCallable = __webpack_require__(9306);
|
826 | var isNullOrUndefined = __webpack_require__(4117);
|
827 |
|
828 |
|
829 |
|
830 | module.exports = function (V, P) {
|
831 | var func = V[P];
|
832 | return isNullOrUndefined(func) ? undefined : aCallable(func);
|
833 | };
|
834 |
|
835 |
|
836 | }),
|
837 |
|
838 | 3789:
|
839 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
840 |
|
841 |
|
842 | var aCallable = __webpack_require__(9306);
|
843 | var anObject = __webpack_require__(8551);
|
844 | var call = __webpack_require__(9565);
|
845 | var toIntegerOrInfinity = __webpack_require__(1291);
|
846 | var getIteratorDirect = __webpack_require__(1767);
|
847 |
|
848 | var INVALID_SIZE = 'Invalid size';
|
849 | var $RangeError = RangeError;
|
850 | var $TypeError = TypeError;
|
851 | var max = Math.max;
|
852 |
|
853 | var SetRecord = function (set, intSize) {
|
854 | this.set = set;
|
855 | this.size = max(intSize, 0);
|
856 | this.has = aCallable(set.has);
|
857 | this.keys = aCallable(set.keys);
|
858 | };
|
859 |
|
860 | SetRecord.prototype = {
|
861 | getIterator: function () {
|
862 | return getIteratorDirect(anObject(call(this.keys, this.set)));
|
863 | },
|
864 | includes: function (it) {
|
865 | return call(this.has, this.set, it);
|
866 | }
|
867 | };
|
868 |
|
869 |
|
870 |
|
871 | module.exports = function (obj) {
|
872 | anObject(obj);
|
873 | var numSize = +obj.size;
|
874 |
|
875 |
|
876 | if (numSize !== numSize) throw new $TypeError(INVALID_SIZE);
|
877 | var intSize = toIntegerOrInfinity(numSize);
|
878 | if (intSize < 0) throw new $RangeError(INVALID_SIZE);
|
879 | return new SetRecord(obj, intSize);
|
880 | };
|
881 |
|
882 |
|
883 | }),
|
884 |
|
885 | 4475:
|
886 | (function(module) {
|
887 |
|
888 |
|
889 | var check = function (it) {
|
890 | return it && it.Math === Math && it;
|
891 | };
|
892 |
|
893 |
|
894 | module.exports =
|
895 |
|
896 | check(typeof globalThis == 'object' && globalThis) ||
|
897 | check(typeof window == 'object' && window) ||
|
898 |
|
899 | check(typeof self == 'object' && self) ||
|
900 | check(typeof global == 'object' && global) ||
|
901 | check(typeof this == 'object' && this) ||
|
902 |
|
903 | (function () { return this; })() || Function('return this')();
|
904 |
|
905 |
|
906 | }),
|
907 |
|
908 | 9297:
|
909 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
910 |
|
911 |
|
912 | var uncurryThis = __webpack_require__(9504);
|
913 | var toObject = __webpack_require__(8981);
|
914 |
|
915 | var hasOwnProperty = uncurryThis({}.hasOwnProperty);
|
916 |
|
917 |
|
918 |
|
919 |
|
920 | module.exports = Object.hasOwn || function hasOwn(it, key) {
|
921 | return hasOwnProperty(toObject(it), key);
|
922 | };
|
923 |
|
924 |
|
925 | }),
|
926 |
|
927 | 421:
|
928 | ((module) => {
|
929 |
|
930 |
|
931 | module.exports = {};
|
932 |
|
933 |
|
934 | }),
|
935 |
|
936 | 397:
|
937 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
938 |
|
939 |
|
940 | var getBuiltIn = __webpack_require__(7751);
|
941 |
|
942 | module.exports = getBuiltIn('document', 'documentElement');
|
943 |
|
944 |
|
945 | }),
|
946 |
|
947 | 5917:
|
948 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
949 |
|
950 |
|
951 | var DESCRIPTORS = __webpack_require__(3724);
|
952 | var fails = __webpack_require__(9039);
|
953 | var createElement = __webpack_require__(4055);
|
954 |
|
955 |
|
956 | module.exports = !DESCRIPTORS && !fails(function () {
|
957 |
|
958 | return Object.defineProperty(createElement('div'), 'a', {
|
959 | get: function () { return 7; }
|
960 | }).a !== 7;
|
961 | });
|
962 |
|
963 |
|
964 | }),
|
965 |
|
966 | 7055:
|
967 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
968 |
|
969 |
|
970 | var uncurryThis = __webpack_require__(9504);
|
971 | var fails = __webpack_require__(9039);
|
972 | var classof = __webpack_require__(4576);
|
973 |
|
974 | var $Object = Object;
|
975 | var split = uncurryThis(''.split);
|
976 |
|
977 |
|
978 | module.exports = fails(function () {
|
979 |
|
980 |
|
981 | return !$Object('z').propertyIsEnumerable(0);
|
982 | }) ? function (it) {
|
983 | return classof(it) === 'String' ? split(it, '') : $Object(it);
|
984 | } : $Object;
|
985 |
|
986 |
|
987 | }),
|
988 |
|
989 | 3706:
|
990 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
991 |
|
992 |
|
993 | var uncurryThis = __webpack_require__(9504);
|
994 | var isCallable = __webpack_require__(4901);
|
995 | var store = __webpack_require__(7629);
|
996 |
|
997 | var functionToString = uncurryThis(Function.toString);
|
998 |
|
999 |
|
1000 | if (!isCallable(store.inspectSource)) {
|
1001 | store.inspectSource = function (it) {
|
1002 | return functionToString(it);
|
1003 | };
|
1004 | }
|
1005 |
|
1006 | module.exports = store.inspectSource;
|
1007 |
|
1008 |
|
1009 | }),
|
1010 |
|
1011 | 1181:
|
1012 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1013 |
|
1014 |
|
1015 | var NATIVE_WEAK_MAP = __webpack_require__(8622);
|
1016 | var global = __webpack_require__(4475);
|
1017 | var isObject = __webpack_require__(34);
|
1018 | var createNonEnumerableProperty = __webpack_require__(6699);
|
1019 | var hasOwn = __webpack_require__(9297);
|
1020 | var shared = __webpack_require__(7629);
|
1021 | var sharedKey = __webpack_require__(6119);
|
1022 | var hiddenKeys = __webpack_require__(421);
|
1023 |
|
1024 | var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
|
1025 | var TypeError = global.TypeError;
|
1026 | var WeakMap = global.WeakMap;
|
1027 | var set, get, has;
|
1028 |
|
1029 | var enforce = function (it) {
|
1030 | return has(it) ? get(it) : set(it, {});
|
1031 | };
|
1032 |
|
1033 | var getterFor = function (TYPE) {
|
1034 | return function (it) {
|
1035 | var state;
|
1036 | if (!isObject(it) || (state = get(it)).type !== TYPE) {
|
1037 | throw new TypeError('Incompatible receiver, ' + TYPE + ' required');
|
1038 | } return state;
|
1039 | };
|
1040 | };
|
1041 |
|
1042 | if (NATIVE_WEAK_MAP || shared.state) {
|
1043 | var store = shared.state || (shared.state = new WeakMap());
|
1044 |
|
1045 | store.get = store.get;
|
1046 | store.has = store.has;
|
1047 | store.set = store.set;
|
1048 |
|
1049 | set = function (it, metadata) {
|
1050 | if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
1051 | metadata.facade = it;
|
1052 | store.set(it, metadata);
|
1053 | return metadata;
|
1054 | };
|
1055 | get = function (it) {
|
1056 | return store.get(it) || {};
|
1057 | };
|
1058 | has = function (it) {
|
1059 | return store.has(it);
|
1060 | };
|
1061 | } else {
|
1062 | var STATE = sharedKey('state');
|
1063 | hiddenKeys[STATE] = true;
|
1064 | set = function (it, metadata) {
|
1065 | if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
|
1066 | metadata.facade = it;
|
1067 | createNonEnumerableProperty(it, STATE, metadata);
|
1068 | return metadata;
|
1069 | };
|
1070 | get = function (it) {
|
1071 | return hasOwn(it, STATE) ? it[STATE] : {};
|
1072 | };
|
1073 | has = function (it) {
|
1074 | return hasOwn(it, STATE);
|
1075 | };
|
1076 | }
|
1077 |
|
1078 | module.exports = {
|
1079 | set: set,
|
1080 | get: get,
|
1081 | has: has,
|
1082 | enforce: enforce,
|
1083 | getterFor: getterFor
|
1084 | };
|
1085 |
|
1086 |
|
1087 | /***/ }),
|
1088 |
|
1089 | /***/ 4209:
|
1090 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
1091 |
|
1092 |
|
1093 | var wellKnownSymbol = __webpack_require__(8227);
|
1094 | var Iterators = __webpack_require__(6269);
|
1095 |
|
1096 | var ITERATOR = wellKnownSymbol('iterator');
|
1097 | var ArrayPrototype = Array.prototype;
|
1098 |
|
1099 |
|
1100 | module.exports = function (it) {
|
1101 | return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
|
1102 | };
|
1103 |
|
1104 |
|
1105 | }),
|
1106 |
|
1107 | 4376:
|
1108 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1109 |
|
1110 |
|
1111 | var classof = __webpack_require__(4576);
|
1112 |
|
1113 |
|
1114 |
|
1115 |
|
1116 | module.exports = Array.isArray || function isArray(argument) {
|
1117 | return classof(argument) === 'Array';
|
1118 | };
|
1119 |
|
1120 |
|
1121 | }),
|
1122 |
|
1123 | 4901:
|
1124 | ((module) => {
|
1125 |
|
1126 |
|
1127 |
|
1128 | var documentAll = typeof document == 'object' && document.all;
|
1129 |
|
1130 |
|
1131 |
|
1132 |
|
1133 | module.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
|
1134 | return typeof argument == 'function' || argument === documentAll;
|
1135 | } : function (argument) {
|
1136 | return typeof argument == 'function';
|
1137 | };
|
1138 |
|
1139 |
|
1140 | }),
|
1141 |
|
1142 | 2796:
|
1143 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1144 |
|
1145 |
|
1146 | var fails = __webpack_require__(9039);
|
1147 | var isCallable = __webpack_require__(4901);
|
1148 |
|
1149 | var replacement = /#|\.prototype\./;
|
1150 |
|
1151 | var isForced = function (feature, detection) {
|
1152 | var value = data[normalize(feature)];
|
1153 | return value === POLYFILL ? true
|
1154 | : value === NATIVE ? false
|
1155 | : isCallable(detection) ? fails(detection)
|
1156 | : !!detection;
|
1157 | };
|
1158 |
|
1159 | var normalize = isForced.normalize = function (string) {
|
1160 | return String(string).replace(replacement, '.').toLowerCase();
|
1161 | };
|
1162 |
|
1163 | var data = isForced.data = {};
|
1164 | var NATIVE = isForced.NATIVE = 'N';
|
1165 | var POLYFILL = isForced.POLYFILL = 'P';
|
1166 |
|
1167 | module.exports = isForced;
|
1168 |
|
1169 |
|
1170 | }),
|
1171 |
|
1172 | 4117:
|
1173 | ((module) => {
|
1174 |
|
1175 |
|
1176 |
|
1177 |
|
1178 | module.exports = function (it) {
|
1179 | return it === null || it === undefined;
|
1180 | };
|
1181 |
|
1182 |
|
1183 | }),
|
1184 |
|
1185 | 34:
|
1186 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1187 |
|
1188 |
|
1189 | var isCallable = __webpack_require__(4901);
|
1190 |
|
1191 | module.exports = function (it) {
|
1192 | return typeof it == 'object' ? it !== null : isCallable(it);
|
1193 | };
|
1194 |
|
1195 |
|
1196 | }),
|
1197 |
|
1198 | 6395:
|
1199 | ((module) => {
|
1200 |
|
1201 |
|
1202 | module.exports = false;
|
1203 |
|
1204 |
|
1205 | }),
|
1206 |
|
1207 | 757:
|
1208 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1209 |
|
1210 |
|
1211 | var getBuiltIn = __webpack_require__(7751);
|
1212 | var isCallable = __webpack_require__(4901);
|
1213 | var isPrototypeOf = __webpack_require__(1625);
|
1214 | var USE_SYMBOL_AS_UID = __webpack_require__(7040);
|
1215 |
|
1216 | var $Object = Object;
|
1217 |
|
1218 | module.exports = USE_SYMBOL_AS_UID ? function (it) {
|
1219 | return typeof it == 'symbol';
|
1220 | } : function (it) {
|
1221 | var $Symbol = getBuiltIn('Symbol');
|
1222 | return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
|
1223 | };
|
1224 |
|
1225 |
|
1226 | }),
|
1227 |
|
1228 | 507:
|
1229 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1230 |
|
1231 |
|
1232 | var call = __webpack_require__(9565);
|
1233 |
|
1234 | module.exports = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) {
|
1235 | var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator;
|
1236 | var next = record.next;
|
1237 | var step, result;
|
1238 | while (!(step = call(next, iterator)).done) {
|
1239 | result = fn(step.value);
|
1240 | if (result !== undefined) return result;
|
1241 | }
|
1242 | };
|
1243 |
|
1244 |
|
1245 | }),
|
1246 |
|
1247 | 2652:
|
1248 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1249 |
|
1250 |
|
1251 | var bind = __webpack_require__(6080);
|
1252 | var call = __webpack_require__(9565);
|
1253 | var anObject = __webpack_require__(8551);
|
1254 | var tryToString = __webpack_require__(6823);
|
1255 | var isArrayIteratorMethod = __webpack_require__(4209);
|
1256 | var lengthOfArrayLike = __webpack_require__(6198);
|
1257 | var isPrototypeOf = __webpack_require__(1625);
|
1258 | var getIterator = __webpack_require__(81);
|
1259 | var getIteratorMethod = __webpack_require__(851);
|
1260 | var iteratorClose = __webpack_require__(9539);
|
1261 |
|
1262 | var $TypeError = TypeError;
|
1263 |
|
1264 | var Result = function (stopped, result) {
|
1265 | this.stopped = stopped;
|
1266 | this.result = result;
|
1267 | };
|
1268 |
|
1269 | var ResultPrototype = Result.prototype;
|
1270 |
|
1271 | module.exports = function (iterable, unboundFunction, options) {
|
1272 | var that = options && options.that;
|
1273 | var AS_ENTRIES = !!(options && options.AS_ENTRIES);
|
1274 | var IS_RECORD = !!(options && options.IS_RECORD);
|
1275 | var IS_ITERATOR = !!(options && options.IS_ITERATOR);
|
1276 | var INTERRUPTED = !!(options && options.INTERRUPTED);
|
1277 | var fn = bind(unboundFunction, that);
|
1278 | var iterator, iterFn, index, length, result, next, step;
|
1279 |
|
1280 | var stop = function (condition) {
|
1281 | if (iterator) iteratorClose(iterator, 'normal', condition);
|
1282 | return new Result(true, condition);
|
1283 | };
|
1284 |
|
1285 | var callFn = function (value) {
|
1286 | if (AS_ENTRIES) {
|
1287 | anObject(value);
|
1288 | return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
|
1289 | } return INTERRUPTED ? fn(value, stop) : fn(value);
|
1290 | };
|
1291 |
|
1292 | if (IS_RECORD) {
|
1293 | iterator = iterable.iterator;
|
1294 | } else if (IS_ITERATOR) {
|
1295 | iterator = iterable;
|
1296 | } else {
|
1297 | iterFn = getIteratorMethod(iterable);
|
1298 | if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable');
|
1299 |
|
1300 | if (isArrayIteratorMethod(iterFn)) {
|
1301 | for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
|
1302 | result = callFn(iterable[index]);
|
1303 | if (result && isPrototypeOf(ResultPrototype, result)) return result;
|
1304 | } return new Result(false);
|
1305 | }
|
1306 | iterator = getIterator(iterable, iterFn);
|
1307 | }
|
1308 |
|
1309 | next = IS_RECORD ? iterable.next : iterator.next;
|
1310 | while (!(step = call(next, iterator)).done) {
|
1311 | try {
|
1312 | result = callFn(step.value);
|
1313 | } catch (error) {
|
1314 | iteratorClose(iterator, 'throw', error);
|
1315 | }
|
1316 | if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
|
1317 | } return new Result(false);
|
1318 | };
|
1319 |
|
1320 |
|
1321 | }),
|
1322 |
|
1323 | 9539:
|
1324 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1325 |
|
1326 |
|
1327 | var call = __webpack_require__(9565);
|
1328 | var anObject = __webpack_require__(8551);
|
1329 | var getMethod = __webpack_require__(5966);
|
1330 |
|
1331 | module.exports = function (iterator, kind, value) {
|
1332 | var innerResult, innerError;
|
1333 | anObject(iterator);
|
1334 | try {
|
1335 | innerResult = getMethod(iterator, 'return');
|
1336 | if (!innerResult) {
|
1337 | if (kind === 'throw') throw value;
|
1338 | return value;
|
1339 | }
|
1340 | innerResult = call(innerResult, iterator);
|
1341 | } catch (error) {
|
1342 | innerError = true;
|
1343 | innerResult = error;
|
1344 | }
|
1345 | if (kind === 'throw') throw value;
|
1346 | if (innerError) throw innerResult;
|
1347 | anObject(innerResult);
|
1348 | return value;
|
1349 | };
|
1350 |
|
1351 |
|
1352 | }),
|
1353 |
|
1354 | 9462:
|
1355 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1356 |
|
1357 |
|
1358 | var call = __webpack_require__(9565);
|
1359 | var create = __webpack_require__(2360);
|
1360 | var createNonEnumerableProperty = __webpack_require__(6699);
|
1361 | var defineBuiltIns = __webpack_require__(6279);
|
1362 | var wellKnownSymbol = __webpack_require__(8227);
|
1363 | var InternalStateModule = __webpack_require__(1181);
|
1364 | var getMethod = __webpack_require__(5966);
|
1365 | var IteratorPrototype = (__webpack_require__(7657).IteratorPrototype);
|
1366 | var createIterResultObject = __webpack_require__(2529);
|
1367 | var iteratorClose = __webpack_require__(9539);
|
1368 |
|
1369 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
1370 | var ITERATOR_HELPER = 'IteratorHelper';
|
1371 | var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator';
|
1372 | var setInternalState = InternalStateModule.set;
|
1373 |
|
1374 | var createIteratorProxyPrototype = function (IS_ITERATOR) {
|
1375 | var getInternalState = InternalStateModule.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER);
|
1376 |
|
1377 | return defineBuiltIns(create(IteratorPrototype), {
|
1378 | next: function next() {
|
1379 | var state = getInternalState(this);
|
1380 |
|
1381 |
|
1382 |
|
1383 | if (IS_ITERATOR) return state.nextHandler();
|
1384 | try {
|
1385 | var result = state.done ? undefined : state.nextHandler();
|
1386 | return createIterResultObject(result, state.done);
|
1387 | } catch (error) {
|
1388 | state.done = true;
|
1389 | throw error;
|
1390 | }
|
1391 | },
|
1392 | 'return': function () {
|
1393 | var state = getInternalState(this);
|
1394 | var iterator = state.iterator;
|
1395 | state.done = true;
|
1396 | if (IS_ITERATOR) {
|
1397 | var returnMethod = getMethod(iterator, 'return');
|
1398 | return returnMethod ? call(returnMethod, iterator) : createIterResultObject(undefined, true);
|
1399 | }
|
1400 | if (state.inner) try {
|
1401 | iteratorClose(state.inner.iterator, 'normal');
|
1402 | } catch (error) {
|
1403 | return iteratorClose(iterator, 'throw', error);
|
1404 | }
|
1405 | iteratorClose(iterator, 'normal');
|
1406 | return createIterResultObject(undefined, true);
|
1407 | }
|
1408 | });
|
1409 | };
|
1410 |
|
1411 | var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true);
|
1412 | var IteratorHelperPrototype = createIteratorProxyPrototype(false);
|
1413 |
|
1414 | createNonEnumerableProperty(IteratorHelperPrototype, TO_STRING_TAG, 'Iterator Helper');
|
1415 |
|
1416 | module.exports = function (nextHandler, IS_ITERATOR) {
|
1417 | var IteratorProxy = function Iterator(record, state) {
|
1418 | if (state) {
|
1419 | state.iterator = record.iterator;
|
1420 | state.next = record.next;
|
1421 | } else state = record;
|
1422 | state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
|
1423 | state.nextHandler = nextHandler;
|
1424 | state.counter = 0;
|
1425 | state.done = false;
|
1426 | setInternalState(this, state);
|
1427 | };
|
1428 |
|
1429 | IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype;
|
1430 |
|
1431 | return IteratorProxy;
|
1432 | };
|
1433 |
|
1434 |
|
1435 | }),
|
1436 |
|
1437 | 713:
|
1438 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1439 |
|
1440 |
|
1441 | var call = __webpack_require__(9565);
|
1442 | var aCallable = __webpack_require__(9306);
|
1443 | var anObject = __webpack_require__(8551);
|
1444 | var getIteratorDirect = __webpack_require__(1767);
|
1445 | var createIteratorProxy = __webpack_require__(9462);
|
1446 | var callWithSafeIterationClosing = __webpack_require__(6319);
|
1447 |
|
1448 | var IteratorProxy = createIteratorProxy(function () {
|
1449 | var iterator = this.iterator;
|
1450 | var result = anObject(call(this.next, iterator));
|
1451 | var done = this.done = !!result.done;
|
1452 | if (!done) return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true);
|
1453 | });
|
1454 |
|
1455 |
|
1456 |
|
1457 | module.exports = function map(mapper) {
|
1458 | anObject(this);
|
1459 | aCallable(mapper);
|
1460 | return new IteratorProxy(getIteratorDirect(this), {
|
1461 | mapper: mapper
|
1462 | });
|
1463 | };
|
1464 |
|
1465 |
|
1466 | }),
|
1467 |
|
1468 | 7657:
|
1469 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1470 |
|
1471 |
|
1472 | var fails = __webpack_require__(9039);
|
1473 | var isCallable = __webpack_require__(4901);
|
1474 | var isObject = __webpack_require__(34);
|
1475 | var create = __webpack_require__(2360);
|
1476 | var getPrototypeOf = __webpack_require__(2787);
|
1477 | var defineBuiltIn = __webpack_require__(6840);
|
1478 | var wellKnownSymbol = __webpack_require__(8227);
|
1479 | var IS_PURE = __webpack_require__(6395);
|
1480 |
|
1481 | var ITERATOR = wellKnownSymbol('iterator');
|
1482 | var BUGGY_SAFARI_ITERATORS = false;
|
1483 |
|
1484 |
|
1485 |
|
1486 | var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
|
1487 |
|
1488 |
|
1489 | if ([].keys) {
|
1490 | arrayIterator = [].keys();
|
1491 |
|
1492 | if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
|
1493 | else {
|
1494 | PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
|
1495 | if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
|
1496 | }
|
1497 | }
|
1498 |
|
1499 | var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () {
|
1500 | var test = {};
|
1501 |
|
1502 | return IteratorPrototype[ITERATOR].call(test) !== test;
|
1503 | });
|
1504 |
|
1505 | if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
|
1506 | else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
|
1507 |
|
1508 |
|
1509 |
|
1510 | if (!isCallable(IteratorPrototype[ITERATOR])) {
|
1511 | defineBuiltIn(IteratorPrototype, ITERATOR, function () {
|
1512 | return this;
|
1513 | });
|
1514 | }
|
1515 |
|
1516 | module.exports = {
|
1517 | IteratorPrototype: IteratorPrototype,
|
1518 | BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
|
1519 | };
|
1520 |
|
1521 |
|
1522 | }),
|
1523 |
|
1524 | 6269:
|
1525 | ((module) => {
|
1526 |
|
1527 |
|
1528 | module.exports = {};
|
1529 |
|
1530 |
|
1531 | }),
|
1532 |
|
1533 | 6198:
|
1534 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1535 |
|
1536 |
|
1537 | var toLength = __webpack_require__(8014);
|
1538 |
|
1539 |
|
1540 |
|
1541 | module.exports = function (obj) {
|
1542 | return toLength(obj.length);
|
1543 | };
|
1544 |
|
1545 |
|
1546 | }),
|
1547 |
|
1548 | 283:
|
1549 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1550 |
|
1551 |
|
1552 | var uncurryThis = __webpack_require__(9504);
|
1553 | var fails = __webpack_require__(9039);
|
1554 | var isCallable = __webpack_require__(4901);
|
1555 | var hasOwn = __webpack_require__(9297);
|
1556 | var DESCRIPTORS = __webpack_require__(3724);
|
1557 | var CONFIGURABLE_FUNCTION_NAME = (__webpack_require__(350).CONFIGURABLE);
|
1558 | var inspectSource = __webpack_require__(3706);
|
1559 | var InternalStateModule = __webpack_require__(1181);
|
1560 |
|
1561 | var enforceInternalState = InternalStateModule.enforce;
|
1562 | var getInternalState = InternalStateModule.get;
|
1563 | var $String = String;
|
1564 |
|
1565 | var defineProperty = Object.defineProperty;
|
1566 | var stringSlice = uncurryThis(''.slice);
|
1567 | var replace = uncurryThis(''.replace);
|
1568 | var join = uncurryThis([].join);
|
1569 |
|
1570 | var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {
|
1571 | return defineProperty(function () { }, 'length', { value: 8 }).length !== 8;
|
1572 | });
|
1573 |
|
1574 | var TEMPLATE = String(String).split('String');
|
1575 |
|
1576 | var makeBuiltIn = module.exports = function (value, name, options) {
|
1577 | if (stringSlice($String(name), 0, 7) === 'Symbol(') {
|
1578 | name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
|
1579 | }
|
1580 | if (options && options.getter) name = 'get ' + name;
|
1581 | if (options && options.setter) name = 'set ' + name;
|
1582 | if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
|
1583 | if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });
|
1584 | else value.name = name;
|
1585 | }
|
1586 | if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {
|
1587 | defineProperty(value, 'length', { value: options.arity });
|
1588 | }
|
1589 | try {
|
1590 | if (options && hasOwn(options, 'constructor') && options.constructor) {
|
1591 | if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });
|
1592 |
|
1593 | } else if (value.prototype) value.prototype = undefined;
|
1594 | } catch (error) { }
|
1595 | var state = enforceInternalState(value);
|
1596 | if (!hasOwn(state, 'source')) {
|
1597 | state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
|
1598 | } return value;
|
1599 | };
|
1600 |
|
1601 |
|
1602 |
|
1603 | Function.prototype.toString = makeBuiltIn(function toString() {
|
1604 | return isCallable(this) && getInternalState(this).source || inspectSource(this);
|
1605 | }, 'toString');
|
1606 |
|
1607 |
|
1608 | }),
|
1609 |
|
1610 | 741:
|
1611 | ((module) => {
|
1612 |
|
1613 |
|
1614 | var ceil = Math.ceil;
|
1615 | var floor = Math.floor;
|
1616 |
|
1617 |
|
1618 |
|
1619 |
|
1620 | module.exports = Math.trunc || function trunc(x) {
|
1621 | var n = +x;
|
1622 | return (n > 0 ? floor : ceil)(n);
|
1623 | };
|
1624 |
|
1625 |
|
1626 | }),
|
1627 |
|
1628 | 6043:
|
1629 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1630 |
|
1631 |
|
1632 | var aCallable = __webpack_require__(9306);
|
1633 |
|
1634 | var $TypeError = TypeError;
|
1635 |
|
1636 | var PromiseCapability = function (C) {
|
1637 | var resolve, reject;
|
1638 | this.promise = new C(function ($$resolve, $$reject) {
|
1639 | if (resolve !== undefined || reject !== undefined) throw new $TypeError('Bad Promise constructor');
|
1640 | resolve = $$resolve;
|
1641 | reject = $$reject;
|
1642 | });
|
1643 | this.resolve = aCallable(resolve);
|
1644 | this.reject = aCallable(reject);
|
1645 | };
|
1646 |
|
1647 |
|
1648 |
|
1649 | module.exports.f = function (C) {
|
1650 | return new PromiseCapability(C);
|
1651 | };
|
1652 |
|
1653 |
|
1654 | }),
|
1655 |
|
1656 | 2360:
|
1657 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1658 |
|
1659 |
|
1660 |
|
1661 | var anObject = __webpack_require__(8551);
|
1662 | var definePropertiesModule = __webpack_require__(6801);
|
1663 | var enumBugKeys = __webpack_require__(8727);
|
1664 | var hiddenKeys = __webpack_require__(421);
|
1665 | var html = __webpack_require__(397);
|
1666 | var documentCreateElement = __webpack_require__(4055);
|
1667 | var sharedKey = __webpack_require__(6119);
|
1668 |
|
1669 | var GT = '>';
|
1670 | var LT = '<';
|
1671 | var PROTOTYPE = 'prototype';
|
1672 | var SCRIPT = 'script';
|
1673 | var IE_PROTO = sharedKey('IE_PROTO');
|
1674 |
|
1675 | var EmptyConstructor = function () { };
|
1676 |
|
1677 | var scriptTag = function (content) {
|
1678 | return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
|
1679 | };
|
1680 |
|
1681 |
|
1682 | var NullProtoObjectViaActiveX = function (activeXDocument) {
|
1683 | activeXDocument.write(scriptTag(''));
|
1684 | activeXDocument.close();
|
1685 | var temp = activeXDocument.parentWindow.Object;
|
1686 | activeXDocument = null;
|
1687 | return temp;
|
1688 | };
|
1689 |
|
1690 |
|
1691 | var NullProtoObjectViaIFrame = function () {
|
1692 |
|
1693 | var iframe = documentCreateElement('iframe');
|
1694 | var JS = 'java' + SCRIPT + ':';
|
1695 | var iframeDocument;
|
1696 | iframe.style.display = 'none';
|
1697 | html.appendChild(iframe);
|
1698 |
|
1699 | iframe.src = String(JS);
|
1700 | iframeDocument = iframe.contentWindow.document;
|
1701 | iframeDocument.open();
|
1702 | iframeDocument.write(scriptTag('document.F=Object'));
|
1703 | iframeDocument.close();
|
1704 | return iframeDocument.F;
|
1705 | };
|
1706 |
|
1707 |
|
1708 |
|
1709 |
|
1710 |
|
1711 |
|
1712 | var activeXDocument;
|
1713 | var NullProtoObject = function () {
|
1714 | try {
|
1715 | activeXDocument = new ActiveXObject('htmlfile');
|
1716 | } catch (error) { }
|
1717 | NullProtoObject = typeof document != 'undefined'
|
1718 | ? document.domain && activeXDocument
|
1719 | ? NullProtoObjectViaActiveX(activeXDocument)
|
1720 | : NullProtoObjectViaIFrame()
|
1721 | : NullProtoObjectViaActiveX(activeXDocument);
|
1722 | var length = enumBugKeys.length;
|
1723 | while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
|
1724 | return NullProtoObject();
|
1725 | };
|
1726 |
|
1727 | hiddenKeys[IE_PROTO] = true;
|
1728 |
|
1729 |
|
1730 |
|
1731 |
|
1732 | module.exports = Object.create || function create(O, Properties) {
|
1733 | var result;
|
1734 | if (O !== null) {
|
1735 | EmptyConstructor[PROTOTYPE] = anObject(O);
|
1736 | result = new EmptyConstructor();
|
1737 | EmptyConstructor[PROTOTYPE] = null;
|
1738 |
|
1739 | result[IE_PROTO] = O;
|
1740 | } else result = NullProtoObject();
|
1741 | return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
|
1742 | };
|
1743 |
|
1744 |
|
1745 | }),
|
1746 |
|
1747 | 6801:
|
1748 | ((__unused_webpack_module, exports, __webpack_require__) => {
|
1749 |
|
1750 |
|
1751 | var DESCRIPTORS = __webpack_require__(3724);
|
1752 | var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(8686);
|
1753 | var definePropertyModule = __webpack_require__(4913);
|
1754 | var anObject = __webpack_require__(8551);
|
1755 | var toIndexedObject = __webpack_require__(5397);
|
1756 | var objectKeys = __webpack_require__(1072);
|
1757 |
|
1758 |
|
1759 |
|
1760 |
|
1761 | exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
|
1762 | anObject(O);
|
1763 | var props = toIndexedObject(Properties);
|
1764 | var keys = objectKeys(Properties);
|
1765 | var length = keys.length;
|
1766 | var index = 0;
|
1767 | var key;
|
1768 | while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
|
1769 | return O;
|
1770 | };
|
1771 |
|
1772 |
|
1773 | }),
|
1774 |
|
1775 | 4913:
|
1776 | ((__unused_webpack_module, exports, __webpack_require__) => {
|
1777 |
|
1778 |
|
1779 | var DESCRIPTORS = __webpack_require__(3724);
|
1780 | var IE8_DOM_DEFINE = __webpack_require__(5917);
|
1781 | var V8_PROTOTYPE_DEFINE_BUG = __webpack_require__(8686);
|
1782 | var anObject = __webpack_require__(8551);
|
1783 | var toPropertyKey = __webpack_require__(6969);
|
1784 |
|
1785 | var $TypeError = TypeError;
|
1786 |
|
1787 | var $defineProperty = Object.defineProperty;
|
1788 |
|
1789 | var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
1790 | var ENUMERABLE = 'enumerable';
|
1791 | var CONFIGURABLE = 'configurable';
|
1792 | var WRITABLE = 'writable';
|
1793 |
|
1794 |
|
1795 |
|
1796 | exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
|
1797 | anObject(O);
|
1798 | P = toPropertyKey(P);
|
1799 | anObject(Attributes);
|
1800 | if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
|
1801 | var current = $getOwnPropertyDescriptor(O, P);
|
1802 | if (current && current[WRITABLE]) {
|
1803 | O[P] = Attributes.value;
|
1804 | Attributes = {
|
1805 | configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
|
1806 | enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
|
1807 | writable: false
|
1808 | };
|
1809 | }
|
1810 | } return $defineProperty(O, P, Attributes);
|
1811 | } : $defineProperty : function defineProperty(O, P, Attributes) {
|
1812 | anObject(O);
|
1813 | P = toPropertyKey(P);
|
1814 | anObject(Attributes);
|
1815 | if (IE8_DOM_DEFINE) try {
|
1816 | return $defineProperty(O, P, Attributes);
|
1817 | } catch (error) { }
|
1818 | if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported');
|
1819 | if ('value' in Attributes) O[P] = Attributes.value;
|
1820 | return O;
|
1821 | };
|
1822 |
|
1823 |
|
1824 | }),
|
1825 |
|
1826 | 7347:
|
1827 | ((__unused_webpack_module, exports, __webpack_require__) => {
|
1828 |
|
1829 |
|
1830 | var DESCRIPTORS = __webpack_require__(3724);
|
1831 | var call = __webpack_require__(9565);
|
1832 | var propertyIsEnumerableModule = __webpack_require__(8773);
|
1833 | var createPropertyDescriptor = __webpack_require__(6980);
|
1834 | var toIndexedObject = __webpack_require__(5397);
|
1835 | var toPropertyKey = __webpack_require__(6969);
|
1836 | var hasOwn = __webpack_require__(9297);
|
1837 | var IE8_DOM_DEFINE = __webpack_require__(5917);
|
1838 |
|
1839 |
|
1840 | var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
1841 |
|
1842 |
|
1843 |
|
1844 | exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
|
1845 | O = toIndexedObject(O);
|
1846 | P = toPropertyKey(P);
|
1847 | if (IE8_DOM_DEFINE) try {
|
1848 | return $getOwnPropertyDescriptor(O, P);
|
1849 | } catch (error) { }
|
1850 | if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
|
1851 | };
|
1852 |
|
1853 |
|
1854 | }),
|
1855 |
|
1856 | 8480:
|
1857 | ((__unused_webpack_module, exports, __webpack_require__) => {
|
1858 |
|
1859 |
|
1860 | var internalObjectKeys = __webpack_require__(1828);
|
1861 | var enumBugKeys = __webpack_require__(8727);
|
1862 |
|
1863 | var hiddenKeys = enumBugKeys.concat('length', 'prototype');
|
1864 |
|
1865 |
|
1866 |
|
1867 |
|
1868 | exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
|
1869 | return internalObjectKeys(O, hiddenKeys);
|
1870 | };
|
1871 |
|
1872 |
|
1873 | }),
|
1874 |
|
1875 | 3717:
|
1876 | ((__unused_webpack_module, exports) => {
|
1877 |
|
1878 |
|
1879 |
|
1880 | exports.f = Object.getOwnPropertySymbols;
|
1881 |
|
1882 |
|
1883 | }),
|
1884 |
|
1885 | 2787:
|
1886 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1887 |
|
1888 |
|
1889 | var hasOwn = __webpack_require__(9297);
|
1890 | var isCallable = __webpack_require__(4901);
|
1891 | var toObject = __webpack_require__(8981);
|
1892 | var sharedKey = __webpack_require__(6119);
|
1893 | var CORRECT_PROTOTYPE_GETTER = __webpack_require__(2211);
|
1894 |
|
1895 | var IE_PROTO = sharedKey('IE_PROTO');
|
1896 | var $Object = Object;
|
1897 | var ObjectPrototype = $Object.prototype;
|
1898 |
|
1899 |
|
1900 |
|
1901 |
|
1902 | module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
|
1903 | var object = toObject(O);
|
1904 | if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
|
1905 | var constructor = object.constructor;
|
1906 | if (isCallable(constructor) && object instanceof constructor) {
|
1907 | return constructor.prototype;
|
1908 | } return object instanceof $Object ? ObjectPrototype : null;
|
1909 | };
|
1910 |
|
1911 |
|
1912 | /***/ }),
|
1913 |
|
1914 | /***/ 1625:
|
1915 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
1916 |
|
1917 |
|
1918 | var uncurryThis = __webpack_require__(9504);
|
1919 |
|
1920 | module.exports = uncurryThis({}.isPrototypeOf);
|
1921 |
|
1922 |
|
1923 | }),
|
1924 |
|
1925 | 1828:
|
1926 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1927 |
|
1928 |
|
1929 | var uncurryThis = __webpack_require__(9504);
|
1930 | var hasOwn = __webpack_require__(9297);
|
1931 | var toIndexedObject = __webpack_require__(5397);
|
1932 | var indexOf = (__webpack_require__(9617).indexOf);
|
1933 | var hiddenKeys = __webpack_require__(421);
|
1934 |
|
1935 | var push = uncurryThis([].push);
|
1936 |
|
1937 | module.exports = function (object, names) {
|
1938 | var O = toIndexedObject(object);
|
1939 | var i = 0;
|
1940 | var result = [];
|
1941 | var key;
|
1942 | for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
|
1943 |
|
1944 | while (names.length > i) if (hasOwn(O, key = names[i++])) {
|
1945 | ~indexOf(result, key) || push(result, key);
|
1946 | }
|
1947 | return result;
|
1948 | };
|
1949 |
|
1950 |
|
1951 | }),
|
1952 |
|
1953 | 1072:
|
1954 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1955 |
|
1956 |
|
1957 | var internalObjectKeys = __webpack_require__(1828);
|
1958 | var enumBugKeys = __webpack_require__(8727);
|
1959 |
|
1960 |
|
1961 |
|
1962 |
|
1963 | module.exports = Object.keys || function keys(O) {
|
1964 | return internalObjectKeys(O, enumBugKeys);
|
1965 | };
|
1966 |
|
1967 |
|
1968 | }),
|
1969 |
|
1970 | 8773:
|
1971 | ((__unused_webpack_module, exports) => {
|
1972 |
|
1973 |
|
1974 | var $propertyIsEnumerable = {}.propertyIsEnumerable;
|
1975 |
|
1976 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
1977 |
|
1978 |
|
1979 | var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
|
1980 |
|
1981 |
|
1982 |
|
1983 | exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
|
1984 | var descriptor = getOwnPropertyDescriptor(this, V);
|
1985 | return !!descriptor && descriptor.enumerable;
|
1986 | } : $propertyIsEnumerable;
|
1987 |
|
1988 |
|
1989 | }),
|
1990 |
|
1991 | 4270:
|
1992 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
1993 |
|
1994 |
|
1995 | var call = __webpack_require__(9565);
|
1996 | var isCallable = __webpack_require__(4901);
|
1997 | var isObject = __webpack_require__(34);
|
1998 |
|
1999 | var $TypeError = TypeError;
|
2000 |
|
2001 |
|
2002 |
|
2003 | module.exports = function (input, pref) {
|
2004 | var fn, val;
|
2005 | if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
|
2006 | if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
|
2007 | if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
|
2008 | throw new $TypeError("Can't convert object to primitive value");
|
2009 | };
|
2010 |
|
2011 |
|
2012 | }),
|
2013 |
|
2014 | 5031:
|
2015 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2016 |
|
2017 |
|
2018 | var getBuiltIn = __webpack_require__(7751);
|
2019 | var uncurryThis = __webpack_require__(9504);
|
2020 | var getOwnPropertyNamesModule = __webpack_require__(8480);
|
2021 | var getOwnPropertySymbolsModule = __webpack_require__(3717);
|
2022 | var anObject = __webpack_require__(8551);
|
2023 |
|
2024 | var concat = uncurryThis([].concat);
|
2025 |
|
2026 |
|
2027 | module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
|
2028 | var keys = getOwnPropertyNamesModule.f(anObject(it));
|
2029 | var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
|
2030 | return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
|
2031 | };
|
2032 |
|
2033 |
|
2034 | }),
|
2035 |
|
2036 | 8235:
|
2037 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2038 |
|
2039 |
|
2040 | var uncurryThis = __webpack_require__(9504);
|
2041 | var hasOwn = __webpack_require__(9297);
|
2042 |
|
2043 | var $SyntaxError = SyntaxError;
|
2044 | var $parseInt = parseInt;
|
2045 | var fromCharCode = String.fromCharCode;
|
2046 | var at = uncurryThis(''.charAt);
|
2047 | var slice = uncurryThis(''.slice);
|
2048 | var exec = uncurryThis(/./.exec);
|
2049 |
|
2050 | var codePoints = {
|
2051 | '\\"': '"',
|
2052 | '\\\\': '\\',
|
2053 | '\\/': '/',
|
2054 | '\\b': '\b',
|
2055 | '\\f': '\f',
|
2056 | '\\n': '\n',
|
2057 | '\\r': '\r',
|
2058 | '\\t': '\t'
|
2059 | };
|
2060 |
|
2061 | var IS_4_HEX_DIGITS = /^[\da-f]{4}$/i;
|
2062 |
|
2063 | var IS_C0_CONTROL_CODE = /^[\u0000-\u001F]$/;
|
2064 |
|
2065 | module.exports = function (source, i) {
|
2066 | var unterminated = true;
|
2067 | var value = '';
|
2068 | while (i < source.length) {
|
2069 | var chr = at(source, i);
|
2070 | if (chr === '\\') {
|
2071 | var twoChars = slice(source, i, i + 2);
|
2072 | if (hasOwn(codePoints, twoChars)) {
|
2073 | value += codePoints[twoChars];
|
2074 | i += 2;
|
2075 | } else if (twoChars === '\\u') {
|
2076 | i += 2;
|
2077 | var fourHexDigits = slice(source, i, i + 4);
|
2078 | if (!exec(IS_4_HEX_DIGITS, fourHexDigits)) throw new $SyntaxError('Bad Unicode escape at: ' + i);
|
2079 | value += fromCharCode($parseInt(fourHexDigits, 16));
|
2080 | i += 4;
|
2081 | } else throw new $SyntaxError('Unknown escape sequence: "' + twoChars + '"');
|
2082 | } else if (chr === '"') {
|
2083 | unterminated = false;
|
2084 | i++;
|
2085 | break;
|
2086 | } else {
|
2087 | if (exec(IS_C0_CONTROL_CODE, chr)) throw new $SyntaxError('Bad control character in string literal at: ' + i);
|
2088 | value += chr;
|
2089 | i++;
|
2090 | }
|
2091 | }
|
2092 | if (unterminated) throw new $SyntaxError('Unterminated string at: ' + i);
|
2093 | return { value: value, end: i };
|
2094 | };
|
2095 |
|
2096 |
|
2097 | }),
|
2098 |
|
2099 | 7750:
|
2100 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2101 |
|
2102 |
|
2103 | var isNullOrUndefined = __webpack_require__(4117);
|
2104 |
|
2105 | var $TypeError = TypeError;
|
2106 |
|
2107 |
|
2108 |
|
2109 | module.exports = function (it) {
|
2110 | if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it);
|
2111 | return it;
|
2112 | };
|
2113 |
|
2114 |
|
2115 | }),
|
2116 |
|
2117 | 9286:
|
2118 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2119 |
|
2120 |
|
2121 | var SetHelpers = __webpack_require__(4402);
|
2122 | var iterate = __webpack_require__(8469);
|
2123 |
|
2124 | var Set = SetHelpers.Set;
|
2125 | var add = SetHelpers.add;
|
2126 |
|
2127 | module.exports = function (set) {
|
2128 | var result = new Set();
|
2129 | iterate(set, function (it) {
|
2130 | add(result, it);
|
2131 | });
|
2132 | return result;
|
2133 | };
|
2134 |
|
2135 |
|
2136 | }),
|
2137 |
|
2138 | 3440:
|
2139 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2140 |
|
2141 |
|
2142 | var aSet = __webpack_require__(7080);
|
2143 | var SetHelpers = __webpack_require__(4402);
|
2144 | var clone = __webpack_require__(9286);
|
2145 | var size = __webpack_require__(5170);
|
2146 | var getSetRecord = __webpack_require__(3789);
|
2147 | var iterateSet = __webpack_require__(8469);
|
2148 | var iterateSimple = __webpack_require__(507);
|
2149 |
|
2150 | var has = SetHelpers.has;
|
2151 | var remove = SetHelpers.remove;
|
2152 |
|
2153 |
|
2154 |
|
2155 | module.exports = function difference(other) {
|
2156 | var O = aSet(this);
|
2157 | var otherRec = getSetRecord(other);
|
2158 | var result = clone(O);
|
2159 | if (size(O) <= otherRec.size) iterateSet(O, function (e) {
|
2160 | if (otherRec.includes(e)) remove(result, e);
|
2161 | });
|
2162 | else iterateSimple(otherRec.getIterator(), function (e) {
|
2163 | if (has(O, e)) remove(result, e);
|
2164 | });
|
2165 | return result;
|
2166 | };
|
2167 |
|
2168 |
|
2169 | }),
|
2170 |
|
2171 | 4402:
|
2172 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2173 |
|
2174 |
|
2175 | var uncurryThis = __webpack_require__(9504);
|
2176 |
|
2177 |
|
2178 | var SetPrototype = Set.prototype;
|
2179 |
|
2180 | module.exports = {
|
2181 |
|
2182 | Set: Set,
|
2183 | add: uncurryThis(SetPrototype.add),
|
2184 | has: uncurryThis(SetPrototype.has),
|
2185 | remove: uncurryThis(SetPrototype['delete']),
|
2186 | proto: SetPrototype
|
2187 | };
|
2188 |
|
2189 |
|
2190 | }),
|
2191 |
|
2192 | 8750:
|
2193 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2194 |
|
2195 |
|
2196 | var aSet = __webpack_require__(7080);
|
2197 | var SetHelpers = __webpack_require__(4402);
|
2198 | var size = __webpack_require__(5170);
|
2199 | var getSetRecord = __webpack_require__(3789);
|
2200 | var iterateSet = __webpack_require__(8469);
|
2201 | var iterateSimple = __webpack_require__(507);
|
2202 |
|
2203 | var Set = SetHelpers.Set;
|
2204 | var add = SetHelpers.add;
|
2205 | var has = SetHelpers.has;
|
2206 |
|
2207 |
|
2208 |
|
2209 | module.exports = function intersection(other) {
|
2210 | var O = aSet(this);
|
2211 | var otherRec = getSetRecord(other);
|
2212 | var result = new Set();
|
2213 |
|
2214 | if (size(O) > otherRec.size) {
|
2215 | iterateSimple(otherRec.getIterator(), function (e) {
|
2216 | if (has(O, e)) add(result, e);
|
2217 | });
|
2218 | } else {
|
2219 | iterateSet(O, function (e) {
|
2220 | if (otherRec.includes(e)) add(result, e);
|
2221 | });
|
2222 | }
|
2223 |
|
2224 | return result;
|
2225 | };
|
2226 |
|
2227 |
|
2228 | }),
|
2229 |
|
2230 | 4449:
|
2231 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2232 |
|
2233 |
|
2234 | var aSet = __webpack_require__(7080);
|
2235 | var has = (__webpack_require__(4402).has);
|
2236 | var size = __webpack_require__(5170);
|
2237 | var getSetRecord = __webpack_require__(3789);
|
2238 | var iterateSet = __webpack_require__(8469);
|
2239 | var iterateSimple = __webpack_require__(507);
|
2240 | var iteratorClose = __webpack_require__(9539);
|
2241 |
|
2242 |
|
2243 |
|
2244 | module.exports = function isDisjointFrom(other) {
|
2245 | var O = aSet(this);
|
2246 | var otherRec = getSetRecord(other);
|
2247 | if (size(O) <= otherRec.size) return iterateSet(O, function (e) {
|
2248 | if (otherRec.includes(e)) return false;
|
2249 | }, true) !== false;
|
2250 | var iterator = otherRec.getIterator();
|
2251 | return iterateSimple(iterator, function (e) {
|
2252 | if (has(O, e)) return iteratorClose(iterator, 'normal', false);
|
2253 | }) !== false;
|
2254 | };
|
2255 |
|
2256 |
|
2257 | }),
|
2258 |
|
2259 | 3838:
|
2260 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2261 |
|
2262 |
|
2263 | var aSet = __webpack_require__(7080);
|
2264 | var size = __webpack_require__(5170);
|
2265 | var iterate = __webpack_require__(8469);
|
2266 | var getSetRecord = __webpack_require__(3789);
|
2267 |
|
2268 |
|
2269 |
|
2270 | module.exports = function isSubsetOf(other) {
|
2271 | var O = aSet(this);
|
2272 | var otherRec = getSetRecord(other);
|
2273 | if (size(O) > otherRec.size) return false;
|
2274 | return iterate(O, function (e) {
|
2275 | if (!otherRec.includes(e)) return false;
|
2276 | }, true) !== false;
|
2277 | };
|
2278 |
|
2279 |
|
2280 | }),
|
2281 |
|
2282 | 8527:
|
2283 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2284 |
|
2285 |
|
2286 | var aSet = __webpack_require__(7080);
|
2287 | var has = (__webpack_require__(4402).has);
|
2288 | var size = __webpack_require__(5170);
|
2289 | var getSetRecord = __webpack_require__(3789);
|
2290 | var iterateSimple = __webpack_require__(507);
|
2291 | var iteratorClose = __webpack_require__(9539);
|
2292 |
|
2293 |
|
2294 |
|
2295 | module.exports = function isSupersetOf(other) {
|
2296 | var O = aSet(this);
|
2297 | var otherRec = getSetRecord(other);
|
2298 | if (size(O) < otherRec.size) return false;
|
2299 | var iterator = otherRec.getIterator();
|
2300 | return iterateSimple(iterator, function (e) {
|
2301 | if (!has(O, e)) return iteratorClose(iterator, 'normal', false);
|
2302 | }) !== false;
|
2303 | };
|
2304 |
|
2305 |
|
2306 | }),
|
2307 |
|
2308 | 8469:
|
2309 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2310 |
|
2311 |
|
2312 | var uncurryThis = __webpack_require__(9504);
|
2313 | var iterateSimple = __webpack_require__(507);
|
2314 | var SetHelpers = __webpack_require__(4402);
|
2315 |
|
2316 | var Set = SetHelpers.Set;
|
2317 | var SetPrototype = SetHelpers.proto;
|
2318 | var forEach = uncurryThis(SetPrototype.forEach);
|
2319 | var keys = uncurryThis(SetPrototype.keys);
|
2320 | var next = keys(new Set()).next;
|
2321 |
|
2322 | module.exports = function (set, fn, interruptible) {
|
2323 | return interruptible ? iterateSimple({ iterator: keys(set), next: next }, fn) : forEach(set, fn);
|
2324 | };
|
2325 |
|
2326 |
|
2327 | /***/ }),
|
2328 |
|
2329 | /***/ 4916:
|
2330 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
2331 |
|
2332 |
|
2333 | var getBuiltIn = __webpack_require__(7751);
|
2334 |
|
2335 | var createSetLike = function (size) {
|
2336 | return {
|
2337 | size: size,
|
2338 | has: function () {
|
2339 | return false;
|
2340 | },
|
2341 | keys: function () {
|
2342 | return {
|
2343 | next: function () {
|
2344 | return { done: true };
|
2345 | }
|
2346 | };
|
2347 | }
|
2348 | };
|
2349 | };
|
2350 |
|
2351 | module.exports = function (name) {
|
2352 | var Set = getBuiltIn('Set');
|
2353 | try {
|
2354 | new Set()[name](createSetLike(0));
|
2355 | try {
|
2356 |
|
2357 |
|
2358 | new Set()[name](createSetLike(-1));
|
2359 | return false;
|
2360 | } catch (error2) {
|
2361 | return true;
|
2362 | }
|
2363 | } catch (error) {
|
2364 | return false;
|
2365 | }
|
2366 | };
|
2367 |
|
2368 |
|
2369 | }),
|
2370 |
|
2371 | 5170:
|
2372 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2373 |
|
2374 |
|
2375 | var uncurryThisAccessor = __webpack_require__(6706);
|
2376 | var SetHelpers = __webpack_require__(4402);
|
2377 |
|
2378 | module.exports = uncurryThisAccessor(SetHelpers.proto, 'size', 'get') || function (set) {
|
2379 | return set.size;
|
2380 | };
|
2381 |
|
2382 |
|
2383 | /***/ }),
|
2384 |
|
2385 | /***/ 3650:
|
2386 | /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
2387 |
|
2388 |
|
2389 | var aSet = __webpack_require__(7080);
|
2390 | var SetHelpers = __webpack_require__(4402);
|
2391 | var clone = __webpack_require__(9286);
|
2392 | var getSetRecord = __webpack_require__(3789);
|
2393 | var iterateSimple = __webpack_require__(507);
|
2394 |
|
2395 | var add = SetHelpers.add;
|
2396 | var has = SetHelpers.has;
|
2397 | var remove = SetHelpers.remove;
|
2398 |
|
2399 |
|
2400 |
|
2401 | module.exports = function symmetricDifference(other) {
|
2402 | var O = aSet(this);
|
2403 | var keysIter = getSetRecord(other).getIterator();
|
2404 | var result = clone(O);
|
2405 | iterateSimple(keysIter, function (e) {
|
2406 | if (has(O, e)) remove(result, e);
|
2407 | else add(result, e);
|
2408 | });
|
2409 | return result;
|
2410 | };
|
2411 |
|
2412 |
|
2413 | }),
|
2414 |
|
2415 | 4204:
|
2416 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2417 |
|
2418 |
|
2419 | var aSet = __webpack_require__(7080);
|
2420 | var add = (__webpack_require__(4402).add);
|
2421 | var clone = __webpack_require__(9286);
|
2422 | var getSetRecord = __webpack_require__(3789);
|
2423 | var iterateSimple = __webpack_require__(507);
|
2424 |
|
2425 |
|
2426 |
|
2427 | module.exports = function union(other) {
|
2428 | var O = aSet(this);
|
2429 | var keysIter = getSetRecord(other).getIterator();
|
2430 | var result = clone(O);
|
2431 | iterateSimple(keysIter, function (it) {
|
2432 | add(result, it);
|
2433 | });
|
2434 | return result;
|
2435 | };
|
2436 |
|
2437 |
|
2438 | }),
|
2439 |
|
2440 | 6119:
|
2441 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2442 |
|
2443 |
|
2444 | var shared = __webpack_require__(5745);
|
2445 | var uid = __webpack_require__(3392);
|
2446 |
|
2447 | var keys = shared('keys');
|
2448 |
|
2449 | module.exports = function (key) {
|
2450 | return keys[key] || (keys[key] = uid(key));
|
2451 | };
|
2452 |
|
2453 |
|
2454 | }),
|
2455 |
|
2456 | 7629:
|
2457 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2458 |
|
2459 |
|
2460 | var IS_PURE = __webpack_require__(6395);
|
2461 | var globalThis = __webpack_require__(4475);
|
2462 | var defineGlobalProperty = __webpack_require__(9433);
|
2463 |
|
2464 | var SHARED = '__core-js_shared__';
|
2465 | var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
|
2466 |
|
2467 | (store.versions || (store.versions = [])).push({
|
2468 | version: '3.36.1',
|
2469 | mode: IS_PURE ? 'pure' : 'global',
|
2470 | copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)',
|
2471 | license: 'https://github.com/zloirock/core-js/blob/v3.36.1/LICENSE',
|
2472 | source: 'https://github.com/zloirock/core-js'
|
2473 | });
|
2474 |
|
2475 |
|
2476 | }),
|
2477 |
|
2478 | 5745:
|
2479 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2480 |
|
2481 |
|
2482 | var store = __webpack_require__(7629);
|
2483 |
|
2484 | module.exports = function (key, value) {
|
2485 | return store[key] || (store[key] = value || {});
|
2486 | };
|
2487 |
|
2488 |
|
2489 | }),
|
2490 |
|
2491 | 4495:
|
2492 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2493 |
|
2494 |
|
2495 |
|
2496 | var V8_VERSION = __webpack_require__(7388);
|
2497 | var fails = __webpack_require__(9039);
|
2498 | var global = __webpack_require__(4475);
|
2499 |
|
2500 | var $String = global.String;
|
2501 |
|
2502 |
|
2503 | module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
|
2504 | var symbol = Symbol('symbol detection');
|
2505 |
|
2506 |
|
2507 |
|
2508 |
|
2509 | return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||
|
2510 |
|
2511 | !Symbol.sham && V8_VERSION && V8_VERSION < 41;
|
2512 | });
|
2513 |
|
2514 |
|
2515 | }),
|
2516 |
|
2517 | 5610:
|
2518 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2519 |
|
2520 |
|
2521 | var toIntegerOrInfinity = __webpack_require__(1291);
|
2522 |
|
2523 | var max = Math.max;
|
2524 | var min = Math.min;
|
2525 |
|
2526 |
|
2527 |
|
2528 |
|
2529 | module.exports = function (index, length) {
|
2530 | var integer = toIntegerOrInfinity(index);
|
2531 | return integer < 0 ? max(integer + length, 0) : min(integer, length);
|
2532 | };
|
2533 |
|
2534 |
|
2535 | }),
|
2536 |
|
2537 | 5397:
|
2538 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2539 |
|
2540 |
|
2541 |
|
2542 | var IndexedObject = __webpack_require__(7055);
|
2543 | var requireObjectCoercible = __webpack_require__(7750);
|
2544 |
|
2545 | module.exports = function (it) {
|
2546 | return IndexedObject(requireObjectCoercible(it));
|
2547 | };
|
2548 |
|
2549 |
|
2550 | }),
|
2551 |
|
2552 | 1291:
|
2553 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2554 |
|
2555 |
|
2556 | var trunc = __webpack_require__(741);
|
2557 |
|
2558 |
|
2559 |
|
2560 | module.exports = function (argument) {
|
2561 | var number = +argument;
|
2562 |
|
2563 | return number !== number || number === 0 ? 0 : trunc(number);
|
2564 | };
|
2565 |
|
2566 |
|
2567 | }),
|
2568 |
|
2569 | 8014:
|
2570 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2571 |
|
2572 |
|
2573 | var toIntegerOrInfinity = __webpack_require__(1291);
|
2574 |
|
2575 | var min = Math.min;
|
2576 |
|
2577 |
|
2578 |
|
2579 | module.exports = function (argument) {
|
2580 | var len = toIntegerOrInfinity(argument);
|
2581 | return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0;
|
2582 | };
|
2583 |
|
2584 |
|
2585 | }),
|
2586 |
|
2587 | 8981:
|
2588 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2589 |
|
2590 |
|
2591 | var requireObjectCoercible = __webpack_require__(7750);
|
2592 |
|
2593 | var $Object = Object;
|
2594 |
|
2595 |
|
2596 |
|
2597 | module.exports = function (argument) {
|
2598 | return $Object(requireObjectCoercible(argument));
|
2599 | };
|
2600 |
|
2601 |
|
2602 | }),
|
2603 |
|
2604 | 2777:
|
2605 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2606 |
|
2607 |
|
2608 | var call = __webpack_require__(9565);
|
2609 | var isObject = __webpack_require__(34);
|
2610 | var isSymbol = __webpack_require__(757);
|
2611 | var getMethod = __webpack_require__(5966);
|
2612 | var ordinaryToPrimitive = __webpack_require__(4270);
|
2613 | var wellKnownSymbol = __webpack_require__(8227);
|
2614 |
|
2615 | var $TypeError = TypeError;
|
2616 | var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
|
2617 |
|
2618 |
|
2619 |
|
2620 | module.exports = function (input, pref) {
|
2621 | if (!isObject(input) || isSymbol(input)) return input;
|
2622 | var exoticToPrim = getMethod(input, TO_PRIMITIVE);
|
2623 | var result;
|
2624 | if (exoticToPrim) {
|
2625 | if (pref === undefined) pref = 'default';
|
2626 | result = call(exoticToPrim, input, pref);
|
2627 | if (!isObject(result) || isSymbol(result)) return result;
|
2628 | throw new $TypeError("Can't convert object to primitive value");
|
2629 | }
|
2630 | if (pref === undefined) pref = 'number';
|
2631 | return ordinaryToPrimitive(input, pref);
|
2632 | };
|
2633 |
|
2634 |
|
2635 | }),
|
2636 |
|
2637 | 6969:
|
2638 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2639 |
|
2640 |
|
2641 | var toPrimitive = __webpack_require__(2777);
|
2642 | var isSymbol = __webpack_require__(757);
|
2643 |
|
2644 |
|
2645 |
|
2646 | module.exports = function (argument) {
|
2647 | var key = toPrimitive(argument, 'string');
|
2648 | return isSymbol(key) ? key : key + '';
|
2649 | };
|
2650 |
|
2651 |
|
2652 | }),
|
2653 |
|
2654 | 2140:
|
2655 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2656 |
|
2657 |
|
2658 | var wellKnownSymbol = __webpack_require__(8227);
|
2659 |
|
2660 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
2661 | var test = {};
|
2662 |
|
2663 | test[TO_STRING_TAG] = 'z';
|
2664 |
|
2665 | module.exports = String(test) === '[object z]';
|
2666 |
|
2667 |
|
2668 | }),
|
2669 |
|
2670 | 655:
|
2671 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2672 |
|
2673 |
|
2674 | var classof = __webpack_require__(6955);
|
2675 |
|
2676 | var $String = String;
|
2677 |
|
2678 | module.exports = function (argument) {
|
2679 | if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
|
2680 | return $String(argument);
|
2681 | };
|
2682 |
|
2683 |
|
2684 | }),
|
2685 |
|
2686 | 6823:
|
2687 | ((module) => {
|
2688 |
|
2689 |
|
2690 | var $String = String;
|
2691 |
|
2692 | module.exports = function (argument) {
|
2693 | try {
|
2694 | return $String(argument);
|
2695 | } catch (error) {
|
2696 | return 'Object';
|
2697 | }
|
2698 | };
|
2699 |
|
2700 |
|
2701 | }),
|
2702 |
|
2703 | 3392:
|
2704 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2705 |
|
2706 |
|
2707 | var uncurryThis = __webpack_require__(9504);
|
2708 |
|
2709 | var id = 0;
|
2710 | var postfix = Math.random();
|
2711 | var toString = uncurryThis(1.0.toString);
|
2712 |
|
2713 | module.exports = function (key) {
|
2714 | return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
|
2715 | };
|
2716 |
|
2717 |
|
2718 | }),
|
2719 |
|
2720 | 7040:
|
2721 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2722 |
|
2723 |
|
2724 |
|
2725 | var NATIVE_SYMBOL = __webpack_require__(4495);
|
2726 |
|
2727 | module.exports = NATIVE_SYMBOL
|
2728 | && !Symbol.sham
|
2729 | && typeof Symbol.iterator == 'symbol';
|
2730 |
|
2731 |
|
2732 | }),
|
2733 |
|
2734 | 8686:
|
2735 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2736 |
|
2737 |
|
2738 | var DESCRIPTORS = __webpack_require__(3724);
|
2739 | var fails = __webpack_require__(9039);
|
2740 |
|
2741 |
|
2742 |
|
2743 | module.exports = DESCRIPTORS && fails(function () {
|
2744 |
|
2745 | return Object.defineProperty(function () { }, 'prototype', {
|
2746 | value: 42,
|
2747 | writable: false
|
2748 | }).prototype !== 42;
|
2749 | });
|
2750 |
|
2751 |
|
2752 | }),
|
2753 |
|
2754 | 2812:
|
2755 | ((module) => {
|
2756 |
|
2757 |
|
2758 | var $TypeError = TypeError;
|
2759 |
|
2760 | module.exports = function (passed, required) {
|
2761 | if (passed < required) throw new $TypeError('Not enough arguments');
|
2762 | return passed;
|
2763 | };
|
2764 |
|
2765 |
|
2766 | }),
|
2767 |
|
2768 | 8622:
|
2769 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2770 |
|
2771 |
|
2772 | var global = __webpack_require__(4475);
|
2773 | var isCallable = __webpack_require__(4901);
|
2774 |
|
2775 | var WeakMap = global.WeakMap;
|
2776 |
|
2777 | module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));
|
2778 |
|
2779 |
|
2780 | }),
|
2781 |
|
2782 | 8227:
|
2783 | ((module, __unused_webpack_exports, __webpack_require__) => {
|
2784 |
|
2785 |
|
2786 | var global = __webpack_require__(4475);
|
2787 | var shared = __webpack_require__(5745);
|
2788 | var hasOwn = __webpack_require__(9297);
|
2789 | var uid = __webpack_require__(3392);
|
2790 | var NATIVE_SYMBOL = __webpack_require__(4495);
|
2791 | var USE_SYMBOL_AS_UID = __webpack_require__(7040);
|
2792 |
|
2793 | var Symbol = global.Symbol;
|
2794 | var WellKnownSymbolsStore = shared('wks');
|
2795 | var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;
|
2796 |
|
2797 | module.exports = function (name) {
|
2798 | if (!hasOwn(WellKnownSymbolsStore, name)) {
|
2799 | WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)
|
2800 | ? Symbol[name]
|
2801 | : createWellKnownSymbol('Symbol.' + name);
|
2802 | } return WellKnownSymbolsStore[name];
|
2803 | };
|
2804 |
|
2805 |
|
2806 | }),
|
2807 |
|
2808 | 4114:
|
2809 | ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
2810 |
|
2811 |
|
2812 | var $ = __webpack_require__(6518);
|
2813 | var toObject = __webpack_require__(8981);
|
2814 | var lengthOfArrayLike = __webpack_require__(6198);
|
2815 | var setArrayLength = __webpack_require__(4527);
|
2816 | var doesNotExceedSafeInteger = __webpack_require__(6837);
|
2817 | var fails = __webpack_require__(9039);
|
2818 |
|
2819 | var INCORRECT_TO_LENGTH = fails(function () {
|
2820 | return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
|
2821 | });
|
2822 |
|
2823 |
|
2824 |
|
2825 | var properErrorOnNonWritableLength = function () {
|
2826 | try {
|
2827 |
|
2828 | Object.defineProperty([], 'length', { writable: false }).push();
|
2829 | } catch (error) {
|
2830 | return error instanceof TypeError;
|
2831 | }
|
2832 | };
|
2833 |
|
2834 | var FORCED = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
|
2835 |
|
2836 |
|
2837 |
|
2838 | $({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
|
2839 |
|
2840 | push: function push(item) {
|
2841 | var O = toObject(this);
|
2842 | var len = lengthOfArrayLike(O);
|
2843 | var argCount = arguments.length;
|
2844 | doesNotExceedSafeInteger(len + argCount);
|
2845 | for (var i = 0; i < argCount; i++) {
|
2846 | O[len] = arguments[i];
|
2847 | len++;
|
2848 | }
|
2849 | setArrayLength(O, len);
|
2850 | return len;
|
2851 | }
|
2852 | });
|
2853 |
|
2854 |
|
2855 | }),
|
2856 |
|
2857 | 4628:
|
2858 | ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
2859 |
|
2860 |
|
2861 | var $ = __webpack_require__(6518);
|
2862 | var newPromiseCapabilityModule = __webpack_require__(6043);
|
2863 |
|
2864 |
|
2865 |
|
2866 | $({ target: 'Promise', stat: true }, {
|
2867 | withResolvers: function withResolvers() {
|
2868 | var promiseCapability = newPromiseCapabilityModule.f(this);
|
2869 | return {
|
2870 | promise: promiseCapability.promise,
|
2871 | resolve: promiseCapability.resolve,
|
2872 | reject: promiseCapability.reject
|
2873 | };
|
2874 | }
|
2875 | });
|
2876 |
|
2877 |
|
2878 | }),
|
2879 |
|
2880 | 8992:
|
2881 | ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
2882 |
|
2883 |
|
2884 | var $ = __webpack_require__(6518);
|
2885 | var global = __webpack_require__(4475);
|
2886 | var anInstance = __webpack_require__(679);
|
2887 | var anObject = __webpack_require__(8551);
|
2888 | var isCallable = __webpack_require__(4901);
|
2889 | var getPrototypeOf = __webpack_require__(2787);
|
2890 | var defineBuiltInAccessor = __webpack_require__(2106);
|
2891 | var createProperty = __webpack_require__(4659);
|
2892 | var fails = __webpack_require__(9039);
|
2893 | var hasOwn = __webpack_require__(9297);
|
2894 | var wellKnownSymbol = __webpack_require__(8227);
|
2895 | var IteratorPrototype = (__webpack_require__(7657).IteratorPrototype);
|
2896 | var DESCRIPTORS = __webpack_require__(3724);
|
2897 | var IS_PURE = __webpack_require__(6395);
|
2898 |
|
2899 | var CONSTRUCTOR = 'constructor';
|
2900 | var ITERATOR = 'Iterator';
|
2901 | var TO_STRING_TAG = wellKnownSymbol('toStringTag');
|
2902 |
|
2903 | var $TypeError = TypeError;
|
2904 | var NativeIterator = global[ITERATOR];
|
2905 |
|
2906 |
|
2907 | var FORCED = IS_PURE
|
2908 | || !isCallable(NativeIterator)
|
2909 | || NativeIterator.prototype !== IteratorPrototype
|
2910 |
|
2911 | || !fails(function () { NativeIterator({}); });
|
2912 |
|
2913 | var IteratorConstructor = function Iterator() {
|
2914 | anInstance(this, IteratorPrototype);
|
2915 | if (getPrototypeOf(this) === IteratorPrototype) throw new $TypeError('Abstract class Iterator not directly constructable');
|
2916 | };
|
2917 |
|
2918 | var defineIteratorPrototypeAccessor = function (key, value) {
|
2919 | if (DESCRIPTORS) {
|
2920 | defineBuiltInAccessor(IteratorPrototype, key, {
|
2921 | configurable: true,
|
2922 | get: function () {
|
2923 | return value;
|
2924 | },
|
2925 | set: function (replacement) {
|
2926 | anObject(this);
|
2927 | if (this === IteratorPrototype) throw new $TypeError("You can't redefine this property");
|
2928 | if (hasOwn(this, key)) this[key] = replacement;
|
2929 | else createProperty(this, key, replacement);
|
2930 | }
|
2931 | });
|
2932 | } else IteratorPrototype[key] = value;
|
2933 | };
|
2934 |
|
2935 | if (!hasOwn(IteratorPrototype, TO_STRING_TAG)) defineIteratorPrototypeAccessor(TO_STRING_TAG, ITERATOR);
|
2936 |
|
2937 | if (FORCED || !hasOwn(IteratorPrototype, CONSTRUCTOR) || IteratorPrototype[CONSTRUCTOR] === Object) {
|
2938 | defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor);
|
2939 | }
|
2940 |
|
2941 | IteratorConstructor.prototype = IteratorPrototype;
|
2942 |
|
2943 |
|
2944 |
|
2945 | $({ global: true, constructor: true, forced: FORCED }, {
|
2946 | Iterator: IteratorConstructor
|
2947 | });
|
2948 |
|
2949 |
|
2950 | }),
|
2951 |
|
2952 | 3215:
|
2953 | ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
2954 |
|
2955 |
|
2956 | var $ = __webpack_require__(6518);
|
2957 | var iterate = __webpack_require__(2652);
|
2958 | var aCallable = __webpack_require__(9306);
|
2959 | var anObject = __webpack_require__(8551);
|
2960 | var getIteratorDirect = __webpack_require__(1767);
|
2961 |
|
2962 |
|
2963 |
|
2964 | $({ target: 'Iterator', proto: true, real: true }, {
|
2965 | every: function every(predicate) {
|
2966 | anObject(this);
|
2967 | aCallable(predicate);
|
2968 | var record = getIteratorDirect(this);
|
2969 | var counter = 0;
|
2970 | return !iterate(record, function (value, stop) {
|
2971 | if (!predicate(value, counter++)) return stop();
|
2972 | }, { IS_RECORD: true, INTERRUPTED: true }).stopped;
|
2973 | }
|
2974 | });
|
2975 |
|
2976 |
|
2977 | }),
|
2978 |
|
2979 | 4520:
|
2980 | ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
2981 |
|
2982 |
|
2983 | var $ = __webpack_require__(6518);
|
2984 | var call = __webpack_require__(9565);
|
2985 | var aCallable = __webpack_require__(9306);
|
2986 | var anObject = __webpack_require__(8551);
|
2987 | var getIteratorDirect = __webpack_require__(1767);
|
2988 | var createIteratorProxy = __webpack_require__(9462);
|
2989 | var callWithSafeIterationClosing = __webpack_require__(6319);
|
2990 | var IS_PURE = __webpack_require__(6395);
|
2991 |
|
2992 | var IteratorProxy = createIteratorProxy(function () {
|
2993 | var iterator = this.iterator;
|
2994 | var predicate = this.predicate;
|
2995 | var next = this.next;
|
2996 | var result, done, value;
|
2997 | while (true) {
|
2998 | result = anObject(call(next, iterator));
|
2999 | done = this.done = !!result.done;
|
3000 | if (done) return;
|
3001 | value = result.value;
|
3002 | if (callWithSafeIterationClosing(iterator, predicate, [value, this.counter++], true)) return value;
|
3003 | }
|
3004 | });
|
3005 |
|
3006 |
|
3007 |
|
3008 | $({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, {
|
3009 | filter: function filter(predicate) {
|
3010 | anObject(this);
|
3011 | aCallable(predicate);
|
3012 | return new IteratorProxy(getIteratorDirect(this), {
|
3013 | predicate: predicate
|
3014 | });
|
3015 | }
|
3016 | });
|
3017 |
|
3018 |
|
3019 | }),
|
3020 |
|
3021 | 3949:
|
3022 | ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
3023 |
|
3024 |
|
3025 | var $ = __webpack_require__(6518);
|
3026 | var iterate = __webpack_require__(2652);
|
3027 | var aCallable = __webpack_require__(9306);
|
3028 | var anObject = __webpack_require__(8551);
|
3029 | var getIteratorDirect = __webpack_require__(1767);
|
3030 |
|
3031 |
|
3032 |
|
3033 | $({ target: 'Iterator', proto: true, real: true }, {
|
3034 | forEach: function forEach(fn) {
|
3035 | anObject(this);
|
3036 | aCallable(fn);
|
3037 | var record = getIteratorDirect(this);
|
3038 | var counter = 0;
|
3039 | iterate(record, function (value) {
|
3040 | fn(value, counter++);
|
3041 | }, { IS_RECORD: true });
|
3042 | }
|
3043 | });
|
3044 |
|
3045 |
|
3046 | }),
|
3047 |
|
3048 | 1454:
|
3049 | ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
3050 |
|
3051 |
|
3052 | var $ = __webpack_require__(6518);
|
3053 | var map = __webpack_require__(713);
|
3054 | var IS_PURE = __webpack_require__(6395);
|
3055 |
|
3056 |
|
3057 |
|
3058 | $({ target: 'Iterator', proto: true, real: true, forced: IS_PURE }, {
|
3059 | map: map
|
3060 | });
|
3061 |
|
3062 |
|
3063 | }),
|
3064 |
|
3065 | 8335:
|
3066 | ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
3067 |
|
3068 |
|
3069 | var $ = __webpack_require__(6518);
|
3070 | var DESCRIPTORS = __webpack_require__(3724);
|
3071 | var global = __webpack_require__(4475);
|
3072 | var getBuiltIn = __webpack_require__(7751);
|
3073 | var uncurryThis = __webpack_require__(9504);
|
3074 | var call = __webpack_require__(9565);
|
3075 | var isCallable = __webpack_require__(4901);
|
3076 | var isObject = __webpack_require__(34);
|
3077 | var isArray = __webpack_require__(4376);
|
3078 | var hasOwn = __webpack_require__(9297);
|
3079 | var toString = __webpack_require__(655);
|
3080 | var lengthOfArrayLike = __webpack_require__(6198);
|
3081 | var createProperty = __webpack_require__(4659);
|
3082 | var fails = __webpack_require__(9039);
|
3083 | var parseJSONString = __webpack_require__(8235);
|
3084 | var NATIVE_SYMBOL = __webpack_require__(4495);
|
3085 |
|
3086 | var JSON = global.JSON;
|
3087 | var Number = global.Number;
|
3088 | var SyntaxError = global.SyntaxError;
|
3089 | var nativeParse = JSON && JSON.parse;
|
3090 | var enumerableOwnProperties = getBuiltIn('Object', 'keys');
|
3091 |
|
3092 | var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
|
3093 | var at = uncurryThis(''.charAt);
|
3094 | var slice = uncurryThis(''.slice);
|
3095 | var exec = uncurryThis(/./.exec);
|
3096 | var push = uncurryThis([].push);
|
3097 |
|
3098 | var IS_DIGIT = /^\d$/;
|
3099 | var IS_NON_ZERO_DIGIT = /^[1-9]$/;
|
3100 | var IS_NUMBER_START = /^(?:-|\d)$/;
|
3101 | var IS_WHITESPACE = /^[\t\n\r ]$/;
|
3102 |
|
3103 | var PRIMITIVE = 0;
|
3104 | var OBJECT = 1;
|
3105 |
|
3106 | var $parse = function (source, reviver) {
|
3107 | source = toString(source);
|
3108 | var context = new Context(source, 0, '');
|
3109 | var root = context.parse();
|
3110 | var value = root.value;
|
3111 | var endIndex = context.skip(IS_WHITESPACE, root.end);
|
3112 | if (endIndex < source.length) {
|
3113 | throw new SyntaxError('Unexpected extra character: "' + at(source, endIndex) + '" after the parsed data at: ' + endIndex);
|
3114 | }
|
3115 | return isCallable(reviver) ? internalize({ '': value }, '', reviver, root) : value;
|
3116 | };
|
3117 |
|
3118 | var internalize = function (holder, name, reviver, node) {
|
3119 | var val = holder[name];
|
3120 | var unmodified = node && val === node.value;
|
3121 | var context = unmodified && typeof node.source == 'string' ? { source: node.source } : {};
|
3122 | var elementRecordsLen, keys, len, i, P;
|
3123 | if (isObject(val)) {
|
3124 | var nodeIsArray = isArray(val);
|
3125 | var nodes = unmodified ? node.nodes : nodeIsArray ? [] : {};
|
3126 | if (nodeIsArray) {
|
3127 | elementRecordsLen = nodes.length;
|
3128 | len = lengthOfArrayLike(val);
|
3129 | for (i = 0; i < len; i++) {
|
3130 | internalizeProperty(val, i, internalize(val, '' + i, reviver, i < elementRecordsLen ? nodes[i] : undefined));
|
3131 | }
|
3132 | } else {
|
3133 | keys = enumerableOwnProperties(val);
|
3134 | len = lengthOfArrayLike(keys);
|
3135 | for (i = 0; i < len; i++) {
|
3136 | P = keys[i];
|
3137 | internalizeProperty(val, P, internalize(val, P, reviver, hasOwn(nodes, P) ? nodes[P] : undefined));
|
3138 | }
|
3139 | }
|
3140 | }
|
3141 | return call(reviver, holder, name, val, context);
|
3142 | };
|
3143 |
|
3144 | var internalizeProperty = function (object, key, value) {
|
3145 | if (DESCRIPTORS) {
|
3146 | var descriptor = getOwnPropertyDescriptor(object, key);
|
3147 | if (descriptor && !descriptor.configurable) return;
|
3148 | }
|
3149 | if (value === undefined) delete object[key];
|
3150 | else createProperty(object, key, value);
|
3151 | };
|
3152 |
|
3153 | var Node = function (value, end, source, nodes) {
|
3154 | this.value = value;
|
3155 | this.end = end;
|
3156 | this.source = source;
|
3157 | this.nodes = nodes;
|
3158 | };
|
3159 |
|
3160 | var Context = function (source, index) {
|
3161 | this.source = source;
|
3162 | this.index = index;
|
3163 | };
|
3164 |
|
3165 |
|
3166 | Context.prototype = {
|
3167 | fork: function (nextIndex) {
|
3168 | return new Context(this.source, nextIndex);
|
3169 | },
|
3170 | parse: function () {
|
3171 | var source = this.source;
|
3172 | var i = this.skip(IS_WHITESPACE, this.index);
|
3173 | var fork = this.fork(i);
|
3174 | var chr = at(source, i);
|
3175 | if (exec(IS_NUMBER_START, chr)) return fork.number();
|
3176 | switch (chr) {
|
3177 | case '{':
|
3178 | return fork.object();
|
3179 | case '[':
|
3180 | return fork.array();
|
3181 | case '"':
|
3182 | return fork.string();
|
3183 | case 't':
|
3184 | return fork.keyword(true);
|
3185 | case 'f':
|
3186 | return fork.keyword(false);
|
3187 | case 'n':
|
3188 | return fork.keyword(null);
|
3189 | } throw new SyntaxError('Unexpected character: "' + chr + '" at: ' + i);
|
3190 | },
|
3191 | node: function (type, value, start, end, nodes) {
|
3192 | return new Node(value, end, type ? null : slice(this.source, start, end), nodes);
|
3193 | },
|
3194 | object: function () {
|
3195 | var source = this.source;
|
3196 | var i = this.index + 1;
|
3197 | var expectKeypair = false;
|
3198 | var object = {};
|
3199 | var nodes = {};
|
3200 | while (i < source.length) {
|
3201 | i = this.until(['"', '}'], i);
|
3202 | if (at(source, i) === '}' && !expectKeypair) {
|
3203 | i++;
|
3204 | break;
|
3205 | }
|
3206 |
|
3207 | var result = this.fork(i).string();
|
3208 | var key = result.value;
|
3209 | i = result.end;
|
3210 | i = this.until([':'], i) + 1;
|
3211 |
|
3212 | i = this.skip(IS_WHITESPACE, i);
|
3213 | result = this.fork(i).parse();
|
3214 | createProperty(nodes, key, result);
|
3215 | createProperty(object, key, result.value);
|
3216 | i = this.until([',', '}'], result.end);
|
3217 | var chr = at(source, i);
|
3218 | if (chr === ',') {
|
3219 | expectKeypair = true;
|
3220 | i++;
|
3221 | } else if (chr === '}') {
|
3222 | i++;
|
3223 | break;
|
3224 | }
|
3225 | }
|
3226 | return this.node(OBJECT, object, this.index, i, nodes);
|
3227 | },
|
3228 | array: function () {
|
3229 | var source = this.source;
|
3230 | var i = this.index + 1;
|
3231 | var expectElement = false;
|
3232 | var array = [];
|
3233 | var nodes = [];
|
3234 | while (i < source.length) {
|
3235 | i = this.skip(IS_WHITESPACE, i);
|
3236 | if (at(source, i) === ']' && !expectElement) {
|
3237 | i++;
|
3238 | break;
|
3239 | }
|
3240 | var result = this.fork(i).parse();
|
3241 | push(nodes, result);
|
3242 | push(array, result.value);
|
3243 | i = this.until([',', ']'], result.end);
|
3244 | if (at(source, i) === ',') {
|
3245 | expectElement = true;
|
3246 | i++;
|
3247 | } else if (at(source, i) === ']') {
|
3248 | i++;
|
3249 | break;
|
3250 | }
|
3251 | }
|
3252 | return this.node(OBJECT, array, this.index, i, nodes);
|
3253 | },
|
3254 | string: function () {
|
3255 | var index = this.index;
|
3256 | var parsed = parseJSONString(this.source, this.index + 1);
|
3257 | return this.node(PRIMITIVE, parsed.value, index, parsed.end);
|
3258 | },
|
3259 | number: function () {
|
3260 | var source = this.source;
|
3261 | var startIndex = this.index;
|
3262 | var i = startIndex;
|
3263 | if (at(source, i) === '-') i++;
|
3264 | if (at(source, i) === '0') i++;
|
3265 | else if (exec(IS_NON_ZERO_DIGIT, at(source, i))) i = this.skip(IS_DIGIT, ++i);
|
3266 | else throw new SyntaxError('Failed to parse number at: ' + i);
|
3267 | if (at(source, i) === '.') i = this.skip(IS_DIGIT, ++i);
|
3268 | if (at(source, i) === 'e' || at(source, i) === 'E') {
|
3269 | i++;
|
3270 | if (at(source, i) === '+' || at(source, i) === '-') i++;
|
3271 | var exponentStartIndex = i;
|
3272 | i = this.skip(IS_DIGIT, i);
|
3273 | if (exponentStartIndex === i) throw new SyntaxError("Failed to parse number's exponent value at: " + i);
|
3274 | }
|
3275 | return this.node(PRIMITIVE, Number(slice(source, startIndex, i)), startIndex, i);
|
3276 | },
|
3277 | keyword: function (value) {
|
3278 | var keyword = '' + value;
|
3279 | var index = this.index;
|
3280 | var endIndex = index + keyword.length;
|
3281 | if (slice(this.source, index, endIndex) !== keyword) throw new SyntaxError('Failed to parse value at: ' + index);
|
3282 | return this.node(PRIMITIVE, value, index, endIndex);
|
3283 | },
|
3284 | skip: function (regex, i) {
|
3285 | var source = this.source;
|
3286 | for (; i < source.length; i++) if (!exec(regex, at(source, i))) break;
|
3287 | return i;
|
3288 | },
|
3289 | until: function (array, i) {
|
3290 | i = this.skip(IS_WHITESPACE, i);
|
3291 | var chr = at(this.source, i);
|
3292 | for (var j = 0; j < array.length; j++) if (array[j] === chr) return i;
|
3293 | throw new SyntaxError('Unexpected character: "' + chr + '" at: ' + i);
|
3294 | }
|
3295 | };
|
3296 |
|
3297 | var NO_SOURCE_SUPPORT = fails(function () {
|
3298 | var unsafeInt = '9007199254740993';
|
3299 | var source;
|
3300 | nativeParse(unsafeInt, function (key, value, context) {
|
3301 | source = context.source;
|
3302 | });
|
3303 | return source !== unsafeInt;
|
3304 | });
|
3305 |
|
3306 | var PROPER_BASE_PARSE = NATIVE_SYMBOL && !fails(function () {
|
3307 |
|
3308 | return 1 / nativeParse('-0 \t') !== -Infinity;
|
3309 | });
|
3310 |
|
3311 |
|
3312 |
|
3313 |
|
3314 | $({ target: 'JSON', stat: true, forced: NO_SOURCE_SUPPORT }, {
|
3315 | parse: function parse(text, reviver) {
|
3316 | return PROPER_BASE_PARSE && !isCallable(reviver) ? nativeParse(text) : $parse(text, reviver);
|
3317 | }
|
3318 | });
|
3319 |
|
3320 |
|
3321 | }),
|
3322 |
|
3323 | 3375:
|
3324 | ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
3325 |
|
3326 |
|
3327 | var $ = __webpack_require__(6518);
|
3328 | var difference = __webpack_require__(3440);
|
3329 | var setMethodAcceptSetLike = __webpack_require__(4916);
|
3330 |
|
3331 |
|
3332 |
|
3333 | $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('difference') }, {
|
3334 | difference: difference
|
3335 | });
|
3336 |
|
3337 |
|
3338 | }),
|
3339 |
|
3340 | 9225:
|
3341 | ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
3342 |
|
3343 |
|
3344 | var $ = __webpack_require__(6518);
|
3345 | var fails = __webpack_require__(9039);
|
3346 | var intersection = __webpack_require__(8750);
|
3347 | var setMethodAcceptSetLike = __webpack_require__(4916);
|
3348 |
|
3349 | var INCORRECT = !setMethodAcceptSetLike('intersection') || fails(function () {
|
3350 |
|
3351 | return String(Array.from(new Set([1, 2, 3]).intersection(new Set([3, 2])))) !== '3,2';
|
3352 | });
|
3353 |
|
3354 |
|
3355 |
|
3356 | $({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {
|
3357 | intersection: intersection
|
3358 | });
|
3359 |
|
3360 |
|
3361 | }),
|
3362 |
|
3363 | 3972:
|
3364 | ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
3365 |
|
3366 |
|
3367 | var $ = __webpack_require__(6518);
|
3368 | var isDisjointFrom = __webpack_require__(4449);
|
3369 | var setMethodAcceptSetLike = __webpack_require__(4916);
|
3370 |
|
3371 |
|
3372 |
|
3373 | $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isDisjointFrom') }, {
|
3374 | isDisjointFrom: isDisjointFrom
|
3375 | });
|
3376 |
|
3377 |
|
3378 | }),
|
3379 |
|
3380 | 9209:
|
3381 | ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
3382 |
|
3383 |
|
3384 | var $ = __webpack_require__(6518);
|
3385 | var isSubsetOf = __webpack_require__(3838);
|
3386 | var setMethodAcceptSetLike = __webpack_require__(4916);
|
3387 |
|
3388 |
|
3389 |
|
3390 | $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isSubsetOf') }, {
|
3391 | isSubsetOf: isSubsetOf
|
3392 | });
|
3393 |
|
3394 |
|
3395 | }),
|
3396 |
|
3397 | 5714:
|
3398 | ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
3399 |
|
3400 |
|
3401 | var $ = __webpack_require__(6518);
|
3402 | var isSupersetOf = __webpack_require__(8527);
|
3403 | var setMethodAcceptSetLike = __webpack_require__(4916);
|
3404 |
|
3405 |
|
3406 |
|
3407 | $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('isSupersetOf') }, {
|
3408 | isSupersetOf: isSupersetOf
|
3409 | });
|
3410 |
|
3411 |
|
3412 | }),
|
3413 |
|
3414 | 7561:
|
3415 | ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
3416 |
|
3417 |
|
3418 | var $ = __webpack_require__(6518);
|
3419 | var symmetricDifference = __webpack_require__(3650);
|
3420 | var setMethodAcceptSetLike = __webpack_require__(4916);
|
3421 |
|
3422 |
|
3423 |
|
3424 | $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('symmetricDifference') }, {
|
3425 | symmetricDifference: symmetricDifference
|
3426 | });
|
3427 |
|
3428 |
|
3429 | }),
|
3430 |
|
3431 | 6197:
|
3432 | ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
3433 |
|
3434 |
|
3435 | var $ = __webpack_require__(6518);
|
3436 | var union = __webpack_require__(4204);
|
3437 | var setMethodAcceptSetLike = __webpack_require__(4916);
|
3438 |
|
3439 |
|
3440 |
|
3441 | $({ target: 'Set', proto: true, real: true, forced: !setMethodAcceptSetLike('union') }, {
|
3442 | union: union
|
3443 | });
|
3444 |
|
3445 |
|
3446 | }),
|
3447 |
|
3448 | 4603:
|
3449 | ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
3450 |
|
3451 |
|
3452 | var defineBuiltIn = __webpack_require__(6840);
|
3453 | var uncurryThis = __webpack_require__(9504);
|
3454 | var toString = __webpack_require__(655);
|
3455 | var validateArgumentsLength = __webpack_require__(2812);
|
3456 |
|
3457 | var $URLSearchParams = URLSearchParams;
|
3458 | var URLSearchParamsPrototype = $URLSearchParams.prototype;
|
3459 | var append = uncurryThis(URLSearchParamsPrototype.append);
|
3460 | var $delete = uncurryThis(URLSearchParamsPrototype['delete']);
|
3461 | var forEach = uncurryThis(URLSearchParamsPrototype.forEach);
|
3462 | var push = uncurryThis([].push);
|
3463 | var params = new $URLSearchParams('a=1&a=2&b=3');
|
3464 |
|
3465 | params['delete']('a', 1);
|
3466 |
|
3467 |
|
3468 | params['delete']('b', undefined);
|
3469 |
|
3470 | if (params + '' !== 'a=2') {
|
3471 | defineBuiltIn(URLSearchParamsPrototype, 'delete', function (name /* , value */) {
|
3472 | var length = arguments.length;
|
3473 | var $value = length < 2 ? undefined : arguments[1];
|
3474 | if (length && $value === undefined) return $delete(this, name);
|
3475 | var entries = [];
|
3476 | forEach(this, function (v, k) {
|
3477 | push(entries, { key: k, value: v });
|
3478 | });
|
3479 | validateArgumentsLength(length, 1);
|
3480 | var key = toString(name);
|
3481 | var value = toString($value);
|
3482 | var index = 0;
|
3483 | var dindex = 0;
|
3484 | var found = false;
|
3485 | var entriesLength = entries.length;
|
3486 | var entry;
|
3487 | while (index < entriesLength) {
|
3488 | entry = entries[index++];
|
3489 | if (found || entry.key === key) {
|
3490 | found = true;
|
3491 | $delete(this, entry.key);
|
3492 | } else dindex++;
|
3493 | }
|
3494 | while (dindex < entriesLength) {
|
3495 | entry = entries[dindex++];
|
3496 | if (!(entry.key === key && entry.value === value)) append(this, entry.key, entry.value);
|
3497 | }
|
3498 | }, { enumerable: true, unsafe: true });
|
3499 | }
|
3500 |
|
3501 |
|
3502 | }),
|
3503 |
|
3504 | 7566:
|
3505 | ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
3506 |
|
3507 |
|
3508 | var defineBuiltIn = __webpack_require__(6840);
|
3509 | var uncurryThis = __webpack_require__(9504);
|
3510 | var toString = __webpack_require__(655);
|
3511 | var validateArgumentsLength = __webpack_require__(2812);
|
3512 |
|
3513 | var $URLSearchParams = URLSearchParams;
|
3514 | var URLSearchParamsPrototype = $URLSearchParams.prototype;
|
3515 | var getAll = uncurryThis(URLSearchParamsPrototype.getAll);
|
3516 | var $has = uncurryThis(URLSearchParamsPrototype.has);
|
3517 | var params = new $URLSearchParams('a=1');
|
3518 |
|
3519 |
|
3520 |
|
3521 | if (params.has('a', 2) || !params.has('a', undefined)) {
|
3522 | defineBuiltIn(URLSearchParamsPrototype, 'has', function has(name /* , value */) {
|
3523 | var length = arguments.length;
|
3524 | var $value = length < 2 ? undefined : arguments[1];
|
3525 | if (length && $value === undefined) return $has(this, name);
|
3526 | var values = getAll(this, name);
|
3527 | validateArgumentsLength(length, 1);
|
3528 | var value = toString($value);
|
3529 | var index = 0;
|
3530 | while (index < values.length) {
|
3531 | if (values[index++] === value) return true;
|
3532 | } return false;
|
3533 | }, { enumerable: true, unsafe: true });
|
3534 | }
|
3535 |
|
3536 |
|
3537 | }),
|
3538 |
|
3539 | 8721:
|
3540 | ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {
|
3541 |
|
3542 |
|
3543 | var DESCRIPTORS = __webpack_require__(3724);
|
3544 | var uncurryThis = __webpack_require__(9504);
|
3545 | var defineBuiltInAccessor = __webpack_require__(2106);
|
3546 |
|
3547 | var URLSearchParamsPrototype = URLSearchParams.prototype;
|
3548 | var forEach = uncurryThis(URLSearchParamsPrototype.forEach);
|
3549 |
|
3550 |
|
3551 |
|
3552 | if (DESCRIPTORS && !('size' in URLSearchParamsPrototype)) {
|
3553 | defineBuiltInAccessor(URLSearchParamsPrototype, 'size', {
|
3554 | get: function size() {
|
3555 | var count = 0;
|
3556 | forEach(this, function () { count++; });
|
3557 | return count;
|
3558 | },
|
3559 | configurable: true,
|
3560 | enumerable: true
|
3561 | });
|
3562 | }
|
3563 |
|
3564 |
|
3565 | }),
|
3566 |
|
3567 | 588:
|
3568 | ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
3569 |
|
3570 |
|
3571 |
|
3572 | __webpack_require__.d(__webpack_exports__, {
|
3573 | FluentBundle: () => ( FluentBundle),
|
3574 | FluentResource: () => ( FluentResource)
|
3575 | });
|
3576 |
|
3577 |
|
3578 |
|
3579 |
|
3580 | var es_array_push = __webpack_require__(4114);
|
3581 | ;
|
3582 | class FluentType {
|
3583 | constructor(value) {
|
3584 | this.value = value;
|
3585 | }
|
3586 | valueOf() {
|
3587 | return this.value;
|
3588 | }
|
3589 | }
|
3590 | class FluentNone extends FluentType {
|
3591 | constructor() {
|
3592 | let value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "???";
|
3593 | super(value);
|
3594 | }
|
3595 | toString(scope) {
|
3596 | return `{${this.value}}`;
|
3597 | }
|
3598 | }
|
3599 | class FluentNumber extends FluentType {
|
3600 | constructor(value) {
|
3601 | let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
3602 | super(value);
|
3603 | this.opts = opts;
|
3604 | }
|
3605 | toString(scope) {
|
3606 | try {
|
3607 | const nf = scope.memoizeIntlObject(Intl.NumberFormat, this.opts);
|
3608 | return nf.format(this.value);
|
3609 | } catch (err) {
|
3610 | scope.reportError(err);
|
3611 | return this.value.toString(10);
|
3612 | }
|
3613 | }
|
3614 | }
|
3615 | class FluentDateTime extends FluentType {
|
3616 | constructor(value) {
|
3617 | let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
3618 | super(value);
|
3619 | this.opts = opts;
|
3620 | }
|
3621 | toString(scope) {
|
3622 | try {
|
3623 | const dtf = scope.memoizeIntlObject(Intl.DateTimeFormat, this.opts);
|
3624 | return dtf.format(this.value);
|
3625 | } catch (err) {
|
3626 | scope.reportError(err);
|
3627 | return new Date(this.value).toISOString();
|
3628 | }
|
3629 | }
|
3630 | }
|
3631 | ;
|
3632 |
|
3633 |
|
3634 | const MAX_PLACEABLES = 100;
|
3635 | const FSI = "\u2068";
|
3636 | const PDI = "\u2069";
|
3637 | function match(scope, selector, key) {
|
3638 | if (key === selector) {
|
3639 | return true;
|
3640 | }
|
3641 | if (key instanceof FluentNumber && selector instanceof FluentNumber && key.value === selector.value) {
|
3642 | return true;
|
3643 | }
|
3644 | if (selector instanceof FluentNumber && typeof key === "string") {
|
3645 | let category = scope.memoizeIntlObject(Intl.PluralRules, selector.opts).select(selector.value);
|
3646 | if (key === category) {
|
3647 | return true;
|
3648 | }
|
3649 | }
|
3650 | return false;
|
3651 | }
|
3652 | function getDefault(scope, variants, star) {
|
3653 | if (variants[star]) {
|
3654 | return resolvePattern(scope, variants[star].value);
|
3655 | }
|
3656 | scope.reportError(new RangeError("No default"));
|
3657 | return new FluentNone();
|
3658 | }
|
3659 | function getArguments(scope, args) {
|
3660 | const positional = [];
|
3661 | const named = Object.create(null);
|
3662 | for (const arg of args) {
|
3663 | if (arg.type === "narg") {
|
3664 | named[arg.name] = resolveExpression(scope, arg.value);
|
3665 | } else {
|
3666 | positional.push(resolveExpression(scope, arg));
|
3667 | }
|
3668 | }
|
3669 | return {
|
3670 | positional,
|
3671 | named
|
3672 | };
|
3673 | }
|
3674 | function resolveExpression(scope, expr) {
|
3675 | switch (expr.type) {
|
3676 | case "str":
|
3677 | return expr.value;
|
3678 | case "num":
|
3679 | return new FluentNumber(expr.value, {
|
3680 | minimumFractionDigits: expr.precision
|
3681 | });
|
3682 | case "var":
|
3683 | return resolveVariableReference(scope, expr);
|
3684 | case "mesg":
|
3685 | return resolveMessageReference(scope, expr);
|
3686 | case "term":
|
3687 | return resolveTermReference(scope, expr);
|
3688 | case "func":
|
3689 | return resolveFunctionReference(scope, expr);
|
3690 | case "select":
|
3691 | return resolveSelectExpression(scope, expr);
|
3692 | default:
|
3693 | return new FluentNone();
|
3694 | }
|
3695 | }
|
3696 | function resolveVariableReference(scope, _ref) {
|
3697 | let {
|
3698 | name
|
3699 | } = _ref;
|
3700 | let arg;
|
3701 | if (scope.params) {
|
3702 | if (Object.prototype.hasOwnProperty.call(scope.params, name)) {
|
3703 | arg = scope.params[name];
|
3704 | } else {
|
3705 | return new FluentNone(`$${name}`);
|
3706 | }
|
3707 | } else if (scope.args && Object.prototype.hasOwnProperty.call(scope.args, name)) {
|
3708 | arg = scope.args[name];
|
3709 | } else {
|
3710 | scope.reportError(new ReferenceError(`Unknown variable: $${name}`));
|
3711 | return new FluentNone(`$${name}`);
|
3712 | }
|
3713 | if (arg instanceof FluentType) {
|
3714 | return arg;
|
3715 | }
|
3716 | switch (typeof arg) {
|
3717 | case "string":
|
3718 | return arg;
|
3719 | case "number":
|
3720 | return new FluentNumber(arg);
|
3721 | case "object":
|
3722 | if (arg instanceof Date) {
|
3723 | return new FluentDateTime(arg.getTime());
|
3724 | }
|
3725 | default:
|
3726 | scope.reportError(new TypeError(`Variable type not supported: $${name}, ${typeof arg}`));
|
3727 | return new FluentNone(`$${name}`);
|
3728 | }
|
3729 | }
|
3730 | function resolveMessageReference(scope, _ref2) {
|
3731 | let {
|
3732 | name,
|
3733 | attr
|
3734 | } = _ref2;
|
3735 | const message = scope.bundle._messages.get(name);
|
3736 | if (!message) {
|
3737 | scope.reportError(new ReferenceError(`Unknown message: ${name}`));
|
3738 | return new FluentNone(name);
|
3739 | }
|
3740 | if (attr) {
|
3741 | const attribute = message.attributes[attr];
|
3742 | if (attribute) {
|
3743 | return resolvePattern(scope, attribute);
|
3744 | }
|
3745 | scope.reportError(new ReferenceError(`Unknown attribute: ${attr}`));
|
3746 | return new FluentNone(`${name}.${attr}`);
|
3747 | }
|
3748 | if (message.value) {
|
3749 | return resolvePattern(scope, message.value);
|
3750 | }
|
3751 | scope.reportError(new ReferenceError(`No value: ${name}`));
|
3752 | return new FluentNone(name);
|
3753 | }
|
3754 | function resolveTermReference(scope, _ref3) {
|
3755 | let {
|
3756 | name,
|
3757 | attr,
|
3758 | args
|
3759 | } = _ref3;
|
3760 | const id = `-${name}`;
|
3761 | const term = scope.bundle._terms.get(id);
|
3762 | if (!term) {
|
3763 | scope.reportError(new ReferenceError(`Unknown term: ${id}`));
|
3764 | return new FluentNone(id);
|
3765 | }
|
3766 | if (attr) {
|
3767 | const attribute = term.attributes[attr];
|
3768 | if (attribute) {
|
3769 | scope.params = getArguments(scope, args).named;
|
3770 | const resolved = resolvePattern(scope, attribute);
|
3771 | scope.params = null;
|
3772 | return resolved;
|
3773 | }
|
3774 | scope.reportError(new ReferenceError(`Unknown attribute: ${attr}`));
|
3775 | return new FluentNone(`${id}.${attr}`);
|
3776 | }
|
3777 | scope.params = getArguments(scope, args).named;
|
3778 | const resolved = resolvePattern(scope, term.value);
|
3779 | scope.params = null;
|
3780 | return resolved;
|
3781 | }
|
3782 | function resolveFunctionReference(scope, _ref4) {
|
3783 | let {
|
3784 | name,
|
3785 | args
|
3786 | } = _ref4;
|
3787 | let func = scope.bundle._functions[name];
|
3788 | if (!func) {
|
3789 | scope.reportError(new ReferenceError(`Unknown function: ${name}()`));
|
3790 | return new FluentNone(`${name}()`);
|
3791 | }
|
3792 | if (typeof func !== "function") {
|
3793 | scope.reportError(new TypeError(`Function ${name}() is not callable`));
|
3794 | return new FluentNone(`${name}()`);
|
3795 | }
|
3796 | try {
|
3797 | let resolved = getArguments(scope, args);
|
3798 | return func(resolved.positional, resolved.named);
|
3799 | } catch (err) {
|
3800 | scope.reportError(err);
|
3801 | return new FluentNone(`${name}()`);
|
3802 | }
|
3803 | }
|
3804 | function resolveSelectExpression(scope, _ref5) {
|
3805 | let {
|
3806 | selector,
|
3807 | variants,
|
3808 | star
|
3809 | } = _ref5;
|
3810 | let sel = resolveExpression(scope, selector);
|
3811 | if (sel instanceof FluentNone) {
|
3812 | return getDefault(scope, variants, star);
|
3813 | }
|
3814 | for (const variant of variants) {
|
3815 | const key = resolveExpression(scope, variant.key);
|
3816 | if (match(scope, sel, key)) {
|
3817 | return resolvePattern(scope, variant.value);
|
3818 | }
|
3819 | }
|
3820 | return getDefault(scope, variants, star);
|
3821 | }
|
3822 | function resolveComplexPattern(scope, ptn) {
|
3823 | if (scope.dirty.has(ptn)) {
|
3824 | scope.reportError(new RangeError("Cyclic reference"));
|
3825 | return new FluentNone();
|
3826 | }
|
3827 | scope.dirty.add(ptn);
|
3828 | const result = [];
|
3829 | const useIsolating = scope.bundle._useIsolating && ptn.length > 1;
|
3830 | for (const elem of ptn) {
|
3831 | if (typeof elem === "string") {
|
3832 | result.push(scope.bundle._transform(elem));
|
3833 | continue;
|
3834 | }
|
3835 | scope.placeables++;
|
3836 | if (scope.placeables > MAX_PLACEABLES) {
|
3837 | scope.dirty.delete(ptn);
|
3838 | throw new RangeError(`Too many placeables expanded: ${scope.placeables}, ` + `max allowed is ${MAX_PLACEABLES}`);
|
3839 | }
|
3840 | if (useIsolating) {
|
3841 | result.push(FSI);
|
3842 | }
|
3843 | result.push(resolveExpression(scope, elem).toString(scope));
|
3844 | if (useIsolating) {
|
3845 | result.push(PDI);
|
3846 | }
|
3847 | }
|
3848 | scope.dirty.delete(ptn);
|
3849 | return result.join("");
|
3850 | }
|
3851 | function resolvePattern(scope, value) {
|
3852 | if (typeof value === "string") {
|
3853 | return scope.bundle._transform(value);
|
3854 | }
|
3855 | return resolveComplexPattern(scope, value);
|
3856 | }
|
3857 | ;
|
3858 |
|
3859 | class Scope {
|
3860 | constructor(bundle, errors, args) {
|
3861 | this.dirty = new WeakSet();
|
3862 | this.params = null;
|
3863 | this.placeables = 0;
|
3864 | this.bundle = bundle;
|
3865 | this.errors = errors;
|
3866 | this.args = args;
|
3867 | }
|
3868 | reportError(error) {
|
3869 | if (!this.errors || !(error instanceof Error)) {
|
3870 | throw error;
|
3871 | }
|
3872 | this.errors.push(error);
|
3873 | }
|
3874 | memoizeIntlObject(ctor, opts) {
|
3875 | let cache = this.bundle._intls.get(ctor);
|
3876 | if (!cache) {
|
3877 | cache = {};
|
3878 | this.bundle._intls.set(ctor, cache);
|
3879 | }
|
3880 | let id = JSON.stringify(opts);
|
3881 | if (!cache[id]) {
|
3882 | cache[id] = new ctor(this.bundle.locales, opts);
|
3883 | }
|
3884 | return cache[id];
|
3885 | }
|
3886 | }
|
3887 | ;
|
3888 |
|
3889 | function values(opts, allowed) {
|
3890 | const unwrapped = Object.create(null);
|
3891 | for (const [name, opt] of Object.entries(opts)) {
|
3892 | if (allowed.includes(name)) {
|
3893 | unwrapped[name] = opt.valueOf();
|
3894 | }
|
3895 | }
|
3896 | return unwrapped;
|
3897 | }
|
3898 | const NUMBER_ALLOWED = ["unitDisplay", "currencyDisplay", "useGrouping", "minimumIntegerDigits", "minimumFractionDigits", "maximumFractionDigits", "minimumSignificantDigits", "maximumSignificantDigits"];
|
3899 | function NUMBER(args, opts) {
|
3900 | let arg = args[0];
|
3901 | if (arg instanceof FluentNone) {
|
3902 | return new FluentNone(`NUMBER(${arg.valueOf()})`);
|
3903 | }
|
3904 | if (arg instanceof FluentNumber) {
|
3905 | return new FluentNumber(arg.valueOf(), {
|
3906 | ...arg.opts,
|
3907 | ...values(opts, NUMBER_ALLOWED)
|
3908 | });
|
3909 | }
|
3910 | if (arg instanceof FluentDateTime) {
|
3911 | return new FluentNumber(arg.valueOf(), {
|
3912 | ...values(opts, NUMBER_ALLOWED)
|
3913 | });
|
3914 | }
|
3915 | throw new TypeError("Invalid argument to NUMBER");
|
3916 | }
|
3917 | const DATETIME_ALLOWED = ["dateStyle", "timeStyle", "fractionalSecondDigits", "dayPeriod", "hour12", "weekday", "era", "year", "month", "day", "hour", "minute", "second", "timeZoneName"];
|
3918 | function DATETIME(args, opts) {
|
3919 | let arg = args[0];
|
3920 | if (arg instanceof FluentNone) {
|
3921 | return new FluentNone(`DATETIME(${arg.valueOf()})`);
|
3922 | }
|
3923 | if (arg instanceof FluentDateTime) {
|
3924 | return new FluentDateTime(arg.valueOf(), {
|
3925 | ...arg.opts,
|
3926 | ...values(opts, DATETIME_ALLOWED)
|
3927 | });
|
3928 | }
|
3929 | if (arg instanceof FluentNumber) {
|
3930 | return new FluentDateTime(arg.valueOf(), {
|
3931 | ...values(opts, DATETIME_ALLOWED)
|
3932 | });
|
3933 | }
|
3934 | throw new TypeError("Invalid argument to DATETIME");
|
3935 | }
|
3936 | ;
|
3937 | const cache = new Map();
|
3938 | function getMemoizerForLocale(locales) {
|
3939 | const stringLocale = Array.isArray(locales) ? locales.join(" ") : locales;
|
3940 | let memoizer = cache.get(stringLocale);
|
3941 | if (memoizer === undefined) {
|
3942 | memoizer = new Map();
|
3943 | cache.set(stringLocale, memoizer);
|
3944 | }
|
3945 | return memoizer;
|
3946 | }
|
3947 | ;
|
3948 |
|
3949 |
|
3950 |
|
3951 |
|
3952 |
|
3953 |
|
3954 | class FluentBundle {
|
3955 | constructor(locales) {
|
3956 | let {
|
3957 | functions,
|
3958 | useIsolating = true,
|
3959 | transform = v => v
|
3960 | } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
3961 | this._terms = new Map();
|
3962 | this._messages = new Map();
|
3963 | this.locales = Array.isArray(locales) ? locales : [locales];
|
3964 | this._functions = {
|
3965 | NUMBER: NUMBER,
|
3966 | DATETIME: DATETIME,
|
3967 | ...functions
|
3968 | };
|
3969 | this._useIsolating = useIsolating;
|
3970 | this._transform = transform;
|
3971 | this._intls = getMemoizerForLocale(locales);
|
3972 | }
|
3973 | hasMessage(id) {
|
3974 | return this._messages.has(id);
|
3975 | }
|
3976 | getMessage(id) {
|
3977 | return this._messages.get(id);
|
3978 | }
|
3979 | addResource(res) {
|
3980 | let {
|
3981 | allowOverrides = false
|
3982 | } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
3983 | const errors = [];
|
3984 | for (let i = 0; i < res.body.length; i++) {
|
3985 | let entry = res.body[i];
|
3986 | if (entry.id.startsWith("-")) {
|
3987 | if (allowOverrides === false && this._terms.has(entry.id)) {
|
3988 | errors.push(new Error(`Attempt to override an existing term: "${entry.id}"`));
|
3989 | continue;
|
3990 | }
|
3991 | this._terms.set(entry.id, entry);
|
3992 | } else {
|
3993 | if (allowOverrides === false && this._messages.has(entry.id)) {
|
3994 | errors.push(new Error(`Attempt to override an existing message: "${entry.id}"`));
|
3995 | continue;
|
3996 | }
|
3997 | this._messages.set(entry.id, entry);
|
3998 | }
|
3999 | }
|
4000 | return errors;
|
4001 | }
|
4002 | formatPattern(pattern) {
|
4003 | let args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
4004 | let errors = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
4005 | if (typeof pattern === "string") {
|
4006 | return this._transform(pattern);
|
4007 | }
|
4008 | let scope = new Scope(this, errors, args);
|
4009 | try {
|
4010 | let value = resolveComplexPattern(scope, pattern);
|
4011 | return value.toString(scope);
|
4012 | } catch (err) {
|
4013 | if (scope.errors && err instanceof Error) {
|
4014 | scope.errors.push(err);
|
4015 | return new FluentNone().toString(scope);
|
4016 | }
|
4017 | throw err;
|
4018 | }
|
4019 | }
|
4020 | }
|
4021 | ;
|
4022 |
|
4023 | const RE_MESSAGE_START = /^(-?[a-zA-Z][\w-]*) *= */gm;
|
4024 | const RE_ATTRIBUTE_START = /\.([a-zA-Z][\w-]*) *= */y;
|
4025 | const RE_VARIANT_START = /\*?\[/y;
|
4026 | const RE_NUMBER_LITERAL = /(-?[0-9]+(?:\.([0-9]+))?)/y;
|
4027 | const RE_IDENTIFIER = /([a-zA-Z][\w-]*)/y;
|
4028 | const RE_REFERENCE = /([$-])?([a-zA-Z][\w-]*)(?:\.([a-zA-Z][\w-]*))?/y;
|
4029 | const RE_FUNCTION_NAME = /^[A-Z][A-Z0-9_-]*$/;
|
4030 | const RE_TEXT_RUN = /([^{}\n\r]+)/y;
|
4031 | const RE_STRING_RUN = /([^\\"\n\r]*)/y;
|
4032 | const RE_STRING_ESCAPE = /\\([\\"])/y;
|
4033 | const RE_UNICODE_ESCAPE = /\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{6})/y;
|
4034 | const RE_LEADING_NEWLINES = /^\n+/;
|
4035 | const RE_TRAILING_SPACES = / +$/;
|
4036 | const RE_BLANK_LINES = / *\r?\n/g;
|
4037 | const RE_INDENT = /( *)$/;
|
4038 | const TOKEN_BRACE_OPEN = /{\s*/y;
|
4039 | const TOKEN_BRACE_CLOSE = /\s*}/y;
|
4040 | const TOKEN_BRACKET_OPEN = /\[\s*/y;
|
4041 | const TOKEN_BRACKET_CLOSE = /\s*] */y;
|
4042 | const TOKEN_PAREN_OPEN = /\s*\(\s*/y;
|
4043 | const TOKEN_ARROW = /\s*->\s*/y;
|
4044 | const TOKEN_COLON = /\s*:\s*/y;
|
4045 | const TOKEN_COMMA = /\s*,?\s*/y;
|
4046 | const TOKEN_BLANK = /\s+/y;
|
4047 | class FluentResource {
|
4048 | constructor(source) {
|
4049 | this.body = [];
|
4050 | RE_MESSAGE_START.lastIndex = 0;
|
4051 | let cursor = 0;
|
4052 | while (true) {
|
4053 | let next = RE_MESSAGE_START.exec(source);
|
4054 | if (next === null) {
|
4055 | break;
|
4056 | }
|
4057 | cursor = RE_MESSAGE_START.lastIndex;
|
4058 | try {
|
4059 | this.body.push(parseMessage(next[1]));
|
4060 | } catch (err) {
|
4061 | if (err instanceof SyntaxError) {
|
4062 | continue;
|
4063 | }
|
4064 | throw err;
|
4065 | }
|
4066 | }
|
4067 | function test(re) {
|
4068 | re.lastIndex = cursor;
|
4069 | return re.test(source);
|
4070 | }
|
4071 | function consumeChar(char, errorClass) {
|
4072 | if (source[cursor] === char) {
|
4073 | cursor++;
|
4074 | return true;
|
4075 | }
|
4076 | if (errorClass) {
|
4077 | throw new errorClass(`Expected ${char}`);
|
4078 | }
|
4079 | return false;
|
4080 | }
|
4081 | function consumeToken(re, errorClass) {
|
4082 | if (test(re)) {
|
4083 | cursor = re.lastIndex;
|
4084 | return true;
|
4085 | }
|
4086 | if (errorClass) {
|
4087 | throw new errorClass(`Expected ${re.toString()}`);
|
4088 | }
|
4089 | return false;
|
4090 | }
|
4091 | function match(re) {
|
4092 | re.lastIndex = cursor;
|
4093 | let result = re.exec(source);
|
4094 | if (result === null) {
|
4095 | throw new SyntaxError(`Expected ${re.toString()}`);
|
4096 | }
|
4097 | cursor = re.lastIndex;
|
4098 | return result;
|
4099 | }
|
4100 | function match1(re) {
|
4101 | return match(re)[1];
|
4102 | }
|
4103 | function parseMessage(id) {
|
4104 | let value = parsePattern();
|
4105 | let attributes = parseAttributes();
|
4106 | if (value === null && Object.keys(attributes).length === 0) {
|
4107 | throw new SyntaxError("Expected message value or attributes");
|
4108 | }
|
4109 | return {
|
4110 | id,
|
4111 | value,
|
4112 | attributes
|
4113 | };
|
4114 | }
|
4115 | function parseAttributes() {
|
4116 | let attrs = Object.create(null);
|
4117 | while (test(RE_ATTRIBUTE_START)) {
|
4118 | let name = match1(RE_ATTRIBUTE_START);
|
4119 | let value = parsePattern();
|
4120 | if (value === null) {
|
4121 | throw new SyntaxError("Expected attribute value");
|
4122 | }
|
4123 | attrs[name] = value;
|
4124 | }
|
4125 | return attrs;
|
4126 | }
|
4127 | function parsePattern() {
|
4128 | let first;
|
4129 | if (test(RE_TEXT_RUN)) {
|
4130 | first = match1(RE_TEXT_RUN);
|
4131 | }
|
4132 | if (source[cursor] === "{" || source[cursor] === "}") {
|
4133 | return parsePatternElements(first ? [first] : [], Infinity);
|
4134 | }
|
4135 | let indent = parseIndent();
|
4136 | if (indent) {
|
4137 | if (first) {
|
4138 | return parsePatternElements([first, indent], indent.length);
|
4139 | }
|
4140 | indent.value = trim(indent.value, RE_LEADING_NEWLINES);
|
4141 | return parsePatternElements([indent], indent.length);
|
4142 | }
|
4143 | if (first) {
|
4144 | return trim(first, RE_TRAILING_SPACES);
|
4145 | }
|
4146 | return null;
|
4147 | }
|
4148 | function parsePatternElements() {
|
4149 | let elements = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
4150 | let commonIndent = arguments.length > 1 ? arguments[1] : undefined;
|
4151 | while (true) {
|
4152 | if (test(RE_TEXT_RUN)) {
|
4153 | elements.push(match1(RE_TEXT_RUN));
|
4154 | continue;
|
4155 | }
|
4156 | if (source[cursor] === "{") {
|
4157 | elements.push(parsePlaceable());
|
4158 | continue;
|
4159 | }
|
4160 | if (source[cursor] === "}") {
|
4161 | throw new SyntaxError("Unbalanced closing brace");
|
4162 | }
|
4163 | let indent = parseIndent();
|
4164 | if (indent) {
|
4165 | elements.push(indent);
|
4166 | commonIndent = Math.min(commonIndent, indent.length);
|
4167 | continue;
|
4168 | }
|
4169 | break;
|
4170 | }
|
4171 | let lastIndex = elements.length - 1;
|
4172 | let lastElement = elements[lastIndex];
|
4173 | if (typeof lastElement === "string") {
|
4174 | elements[lastIndex] = trim(lastElement, RE_TRAILING_SPACES);
|
4175 | }
|
4176 | let baked = [];
|
4177 | for (let element of elements) {
|
4178 | if (element instanceof Indent) {
|
4179 | element = element.value.slice(0, element.value.length - commonIndent);
|
4180 | }
|
4181 | if (element) {
|
4182 | baked.push(element);
|
4183 | }
|
4184 | }
|
4185 | return baked;
|
4186 | }
|
4187 | function parsePlaceable() {
|
4188 | consumeToken(TOKEN_BRACE_OPEN, SyntaxError);
|
4189 | let selector = parseInlineExpression();
|
4190 | if (consumeToken(TOKEN_BRACE_CLOSE)) {
|
4191 | return selector;
|
4192 | }
|
4193 | if (consumeToken(TOKEN_ARROW)) {
|
4194 | let variants = parseVariants();
|
4195 | consumeToken(TOKEN_BRACE_CLOSE, SyntaxError);
|
4196 | return {
|
4197 | type: "select",
|
4198 | selector,
|
4199 | ...variants
|
4200 | };
|
4201 | }
|
4202 | throw new SyntaxError("Unclosed placeable");
|
4203 | }
|
4204 | function parseInlineExpression() {
|
4205 | if (source[cursor] === "{") {
|
4206 | return parsePlaceable();
|
4207 | }
|
4208 | if (test(RE_REFERENCE)) {
|
4209 | let [, sigil, name, attr = null] = match(RE_REFERENCE);
|
4210 | if (sigil === "$") {
|
4211 | return {
|
4212 | type: "var",
|
4213 | name
|
4214 | };
|
4215 | }
|
4216 | if (consumeToken(TOKEN_PAREN_OPEN)) {
|
4217 | let args = parseArguments();
|
4218 | if (sigil === "-") {
|
4219 | return {
|
4220 | type: "term",
|
4221 | name,
|
4222 | attr,
|
4223 | args
|
4224 | };
|
4225 | }
|
4226 | if (RE_FUNCTION_NAME.test(name)) {
|
4227 | return {
|
4228 | type: "func",
|
4229 | name,
|
4230 | args
|
4231 | };
|
4232 | }
|
4233 | throw new SyntaxError("Function names must be all upper-case");
|
4234 | }
|
4235 | if (sigil === "-") {
|
4236 | return {
|
4237 | type: "term",
|
4238 | name,
|
4239 | attr,
|
4240 | args: []
|
4241 | };
|
4242 | }
|
4243 | return {
|
4244 | type: "mesg",
|
4245 | name,
|
4246 | attr
|
4247 | };
|
4248 | }
|
4249 | return parseLiteral();
|
4250 | }
|
4251 | function parseArguments() {
|
4252 | let args = [];
|
4253 | while (true) {
|
4254 | switch (source[cursor]) {
|
4255 | case ")":
|
4256 | cursor++;
|
4257 | return args;
|
4258 | case undefined:
|
4259 | throw new SyntaxError("Unclosed argument list");
|
4260 | }
|
4261 | args.push(parseArgument());
|
4262 | consumeToken(TOKEN_COMMA);
|
4263 | }
|
4264 | }
|
4265 | function parseArgument() {
|
4266 | let expr = parseInlineExpression();
|
4267 | if (expr.type !== "mesg") {
|
4268 | return expr;
|
4269 | }
|
4270 | if (consumeToken(TOKEN_COLON)) {
|
4271 | return {
|
4272 | type: "narg",
|
4273 | name: expr.name,
|
4274 | value: parseLiteral()
|
4275 | };
|
4276 | }
|
4277 | return expr;
|
4278 | }
|
4279 | function parseVariants() {
|
4280 | let variants = [];
|
4281 | let count = 0;
|
4282 | let star;
|
4283 | while (test(RE_VARIANT_START)) {
|
4284 | if (consumeChar("*")) {
|
4285 | star = count;
|
4286 | }
|
4287 | let key = parseVariantKey();
|
4288 | let value = parsePattern();
|
4289 | if (value === null) {
|
4290 | throw new SyntaxError("Expected variant value");
|
4291 | }
|
4292 | variants[count++] = {
|
4293 | key,
|
4294 | value
|
4295 | };
|
4296 | }
|
4297 | if (count === 0) {
|
4298 | return null;
|
4299 | }
|
4300 | if (star === undefined) {
|
4301 | throw new SyntaxError("Expected default variant");
|
4302 | }
|
4303 | return {
|
4304 | variants,
|
4305 | star
|
4306 | };
|
4307 | }
|
4308 | function parseVariantKey() {
|
4309 | consumeToken(TOKEN_BRACKET_OPEN, SyntaxError);
|
4310 | let key;
|
4311 | if (test(RE_NUMBER_LITERAL)) {
|
4312 | key = parseNumberLiteral();
|
4313 | } else {
|
4314 | key = {
|
4315 | type: "str",
|
4316 | value: match1(RE_IDENTIFIER)
|
4317 | };
|
4318 | }
|
4319 | consumeToken(TOKEN_BRACKET_CLOSE, SyntaxError);
|
4320 | return key;
|
4321 | }
|
4322 | function parseLiteral() {
|
4323 | if (test(RE_NUMBER_LITERAL)) {
|
4324 | return parseNumberLiteral();
|
4325 | }
|
4326 | if (source[cursor] === '"') {
|
4327 | return parseStringLiteral();
|
4328 | }
|
4329 | throw new SyntaxError("Invalid expression");
|
4330 | }
|
4331 | function parseNumberLiteral() {
|
4332 | let [, value, fraction = ""] = match(RE_NUMBER_LITERAL);
|
4333 | let precision = fraction.length;
|
4334 | return {
|
4335 | type: "num",
|
4336 | value: parseFloat(value),
|
4337 | precision
|
4338 | };
|
4339 | }
|
4340 | function parseStringLiteral() {
|
4341 | consumeChar('"', SyntaxError);
|
4342 | let value = "";
|
4343 | while (true) {
|
4344 | value += match1(RE_STRING_RUN);
|
4345 | if (source[cursor] === "\\") {
|
4346 | value += parseEscapeSequence();
|
4347 | continue;
|
4348 | }
|
4349 | if (consumeChar('"')) {
|
4350 | return {
|
4351 | type: "str",
|
4352 | value
|
4353 | };
|
4354 | }
|
4355 | throw new SyntaxError("Unclosed string literal");
|
4356 | }
|
4357 | }
|
4358 | function parseEscapeSequence() {
|
4359 | if (test(RE_STRING_ESCAPE)) {
|
4360 | return match1(RE_STRING_ESCAPE);
|
4361 | }
|
4362 | if (test(RE_UNICODE_ESCAPE)) {
|
4363 | let [, codepoint4, codepoint6] = match(RE_UNICODE_ESCAPE);
|
4364 | let codepoint = parseInt(codepoint4 || codepoint6, 16);
|
4365 | return codepoint <= 0xd7ff || 0xe000 <= codepoint ? String.fromCodePoint(codepoint) : "�";
|
4366 | }
|
4367 | throw new SyntaxError("Unknown escape sequence");
|
4368 | }
|
4369 | function parseIndent() {
|
4370 | let start = cursor;
|
4371 | consumeToken(TOKEN_BLANK);
|
4372 | switch (source[cursor]) {
|
4373 | case ".":
|
4374 | case "[":
|
4375 | case "*":
|
4376 | case "}":
|
4377 | case undefined:
|
4378 | return false;
|
4379 | case "{":
|
4380 | return makeIndent(source.slice(start, cursor));
|
4381 | }
|
4382 | if (source[cursor - 1] === " ") {
|
4383 | return makeIndent(source.slice(start, cursor));
|
4384 | }
|
4385 | return false;
|
4386 | }
|
4387 | function trim(text, re) {
|
4388 | return text.replace(re, "");
|
4389 | }
|
4390 | function makeIndent(blank) {
|
4391 | let value = blank.replace(RE_BLANK_LINES, "\n");
|
4392 | let length = RE_INDENT.exec(blank)[1].length;
|
4393 | return new Indent(value, length);
|
4394 | }
|
4395 | }
|
4396 | }
|
4397 | class Indent {
|
4398 | constructor(value, length) {
|
4399 | this.value = value;
|
4400 | this.length = length;
|
4401 | }
|
4402 | }
|
4403 | ;
|
4404 |
|
4405 |
|
4406 |
|
4407 |
|
4408 | }),
|
4409 |
|
4410 | 5273:
|
4411 | ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
4412 |
|
4413 |
|
4414 |
|
4415 | __webpack_require__.d(__webpack_exports__, {
|
4416 | DOMLocalization: () => ( DOMLocalization)
|
4417 | });
|
4418 |
|
4419 |
|
4420 |
|
4421 |
|
4422 | var es_array_push = __webpack_require__(4114);
|
4423 |
|
4424 | var esnext_iterator_map = __webpack_require__(1454);
|
4425 |
|
4426 | var esnext_json_parse = __webpack_require__(8335);
|
4427 |
|
4428 | var esnext_set_difference_v2 = __webpack_require__(3375);
|
4429 |
|
4430 | var esnext_set_intersection_v2 = __webpack_require__(9225);
|
4431 |
|
4432 | var esnext_set_is_disjoint_from_v2 = __webpack_require__(3972);
|
4433 |
|
4434 | var esnext_set_is_subset_of_v2 = __webpack_require__(9209);
|
4435 |
|
4436 | var esnext_set_is_superset_of_v2 = __webpack_require__(5714);
|
4437 |
|
4438 | var esnext_set_symmetric_difference_v2 = __webpack_require__(7561);
|
4439 |
|
4440 | var esnext_set_union_v2 = __webpack_require__(6197);
|
4441 | ;
|
4442 |
|
4443 | const reOverlay = /<|&#?\w+;/;
|
4444 | const TEXT_LEVEL_ELEMENTS = {
|
4445 | "http://www.w3.org/1999/xhtml": ["em", "strong", "small", "s", "cite", "q", "dfn", "abbr", "data", "time", "code", "var", "samp", "kbd", "sub", "sup", "i", "b", "u", "mark", "bdi", "bdo", "span", "br", "wbr"]
|
4446 | };
|
4447 | const LOCALIZABLE_ATTRIBUTES = {
|
4448 | "http://www.w3.org/1999/xhtml": {
|
4449 | global: ["title", "aria-label", "aria-valuetext"],
|
4450 | a: ["download"],
|
4451 | area: ["download", "alt"],
|
4452 | input: ["alt", "placeholder"],
|
4453 | menuitem: ["label"],
|
4454 | menu: ["label"],
|
4455 | optgroup: ["label"],
|
4456 | option: ["label"],
|
4457 | track: ["label"],
|
4458 | img: ["alt"],
|
4459 | textarea: ["placeholder"],
|
4460 | th: ["abbr"]
|
4461 | },
|
4462 | "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul": {
|
4463 | global: ["accesskey", "aria-label", "aria-valuetext", "label", "title", "tooltiptext"],
|
4464 | description: ["value"],
|
4465 | key: ["key", "keycode"],
|
4466 | label: ["value"],
|
4467 | textbox: ["placeholder", "value"]
|
4468 | }
|
4469 | };
|
4470 | function translateElement(element, translation) {
|
4471 | const {
|
4472 | value
|
4473 | } = translation;
|
4474 | if (typeof value === "string") {
|
4475 | if (element.localName === "title" && element.namespaceURI === "http://www.w3.org/1999/xhtml") {
|
4476 | element.textContent = value;
|
4477 | } else if (!reOverlay.test(value)) {
|
4478 | element.textContent = value;
|
4479 | } else {
|
4480 | const templateElement = element.ownerDocument.createElementNS("http://www.w3.org/1999/xhtml", "template");
|
4481 | templateElement.innerHTML = value;
|
4482 | overlayChildNodes(templateElement.content, element);
|
4483 | }
|
4484 | }
|
4485 | overlayAttributes(translation, element);
|
4486 | }
|
4487 | function overlayChildNodes(fromFragment, toElement) {
|
4488 | for (const childNode of fromFragment.childNodes) {
|
4489 | if (childNode.nodeType === childNode.TEXT_NODE) {
|
4490 | continue;
|
4491 | }
|
4492 | if (childNode.hasAttribute("data-l10n-name")) {
|
4493 | const sanitized = getNodeForNamedElement(toElement, childNode);
|
4494 | fromFragment.replaceChild(sanitized, childNode);
|
4495 | continue;
|
4496 | }
|
4497 | if (isElementAllowed(childNode)) {
|
4498 | const sanitized = createSanitizedElement(childNode);
|
4499 | fromFragment.replaceChild(sanitized, childNode);
|
4500 | continue;
|
4501 | }
|
4502 | console.warn(`An element of forbidden type "${childNode.localName}" was found in ` + "the translation. Only safe text-level elements and elements with " + "data-l10n-name are allowed.");
|
4503 | fromFragment.replaceChild(createTextNodeFromTextContent(childNode), childNode);
|
4504 | }
|
4505 | toElement.textContent = "";
|
4506 | toElement.appendChild(fromFragment);
|
4507 | }
|
4508 | function hasAttribute(attributes, name) {
|
4509 | if (!attributes) {
|
4510 | return false;
|
4511 | }
|
4512 | for (let attr of attributes) {
|
4513 | if (attr.name === name) {
|
4514 | return true;
|
4515 | }
|
4516 | }
|
4517 | return false;
|
4518 | }
|
4519 | function overlayAttributes(fromElement, toElement) {
|
4520 | const explicitlyAllowed = toElement.hasAttribute("data-l10n-attrs") ? toElement.getAttribute("data-l10n-attrs").split(",").map(i => i.trim()) : null;
|
4521 | for (const attr of Array.from(toElement.attributes)) {
|
4522 | if (isAttrNameLocalizable(attr.name, toElement, explicitlyAllowed) && !hasAttribute(fromElement.attributes, attr.name)) {
|
4523 | toElement.removeAttribute(attr.name);
|
4524 | }
|
4525 | }
|
4526 | if (!fromElement.attributes) {
|
4527 | return;
|
4528 | }
|
4529 | for (const attr of Array.from(fromElement.attributes)) {
|
4530 | if (isAttrNameLocalizable(attr.name, toElement, explicitlyAllowed) && toElement.getAttribute(attr.name) !== attr.value) {
|
4531 | toElement.setAttribute(attr.name, attr.value);
|
4532 | }
|
4533 | }
|
4534 | }
|
4535 | function getNodeForNamedElement(sourceElement, translatedChild) {
|
4536 | const childName = translatedChild.getAttribute("data-l10n-name");
|
4537 | const sourceChild = sourceElement.querySelector(`[data-l10n-name="${childName}"]`);
|
4538 | if (!sourceChild) {
|
4539 | console.warn(`An element named "${childName}" wasn't found in the source.`);
|
4540 | return createTextNodeFromTextContent(translatedChild);
|
4541 | }
|
4542 | if (sourceChild.localName !== translatedChild.localName) {
|
4543 | console.warn(`An element named "${childName}" was found in the translation ` + `but its type ${translatedChild.localName} didn't match the ` + `element found in the source (${sourceChild.localName}).`);
|
4544 | return createTextNodeFromTextContent(translatedChild);
|
4545 | }
|
4546 | sourceElement.removeChild(sourceChild);
|
4547 | const clone = sourceChild.cloneNode(false);
|
4548 | return shallowPopulateUsing(translatedChild, clone);
|
4549 | }
|
4550 | function createSanitizedElement(element) {
|
4551 | const clone = element.ownerDocument.createElement(element.localName);
|
4552 | return shallowPopulateUsing(element, clone);
|
4553 | }
|
4554 | function createTextNodeFromTextContent(element) {
|
4555 | return element.ownerDocument.createTextNode(element.textContent);
|
4556 | }
|
4557 | function isElementAllowed(element) {
|
4558 | const allowed = TEXT_LEVEL_ELEMENTS[element.namespaceURI];
|
4559 | return allowed && allowed.includes(element.localName);
|
4560 | }
|
4561 | function isAttrNameLocalizable(name, element) {
|
4562 | let explicitlyAllowed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
4563 | if (explicitlyAllowed && explicitlyAllowed.includes(name)) {
|
4564 | return true;
|
4565 | }
|
4566 | const allowed = LOCALIZABLE_ATTRIBUTES[element.namespaceURI];
|
4567 | if (!allowed) {
|
4568 | return false;
|
4569 | }
|
4570 | const attrName = name.toLowerCase();
|
4571 | const elemName = element.localName;
|
4572 | if (allowed.global.includes(attrName)) {
|
4573 | return true;
|
4574 | }
|
4575 | if (!allowed[elemName]) {
|
4576 | return false;
|
4577 | }
|
4578 | if (allowed[elemName].includes(attrName)) {
|
4579 | return true;
|
4580 | }
|
4581 | if (element.namespaceURI === "http://www.w3.org/1999/xhtml" && elemName === "input" && attrName === "value") {
|
4582 | const type = element.type.toLowerCase();
|
4583 | if (type === "submit" || type === "button" || type === "reset") {
|
4584 | return true;
|
4585 | }
|
4586 | }
|
4587 | return false;
|
4588 | }
|
4589 | function shallowPopulateUsing(fromElement, toElement) {
|
4590 | toElement.textContent = fromElement.textContent;
|
4591 | overlayAttributes(fromElement, toElement);
|
4592 | return toElement;
|
4593 | }
|
4594 |
|
4595 | var esnext_iterator_constructor = __webpack_require__(8992);
|
4596 |
|
4597 | var esnext_iterator_filter = __webpack_require__(4520);
|
4598 |
|
4599 | var esnext_iterator_for_each = __webpack_require__(3949);
|
4600 | ;
|
4601 | class CachedIterable extends Array {
|
4602 | static from(iterable) {
|
4603 | if (iterable instanceof this) {
|
4604 | return iterable;
|
4605 | }
|
4606 | return new this(iterable);
|
4607 | }
|
4608 | }
|
4609 | ;
|
4610 |
|
4611 |
|
4612 | class CachedSyncIterable extends CachedIterable {
|
4613 | constructor(iterable) {
|
4614 | super();
|
4615 | if (Symbol.iterator in Object(iterable)) {
|
4616 | this.iterator = iterable[Symbol.iterator]();
|
4617 | } else {
|
4618 | throw new TypeError("Argument must implement the iteration protocol.");
|
4619 | }
|
4620 | }
|
4621 | [Symbol.iterator]() {
|
4622 | const cached = this;
|
4623 | let cur = 0;
|
4624 | return {
|
4625 | next() {
|
4626 | if (cached.length <= cur) {
|
4627 | cached.push(cached.iterator.next());
|
4628 | }
|
4629 | return cached[cur++];
|
4630 | }
|
4631 | };
|
4632 | }
|
4633 | touchNext() {
|
4634 | let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
4635 | let idx = 0;
|
4636 | while (idx++ < count) {
|
4637 | const last = this[this.length - 1];
|
4638 | if (last && last.done) {
|
4639 | break;
|
4640 | }
|
4641 | this.push(this.iterator.next());
|
4642 | }
|
4643 | return this[this.length - 1];
|
4644 | }
|
4645 | }
|
4646 | ;// CONCATENATED MODULE: ./node_modules/cached-iterable/src/cached_async_iterable.mjs
|
4647 |
|
4648 |
|
4649 | class CachedAsyncIterable extends CachedIterable {
|
4650 | constructor(iterable) {
|
4651 | super();
|
4652 | if (Symbol.asyncIterator in Object(iterable)) {
|
4653 | this.iterator = iterable[Symbol.asyncIterator]();
|
4654 | } else if (Symbol.iterator in Object(iterable)) {
|
4655 | this.iterator = iterable[Symbol.iterator]();
|
4656 | } else {
|
4657 | throw new TypeError("Argument must implement the iteration protocol.");
|
4658 | }
|
4659 | }
|
4660 | [Symbol.asyncIterator]() {
|
4661 | const cached = this;
|
4662 | let cur = 0;
|
4663 | return {
|
4664 | async next() {
|
4665 | if (cached.length <= cur) {
|
4666 | cached.push(cached.iterator.next());
|
4667 | }
|
4668 | return cached[cur++];
|
4669 | }
|
4670 | };
|
4671 | }
|
4672 | async touchNext() {
|
4673 | let count = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;
|
4674 | let idx = 0;
|
4675 | while (idx++ < count) {
|
4676 | const last = this[this.length - 1];
|
4677 | if (last && (await last).done) {
|
4678 | break;
|
4679 | }
|
4680 | this.push(this.iterator.next());
|
4681 | }
|
4682 | return this[this.length - 1];
|
4683 | }
|
4684 | }
|
4685 | ;// CONCATENATED MODULE: ./node_modules/cached-iterable/src/index.mjs
|
4686 |
|
4687 |
|
4688 | ;// CONCATENATED MODULE: ./node_modules/@fluent/dom/esm/localization.js
|
4689 |
|
4690 |
|
4691 |
|
4692 |
|
4693 |
|
4694 |
|
4695 |
|
4696 |
|
4697 |
|
4698 |
|
4699 |
|
4700 |
|
4701 | class Localization {
|
4702 | constructor() {
|
4703 | let resourceIds = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
4704 | let generateBundles = arguments.length > 1 ? arguments[1] : undefined;
|
4705 | this.resourceIds = resourceIds;
|
4706 | this.generateBundles = generateBundles;
|
4707 | this.onChange(true);
|
4708 | }
|
4709 | addResourceIds(resourceIds) {
|
4710 | let eager = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
4711 | this.resourceIds.push(...resourceIds);
|
4712 | this.onChange(eager);
|
4713 | return this.resourceIds.length;
|
4714 | }
|
4715 | removeResourceIds(resourceIds) {
|
4716 | this.resourceIds = this.resourceIds.filter(r => !resourceIds.includes(r));
|
4717 | this.onChange();
|
4718 | return this.resourceIds.length;
|
4719 | }
|
4720 | async formatWithFallback(keys, method) {
|
4721 | const translations = [];
|
4722 | let hasAtLeastOneBundle = false;
|
4723 | for await (const bundle of this.bundles) {
|
4724 | hasAtLeastOneBundle = true;
|
4725 | const missingIds = keysFromBundle(method, bundle, keys, translations);
|
4726 | if (missingIds.size === 0) {
|
4727 | break;
|
4728 | }
|
4729 | if (typeof console !== "undefined") {
|
4730 | const locale = bundle.locales[0];
|
4731 | const ids = Array.from(missingIds).join(", ");
|
4732 | console.warn(`[fluent] Missing translations in ${locale}: ${ids}`);
|
4733 | }
|
4734 | }
|
4735 | if (!hasAtLeastOneBundle && typeof console !== "undefined") {
|
4736 | console.warn(`[fluent] Request for keys failed because no resource bundles got generated.
|
4737 | keys: ${JSON.stringify(keys)}.
|
4738 | resourceIds: ${JSON.stringify(this.resourceIds)}.`);
|
4739 | }
|
4740 | return translations;
|
4741 | }
|
4742 | formatMessages(keys) {
|
4743 | return this.formatWithFallback(keys, messageFromBundle);
|
4744 | }
|
4745 | formatValues(keys) {
|
4746 | return this.formatWithFallback(keys, valueFromBundle);
|
4747 | }
|
4748 | async formatValue(id, args) {
|
4749 | const [val] = await this.formatValues([{
|
4750 | id,
|
4751 | args
|
4752 | }]);
|
4753 | return val;
|
4754 | }
|
4755 | handleEvent() {
|
4756 | this.onChange();
|
4757 | }
|
4758 | onChange() {
|
4759 | let eager = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
4760 | this.bundles = CachedAsyncIterable.from(this.generateBundles(this.resourceIds));
|
4761 | if (eager) {
|
4762 | this.bundles.touchNext(2);
|
4763 | }
|
4764 | }
|
4765 | }
|
4766 | function valueFromBundle(bundle, errors, message, args) {
|
4767 | if (message.value) {
|
4768 | return bundle.formatPattern(message.value, args, errors);
|
4769 | }
|
4770 | return null;
|
4771 | }
|
4772 | function messageFromBundle(bundle, errors, message, args) {
|
4773 | const formatted = {
|
4774 | value: null,
|
4775 | attributes: null
|
4776 | };
|
4777 | if (message.value) {
|
4778 | formatted.value = bundle.formatPattern(message.value, args, errors);
|
4779 | }
|
4780 | let attrNames = Object.keys(message.attributes);
|
4781 | if (attrNames.length > 0) {
|
4782 | formatted.attributes = new Array(attrNames.length);
|
4783 | for (let [i, name] of attrNames.entries()) {
|
4784 | let value = bundle.formatPattern(message.attributes[name], args, errors);
|
4785 | formatted.attributes[i] = {
|
4786 | name,
|
4787 | value
|
4788 | };
|
4789 | }
|
4790 | }
|
4791 | return formatted;
|
4792 | }
|
4793 | function keysFromBundle(method, bundle, keys, translations) {
|
4794 | const messageErrors = [];
|
4795 | const missingIds = new Set();
|
4796 | keys.forEach((_ref, i) => {
|
4797 | let {
|
4798 | id,
|
4799 | args
|
4800 | } = _ref;
|
4801 | if (translations[i] !== undefined) {
|
4802 | return;
|
4803 | }
|
4804 | let message = bundle.getMessage(id);
|
4805 | if (message) {
|
4806 | messageErrors.length = 0;
|
4807 | translations[i] = method(bundle, messageErrors, message, args);
|
4808 | if (messageErrors.length > 0 && typeof console !== "undefined") {
|
4809 | const locale = bundle.locales[0];
|
4810 | const errors = messageErrors.join(", ");
|
4811 | console.warn(`[fluent][resolver] errors in ${locale}/${id}: ${errors}.`);
|
4812 | }
|
4813 | } else {
|
4814 | missingIds.add(id);
|
4815 | }
|
4816 | });
|
4817 | return missingIds;
|
4818 | }
|
4819 | ;// CONCATENATED MODULE: ./node_modules/@fluent/dom/esm/dom_localization.js
|
4820 |
|
4821 |
|
4822 |
|
4823 |
|
4824 |
|
4825 |
|
4826 |
|
4827 |
|
4828 |
|
4829 |
|
4830 |
|
4831 |
|
4832 | const L10NID_ATTR_NAME = "data-l10n-id";
|
4833 | const L10NARGS_ATTR_NAME = "data-l10n-args";
|
4834 | const L10N_ELEMENT_QUERY = `[${L10NID_ATTR_NAME}]`;
|
4835 | class DOMLocalization extends Localization {
|
4836 | constructor(resourceIds, generateBundles) {
|
4837 | super(resourceIds, generateBundles);
|
4838 | this.roots = new Set();
|
4839 | this.pendingrAF = null;
|
4840 | this.pendingElements = new Set();
|
4841 | this.windowElement = null;
|
4842 | this.mutationObserver = null;
|
4843 | this.observerConfig = {
|
4844 | attributes: true,
|
4845 | characterData: false,
|
4846 | childList: true,
|
4847 | subtree: true,
|
4848 | attributeFilter: [L10NID_ATTR_NAME, L10NARGS_ATTR_NAME]
|
4849 | };
|
4850 | }
|
4851 | onChange() {
|
4852 | let eager = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
4853 | super.onChange(eager);
|
4854 | if (this.roots) {
|
4855 | this.translateRoots();
|
4856 | }
|
4857 | }
|
4858 | setAttributes(element, id, args) {
|
4859 | element.setAttribute(L10NID_ATTR_NAME, id);
|
4860 | if (args) {
|
4861 | element.setAttribute(L10NARGS_ATTR_NAME, JSON.stringify(args));
|
4862 | } else {
|
4863 | element.removeAttribute(L10NARGS_ATTR_NAME);
|
4864 | }
|
4865 | return element;
|
4866 | }
|
4867 | getAttributes(element) {
|
4868 | return {
|
4869 | id: element.getAttribute(L10NID_ATTR_NAME),
|
4870 | args: JSON.parse(element.getAttribute(L10NARGS_ATTR_NAME) || null)
|
4871 | };
|
4872 | }
|
4873 | connectRoot(newRoot) {
|
4874 | for (const root of this.roots) {
|
4875 | if (root === newRoot || root.contains(newRoot) || newRoot.contains(root)) {
|
4876 | throw new Error("Cannot add a root that overlaps with existing root.");
|
4877 | }
|
4878 | }
|
4879 | if (this.windowElement) {
|
4880 | if (this.windowElement !== newRoot.ownerDocument.defaultView) {
|
4881 | throw new Error(`Cannot connect a root:
|
4882 | DOMLocalization already has a root from a different window.`);
|
4883 | }
|
4884 | } else {
|
4885 | this.windowElement = newRoot.ownerDocument.defaultView;
|
4886 | this.mutationObserver = new this.windowElement.MutationObserver(mutations => this.translateMutations(mutations));
|
4887 | }
|
4888 | this.roots.add(newRoot);
|
4889 | this.mutationObserver.observe(newRoot, this.observerConfig);
|
4890 | }
|
4891 | disconnectRoot(root) {
|
4892 | this.roots.delete(root);
|
4893 | this.pauseObserving();
|
4894 | if (this.roots.size === 0) {
|
4895 | this.mutationObserver = null;
|
4896 | this.windowElement = null;
|
4897 | this.pendingrAF = null;
|
4898 | this.pendingElements.clear();
|
4899 | return true;
|
4900 | }
|
4901 | this.resumeObserving();
|
4902 | return false;
|
4903 | }
|
4904 | translateRoots() {
|
4905 | const roots = Array.from(this.roots);
|
4906 | return Promise.all(roots.map(root => this.translateFragment(root)));
|
4907 | }
|
4908 | pauseObserving() {
|
4909 | if (!this.mutationObserver) {
|
4910 | return;
|
4911 | }
|
4912 | this.translateMutations(this.mutationObserver.takeRecords());
|
4913 | this.mutationObserver.disconnect();
|
4914 | }
|
4915 | resumeObserving() {
|
4916 | if (!this.mutationObserver) {
|
4917 | return;
|
4918 | }
|
4919 | for (const root of this.roots) {
|
4920 | this.mutationObserver.observe(root, this.observerConfig);
|
4921 | }
|
4922 | }
|
4923 | translateMutations(mutations) {
|
4924 | for (const mutation of mutations) {
|
4925 | switch (mutation.type) {
|
4926 | case "attributes":
|
4927 | if (mutation.target.hasAttribute("data-l10n-id")) {
|
4928 | this.pendingElements.add(mutation.target);
|
4929 | }
|
4930 | break;
|
4931 | case "childList":
|
4932 | for (const addedNode of mutation.addedNodes) {
|
4933 | if (addedNode.nodeType === addedNode.ELEMENT_NODE) {
|
4934 | if (addedNode.childElementCount) {
|
4935 | for (const element of this.getTranslatables(addedNode)) {
|
4936 | this.pendingElements.add(element);
|
4937 | }
|
4938 | } else if (addedNode.hasAttribute(L10NID_ATTR_NAME)) {
|
4939 | this.pendingElements.add(addedNode);
|
4940 | }
|
4941 | }
|
4942 | }
|
4943 | break;
|
4944 | }
|
4945 | }
|
4946 | if (this.pendingElements.size > 0) {
|
4947 | if (this.pendingrAF === null) {
|
4948 | this.pendingrAF = this.windowElement.requestAnimationFrame(() => {
|
4949 | this.translateElements(Array.from(this.pendingElements));
|
4950 | this.pendingElements.clear();
|
4951 | this.pendingrAF = null;
|
4952 | });
|
4953 | }
|
4954 | }
|
4955 | }
|
4956 | translateFragment(frag) {
|
4957 | return this.translateElements(this.getTranslatables(frag));
|
4958 | }
|
4959 | async translateElements(elements) {
|
4960 | if (!elements.length) {
|
4961 | return undefined;
|
4962 | }
|
4963 | const keys = elements.map(this.getKeysForElement);
|
4964 | const translations = await this.formatMessages(keys);
|
4965 | return this.applyTranslations(elements, translations);
|
4966 | }
|
4967 | applyTranslations(elements, translations) {
|
4968 | this.pauseObserving();
|
4969 | for (let i = 0; i < elements.length; i++) {
|
4970 | if (translations[i] !== undefined) {
|
4971 | translateElement(elements[i], translations[i]);
|
4972 | }
|
4973 | }
|
4974 | this.resumeObserving();
|
4975 | }
|
4976 | getTranslatables(element) {
|
4977 | const nodes = Array.from(element.querySelectorAll(L10N_ELEMENT_QUERY));
|
4978 | if (typeof element.hasAttribute === "function" && element.hasAttribute(L10NID_ATTR_NAME)) {
|
4979 | nodes.push(element);
|
4980 | }
|
4981 | return nodes;
|
4982 | }
|
4983 | getKeysForElement(element) {
|
4984 | return {
|
4985 | id: element.getAttribute(L10NID_ATTR_NAME),
|
4986 | args: JSON.parse(element.getAttribute(L10NARGS_ATTR_NAME) || null)
|
4987 | };
|
4988 | }
|
4989 | }
|
4990 | ;// CONCATENATED MODULE: ./node_modules/@fluent/dom/esm/index.js
|
4991 |
|
4992 |
|
4993 |
|
4994 | /***/ }),
|
4995 |
|
4996 | /***/ 2664:
|
4997 | /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
|
4998 |
|
4999 | __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
5000 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
5001 | /* harmony export */ AnnotationEditorLayerBuilder: () => (/* binding */ AnnotationEditorLayerBuilder)
|
5002 | /* harmony export */ });
|
5003 | /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
|
5004 | /* harmony import */ var web_null_l10n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(410);
|
5005 | var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, web_null_l10n__WEBPACK_IMPORTED_MODULE_1__]);
|
5006 | ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__, web_null_l10n__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
5007 |
|
5008 |
|
5009 | class AnnotationEditorLayerBuilder {
|
5010 | #annotationLayer = null;
|
5011 | #drawLayer = null;
|
5012 | #onAppend = null;
|
5013 | #textLayer = null;
|
5014 | #uiManager;
|
5015 | constructor(options) {
|
5016 | this.pdfPage = options.pdfPage;
|
5017 | this.accessibilityManager = options.accessibilityManager;
|
5018 | this.l10n = options.l10n;
|
5019 | this.l10n ||= new web_null_l10n__WEBPACK_IMPORTED_MODULE_1__.GenericL10n();
|
5020 | this.annotationEditorLayer = null;
|
5021 | this.div = null;
|
5022 | this._cancelled = false;
|
5023 | this.#uiManager = options.uiManager;
|
5024 | this.#annotationLayer = options.annotationLayer || null;
|
5025 | this.#textLayer = options.textLayer || null;
|
5026 | this.#drawLayer = options.drawLayer || null;
|
5027 | this.#onAppend = options.onAppend || null;
|
5028 | }
|
5029 | async render(viewport) {
|
5030 | let intent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "display";
|
5031 | if (intent !== "display") {
|
5032 | return;
|
5033 | }
|
5034 | if (this._cancelled) {
|
5035 | return;
|
5036 | }
|
5037 | const clonedViewport = viewport.clone({
|
5038 | dontFlip: true
|
5039 | });
|
5040 | if (this.div) {
|
5041 | this.annotationEditorLayer.update({
|
5042 | viewport: clonedViewport
|
5043 | });
|
5044 | this.show();
|
5045 | return;
|
5046 | }
|
5047 | const div = this.div = document.createElement("div");
|
5048 | div.className = "annotationEditorLayer";
|
5049 | div.hidden = true;
|
5050 | div.dir = this.#uiManager.direction;
|
5051 | this.#onAppend?.(div);
|
5052 | this.annotationEditorLayer = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorLayer({
|
5053 | uiManager: this.#uiManager,
|
5054 | div,
|
5055 | accessibilityManager: this.accessibilityManager,
|
5056 | pageIndex: this.pdfPage.pageNumber - 1,
|
5057 | l10n: this.l10n,
|
5058 | viewport: clonedViewport,
|
5059 | annotationLayer: this.#annotationLayer,
|
5060 | textLayer: this.#textLayer,
|
5061 | drawLayer: this.#drawLayer
|
5062 | });
|
5063 | const parameters = {
|
5064 | viewport: clonedViewport,
|
5065 | div,
|
5066 | annotations: null,
|
5067 | intent
|
5068 | };
|
5069 | this.annotationEditorLayer.render(parameters);
|
5070 | this.show();
|
5071 | }
|
5072 | cancel() {
|
5073 | this._cancelled = true;
|
5074 | if (!this.div) {
|
5075 | return;
|
5076 | }
|
5077 | this.annotationEditorLayer.destroy();
|
5078 | }
|
5079 | hide() {
|
5080 | if (!this.div) {
|
5081 | return;
|
5082 | }
|
5083 | this.div.hidden = true;
|
5084 | }
|
5085 | show() {
|
5086 | if (!this.div || this.annotationEditorLayer.isInvisible) {
|
5087 | return;
|
5088 | }
|
5089 | this.div.hidden = false;
|
5090 | }
|
5091 | }
|
5092 |
|
5093 | __webpack_async_result__();
|
5094 | } catch(e) { __webpack_async_result__(e); } });
|
5095 |
|
5096 | /***/ }),
|
5097 |
|
5098 | /***/ 2707:
|
5099 | /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
|
5100 |
|
5101 | __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
5102 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
5103 | /* harmony export */ AnnotationLayerBuilder: () => (/* binding */ AnnotationLayerBuilder)
|
5104 | /* harmony export */ });
|
5105 | /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
|
5106 | /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7256);
|
5107 | var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
|
5108 | pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
5109 |
|
5110 |
|
5111 | class AnnotationLayerBuilder {
|
5112 | #onAppend = null;
|
5113 | #onPresentationModeChanged = null;
|
5114 | constructor(_ref) {
|
5115 | let {
|
5116 | pdfPage,
|
5117 | linkService,
|
5118 | downloadManager,
|
5119 | annotationStorage = null,
|
5120 | imageResourcesPath = "",
|
5121 | renderForms = true,
|
5122 | enableScripting = false,
|
5123 | hasJSActionsPromise = null,
|
5124 | fieldObjectsPromise = null,
|
5125 | annotationCanvasMap = null,
|
5126 | accessibilityManager = null,
|
5127 | onAppend = null
|
5128 | } = _ref;
|
5129 | this.pdfPage = pdfPage;
|
5130 | this.linkService = linkService;
|
5131 | this.downloadManager = downloadManager;
|
5132 | this.imageResourcesPath = imageResourcesPath;
|
5133 | this.renderForms = renderForms;
|
5134 | this.annotationStorage = annotationStorage;
|
5135 | this.enableScripting = enableScripting;
|
5136 | this._hasJSActionsPromise = hasJSActionsPromise || Promise.resolve(false);
|
5137 | this._fieldObjectsPromise = fieldObjectsPromise || Promise.resolve(null);
|
5138 | this._annotationCanvasMap = annotationCanvasMap;
|
5139 | this._accessibilityManager = accessibilityManager;
|
5140 | this.#onAppend = onAppend;
|
5141 | this.annotationLayer = null;
|
5142 | this.div = null;
|
5143 | this._cancelled = false;
|
5144 | this._eventBus = linkService.eventBus;
|
5145 | }
|
5146 | async render(viewport) {
|
5147 | let intent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "display";
|
5148 | if (this.div) {
|
5149 | if (this._cancelled || !this.annotationLayer) {
|
5150 | return;
|
5151 | }
|
5152 | this.annotationLayer.update({
|
5153 | viewport: viewport.clone({
|
5154 | dontFlip: true
|
5155 | })
|
5156 | });
|
5157 | return;
|
5158 | }
|
5159 | const [annotations, hasJSActions, fieldObjects] = await Promise.all([this.pdfPage.getAnnotations({
|
5160 | intent
|
5161 | }), this._hasJSActionsPromise, this._fieldObjectsPromise]);
|
5162 | if (this._cancelled) {
|
5163 | return;
|
5164 | }
|
5165 | const div = this.div = document.createElement("div");
|
5166 | div.className = "annotationLayer";
|
5167 | this.#onAppend?.(div);
|
5168 | if (annotations.length === 0) {
|
5169 | this.hide();
|
5170 | return;
|
5171 | }
|
5172 | this.annotationLayer = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.AnnotationLayer({
|
5173 | div,
|
5174 | accessibilityManager: this._accessibilityManager,
|
5175 | annotationCanvasMap: this._annotationCanvasMap,
|
5176 | page: this.pdfPage,
|
5177 | viewport: viewport.clone({
|
5178 | dontFlip: true
|
5179 | })
|
5180 | });
|
5181 | await this.annotationLayer.render({
|
5182 | annotations,
|
5183 | imageResourcesPath: this.imageResourcesPath,
|
5184 | renderForms: this.renderForms,
|
5185 | linkService: this.linkService,
|
5186 | downloadManager: this.downloadManager,
|
5187 | annotationStorage: this.annotationStorage,
|
5188 | enableScripting: this.enableScripting,
|
5189 | hasJSActions,
|
5190 | fieldObjects
|
5191 | });
|
5192 | if (this.linkService.isInPresentationMode) {
|
5193 | this.#updatePresentationModeState(_ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.PresentationModeState.FULLSCREEN);
|
5194 | }
|
5195 | if (!this.#onPresentationModeChanged) {
|
5196 | this.#onPresentationModeChanged = evt => {
|
5197 | this.#updatePresentationModeState(evt.state);
|
5198 | };
|
5199 | this._eventBus?._on("presentationmodechanged", this.#onPresentationModeChanged);
|
5200 | }
|
5201 | }
|
5202 | cancel() {
|
5203 | this._cancelled = true;
|
5204 | if (this.#onPresentationModeChanged) {
|
5205 | this._eventBus?._off("presentationmodechanged", this.#onPresentationModeChanged);
|
5206 | this.#onPresentationModeChanged = null;
|
5207 | }
|
5208 | }
|
5209 | hide() {
|
5210 | if (!this.div) {
|
5211 | return;
|
5212 | }
|
5213 | this.div.hidden = true;
|
5214 | }
|
5215 | #updatePresentationModeState(state) {
|
5216 | if (!this.div) {
|
5217 | return;
|
5218 | }
|
5219 | let disableFormElements = false;
|
5220 | switch (state) {
|
5221 | case _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.PresentationModeState.FULLSCREEN:
|
5222 | disableFormElements = true;
|
5223 | break;
|
5224 | case _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.PresentationModeState.NORMAL:
|
5225 | break;
|
5226 | default:
|
5227 | return;
|
5228 | }
|
5229 | for (const section of this.div.childNodes) {
|
5230 | if (section.hasAttribute("data-internal-link")) {
|
5231 | continue;
|
5232 | }
|
5233 | section.inert = disableFormElements;
|
5234 | }
|
5235 | }
|
5236 | }
|
5237 |
|
5238 | __webpack_async_result__();
|
5239 | } catch(e) { __webpack_async_result__(e); } });
|
5240 |
|
5241 | /***/ }),
|
5242 |
|
5243 | /***/ 9840:
|
5244 | /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
5245 |
|
5246 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
5247 | /* harmony export */ AppOptions: () => (/* binding */ AppOptions)
|
5248 | /* harmony export */ });
|
5249 | /* unused harmony export OptionKind */
|
5250 | {
|
5251 | var compatibilityParams = Object.create(null);
|
5252 | const userAgent = navigator.userAgent || "";
|
5253 | const platform = navigator.platform || "";
|
5254 | const maxTouchPoints = navigator.maxTouchPoints || 1;
|
5255 | const isAndroid = /Android/.test(userAgent);
|
5256 | const isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) || platform === "MacIntel" && maxTouchPoints > 1;
|
5257 | (function checkCanvasSizeLimitation() {
|
5258 | if (isIOS || isAndroid) {
|
5259 | compatibilityParams.maxCanvasPixels = 5242880;
|
5260 | }
|
5261 | })();
|
5262 | }
|
5263 | const OptionKind = {
|
5264 | BROWSER: 0x01,
|
5265 | VIEWER: 0x02,
|
5266 | API: 0x04,
|
5267 | WORKER: 0x08,
|
5268 | PREFERENCE: 0x80
|
5269 | };
|
5270 | const defaultOptions = {
|
5271 | canvasMaxAreaInBytes: {
|
5272 | value: -1,
|
5273 | kind: OptionKind.BROWSER + OptionKind.API
|
5274 | },
|
5275 | isInAutomation: {
|
5276 | value: false,
|
5277 | kind: OptionKind.BROWSER
|
5278 | },
|
5279 | supportsCaretBrowsingMode: {
|
5280 | value: false,
|
5281 | kind: OptionKind.BROWSER
|
5282 | },
|
5283 | supportsDocumentFonts: {
|
5284 | value: true,
|
5285 | kind: OptionKind.BROWSER
|
5286 | },
|
5287 | supportsIntegratedFind: {
|
5288 | value: false,
|
5289 | kind: OptionKind.BROWSER
|
5290 | },
|
5291 | supportsMouseWheelZoomCtrlKey: {
|
5292 | value: true,
|
5293 | kind: OptionKind.BROWSER
|
5294 | },
|
5295 | supportsMouseWheelZoomMetaKey: {
|
5296 | value: true,
|
5297 | kind: OptionKind.BROWSER
|
5298 | },
|
5299 | supportsPinchToZoom: {
|
5300 | value: true,
|
5301 | kind: OptionKind.BROWSER
|
5302 | },
|
5303 | annotationEditorMode: {
|
5304 | value: 0,
|
5305 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5306 | },
|
5307 | annotationMode: {
|
5308 | value: 2,
|
5309 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5310 | },
|
5311 | cursorToolOnLoad: {
|
5312 | value: 0,
|
5313 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5314 | },
|
5315 | debuggerSrc: {
|
5316 | value: "./debugger.mjs",
|
5317 | kind: OptionKind.VIEWER
|
5318 | },
|
5319 | defaultZoomDelay: {
|
5320 | value: 400,
|
5321 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5322 | },
|
5323 | defaultZoomValue: {
|
5324 | value: "",
|
5325 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5326 | },
|
5327 | disableHistory: {
|
5328 | value: false,
|
5329 | kind: OptionKind.VIEWER
|
5330 | },
|
5331 | disablePageLabels: {
|
5332 | value: false,
|
5333 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5334 | },
|
5335 | enableHighlightEditor: {
|
5336 | value: false,
|
5337 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5338 | },
|
5339 | enableHighlightFloatingButton: {
|
5340 | value: false,
|
5341 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5342 | },
|
5343 | enableML: {
|
5344 | value: false,
|
5345 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5346 | },
|
5347 | enablePermissions: {
|
5348 | value: false,
|
5349 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5350 | },
|
5351 | enablePrintAutoRotate: {
|
5352 | value: true,
|
5353 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5354 | },
|
5355 | enableScripting: {
|
5356 | value: true,
|
5357 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5358 | },
|
5359 | enableStampEditor: {
|
5360 | value: true,
|
5361 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5362 | },
|
5363 | externalLinkRel: {
|
5364 | value: "noopener noreferrer nofollow",
|
5365 | kind: OptionKind.VIEWER
|
5366 | },
|
5367 | externalLinkTarget: {
|
5368 | value: 0,
|
5369 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5370 | },
|
5371 | highlightEditorColors: {
|
5372 | value: "yellow=#FFFF98,green=#53FFBC,blue=#80EBFF,pink=#FFCBE6,red=#FF4F5F",
|
5373 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5374 | },
|
5375 | historyUpdateUrl: {
|
5376 | value: false,
|
5377 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5378 | },
|
5379 | ignoreDestinationZoom: {
|
5380 | value: false,
|
5381 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5382 | },
|
5383 | imageResourcesPath: {
|
5384 | value: "./images/",
|
5385 | kind: OptionKind.VIEWER
|
5386 | },
|
5387 | maxCanvasPixels: {
|
5388 | value: 2 ** 25,
|
5389 | kind: OptionKind.VIEWER
|
5390 | },
|
5391 | forcePageColors: {
|
5392 | value: false,
|
5393 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5394 | },
|
5395 | pageColorsBackground: {
|
5396 | value: "Canvas",
|
5397 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5398 | },
|
5399 | pageColorsForeground: {
|
5400 | value: "CanvasText",
|
5401 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5402 | },
|
5403 | pdfBugEnabled: {
|
5404 | value: false,
|
5405 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5406 | },
|
5407 | printResolution: {
|
5408 | value: 150,
|
5409 | kind: OptionKind.VIEWER
|
5410 | },
|
5411 | sidebarViewOnLoad: {
|
5412 | value: -1,
|
5413 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5414 | },
|
5415 | scrollModeOnLoad: {
|
5416 | value: -1,
|
5417 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5418 | },
|
5419 | spreadModeOnLoad: {
|
5420 | value: -1,
|
5421 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5422 | },
|
5423 | textLayerMode: {
|
5424 | value: 1,
|
5425 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5426 | },
|
5427 | viewOnLoad: {
|
5428 | value: 0,
|
5429 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5430 | },
|
5431 | cMapPacked: {
|
5432 | value: true,
|
5433 | kind: OptionKind.API
|
5434 | },
|
5435 | cMapUrl: {
|
5436 | value: "../web/cmaps/",
|
5437 | kind: OptionKind.API
|
5438 | },
|
5439 | disableAutoFetch: {
|
5440 | value: false,
|
5441 | kind: OptionKind.API + OptionKind.PREFERENCE
|
5442 | },
|
5443 | disableFontFace: {
|
5444 | value: false,
|
5445 | kind: OptionKind.API + OptionKind.PREFERENCE
|
5446 | },
|
5447 | disableRange: {
|
5448 | value: false,
|
5449 | kind: OptionKind.API + OptionKind.PREFERENCE
|
5450 | },
|
5451 | disableStream: {
|
5452 | value: false,
|
5453 | kind: OptionKind.API + OptionKind.PREFERENCE
|
5454 | },
|
5455 | docBaseUrl: {
|
5456 | value: "",
|
5457 | kind: OptionKind.API
|
5458 | },
|
5459 | enableXfa: {
|
5460 | value: true,
|
5461 | kind: OptionKind.API + OptionKind.PREFERENCE
|
5462 | },
|
5463 | fontExtraProperties: {
|
5464 | value: false,
|
5465 | kind: OptionKind.API
|
5466 | },
|
5467 | isEvalSupported: {
|
5468 | value: true,
|
5469 | kind: OptionKind.API
|
5470 | },
|
5471 | isOffscreenCanvasSupported: {
|
5472 | value: true,
|
5473 | kind: OptionKind.API
|
5474 | },
|
5475 | maxImageSize: {
|
5476 | value: -1,
|
5477 | kind: OptionKind.API
|
5478 | },
|
5479 | pdfBug: {
|
5480 | value: false,
|
5481 | kind: OptionKind.API
|
5482 | },
|
5483 | standardFontDataUrl: {
|
5484 | value: "../web/standard_fonts/",
|
5485 | kind: OptionKind.API
|
5486 | },
|
5487 | verbosity: {
|
5488 | value: 1,
|
5489 | kind: OptionKind.API
|
5490 | },
|
5491 | workerPort: {
|
5492 | value: null,
|
5493 | kind: OptionKind.WORKER
|
5494 | },
|
5495 | workerSrc: {
|
5496 | value: "../build/pdf.worker.mjs",
|
5497 | kind: OptionKind.WORKER
|
5498 | }
|
5499 | };
|
5500 | {
|
5501 | defaultOptions.defaultUrl = {
|
5502 | value: "compressed.tracemonkey-pldi-09.pdf",
|
5503 | kind: OptionKind.VIEWER
|
5504 | };
|
5505 | defaultOptions.sandboxBundleSrc = {
|
5506 | value: "../build/pdf.sandbox.mjs",
|
5507 | kind: OptionKind.VIEWER
|
5508 | };
|
5509 | defaultOptions.viewerCssTheme = {
|
5510 | value: 0,
|
5511 | kind: OptionKind.VIEWER + OptionKind.PREFERENCE
|
5512 | };
|
5513 | }
|
5514 | {
|
5515 | defaultOptions.disablePreferences = {
|
5516 | value: false,
|
5517 | kind: OptionKind.VIEWER
|
5518 | };
|
5519 | defaultOptions.locale = {
|
5520 | value: navigator.language || "en-US",
|
5521 | kind: OptionKind.VIEWER
|
5522 | };
|
5523 | }
|
5524 | const userOptions = Object.create(null);
|
5525 | {
|
5526 | for (const name in compatibilityParams) {
|
5527 | userOptions[name] = compatibilityParams[name];
|
5528 | }
|
5529 | }
|
5530 | class AppOptions {
|
5531 | constructor() {
|
5532 | throw new Error("Cannot initialize AppOptions.");
|
5533 | }
|
5534 | static get(name) {
|
5535 | return userOptions[name] ?? defaultOptions[name]?.value ?? undefined;
|
5536 | }
|
5537 | static getAll() {
|
5538 | let kind = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
5539 | let defaultOnly = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
5540 | const options = Object.create(null);
|
5541 | for (const name in defaultOptions) {
|
5542 | const defaultOption = defaultOptions[name];
|
5543 | if (kind && !(kind & defaultOption.kind)) {
|
5544 | continue;
|
5545 | }
|
5546 | options[name] = defaultOnly ? defaultOption.value : userOptions[name] ?? defaultOption.value;
|
5547 | }
|
5548 | return options;
|
5549 | }
|
5550 | static set(name, value) {
|
5551 | userOptions[name] = value;
|
5552 | }
|
5553 | static setAll(options) {
|
5554 | let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
5555 | if (init) {
|
5556 | if (this.get("disablePreferences")) {
|
5557 | return;
|
5558 | }
|
5559 | for (const name in userOptions) {
|
5560 | if (compatibilityParams[name] !== undefined) {
|
5561 | continue;
|
5562 | }
|
5563 | console.warn("setAll: The Preferences may override manually set AppOptions; " + 'please use the "disablePreferences"-option in order to prevent that.');
|
5564 | break;
|
5565 | }
|
5566 | }
|
5567 | for (const name in options) {
|
5568 | userOptions[name] = options[name];
|
5569 | }
|
5570 | }
|
5571 | static remove(name) {
|
5572 | delete userOptions[name];
|
5573 | const val = compatibilityParams[name];
|
5574 | if (val !== undefined) {
|
5575 | userOptions[name] = val;
|
5576 | }
|
5577 | }
|
5578 | }
|
5579 |
|
5580 |
|
5581 | /***/ }),
|
5582 |
|
5583 | /***/ 1544:
|
5584 | /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
|
5585 |
|
5586 | __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
5587 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
5588 | /* harmony export */ DownloadManager: () => (/* binding */ DownloadManager)
|
5589 | /* harmony export */ });
|
5590 | /* harmony import */ var core_js_modules_web_url_search_params_delete_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4603);
|
5591 | /* harmony import */ var core_js_modules_web_url_search_params_has_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7566);
|
5592 | /* harmony import */ var core_js_modules_web_url_search_params_size_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8721);
|
5593 | /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2603);
|
5594 | var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_3__]);
|
5595 | pdfjs_lib__WEBPACK_IMPORTED_MODULE_3__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
5596 |
|
5597 |
|
5598 |
|
5599 |
|
5600 | function download(blobUrl, filename) {
|
5601 | const a = document.createElement("a");
|
5602 | if (!a.click) {
|
5603 | throw new Error('DownloadManager: "a.click()" is not supported.');
|
5604 | }
|
5605 | a.href = blobUrl;
|
5606 | a.target = "_parent";
|
5607 | if ("download" in a) {
|
5608 | a.download = filename;
|
5609 | }
|
5610 | (document.body || document.documentElement).append(a);
|
5611 | a.click();
|
5612 | a.remove();
|
5613 | }
|
5614 | class DownloadManager {
|
5615 | #openBlobUrls = new WeakMap();
|
5616 | downloadUrl(url, filename, _options) {
|
5617 | if (!(0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_3__.createValidAbsoluteUrl)(url, "http://example.com")) {
|
5618 | console.error(`downloadUrl - not a valid URL: ${url}`);
|
5619 | return;
|
5620 | }
|
5621 | download(url + "#pdfjs.action=download", filename);
|
5622 | }
|
5623 | downloadData(data, filename, contentType) {
|
5624 | const blobUrl = URL.createObjectURL(new Blob([data], {
|
5625 | type: contentType
|
5626 | }));
|
5627 | download(blobUrl, filename);
|
5628 | }
|
5629 | openOrDownloadData(data, filename) {
|
5630 | let dest = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
5631 | const isPdfData = (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_3__.isPdfFile)(filename);
|
5632 | const contentType = isPdfData ? "application/pdf" : "";
|
5633 | this.downloadData(data, filename, contentType);
|
5634 | return false;
|
5635 | }
|
5636 | download(blob, url, filename, _options) {
|
5637 | const blobUrl = URL.createObjectURL(blob);
|
5638 | download(blobUrl, filename);
|
5639 | }
|
5640 | }
|
5641 |
|
5642 | __webpack_async_result__();
|
5643 | } catch(e) { __webpack_async_result__(e); } });
|
5644 |
|
5645 | /***/ }),
|
5646 |
|
5647 | /***/ 3088:
|
5648 | /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
|
5649 |
|
5650 | __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
5651 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
5652 | /* harmony export */ DrawLayerBuilder: () => (/* binding */ DrawLayerBuilder)
|
5653 | /* harmony export */ });
|
5654 | /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
|
5655 | var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
|
5656 | pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
5657 |
|
5658 | class DrawLayerBuilder {
|
5659 | #drawLayer = null;
|
5660 | constructor(options) {
|
5661 | this.pageIndex = options.pageIndex;
|
5662 | }
|
5663 | async render() {
|
5664 | let intent = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "display";
|
5665 | if (intent !== "display" || this.#drawLayer || this._cancelled) {
|
5666 | return;
|
5667 | }
|
5668 | this.#drawLayer = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.DrawLayer({
|
5669 | pageIndex: this.pageIndex
|
5670 | });
|
5671 | }
|
5672 | cancel() {
|
5673 | this._cancelled = true;
|
5674 | if (!this.#drawLayer) {
|
5675 | return;
|
5676 | }
|
5677 | this.#drawLayer.destroy();
|
5678 | this.#drawLayer = null;
|
5679 | }
|
5680 | setParent(parent) {
|
5681 | this.#drawLayer?.setParent(parent);
|
5682 | }
|
5683 | getDrawLayer() {
|
5684 | return this.#drawLayer;
|
5685 | }
|
5686 | }
|
5687 |
|
5688 | __webpack_async_result__();
|
5689 | } catch(e) { __webpack_async_result__(e); } });
|
5690 |
|
5691 | /***/ }),
|
5692 |
|
5693 | /***/ 5656:
|
5694 | /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
5695 |
|
5696 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
5697 | /* harmony export */ EventBus: () => (/* binding */ EventBus),
|
5698 | /* harmony export */ waitOnEventOrTimeout: () => (/* binding */ waitOnEventOrTimeout)
|
5699 | /* harmony export */ });
|
5700 | /* unused harmony exports AutomationEventBus, WaitOnType */
|
5701 | /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4114);
|
5702 | /* harmony import */ var core_js_modules_es_promise_with_resolvers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4628);
|
5703 |
|
5704 |
|
5705 | const WaitOnType = {
|
5706 | EVENT: "event",
|
5707 | TIMEOUT: "timeout"
|
5708 | };
|
5709 | async function waitOnEventOrTimeout(_ref) {
|
5710 | let {
|
5711 | target,
|
5712 | name,
|
5713 | delay = 0
|
5714 | } = _ref;
|
5715 | if (typeof target !== "object" || !(name && typeof name === "string") || !(Number.isInteger(delay) && delay >= 0)) {
|
5716 | throw new Error("waitOnEventOrTimeout - invalid parameters.");
|
5717 | }
|
5718 | const {
|
5719 | promise,
|
5720 | resolve
|
5721 | } = Promise.withResolvers();
|
5722 | function handler(type) {
|
5723 | if (target instanceof EventBus) {
|
5724 | target._off(name, eventHandler);
|
5725 | } else {
|
5726 | target.removeEventListener(name, eventHandler);
|
5727 | }
|
5728 | if (timeout) {
|
5729 | clearTimeout(timeout);
|
5730 | }
|
5731 | resolve(type);
|
5732 | }
|
5733 | const eventHandler = handler.bind(null, WaitOnType.EVENT);
|
5734 | if (target instanceof EventBus) {
|
5735 | target._on(name, eventHandler);
|
5736 | } else {
|
5737 | target.addEventListener(name, eventHandler);
|
5738 | }
|
5739 | const timeoutHandler = handler.bind(null, WaitOnType.TIMEOUT);
|
5740 | const timeout = setTimeout(timeoutHandler, delay);
|
5741 | return promise;
|
5742 | }
|
5743 | class EventBus {
|
5744 | #listeners = Object.create(null);
|
5745 | on(eventName, listener) {
|
5746 | let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
5747 | this._on(eventName, listener, {
|
5748 | external: true,
|
5749 | once: options?.once
|
5750 | });
|
5751 | }
|
5752 | off(eventName, listener) {
|
5753 | let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
5754 | this._off(eventName, listener, {
|
5755 | external: true,
|
5756 | once: options?.once
|
5757 | });
|
5758 | }
|
5759 | dispatch(eventName, data) {
|
5760 | const eventListeners = this.#listeners[eventName];
|
5761 | if (!eventListeners || eventListeners.length === 0) {
|
5762 | return;
|
5763 | }
|
5764 | let externalListeners;
|
5765 | for (const {
|
5766 | listener,
|
5767 | external,
|
5768 | once
|
5769 | } of eventListeners.slice(0)) {
|
5770 | if (once) {
|
5771 | this._off(eventName, listener);
|
5772 | }
|
5773 | if (external) {
|
5774 | (externalListeners ||= []).push(listener);
|
5775 | continue;
|
5776 | }
|
5777 | listener(data);
|
5778 | }
|
5779 | if (externalListeners) {
|
5780 | for (const listener of externalListeners) {
|
5781 | listener(data);
|
5782 | }
|
5783 | externalListeners = null;
|
5784 | }
|
5785 | }
|
5786 | _on(eventName, listener) {
|
5787 | let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
5788 | const eventListeners = this.#listeners[eventName] ||= [];
|
5789 | eventListeners.push({
|
5790 | listener,
|
5791 | external: options?.external === true,
|
5792 | once: options?.once === true
|
5793 | });
|
5794 | }
|
5795 | _off(eventName, listener) {
|
5796 | let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
5797 | const eventListeners = this.#listeners[eventName];
|
5798 | if (!eventListeners) {
|
5799 | return;
|
5800 | }
|
5801 | for (let i = 0, ii = eventListeners.length; i < ii; i++) {
|
5802 | if (eventListeners[i].listener === listener) {
|
5803 | eventListeners.splice(i, 1);
|
5804 | return;
|
5805 | }
|
5806 | }
|
5807 | }
|
5808 | }
|
5809 | class AutomationEventBus extends (/* unused pure expression or super */ null && (EventBus)) {
|
5810 | dispatch(eventName, data) {
|
5811 | throw new Error("Not implemented: AutomationEventBus.dispatch");
|
5812 | }
|
5813 | }
|
5814 |
|
5815 |
|
5816 | /***/ }),
|
5817 |
|
5818 | /***/ 289:
|
5819 | /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
|
5820 |
|
5821 | __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
5822 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
5823 | /* harmony export */ GenericScripting: () => (/* binding */ GenericScripting),
|
5824 | /* harmony export */ docProperties: () => (/* binding */ docProperties)
|
5825 | /* harmony export */ });
|
5826 | /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
|
5827 | var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
|
5828 | pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
5829 |
|
5830 | async function docProperties(pdfDocument) {
|
5831 | const url = "",
|
5832 | baseUrl = url.split("#", 1)[0];
|
5833 | let {
|
5834 | info,
|
5835 | metadata,
|
5836 | contentDispositionFilename,
|
5837 | contentLength
|
5838 | } = await pdfDocument.getMetadata();
|
5839 | if (!contentLength) {
|
5840 | const {
|
5841 | length
|
5842 | } = await pdfDocument.getDownloadInfo();
|
5843 | contentLength = length;
|
5844 | }
|
5845 | return {
|
5846 | ...info,
|
5847 | baseURL: baseUrl,
|
5848 | filesize: contentLength,
|
5849 | filename: contentDispositionFilename || (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.getPdfFilenameFromUrl)(url),
|
5850 | metadata: metadata?.getRaw(),
|
5851 | authors: metadata?.get("dc:creator"),
|
5852 | numPages: pdfDocument.numPages,
|
5853 | URL: url
|
5854 | };
|
5855 | }
|
5856 | class GenericScripting {
|
5857 | constructor(sandboxBundleSrc) {
|
5858 | this._ready = new Promise((resolve, reject) => {
|
5859 | const sandbox = import( /*webpackIgnore: true*/sandboxBundleSrc);
|
5860 | sandbox.then(pdfjsSandbox => {
|
5861 | resolve(pdfjsSandbox.QuickJSSandbox());
|
5862 | }).catch(reject);
|
5863 | });
|
5864 | }
|
5865 | async createSandbox(data) {
|
5866 | const sandbox = await this._ready;
|
5867 | sandbox.create(data);
|
5868 | }
|
5869 | async dispatchEventInSandbox(event) {
|
5870 | const sandbox = await this._ready;
|
5871 | setTimeout(() => sandbox.dispatchEvent(event), 0);
|
5872 | }
|
5873 | async destroySandbox() {
|
5874 | const sandbox = await this._ready;
|
5875 | sandbox.nukeSandbox();
|
5876 | }
|
5877 | }
|
5878 |
|
5879 | __webpack_async_result__();
|
5880 | } catch(e) { __webpack_async_result__(e); } });
|
5881 |
|
5882 | /***/ }),
|
5883 |
|
5884 | /***/ 410:
|
5885 | /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
|
5886 |
|
5887 | __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
5888 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
5889 | /* harmony export */ GenericL10n: () => (/* binding */ GenericL10n)
|
5890 | /* harmony export */ });
|
5891 | /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4114);
|
5892 | /* harmony import */ var core_js_modules_web_url_search_params_delete_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4603);
|
5893 | /* harmony import */ var core_js_modules_web_url_search_params_has_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7566);
|
5894 | /* harmony import */ var core_js_modules_web_url_search_params_size_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8721);
|
5895 | /* harmony import */ var fluent_bundle__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(588);
|
5896 | /* harmony import */ var fluent_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5273);
|
5897 | /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(2603);
|
5898 | /* harmony import */ var _l10n_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(4693);
|
5899 | var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_6__]);
|
5900 | pdfjs_lib__WEBPACK_IMPORTED_MODULE_6__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
5901 |
|
5902 |
|
5903 |
|
5904 |
|
5905 |
|
5906 |
|
5907 |
|
5908 |
|
5909 | function createBundle(lang, text) {
|
5910 | const resource = new fluent_bundle__WEBPACK_IMPORTED_MODULE_4__.FluentResource(text);
|
5911 | const bundle = new fluent_bundle__WEBPACK_IMPORTED_MODULE_4__.FluentBundle(lang);
|
5912 | const errors = bundle.addResource(resource);
|
5913 | if (errors.length) {
|
5914 | console.error("L10n errors", errors);
|
5915 | }
|
5916 | return bundle;
|
5917 | }
|
5918 | class GenericL10n extends _l10n_js__WEBPACK_IMPORTED_MODULE_7__.L10n {
|
5919 | constructor(lang) {
|
5920 | super({
|
5921 | lang
|
5922 | });
|
5923 | const generateBundles = !lang ? GenericL10n.#generateBundlesFallback.bind(GenericL10n, this.getLanguage()) : GenericL10n.#generateBundles.bind(GenericL10n, "en-us", this.getLanguage());
|
5924 | this._setL10n(new fluent_dom__WEBPACK_IMPORTED_MODULE_5__.DOMLocalization([], generateBundles));
|
5925 | }
|
5926 | static async *#generateBundles(defaultLang, baseLang) {
|
5927 | const {
|
5928 | baseURL,
|
5929 | paths
|
5930 | } = await this.#getPaths();
|
5931 | const langs = [baseLang];
|
5932 | if (defaultLang !== baseLang) {
|
5933 | const shortLang = baseLang.split("-", 1)[0];
|
5934 | if (shortLang !== baseLang) {
|
5935 | langs.push(shortLang);
|
5936 | }
|
5937 | langs.push(defaultLang);
|
5938 | }
|
5939 | for (const lang of langs) {
|
5940 | const bundle = await this.#createBundle(lang, baseURL, paths);
|
5941 | if (bundle) {
|
5942 | yield bundle;
|
5943 | }
|
5944 | if (lang === "en-us") {
|
5945 | yield this.#createBundleFallback(lang);
|
5946 | }
|
5947 | }
|
5948 | }
|
5949 | static async #createBundle(lang, baseURL, paths) {
|
5950 | const path = paths[lang];
|
5951 | if (!path) {
|
5952 | return null;
|
5953 | }
|
5954 | const url = new URL(path, baseURL);
|
5955 | const text = await (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_6__.fetchData)(url, "text");
|
5956 | return createBundle(lang, text);
|
5957 | }
|
5958 | static async #getPaths() {
|
5959 | try {
|
5960 | const {
|
5961 | href
|
5962 | } = document.querySelector(`link[type="application/l10n"]`);
|
5963 | const paths = await (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_6__.fetchData)(href, "json");
|
5964 | return {
|
5965 | baseURL: href.replace(/[^/]*$/, "") || "./",
|
5966 | paths
|
5967 | };
|
5968 | } catch {}
|
5969 | return {
|
5970 | baseURL: "./",
|
5971 | paths: Object.create(null)
|
5972 | };
|
5973 | }
|
5974 | static async *#generateBundlesFallback(lang) {
|
5975 | yield this.#createBundleFallback(lang);
|
5976 | }
|
5977 | static async #createBundleFallback(lang) {
|
5978 | const text = "pdfjs-previous-button =\n .title = Previous Page\npdfjs-previous-button-label = Previous\npdfjs-next-button =\n .title = Next Page\npdfjs-next-button-label = Next\npdfjs-page-input =\n .title = Page\npdfjs-of-pages = of { $pagesCount }\npdfjs-page-of-pages = ({ $pageNumber } of { $pagesCount })\npdfjs-zoom-out-button =\n .title = Zoom Out\npdfjs-zoom-out-button-label = Zoom Out\npdfjs-zoom-in-button =\n .title = Zoom In\npdfjs-zoom-in-button-label = Zoom In\npdfjs-zoom-select =\n .title = Zoom\npdfjs-presentation-mode-button =\n .title = Switch to Presentation Mode\npdfjs-presentation-mode-button-label = Presentation Mode\npdfjs-open-file-button =\n .title = Open File\npdfjs-open-file-button-label = Open\npdfjs-print-button =\n .title = Print\npdfjs-print-button-label = Print\npdfjs-save-button =\n .title = Save\npdfjs-save-button-label = Save\npdfjs-download-button =\n .title = Download\npdfjs-download-button-label = Download\npdfjs-bookmark-button =\n .title = Current Page (View URL from Current Page)\npdfjs-bookmark-button-label = Current Page\npdfjs-tools-button =\n .title = Tools\npdfjs-tools-button-label = Tools\npdfjs-first-page-button =\n .title = Go to First Page\npdfjs-first-page-button-label = Go to First Page\npdfjs-last-page-button =\n .title = Go to Last Page\npdfjs-last-page-button-label = Go to Last Page\npdfjs-page-rotate-cw-button =\n .title = Rotate Clockwise\npdfjs-page-rotate-cw-button-label = Rotate Clockwise\npdfjs-page-rotate-ccw-button =\n .title = Rotate Counterclockwise\npdfjs-page-rotate-ccw-button-label = Rotate Counterclockwise\npdfjs-cursor-text-select-tool-button =\n .title = Enable Text Selection Tool\npdfjs-cursor-text-select-tool-button-label = Text Selection Tool\npdfjs-cursor-hand-tool-button =\n .title = Enable Hand Tool\npdfjs-cursor-hand-tool-button-label = Hand Tool\npdfjs-scroll-page-button =\n .title = Use Page Scrolling\npdfjs-scroll-page-button-label = Page Scrolling\npdfjs-scroll-vertical-button =\n .title = Use Vertical Scrolling\npdfjs-scroll-vertical-button-label = Vertical Scrolling\npdfjs-scroll-horizontal-button =\n .title = Use Horizontal Scrolling\npdfjs-scroll-horizontal-button-label = Horizontal Scrolling\npdfjs-scroll-wrapped-button =\n .title = Use Wrapped Scrolling\npdfjs-scroll-wrapped-button-label = Wrapped Scrolling\npdfjs-spread-none-button =\n .title = Do not join page spreads\npdfjs-spread-none-button-label = No Spreads\npdfjs-spread-odd-button =\n .title = Join page spreads starting with odd-numbered pages\npdfjs-spread-odd-button-label = Odd Spreads\npdfjs-spread-even-button =\n .title = Join page spreads starting with even-numbered pages\npdfjs-spread-even-button-label = Even Spreads\npdfjs-document-properties-button =\n .title = Document Properties\u2026\npdfjs-document-properties-button-label = Document Properties\u2026\npdfjs-document-properties-file-name = File name:\npdfjs-document-properties-file-size = File size:\npdfjs-document-properties-kb = { $size_kb } KB ({ $size_b } bytes)\npdfjs-document-properties-mb = { $size_mb } MB ({ $size_b } bytes)\npdfjs-document-properties-title = Title:\npdfjs-document-properties-author = Author:\npdfjs-document-properties-subject = Subject:\npdfjs-document-properties-keywords = Keywords:\npdfjs-document-properties-creation-date = Creation Date:\npdfjs-document-properties-modification-date = Modification Date:\npdfjs-document-properties-date-string = { $date }, { $time }\npdfjs-document-properties-creator = Creator:\npdfjs-document-properties-producer = PDF Producer:\npdfjs-document-properties-version = PDF Version:\npdfjs-document-properties-page-count = Page Count:\npdfjs-document-properties-page-size = Page Size:\npdfjs-document-properties-page-size-unit-inches = in\npdfjs-document-properties-page-size-unit-millimeters = mm\npdfjs-document-properties-page-size-orientation-portrait = portrait\npdfjs-document-properties-page-size-orientation-landscape = landscape\npdfjs-document-properties-page-size-name-a-three = A3\npdfjs-document-properties-page-size-name-a-four = A4\npdfjs-document-properties-page-size-name-letter = Letter\npdfjs-document-properties-page-size-name-legal = Legal\npdfjs-document-properties-page-size-dimension-string = { $width } \xD7 { $height } { $unit } ({ $orientation })\npdfjs-document-properties-page-size-dimension-name-string = { $width } \xD7 { $height } { $unit } ({ $name }, { $orientation })\npdfjs-document-properties-linearized = Fast Web View:\npdfjs-document-properties-linearized-yes = Yes\npdfjs-document-properties-linearized-no = No\npdfjs-document-properties-close-button = Close\npdfjs-print-progress-message = Preparing document for printing\u2026\npdfjs-print-progress-percent = { $progress }%\npdfjs-print-progress-close-button = Cancel\npdfjs-printing-not-supported = Warning: Printing is not fully supported by this browser.\npdfjs-printing-not-ready = Warning: The PDF is not fully loaded for printing.\npdfjs-toggle-sidebar-button =\n .title = Toggle Sidebar\npdfjs-toggle-sidebar-notification-button =\n .title = Toggle Sidebar (document contains outline/attachments/layers)\npdfjs-toggle-sidebar-button-label = Toggle Sidebar\npdfjs-document-outline-button =\n .title = Show Document Outline (double-click to expand/collapse all items)\npdfjs-document-outline-button-label = Document Outline\npdfjs-attachments-button =\n .title = Show Attachments\npdfjs-attachments-button-label = Attachments\npdfjs-layers-button =\n .title = Show Layers (double-click to reset all layers to the default state)\npdfjs-layers-button-label = Layers\npdfjs-thumbs-button =\n .title = Show Thumbnails\npdfjs-thumbs-button-label = Thumbnails\npdfjs-current-outline-item-button =\n .title = Find Current Outline Item\npdfjs-current-outline-item-button-label = Current Outline Item\npdfjs-findbar-button =\n .title = Find in Document\npdfjs-findbar-button-label = Find\npdfjs-additional-layers = Additional Layers\npdfjs-thumb-page-title =\n .title = Page { $page }\npdfjs-thumb-page-canvas =\n .aria-label = Thumbnail of Page { $page }\npdfjs-find-input =\n .title = Find\n .placeholder = Find in document\u2026\npdfjs-find-previous-button =\n .title = Find the previous occurrence of the phrase\npdfjs-find-previous-button-label = Previous\npdfjs-find-next-button =\n .title = Find the next occurrence of the phrase\npdfjs-find-next-button-label = Next\npdfjs-find-highlight-checkbox = Highlight All\npdfjs-find-match-case-checkbox-label = Match Case\npdfjs-find-match-diacritics-checkbox-label = Match Diacritics\npdfjs-find-entire-word-checkbox-label = Whole Words\npdfjs-find-reached-top = Reached top of document, continued from bottom\npdfjs-find-reached-bottom = Reached end of document, continued from top\npdfjs-find-match-count =\n { $total ->\n [one] { $current } of { $total } match\n *[other] { $current } of { $total } matches\n }\npdfjs-find-match-count-limit =\n { $limit ->\n [one] More than { $limit } match\n *[other] More than { $limit } matches\n }\npdfjs-find-not-found = Phrase not found\npdfjs-page-scale-width = Page Width\npdfjs-page-scale-fit = Page Fit\npdfjs-page-scale-auto = Automatic Zoom\npdfjs-page-scale-actual = Actual Size\npdfjs-page-scale-percent = { $scale }%\npdfjs-page-landmark =\n .aria-label = Page { $page }\npdfjs-loading-error = An error occurred while loading the PDF.\npdfjs-invalid-file-error = Invalid or corrupted PDF file.\npdfjs-missing-file-error = Missing PDF file.\npdfjs-unexpected-response-error = Unexpected server response.\npdfjs-rendering-error = An error occurred while rendering the page.\npdfjs-annotation-date-string = { $date }, { $time }\npdfjs-text-annotation-type =\n .alt = [{ $type } Annotation]\npdfjs-password-label = Enter the password to open this PDF file.\npdfjs-password-invalid = Invalid password. Please try again.\npdfjs-password-ok-button = OK\npdfjs-password-cancel-button = Cancel\npdfjs-web-fonts-disabled = Web fonts are disabled: unable to use embedded PDF fonts.\npdfjs-editor-free-text-button =\n .title = Text\npdfjs-editor-free-text-button-label = Text\npdfjs-editor-ink-button =\n .title = Draw\npdfjs-editor-ink-button-label = Draw\npdfjs-editor-stamp-button =\n .title = Add or edit images\npdfjs-editor-stamp-button-label = Add or edit images\npdfjs-editor-highlight-button =\n .title = Highlight\npdfjs-editor-highlight-button-label = Highlight\npdfjs-highlight-floating-button1 =\n .title = Highlight\n .aria-label = Highlight\npdfjs-highlight-floating-button-label = Highlight\npdfjs-editor-remove-ink-button =\n .title = Remove drawing\npdfjs-editor-remove-freetext-button =\n .title = Remove text\npdfjs-editor-remove-stamp-button =\n .title = Remove image\npdfjs-editor-remove-highlight-button =\n .title = Remove highlight\npdfjs-editor-free-text-color-input = Color\npdfjs-editor-free-text-size-input = Size\npdfjs-editor-ink-color-input = Color\npdfjs-editor-ink-thickness-input = Thickness\npdfjs-editor-ink-opacity-input = Opacity\npdfjs-editor-stamp-add-image-button =\n .title = Add image\npdfjs-editor-stamp-add-image-button-label = Add image\npdfjs-editor-free-highlight-thickness-input = Thickness\npdfjs-editor-free-highlight-thickness-title =\n .title = Change thickness when highlighting items other than text\npdfjs-free-text =\n .aria-label = Text Editor\npdfjs-free-text-default-content = Start typing\u2026\npdfjs-ink =\n .aria-label = Draw Editor\npdfjs-ink-canvas =\n .aria-label = User-created image\npdfjs-editor-alt-text-button-label = Alt text\npdfjs-editor-alt-text-edit-button-label = Edit alt text\npdfjs-editor-alt-text-dialog-label = Choose an option\npdfjs-editor-alt-text-dialog-description = Alt text (alternative text) helps when people can\u2019t see the image or when it doesn\u2019t load.\npdfjs-editor-alt-text-add-description-label = Add a description\npdfjs-editor-alt-text-add-description-description = Aim for 1-2 sentences that describe the subject, setting, or actions.\npdfjs-editor-alt-text-mark-decorative-label = Mark as decorative\npdfjs-editor-alt-text-mark-decorative-description = This is used for ornamental images, like borders or watermarks.\npdfjs-editor-alt-text-cancel-button = Cancel\npdfjs-editor-alt-text-save-button = Save\npdfjs-editor-alt-text-decorative-tooltip = Marked as decorative\npdfjs-editor-alt-text-textarea =\n .placeholder = For example, \u201CA young man sits down at a table to eat a meal\u201D\npdfjs-editor-resizer-label-top-left = Top left corner \u2014 resize\npdfjs-editor-resizer-label-top-middle = Top middle \u2014 resize\npdfjs-editor-resizer-label-top-right = Top right corner \u2014 resize\npdfjs-editor-resizer-label-middle-right = Middle right \u2014 resize\npdfjs-editor-resizer-label-bottom-right = Bottom right corner \u2014 resize\npdfjs-editor-resizer-label-bottom-middle = Bottom middle \u2014 resize\npdfjs-editor-resizer-label-bottom-left = Bottom left corner \u2014 resize\npdfjs-editor-resizer-label-middle-left = Middle left \u2014 resize\npdfjs-editor-highlight-colorpicker-label = Highlight color\npdfjs-editor-colorpicker-button =\n .title = Change color\npdfjs-editor-colorpicker-dropdown =\n .aria-label = Color choices\npdfjs-editor-colorpicker-yellow =\n .title = Yellow\npdfjs-editor-colorpicker-green =\n .title = Green\npdfjs-editor-colorpicker-blue =\n .title = Blue\npdfjs-editor-colorpicker-pink =\n .title = Pink\npdfjs-editor-colorpicker-red =\n .title = Red\npdfjs-editor-highlight-show-all-button-label = Show all\npdfjs-editor-highlight-show-all-button =\n .title = Show all";
|
5979 | return createBundle(lang, text);
|
5980 | }
|
5981 | }
|
5982 |
|
5983 | __webpack_async_result__();
|
5984 | } catch(e) { __webpack_async_result__(e); } });
|
5985 |
|
5986 | /***/ }),
|
5987 |
|
5988 | /***/ 4693:
|
5989 | /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
5990 |
|
5991 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
5992 | /* harmony export */ L10n: () => (/* binding */ L10n)
|
5993 | /* harmony export */ });
|
5994 | /* unused harmony export GenericL10n */
|
5995 | /* harmony import */ var core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1454);
|
5996 |
|
5997 | class L10n {
|
5998 | #dir;
|
5999 | #lang;
|
6000 | #l10n;
|
6001 | constructor(_ref) {
|
6002 | let {
|
6003 | lang,
|
6004 | isRTL
|
6005 | } = _ref;
|
6006 | let l10n = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
6007 | this.#lang = L10n.#fixupLangCode(lang);
|
6008 | this.#l10n = l10n;
|
6009 | this.#dir = isRTL ?? L10n.#isRTL(this.#lang) ? "rtl" : "ltr";
|
6010 | }
|
6011 | _setL10n(l10n) {
|
6012 | this.#l10n = l10n;
|
6013 | }
|
6014 | getLanguage() {
|
6015 | return this.#lang;
|
6016 | }
|
6017 | getDirection() {
|
6018 | return this.#dir;
|
6019 | }
|
6020 | async get(ids) {
|
6021 | let args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
6022 | let fallback = arguments.length > 2 ? arguments[2] : undefined;
|
6023 | if (Array.isArray(ids)) {
|
6024 | ids = ids.map(id => ({
|
6025 | id
|
6026 | }));
|
6027 | const messages = await this.#l10n.formatMessages(ids);
|
6028 | return messages.map(message => message.value);
|
6029 | }
|
6030 | const messages = await this.#l10n.formatMessages([{
|
6031 | id: ids,
|
6032 | args
|
6033 | }]);
|
6034 | return messages?.[0].value || fallback;
|
6035 | }
|
6036 | async translate(element) {
|
6037 | try {
|
6038 | this.#l10n.connectRoot(element);
|
6039 | await this.#l10n.translateRoots();
|
6040 | } catch {}
|
6041 | }
|
6042 | pause() {
|
6043 | this.#l10n.pauseObserving();
|
6044 | }
|
6045 | resume() {
|
6046 | this.#l10n.resumeObserving();
|
6047 | }
|
6048 | static #fixupLangCode(langCode) {
|
6049 | langCode = langCode?.toLowerCase() || "en-us";
|
6050 | const PARTIAL_LANG_CODES = {
|
6051 | en: "en-us",
|
6052 | es: "es-es",
|
6053 | fy: "fy-nl",
|
6054 | ga: "ga-ie",
|
6055 | gu: "gu-in",
|
6056 | hi: "hi-in",
|
6057 | hy: "hy-am",
|
6058 | nb: "nb-no",
|
6059 | ne: "ne-np",
|
6060 | nn: "nn-no",
|
6061 | pa: "pa-in",
|
6062 | pt: "pt-pt",
|
6063 | sv: "sv-se",
|
6064 | zh: "zh-cn"
|
6065 | };
|
6066 | return PARTIAL_LANG_CODES[langCode] || langCode;
|
6067 | }
|
6068 | static #isRTL(lang) {
|
6069 | const shortCode = lang.split("-", 1)[0];
|
6070 | return ["ar", "he", "fa", "ps", "ur"].includes(shortCode);
|
6071 | }
|
6072 | }
|
6073 | const GenericL10n = null;
|
6074 |
|
6075 |
|
6076 | /***/ }),
|
6077 |
|
6078 | /***/ 9814:
|
6079 | /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
6080 |
|
6081 |
|
6082 | // EXPORTS
|
6083 | __webpack_require__.d(__webpack_exports__, {
|
6084 | FindState: () => (/* binding */ FindState),
|
6085 | PDFFindController: () => (/* binding */ PDFFindController)
|
6086 | });
|
6087 |
|
6088 | // EXTERNAL MODULE: ./node_modules/core-js/modules/es.array.push.js
|
6089 | var es_array_push = __webpack_require__(4114);
|
6090 | // EXTERNAL MODULE: ./node_modules/core-js/modules/es.promise.with-resolvers.js
|
6091 | var es_promise_with_resolvers = __webpack_require__(4628);
|
6092 | // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.constructor.js
|
6093 | var esnext_iterator_constructor = __webpack_require__(8992);
|
6094 | // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.filter.js
|
6095 | var esnext_iterator_filter = __webpack_require__(4520);
|
6096 | // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.iterator.map.js
|
6097 | var esnext_iterator_map = __webpack_require__(1454);
|
6098 | // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.difference.v2.js
|
6099 | var esnext_set_difference_v2 = __webpack_require__(3375);
|
6100 | // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.intersection.v2.js
|
6101 | var esnext_set_intersection_v2 = __webpack_require__(9225);
|
6102 | // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.is-disjoint-from.v2.js
|
6103 | var esnext_set_is_disjoint_from_v2 = __webpack_require__(3972);
|
6104 | // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.is-subset-of.v2.js
|
6105 | var esnext_set_is_subset_of_v2 = __webpack_require__(9209);
|
6106 | // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.is-superset-of.v2.js
|
6107 | var esnext_set_is_superset_of_v2 = __webpack_require__(5714);
|
6108 | // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.symmetric-difference.v2.js
|
6109 | var esnext_set_symmetric_difference_v2 = __webpack_require__(7561);
|
6110 | // EXTERNAL MODULE: ./node_modules/core-js/modules/esnext.set.union.v2.js
|
6111 | var esnext_set_union_v2 = __webpack_require__(6197);
|
6112 | // EXTERNAL MODULE: ./web/ui_utils.js
|
6113 | var ui_utils = __webpack_require__(7256);
|
6114 | ;// CONCATENATED MODULE: ./web/pdf_find_utils.js
|
6115 |
|
6116 | const CharacterType = {
|
6117 | SPACE: 0,
|
6118 | ALPHA_LETTER: 1,
|
6119 | PUNCT: 2,
|
6120 | HAN_LETTER: 3,
|
6121 | KATAKANA_LETTER: 4,
|
6122 | HIRAGANA_LETTER: 5,
|
6123 | HALFWIDTH_KATAKANA_LETTER: 6,
|
6124 | THAI_LETTER: 7
|
6125 | };
|
6126 | function isAlphabeticalScript(charCode) {
|
6127 | return charCode < 0x2e80;
|
6128 | }
|
6129 | function isAscii(charCode) {
|
6130 | return (charCode & 0xff80) === 0;
|
6131 | }
|
6132 | function isAsciiAlpha(charCode) {
|
6133 | return charCode >= 0x61 && charCode <= 0x7a || charCode >= 0x41 && charCode <= 0x5a;
|
6134 | }
|
6135 | function isAsciiDigit(charCode) {
|
6136 | return charCode >= 0x30 && charCode <= 0x39;
|
6137 | }
|
6138 | function isAsciiSpace(charCode) {
|
6139 | return charCode === 0x20 || charCode === 0x09 || charCode === 0x0d || charCode === 0x0a;
|
6140 | }
|
6141 | function isHan(charCode) {
|
6142 | return charCode >= 0x3400 && charCode <= 0x9fff || charCode >= 0xf900 && charCode <= 0xfaff;
|
6143 | }
|
6144 | function isKatakana(charCode) {
|
6145 | return charCode >= 0x30a0 && charCode <= 0x30ff;
|
6146 | }
|
6147 | function isHiragana(charCode) {
|
6148 | return charCode >= 0x3040 && charCode <= 0x309f;
|
6149 | }
|
6150 | function isHalfwidthKatakana(charCode) {
|
6151 | return charCode >= 0xff60 && charCode <= 0xff9f;
|
6152 | }
|
6153 | function isThai(charCode) {
|
6154 | return (charCode & 0xff80) === 0x0e00;
|
6155 | }
|
6156 | function getCharacterType(charCode) {
|
6157 | if (isAlphabeticalScript(charCode)) {
|
6158 | if (isAscii(charCode)) {
|
6159 | if (isAsciiSpace(charCode)) {
|
6160 | return CharacterType.SPACE;
|
6161 | } else if (isAsciiAlpha(charCode) || isAsciiDigit(charCode) || charCode === 0x5f) {
|
6162 | return CharacterType.ALPHA_LETTER;
|
6163 | }
|
6164 | return CharacterType.PUNCT;
|
6165 | } else if (isThai(charCode)) {
|
6166 | return CharacterType.THAI_LETTER;
|
6167 | } else if (charCode === 0xa0) {
|
6168 | return CharacterType.SPACE;
|
6169 | }
|
6170 | return CharacterType.ALPHA_LETTER;
|
6171 | }
|
6172 | if (isHan(charCode)) {
|
6173 | return CharacterType.HAN_LETTER;
|
6174 | } else if (isKatakana(charCode)) {
|
6175 | return CharacterType.KATAKANA_LETTER;
|
6176 | } else if (isHiragana(charCode)) {
|
6177 | return CharacterType.HIRAGANA_LETTER;
|
6178 | } else if (isHalfwidthKatakana(charCode)) {
|
6179 | return CharacterType.HALFWIDTH_KATAKANA_LETTER;
|
6180 | }
|
6181 | return CharacterType.ALPHA_LETTER;
|
6182 | }
|
6183 | let NormalizeWithNFKC;
|
6184 | function getNormalizeWithNFKC() {
|
6185 | NormalizeWithNFKC ||= ` ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩`;
|
6186 | return NormalizeWithNFKC;
|
6187 | }
|
6188 |
|
6189 | ;// CONCATENATED MODULE: ./web/pdf_find_controller.js
|
6190 |
|
6191 |
|
6192 |
|
6193 |
|
6194 |
|
6195 |
|
6196 |
|
6197 |
|
6198 |
|
6199 |
|
6200 |
|
6201 |
|
6202 |
|
6203 |
|
6204 | const FindState = {
|
6205 | FOUND: 0,
|
6206 | NOT_FOUND: 1,
|
6207 | WRAPPED: 2,
|
6208 | PENDING: 3
|
6209 | };
|
6210 | const FIND_TIMEOUT = 250;
|
6211 | const MATCH_SCROLL_OFFSET_TOP = -50;
|
6212 | const MATCH_SCROLL_OFFSET_LEFT = -400;
|
6213 | const CHARACTERS_TO_NORMALIZE = {
|
6214 | "\u2010": "-",
|
6215 | "\u2018": "'",
|
6216 | "\u2019": "'",
|
6217 | "\u201A": "'",
|
6218 | "\u201B": "'",
|
6219 | "\u201C": '"',
|
6220 | "\u201D": '"',
|
6221 | "\u201E": '"',
|
6222 | "\u201F": '"',
|
6223 | "\u00BC": "1/4",
|
6224 | "\u00BD": "1/2",
|
6225 | "\u00BE": "3/4"
|
6226 | };
|
6227 | const DIACRITICS_EXCEPTION = new Set([0x3099, 0x309a, 0x094d, 0x09cd, 0x0a4d, 0x0acd, 0x0b4d, 0x0bcd, 0x0c4d, 0x0ccd, 0x0d3b, 0x0d3c, 0x0d4d, 0x0dca, 0x0e3a, 0x0eba, 0x0f84, 0x1039, 0x103a, 0x1714, 0x1734, 0x17d2, 0x1a60, 0x1b44, 0x1baa, 0x1bab, 0x1bf2, 0x1bf3, 0x2d7f, 0xa806, 0xa82c, 0xa8c4, 0xa953, 0xa9c0, 0xaaf6, 0xabed, 0x0c56, 0x0f71, 0x0f72, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f80, 0x0f74]);
|
6228 | let DIACRITICS_EXCEPTION_STR;
|
6229 | const DIACRITICS_REG_EXP = /\p{M}+/gu;
|
6230 | const SPECIAL_CHARS_REG_EXP = /([.*+?^${}()|[\]\\])|(\p{P})|(\s+)|(\p{M})|(\p{L})/gu;
|
6231 | const NOT_DIACRITIC_FROM_END_REG_EXP = /([^\p{M}])\p{M}*$/u;
|
6232 | const NOT_DIACRITIC_FROM_START_REG_EXP = /^\p{M}*([^\p{M}])/u;
|
6233 | const SYLLABLES_REG_EXP = /[\uAC00-\uD7AF\uFA6C\uFACF-\uFAD1\uFAD5-\uFAD7]+/g;
|
6234 | const SYLLABLES_LENGTHS = new Map();
|
6235 | const FIRST_CHAR_SYLLABLES_REG_EXP = "[\\u1100-\\u1112\\ud7a4-\\ud7af\\ud84a\\ud84c\\ud850\\ud854\\ud857\\ud85f]";
|
6236 | const NFKC_CHARS_TO_NORMALIZE = new Map();
|
6237 | let noSyllablesRegExp = null;
|
6238 | let withSyllablesRegExp = null;
|
6239 | function normalize(text) {
|
6240 | const syllablePositions = [];
|
6241 | let m;
|
6242 | while ((m = SYLLABLES_REG_EXP.exec(text)) !== null) {
|
6243 | let {
|
6244 | index
|
6245 | } = m;
|
6246 | for (const char of m[0]) {
|
6247 | let len = SYLLABLES_LENGTHS.get(char);
|
6248 | if (!len) {
|
6249 | len = char.normalize("NFD").length;
|
6250 | SYLLABLES_LENGTHS.set(char, len);
|
6251 | }
|
6252 | syllablePositions.push([len, index++]);
|
6253 | }
|
6254 | }
|
6255 | let normalizationRegex;
|
6256 | if (syllablePositions.length === 0 && noSyllablesRegExp) {
|
6257 | normalizationRegex = noSyllablesRegExp;
|
6258 | } else if (syllablePositions.length > 0 && withSyllablesRegExp) {
|
6259 | normalizationRegex = withSyllablesRegExp;
|
6260 | } else {
|
6261 | const replace = Object.keys(CHARACTERS_TO_NORMALIZE).join("");
|
6262 | const toNormalizeWithNFKC = getNormalizeWithNFKC();
|
6263 | const CJK = "(?:\\p{Ideographic}|[\u3040-\u30FF])";
|
6264 | const HKDiacritics = "(?:\u3099|\u309A)";
|
6265 | const regexp = `([${replace}])|([${toNormalizeWithNFKC}])|(${HKDiacritics}\\n)|(\\p{M}+(?:-\\n)?)|(\\S-\\n)|(${CJK}\\n)|(\\n)`;
|
6266 | if (syllablePositions.length === 0) {
|
6267 | normalizationRegex = noSyllablesRegExp = new RegExp(regexp + "|(\\u0000)", "gum");
|
6268 | } else {
|
6269 | normalizationRegex = withSyllablesRegExp = new RegExp(regexp + `|(${FIRST_CHAR_SYLLABLES_REG_EXP})`, "gum");
|
6270 | }
|
6271 | }
|
6272 | const rawDiacriticsPositions = [];
|
6273 | while ((m = DIACRITICS_REG_EXP.exec(text)) !== null) {
|
6274 | rawDiacriticsPositions.push([m[0].length, m.index]);
|
6275 | }
|
6276 | let normalized = text.normalize("NFD");
|
6277 | const positions = [[0, 0]];
|
6278 | let rawDiacriticsIndex = 0;
|
6279 | let syllableIndex = 0;
|
6280 | let shift = 0;
|
6281 | let shiftOrigin = 0;
|
6282 | let eol = 0;
|
6283 | let hasDiacritics = false;
|
6284 | normalized = normalized.replace(normalizationRegex, (match, p1, p2, p3, p4, p5, p6, p7, p8, i) => {
|
6285 | i -= shiftOrigin;
|
6286 | if (p1) {
|
6287 | const replacement = CHARACTERS_TO_NORMALIZE[p1];
|
6288 | const jj = replacement.length;
|
6289 | for (let j = 1; j < jj; j++) {
|
6290 | positions.push([i - shift + j, shift - j]);
|
6291 | }
|
6292 | shift -= jj - 1;
|
6293 | return replacement;
|
6294 | }
|
6295 | if (p2) {
|
6296 | let replacement = NFKC_CHARS_TO_NORMALIZE.get(p2);
|
6297 | if (!replacement) {
|
6298 | replacement = p2.normalize("NFKC");
|
6299 | NFKC_CHARS_TO_NORMALIZE.set(p2, replacement);
|
6300 | }
|
6301 | const jj = replacement.length;
|
6302 | for (let j = 1; j < jj; j++) {
|
6303 | positions.push([i - shift + j, shift - j]);
|
6304 | }
|
6305 | shift -= jj - 1;
|
6306 | return replacement;
|
6307 | }
|
6308 | if (p3) {
|
6309 | hasDiacritics = true;
|
6310 | if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) {
|
6311 | ++rawDiacriticsIndex;
|
6312 | } else {
|
6313 | positions.push([i - 1 - shift + 1, shift - 1]);
|
6314 | shift -= 1;
|
6315 | shiftOrigin += 1;
|
6316 | }
|
6317 | positions.push([i - shift + 1, shift]);
|
6318 | shiftOrigin += 1;
|
6319 | eol += 1;
|
6320 | return p3.charAt(0);
|
6321 | }
|
6322 | if (p4) {
|
6323 | const hasTrailingDashEOL = p4.endsWith("\n");
|
6324 | const len = hasTrailingDashEOL ? p4.length - 2 : p4.length;
|
6325 | hasDiacritics = true;
|
6326 | let jj = len;
|
6327 | if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) {
|
6328 | jj -= rawDiacriticsPositions[rawDiacriticsIndex][0];
|
6329 | ++rawDiacriticsIndex;
|
6330 | }
|
6331 | for (let j = 1; j <= jj; j++) {
|
6332 | positions.push([i - 1 - shift + j, shift - j]);
|
6333 | }
|
6334 | shift -= jj;
|
6335 | shiftOrigin += jj;
|
6336 | if (hasTrailingDashEOL) {
|
6337 | i += len - 1;
|
6338 | positions.push([i - shift + 1, 1 + shift]);
|
6339 | shift += 1;
|
6340 | shiftOrigin += 1;
|
6341 | eol += 1;
|
6342 | return p4.slice(0, len);
|
6343 | }
|
6344 | return p4;
|
6345 | }
|
6346 | if (p5) {
|
6347 | const len = p5.length - 2;
|
6348 | positions.push([i - shift + len, 1 + shift]);
|
6349 | shift += 1;
|
6350 | shiftOrigin += 1;
|
6351 | eol += 1;
|
6352 | return p5.slice(0, -2);
|
6353 | }
|
6354 | if (p6) {
|
6355 | const len = p6.length - 1;
|
6356 | positions.push([i - shift + len, shift]);
|
6357 | shiftOrigin += 1;
|
6358 | eol += 1;
|
6359 | return p6.slice(0, -1);
|
6360 | }
|
6361 | if (p7) {
|
6362 | positions.push([i - shift + 1, shift - 1]);
|
6363 | shift -= 1;
|
6364 | shiftOrigin += 1;
|
6365 | eol += 1;
|
6366 | return " ";
|
6367 | }
|
6368 | if (i + eol === syllablePositions[syllableIndex]?.[1]) {
|
6369 | const newCharLen = syllablePositions[syllableIndex][0] - 1;
|
6370 | ++syllableIndex;
|
6371 | for (let j = 1; j <= newCharLen; j++) {
|
6372 | positions.push([i - (shift - j), shift - j]);
|
6373 | }
|
6374 | shift -= newCharLen;
|
6375 | shiftOrigin += newCharLen;
|
6376 | }
|
6377 | return p8;
|
6378 | });
|
6379 | positions.push([normalized.length, shift]);
|
6380 | return [normalized, positions, hasDiacritics];
|
6381 | }
|
6382 | function getOriginalIndex(diffs, pos, len) {
|
6383 | if (!diffs) {
|
6384 | return [pos, len];
|
6385 | }
|
6386 | const start = pos;
|
6387 | const end = pos + len - 1;
|
6388 | let i = (0,ui_utils.binarySearchFirstItem)(diffs, x => x[0] >= start);
|
6389 | if (diffs[i][0] > start) {
|
6390 | --i;
|
6391 | }
|
6392 | let j = (0,ui_utils.binarySearchFirstItem)(diffs, x => x[0] >= end, i);
|
6393 | if (diffs[j][0] > end) {
|
6394 | --j;
|
6395 | }
|
6396 | const oldStart = start + diffs[i][1];
|
6397 | const oldEnd = end + diffs[j][1];
|
6398 | const oldLen = oldEnd + 1 - oldStart;
|
6399 | return [oldStart, oldLen];
|
6400 | }
|
6401 | class PDFFindController {
|
6402 | #state = null;
|
6403 | #updateMatchesCountOnProgress = true;
|
6404 | #visitedPagesCount = 0;
|
6405 | constructor(_ref) {
|
6406 | let {
|
6407 | linkService,
|
6408 | eventBus,
|
6409 | updateMatchesCountOnProgress = true
|
6410 | } = _ref;
|
6411 | this._linkService = linkService;
|
6412 | this._eventBus = eventBus;
|
6413 | this.#updateMatchesCountOnProgress = updateMatchesCountOnProgress;
|
6414 | this.onIsPageVisible = null;
|
6415 | this.#reset();
|
6416 | eventBus._on("find", this.#onFind.bind(this));
|
6417 | eventBus._on("findbarclose", this.#onFindBarClose.bind(this));
|
6418 | }
|
6419 | get highlightMatches() {
|
6420 | return this._highlightMatches;
|
6421 | }
|
6422 | get pageMatches() {
|
6423 | return this._pageMatches;
|
6424 | }
|
6425 | get pageMatchesLength() {
|
6426 | return this._pageMatchesLength;
|
6427 | }
|
6428 | get selected() {
|
6429 | return this._selected;
|
6430 | }
|
6431 | get state() {
|
6432 | return this.#state;
|
6433 | }
|
6434 | setDocument(pdfDocument) {
|
6435 | if (this._pdfDocument) {
|
6436 | this.#reset();
|
6437 | }
|
6438 | if (!pdfDocument) {
|
6439 | return;
|
6440 | }
|
6441 | this._pdfDocument = pdfDocument;
|
6442 | this._firstPageCapability.resolve();
|
6443 | }
|
6444 | #onFind(state) {
|
6445 | if (!state) {
|
6446 | return;
|
6447 | }
|
6448 | const pdfDocument = this._pdfDocument;
|
6449 | const {
|
6450 | type
|
6451 | } = state;
|
6452 | if (this.#state === null || this.#shouldDirtyMatch(state)) {
|
6453 | this._dirtyMatch = true;
|
6454 | }
|
6455 | this.#state = state;
|
6456 | if (type !== "highlightallchange") {
|
6457 | this.#updateUIState(FindState.PENDING);
|
6458 | }
|
6459 | this._firstPageCapability.promise.then(() => {
|
6460 | if (!this._pdfDocument || pdfDocument && this._pdfDocument !== pdfDocument) {
|
6461 | return;
|
6462 | }
|
6463 | this.#extractText();
|
6464 | const findbarClosed = !this._highlightMatches;
|
6465 | const pendingTimeout = !!this._findTimeout;
|
6466 | if (this._findTimeout) {
|
6467 | clearTimeout(this._findTimeout);
|
6468 | this._findTimeout = null;
|
6469 | }
|
6470 | if (!type) {
|
6471 | this._findTimeout = setTimeout(() => {
|
6472 | this.#nextMatch();
|
6473 | this._findTimeout = null;
|
6474 | }, FIND_TIMEOUT);
|
6475 | } else if (this._dirtyMatch) {
|
6476 | this.#nextMatch();
|
6477 | } else if (type === "again") {
|
6478 | this.#nextMatch();
|
6479 | if (findbarClosed && this.#state.highlightAll) {
|
6480 | this.#updateAllPages();
|
6481 | }
|
6482 | } else if (type === "highlightallchange") {
|
6483 | if (pendingTimeout) {
|
6484 | this.#nextMatch();
|
6485 | } else {
|
6486 | this._highlightMatches = true;
|
6487 | }
|
6488 | this.#updateAllPages();
|
6489 | } else {
|
6490 | this.#nextMatch();
|
6491 | }
|
6492 | });
|
6493 | }
|
6494 | scrollMatchIntoView(_ref2) {
|
6495 | let {
|
6496 | element = null,
|
6497 | selectedLeft = 0,
|
6498 | pageIndex = -1,
|
6499 | matchIndex = -1
|
6500 | } = _ref2;
|
6501 | if (!this._scrollMatches || !element) {
|
6502 | return;
|
6503 | } else if (matchIndex === -1 || matchIndex !== this._selected.matchIdx) {
|
6504 | return;
|
6505 | } else if (pageIndex === -1 || pageIndex !== this._selected.pageIdx) {
|
6506 | return;
|
6507 | }
|
6508 | this._scrollMatches = false;
|
6509 | const spot = {
|
6510 | top: MATCH_SCROLL_OFFSET_TOP,
|
6511 | left: selectedLeft + MATCH_SCROLL_OFFSET_LEFT
|
6512 | };
|
6513 | (0,ui_utils.scrollIntoView)(element, spot, true);
|
6514 | }
|
6515 | #reset() {
|
6516 | this._highlightMatches = false;
|
6517 | this._scrollMatches = false;
|
6518 | this._pdfDocument = null;
|
6519 | this._pageMatches = [];
|
6520 | this._pageMatchesLength = [];
|
6521 | this.#visitedPagesCount = 0;
|
6522 | this.#state = null;
|
6523 | this._selected = {
|
6524 | pageIdx: -1,
|
6525 | matchIdx: -1
|
6526 | };
|
6527 | this._offset = {
|
6528 | pageIdx: null,
|
6529 | matchIdx: null,
|
6530 | wrapped: false
|
6531 | };
|
6532 | this._extractTextPromises = [];
|
6533 | this._pageContents = [];
|
6534 | this._pageDiffs = [];
|
6535 | this._hasDiacritics = [];
|
6536 | this._matchesCountTotal = 0;
|
6537 | this._pagesToSearch = null;
|
6538 | this._pendingFindMatches = new Set();
|
6539 | this._resumePageIdx = null;
|
6540 | this._dirtyMatch = false;
|
6541 | clearTimeout(this._findTimeout);
|
6542 | this._findTimeout = null;
|
6543 | this._firstPageCapability = Promise.withResolvers();
|
6544 | }
|
6545 | get #query() {
|
6546 | const {
|
6547 | query
|
6548 | } = this.#state;
|
6549 | if (typeof query === "string") {
|
6550 | if (query !== this._rawQuery) {
|
6551 | this._rawQuery = query;
|
6552 | [this._normalizedQuery] = normalize(query);
|
6553 | }
|
6554 | return this._normalizedQuery;
|
6555 | }
|
6556 | return (query || []).filter(q => !!q).map(q => normalize(q)[0]);
|
6557 | }
|
6558 | #shouldDirtyMatch(state) {
|
6559 | const newQuery = state.query,
|
6560 | prevQuery = this.#state.query;
|
6561 | const newType = typeof newQuery,
|
6562 | prevType = typeof prevQuery;
|
6563 | if (newType !== prevType) {
|
6564 | return true;
|
6565 | }
|
6566 | if (newType === "string") {
|
6567 | if (newQuery !== prevQuery) {
|
6568 | return true;
|
6569 | }
|
6570 | } else if (JSON.stringify(newQuery) !== JSON.stringify(prevQuery)) {
|
6571 | return true;
|
6572 | }
|
6573 | switch (state.type) {
|
6574 | case "again":
|
6575 | const pageNumber = this._selected.pageIdx + 1;
|
6576 | const linkService = this._linkService;
|
6577 | return pageNumber >= 1 && pageNumber <= linkService.pagesCount && pageNumber !== linkService.page && !(this.onIsPageVisible?.(pageNumber) ?? true);
|
6578 | case "highlightallchange":
|
6579 | return false;
|
6580 | }
|
6581 | return true;
|
6582 | }
|
6583 | #isEntireWord(content, startIdx, length) {
|
6584 | let match = content.slice(0, startIdx).match(NOT_DIACRITIC_FROM_END_REG_EXP);
|
6585 | if (match) {
|
6586 | const first = content.charCodeAt(startIdx);
|
6587 | const limit = match[1].charCodeAt(0);
|
6588 | if (getCharacterType(first) === getCharacterType(limit)) {
|
6589 | return false;
|
6590 | }
|
6591 | }
|
6592 | match = content.slice(startIdx + length).match(NOT_DIACRITIC_FROM_START_REG_EXP);
|
6593 | if (match) {
|
6594 | const last = content.charCodeAt(startIdx + length - 1);
|
6595 | const limit = match[1].charCodeAt(0);
|
6596 | if (getCharacterType(last) === getCharacterType(limit)) {
|
6597 | return false;
|
6598 | }
|
6599 | }
|
6600 | return true;
|
6601 | }
|
6602 | #calculateRegExpMatch(query, entireWord, pageIndex, pageContent) {
|
6603 | const matches = this._pageMatches[pageIndex] = [];
|
6604 | const matchesLength = this._pageMatchesLength[pageIndex] = [];
|
6605 | if (!query) {
|
6606 | return;
|
6607 | }
|
6608 | const diffs = this._pageDiffs[pageIndex];
|
6609 | let match;
|
6610 | while ((match = query.exec(pageContent)) !== null) {
|
6611 | if (entireWord && !this.#isEntireWord(pageContent, match.index, match[0].length)) {
|
6612 | continue;
|
6613 | }
|
6614 | const [matchPos, matchLen] = getOriginalIndex(diffs, match.index, match[0].length);
|
6615 | if (matchLen) {
|
6616 | matches.push(matchPos);
|
6617 | matchesLength.push(matchLen);
|
6618 | }
|
6619 | }
|
6620 | }
|
6621 | #convertToRegExpString(query, hasDiacritics) {
|
6622 | const {
|
6623 | matchDiacritics
|
6624 | } = this.#state;
|
6625 | let isUnicode = false;
|
6626 | query = query.replaceAll(SPECIAL_CHARS_REG_EXP, (match, p1, p2, p3, p4, p5) => {
|
6627 | if (p1) {
|
6628 | return `[ ]*\\${p1}[ ]*`;
|
6629 | }
|
6630 | if (p2) {
|
6631 | return `[ ]*${p2}[ ]*`;
|
6632 | }
|
6633 | if (p3) {
|
6634 | return "[ ]+";
|
6635 | }
|
6636 | if (matchDiacritics) {
|
6637 | return p4 || p5;
|
6638 | }
|
6639 | if (p4) {
|
6640 | return DIACRITICS_EXCEPTION.has(p4.charCodeAt(0)) ? p4 : "";
|
6641 | }
|
6642 | if (hasDiacritics) {
|
6643 | isUnicode = true;
|
6644 | return `${p5}\\p{M}*`;
|
6645 | }
|
6646 | return p5;
|
6647 | });
|
6648 | const trailingSpaces = "[ ]*";
|
6649 | if (query.endsWith(trailingSpaces)) {
|
6650 | query = query.slice(0, query.length - trailingSpaces.length);
|
6651 | }
|
6652 | if (matchDiacritics) {
|
6653 | if (hasDiacritics) {
|
6654 | DIACRITICS_EXCEPTION_STR ||= String.fromCharCode(...DIACRITICS_EXCEPTION);
|
6655 | isUnicode = true;
|
6656 | query = `${query}(?=[${DIACRITICS_EXCEPTION_STR}]|[^\\p{M}]|$)`;
|
6657 | }
|
6658 | }
|
6659 | return [isUnicode, query];
|
6660 | }
|
6661 | #calculateMatch(pageIndex) {
|
6662 | let query = this.#query;
|
6663 | if (query.length === 0) {
|
6664 | return;
|
6665 | }
|
6666 | const {
|
6667 | caseSensitive,
|
6668 | entireWord
|
6669 | } = this.#state;
|
6670 | const pageContent = this._pageContents[pageIndex];
|
6671 | const hasDiacritics = this._hasDiacritics[pageIndex];
|
6672 | let isUnicode = false;
|
6673 | if (typeof query === "string") {
|
6674 | [isUnicode, query] = this.#convertToRegExpString(query, hasDiacritics);
|
6675 | } else {
|
6676 | query = query.sort().reverse().map(q => {
|
6677 | const [isUnicodePart, queryPart] = this.#convertToRegExpString(q, hasDiacritics);
|
6678 | isUnicode ||= isUnicodePart;
|
6679 | return `(${queryPart})`;
|
6680 | }).join("|");
|
6681 | }
|
6682 | const flags = `g${isUnicode ? "u" : ""}${caseSensitive ? "" : "i"}`;
|
6683 | query = query ? new RegExp(query, flags) : null;
|
6684 | this.#calculateRegExpMatch(query, entireWord, pageIndex, pageContent);
|
6685 | if (this.#state.highlightAll) {
|
6686 | this.#updatePage(pageIndex);
|
6687 | }
|
6688 | if (this._resumePageIdx === pageIndex) {
|
6689 | this._resumePageIdx = null;
|
6690 | this.#nextPageMatch();
|
6691 | }
|
6692 | const pageMatchesCount = this._pageMatches[pageIndex].length;
|
6693 | this._matchesCountTotal += pageMatchesCount;
|
6694 | if (this.#updateMatchesCountOnProgress) {
|
6695 | if (pageMatchesCount > 0) {
|
6696 | this.#updateUIResultsCount();
|
6697 | }
|
6698 | } else if (++this.#visitedPagesCount === this._linkService.pagesCount) {
|
6699 | this.#updateUIResultsCount();
|
6700 | }
|
6701 | }
|
6702 | #extractText() {
|
6703 | if (this._extractTextPromises.length > 0) {
|
6704 | return;
|
6705 | }
|
6706 | let deferred = Promise.resolve();
|
6707 | const textOptions = {
|
6708 | disableNormalization: true
|
6709 | };
|
6710 | for (let i = 0, ii = this._linkService.pagesCount; i < ii; i++) {
|
6711 | const {
|
6712 | promise,
|
6713 | resolve
|
6714 | } = Promise.withResolvers();
|
6715 | this._extractTextPromises[i] = promise;
|
6716 | deferred = deferred.then(() => {
|
6717 | return this._pdfDocument.getPage(i + 1).then(pdfPage => pdfPage.getTextContent(textOptions)).then(textContent => {
|
6718 | const strBuf = [];
|
6719 | for (const textItem of textContent.items) {
|
6720 | strBuf.push(textItem.str);
|
6721 | if (textItem.hasEOL) {
|
6722 | strBuf.push("\n");
|
6723 | }
|
6724 | }
|
6725 | [this._pageContents[i], this._pageDiffs[i], this._hasDiacritics[i]] = normalize(strBuf.join(""));
|
6726 | resolve();
|
6727 | }, reason => {
|
6728 | console.error(`Unable to get text content for page ${i + 1}`, reason);
|
6729 | this._pageContents[i] = "";
|
6730 | this._pageDiffs[i] = null;
|
6731 | this._hasDiacritics[i] = false;
|
6732 | resolve();
|
6733 | });
|
6734 | });
|
6735 | }
|
6736 | }
|
6737 | #updatePage(index) {
|
6738 | if (this._scrollMatches && this._selected.pageIdx === index) {
|
6739 | this._linkService.page = index + 1;
|
6740 | }
|
6741 | this._eventBus.dispatch("updatetextlayermatches", {
|
6742 | source: this,
|
6743 | pageIndex: index
|
6744 | });
|
6745 | }
|
6746 | #updateAllPages() {
|
6747 | this._eventBus.dispatch("updatetextlayermatches", {
|
6748 | source: this,
|
6749 | pageIndex: -1
|
6750 | });
|
6751 | }
|
6752 | #nextMatch() {
|
6753 | const previous = this.#state.findPrevious;
|
6754 | const currentPageIndex = this._linkService.page - 1;
|
6755 | const numPages = this._linkService.pagesCount;
|
6756 | this._highlightMatches = true;
|
6757 | if (this._dirtyMatch) {
|
6758 | this._dirtyMatch = false;
|
6759 | this._selected.pageIdx = this._selected.matchIdx = -1;
|
6760 | this._offset.pageIdx = currentPageIndex;
|
6761 | this._offset.matchIdx = null;
|
6762 | this._offset.wrapped = false;
|
6763 | this._resumePageIdx = null;
|
6764 | this._pageMatches.length = 0;
|
6765 | this._pageMatchesLength.length = 0;
|
6766 | this.#visitedPagesCount = 0;
|
6767 | this._matchesCountTotal = 0;
|
6768 | this.#updateAllPages();
|
6769 | for (let i = 0; i < numPages; i++) {
|
6770 | if (this._pendingFindMatches.has(i)) {
|
6771 | continue;
|
6772 | }
|
6773 | this._pendingFindMatches.add(i);
|
6774 | this._extractTextPromises[i].then(() => {
|
6775 | this._pendingFindMatches.delete(i);
|
6776 | this.#calculateMatch(i);
|
6777 | });
|
6778 | }
|
6779 | }
|
6780 | const query = this.#query;
|
6781 | if (query.length === 0) {
|
6782 | this.#updateUIState(FindState.FOUND);
|
6783 | return;
|
6784 | }
|
6785 | if (this._resumePageIdx) {
|
6786 | return;
|
6787 | }
|
6788 | const offset = this._offset;
|
6789 | this._pagesToSearch = numPages;
|
6790 | if (offset.matchIdx !== null) {
|
6791 | const numPageMatches = this._pageMatches[offset.pageIdx].length;
|
6792 | if (!previous && offset.matchIdx + 1 < numPageMatches || previous && offset.matchIdx > 0) {
|
6793 | offset.matchIdx = previous ? offset.matchIdx - 1 : offset.matchIdx + 1;
|
6794 | this.#updateMatch(true);
|
6795 | return;
|
6796 | }
|
6797 | this.#advanceOffsetPage(previous);
|
6798 | }
|
6799 | this.#nextPageMatch();
|
6800 | }
|
6801 | #matchesReady(matches) {
|
6802 | const offset = this._offset;
|
6803 | const numMatches = matches.length;
|
6804 | const previous = this.#state.findPrevious;
|
6805 | if (numMatches) {
|
6806 | offset.matchIdx = previous ? numMatches - 1 : 0;
|
6807 | this.#updateMatch(true);
|
6808 | return true;
|
6809 | }
|
6810 | this.#advanceOffsetPage(previous);
|
6811 | if (offset.wrapped) {
|
6812 | offset.matchIdx = null;
|
6813 | if (this._pagesToSearch < 0) {
|
6814 | this.#updateMatch(false);
|
6815 | return true;
|
6816 | }
|
6817 | }
|
6818 | return false;
|
6819 | }
|
6820 | #nextPageMatch() {
|
6821 | if (this._resumePageIdx !== null) {
|
6822 | console.error("There can only be one pending page.");
|
6823 | }
|
6824 | let matches = null;
|
6825 | do {
|
6826 | const pageIdx = this._offset.pageIdx;
|
6827 | matches = this._pageMatches[pageIdx];
|
6828 | if (!matches) {
|
6829 | this._resumePageIdx = pageIdx;
|
6830 | break;
|
6831 | }
|
6832 | } while (!this.#matchesReady(matches));
|
6833 | }
|
6834 | #advanceOffsetPage(previous) {
|
6835 | const offset = this._offset;
|
6836 | const numPages = this._linkService.pagesCount;
|
6837 | offset.pageIdx = previous ? offset.pageIdx - 1 : offset.pageIdx + 1;
|
6838 | offset.matchIdx = null;
|
6839 | this._pagesToSearch--;
|
6840 | if (offset.pageIdx >= numPages || offset.pageIdx < 0) {
|
6841 | offset.pageIdx = previous ? numPages - 1 : 0;
|
6842 | offset.wrapped = true;
|
6843 | }
|
6844 | }
|
6845 | #updateMatch() {
|
6846 | let found = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
6847 | let state = FindState.NOT_FOUND;
|
6848 | const wrapped = this._offset.wrapped;
|
6849 | this._offset.wrapped = false;
|
6850 | if (found) {
|
6851 | const previousPage = this._selected.pageIdx;
|
6852 | this._selected.pageIdx = this._offset.pageIdx;
|
6853 | this._selected.matchIdx = this._offset.matchIdx;
|
6854 | state = wrapped ? FindState.WRAPPED : FindState.FOUND;
|
6855 | if (previousPage !== -1 && previousPage !== this._selected.pageIdx) {
|
6856 | this.#updatePage(previousPage);
|
6857 | }
|
6858 | }
|
6859 | this.#updateUIState(state, this.#state.findPrevious);
|
6860 | if (this._selected.pageIdx !== -1) {
|
6861 | this._scrollMatches = true;
|
6862 | this.#updatePage(this._selected.pageIdx);
|
6863 | }
|
6864 | }
|
6865 | #onFindBarClose(evt) {
|
6866 | const pdfDocument = this._pdfDocument;
|
6867 | this._firstPageCapability.promise.then(() => {
|
6868 | if (!this._pdfDocument || pdfDocument && this._pdfDocument !== pdfDocument) {
|
6869 | return;
|
6870 | }
|
6871 | if (this._findTimeout) {
|
6872 | clearTimeout(this._findTimeout);
|
6873 | this._findTimeout = null;
|
6874 | }
|
6875 | if (this._resumePageIdx) {
|
6876 | this._resumePageIdx = null;
|
6877 | this._dirtyMatch = true;
|
6878 | }
|
6879 | this.#updateUIState(FindState.FOUND);
|
6880 | this._highlightMatches = false;
|
6881 | this.#updateAllPages();
|
6882 | });
|
6883 | }
|
6884 | #requestMatchesCount() {
|
6885 | const {
|
6886 | pageIdx,
|
6887 | matchIdx
|
6888 | } = this._selected;
|
6889 | let current = 0,
|
6890 | total = this._matchesCountTotal;
|
6891 | if (matchIdx !== -1) {
|
6892 | for (let i = 0; i < pageIdx; i++) {
|
6893 | current += this._pageMatches[i]?.length || 0;
|
6894 | }
|
6895 | current += matchIdx + 1;
|
6896 | }
|
6897 | if (current < 1 || current > total) {
|
6898 | current = total = 0;
|
6899 | }
|
6900 | return {
|
6901 | current,
|
6902 | total
|
6903 | };
|
6904 | }
|
6905 | #updateUIResultsCount() {
|
6906 | this._eventBus.dispatch("updatefindmatchescount", {
|
6907 | source: this,
|
6908 | matchesCount: this.#requestMatchesCount()
|
6909 | });
|
6910 | }
|
6911 | #updateUIState(state) {
|
6912 | let previous = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
6913 | if (!this.#updateMatchesCountOnProgress && (this.#visitedPagesCount !== this._linkService.pagesCount || state === FindState.PENDING)) {
|
6914 | return;
|
6915 | }
|
6916 | this._eventBus.dispatch("updatefindcontrolstate", {
|
6917 | source: this,
|
6918 | state,
|
6919 | previous,
|
6920 | matchesCount: this.#requestMatchesCount(),
|
6921 | rawQuery: this.#state?.query ?? null
|
6922 | });
|
6923 | }
|
6924 | }
|
6925 |
|
6926 |
|
6927 | /***/ }),
|
6928 |
|
6929 | /***/ 8543:
|
6930 | /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
6931 |
|
6932 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
6933 | /* harmony export */ PDFHistory: () => (/* binding */ PDFHistory)
|
6934 | /* harmony export */ });
|
6935 | /* unused harmony exports isDestArraysEqual, isDestHashesEqual */
|
6936 | /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
|
6937 | /* harmony import */ var _event_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5656);
|
6938 |
|
6939 |
|
6940 | const HASH_CHANGE_TIMEOUT = 1000;
|
6941 | const POSITION_UPDATED_THRESHOLD = 50;
|
6942 | const UPDATE_VIEWAREA_TIMEOUT = 1000;
|
6943 | function getCurrentHash() {
|
6944 | return document.location.hash;
|
6945 | }
|
6946 | class PDFHistory {
|
6947 | constructor(_ref) {
|
6948 | let {
|
6949 | linkService,
|
6950 | eventBus
|
6951 | } = _ref;
|
6952 | this.linkService = linkService;
|
6953 | this.eventBus = eventBus;
|
6954 | this._initialized = false;
|
6955 | this._fingerprint = "";
|
6956 | this.reset();
|
6957 | this._boundEvents = null;
|
6958 | this.eventBus._on("pagesinit", () => {
|
6959 | this._isPagesLoaded = false;
|
6960 | this.eventBus._on("pagesloaded", evt => {
|
6961 | this._isPagesLoaded = !!evt.pagesCount;
|
6962 | }, {
|
6963 | once: true
|
6964 | });
|
6965 | });
|
6966 | }
|
6967 | initialize(_ref2) {
|
6968 | let {
|
6969 | fingerprint,
|
6970 | resetHistory = false,
|
6971 | updateUrl = false
|
6972 | } = _ref2;
|
6973 | if (!fingerprint || typeof fingerprint !== "string") {
|
6974 | console.error('PDFHistory.initialize: The "fingerprint" must be a non-empty string.');
|
6975 | return;
|
6976 | }
|
6977 | if (this._initialized) {
|
6978 | this.reset();
|
6979 | }
|
6980 | const reInitialized = this._fingerprint !== "" && this._fingerprint !== fingerprint;
|
6981 | this._fingerprint = fingerprint;
|
6982 | this._updateUrl = updateUrl === true;
|
6983 | this._initialized = true;
|
6984 | this._bindEvents();
|
6985 | const state = window.history.state;
|
6986 | this._popStateInProgress = false;
|
6987 | this._blockHashChange = 0;
|
6988 | this._currentHash = getCurrentHash();
|
6989 | this._numPositionUpdates = 0;
|
6990 | this._uid = this._maxUid = 0;
|
6991 | this._destination = null;
|
6992 | this._position = null;
|
6993 | if (!this._isValidState(state, true) || resetHistory) {
|
6994 | const {
|
6995 | hash,
|
6996 | page,
|
6997 | rotation
|
6998 | } = this._parseCurrentHash(true);
|
6999 | if (!hash || reInitialized || resetHistory) {
|
7000 | this._pushOrReplaceState(null, true);
|
7001 | return;
|
7002 | }
|
7003 | this._pushOrReplaceState({
|
7004 | hash,
|
7005 | page,
|
7006 | rotation
|
7007 | }, true);
|
7008 | return;
|
7009 | }
|
7010 | const destination = state.destination;
|
7011 | this._updateInternalState(destination, state.uid, true);
|
7012 | if (destination.rotation !== undefined) {
|
7013 | this._initialRotation = destination.rotation;
|
7014 | }
|
7015 | if (destination.dest) {
|
7016 | this._initialBookmark = JSON.stringify(destination.dest);
|
7017 | this._destination.page = null;
|
7018 | } else if (destination.hash) {
|
7019 | this._initialBookmark = destination.hash;
|
7020 | } else if (destination.page) {
|
7021 | this._initialBookmark = `page=${destination.page}`;
|
7022 | }
|
7023 | }
|
7024 | reset() {
|
7025 | if (this._initialized) {
|
7026 | this._pageHide();
|
7027 | this._initialized = false;
|
7028 | this._unbindEvents();
|
7029 | }
|
7030 | if (this._updateViewareaTimeout) {
|
7031 | clearTimeout(this._updateViewareaTimeout);
|
7032 | this._updateViewareaTimeout = null;
|
7033 | }
|
7034 | this._initialBookmark = null;
|
7035 | this._initialRotation = null;
|
7036 | }
|
7037 | push(_ref3) {
|
7038 | let {
|
7039 | namedDest = null,
|
7040 | explicitDest,
|
7041 | pageNumber
|
7042 | } = _ref3;
|
7043 | if (!this._initialized) {
|
7044 | return;
|
7045 | }
|
7046 | if (namedDest && typeof namedDest !== "string") {
|
7047 | console.error("PDFHistory.push: " + `"${namedDest}" is not a valid namedDest parameter.`);
|
7048 | return;
|
7049 | } else if (!Array.isArray(explicitDest)) {
|
7050 | console.error("PDFHistory.push: " + `"${explicitDest}" is not a valid explicitDest parameter.`);
|
7051 | return;
|
7052 | } else if (!this._isValidPage(pageNumber)) {
|
7053 | if (pageNumber !== null || this._destination) {
|
7054 | console.error("PDFHistory.push: " + `"${pageNumber}" is not a valid pageNumber parameter.`);
|
7055 | return;
|
7056 | }
|
7057 | }
|
7058 | const hash = namedDest || JSON.stringify(explicitDest);
|
7059 | if (!hash) {
|
7060 | return;
|
7061 | }
|
7062 | let forceReplace = false;
|
7063 | if (this._destination && (isDestHashesEqual(this._destination.hash, hash) || isDestArraysEqual(this._destination.dest, explicitDest))) {
|
7064 | if (this._destination.page) {
|
7065 | return;
|
7066 | }
|
7067 | forceReplace = true;
|
7068 | }
|
7069 | if (this._popStateInProgress && !forceReplace) {
|
7070 | return;
|
7071 | }
|
7072 | this._pushOrReplaceState({
|
7073 | dest: explicitDest,
|
7074 | hash,
|
7075 | page: pageNumber,
|
7076 | rotation: this.linkService.rotation
|
7077 | }, forceReplace);
|
7078 | if (!this._popStateInProgress) {
|
7079 | this._popStateInProgress = true;
|
7080 | Promise.resolve().then(() => {
|
7081 | this._popStateInProgress = false;
|
7082 | });
|
7083 | }
|
7084 | }
|
7085 | pushPage(pageNumber) {
|
7086 | if (!this._initialized) {
|
7087 | return;
|
7088 | }
|
7089 | if (!this._isValidPage(pageNumber)) {
|
7090 | console.error(`PDFHistory.pushPage: "${pageNumber}" is not a valid page number.`);
|
7091 | return;
|
7092 | }
|
7093 | if (this._destination?.page === pageNumber) {
|
7094 | return;
|
7095 | }
|
7096 | if (this._popStateInProgress) {
|
7097 | return;
|
7098 | }
|
7099 | this._pushOrReplaceState({
|
7100 | dest: null,
|
7101 | hash: `page=${pageNumber}`,
|
7102 | page: pageNumber,
|
7103 | rotation: this.linkService.rotation
|
7104 | });
|
7105 | if (!this._popStateInProgress) {
|
7106 | this._popStateInProgress = true;
|
7107 | Promise.resolve().then(() => {
|
7108 | this._popStateInProgress = false;
|
7109 | });
|
7110 | }
|
7111 | }
|
7112 | pushCurrentPosition() {
|
7113 | if (!this._initialized || this._popStateInProgress) {
|
7114 | return;
|
7115 | }
|
7116 | this._tryPushCurrentPosition();
|
7117 | }
|
7118 | back() {
|
7119 | if (!this._initialized || this._popStateInProgress) {
|
7120 | return;
|
7121 | }
|
7122 | const state = window.history.state;
|
7123 | if (this._isValidState(state) && state.uid > 0) {
|
7124 | window.history.back();
|
7125 | }
|
7126 | }
|
7127 | forward() {
|
7128 | if (!this._initialized || this._popStateInProgress) {
|
7129 | return;
|
7130 | }
|
7131 | const state = window.history.state;
|
7132 | if (this._isValidState(state) && state.uid < this._maxUid) {
|
7133 | window.history.forward();
|
7134 | }
|
7135 | }
|
7136 | get popStateInProgress() {
|
7137 | return this._initialized && (this._popStateInProgress || this._blockHashChange > 0);
|
7138 | }
|
7139 | get initialBookmark() {
|
7140 | return this._initialized ? this._initialBookmark : null;
|
7141 | }
|
7142 | get initialRotation() {
|
7143 | return this._initialized ? this._initialRotation : null;
|
7144 | }
|
7145 | _pushOrReplaceState(destination) {
|
7146 | let forceReplace = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
7147 | const shouldReplace = forceReplace || !this._destination;
|
7148 | const newState = {
|
7149 | fingerprint: this._fingerprint,
|
7150 | uid: shouldReplace ? this._uid : this._uid + 1,
|
7151 | destination
|
7152 | };
|
7153 | this._updateInternalState(destination, newState.uid);
|
7154 | let newUrl;
|
7155 | if (this._updateUrl && destination?.hash) {
|
7156 | const baseUrl = document.location.href.split("#", 1)[0];
|
7157 | if (!baseUrl.startsWith("file://")) {
|
7158 | newUrl = `${baseUrl}#${destination.hash}`;
|
7159 | }
|
7160 | }
|
7161 | if (shouldReplace) {
|
7162 | window.history.replaceState(newState, "", newUrl);
|
7163 | } else {
|
7164 | window.history.pushState(newState, "", newUrl);
|
7165 | }
|
7166 | }
|
7167 | _tryPushCurrentPosition() {
|
7168 | let temporary = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
7169 | if (!this._position) {
|
7170 | return;
|
7171 | }
|
7172 | let position = this._position;
|
7173 | if (temporary) {
|
7174 | position = Object.assign(Object.create(null), this._position);
|
7175 | position.temporary = true;
|
7176 | }
|
7177 | if (!this._destination) {
|
7178 | this._pushOrReplaceState(position);
|
7179 | return;
|
7180 | }
|
7181 | if (this._destination.temporary) {
|
7182 | this._pushOrReplaceState(position, true);
|
7183 | return;
|
7184 | }
|
7185 | if (this._destination.hash === position.hash) {
|
7186 | return;
|
7187 | }
|
7188 | if (!this._destination.page && (POSITION_UPDATED_THRESHOLD <= 0 || this._numPositionUpdates <= POSITION_UPDATED_THRESHOLD)) {
|
7189 | return;
|
7190 | }
|
7191 | let forceReplace = false;
|
7192 | if (this._destination.page >= position.first && this._destination.page <= position.page) {
|
7193 | if (this._destination.dest !== undefined || !this._destination.first) {
|
7194 | return;
|
7195 | }
|
7196 | forceReplace = true;
|
7197 | }
|
7198 | this._pushOrReplaceState(position, forceReplace);
|
7199 | }
|
7200 | _isValidPage(val) {
|
7201 | return Number.isInteger(val) && val > 0 && val <= this.linkService.pagesCount;
|
7202 | }
|
7203 | _isValidState(state) {
|
7204 | let checkReload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
7205 | if (!state) {
|
7206 | return false;
|
7207 | }
|
7208 | if (state.fingerprint !== this._fingerprint) {
|
7209 | if (checkReload) {
|
7210 | if (typeof state.fingerprint !== "string" || state.fingerprint.length !== this._fingerprint.length) {
|
7211 | return false;
|
7212 | }
|
7213 | const [perfEntry] = performance.getEntriesByType("navigation");
|
7214 | if (perfEntry?.type !== "reload") {
|
7215 | return false;
|
7216 | }
|
7217 | } else {
|
7218 | return false;
|
7219 | }
|
7220 | }
|
7221 | if (!Number.isInteger(state.uid) || state.uid < 0) {
|
7222 | return false;
|
7223 | }
|
7224 | if (state.destination === null || typeof state.destination !== "object") {
|
7225 | return false;
|
7226 | }
|
7227 | return true;
|
7228 | }
|
7229 | _updateInternalState(destination, uid) {
|
7230 | let removeTemporary = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
7231 | if (this._updateViewareaTimeout) {
|
7232 | clearTimeout(this._updateViewareaTimeout);
|
7233 | this._updateViewareaTimeout = null;
|
7234 | }
|
7235 | if (removeTemporary && destination?.temporary) {
|
7236 | delete destination.temporary;
|
7237 | }
|
7238 | this._destination = destination;
|
7239 | this._uid = uid;
|
7240 | this._maxUid = Math.max(this._maxUid, uid);
|
7241 | this._numPositionUpdates = 0;
|
7242 | }
|
7243 | _parseCurrentHash() {
|
7244 | let checkNameddest = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
7245 | const hash = unescape(getCurrentHash()).substring(1);
|
7246 | const params = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.parseQueryString)(hash);
|
7247 | const nameddest = params.get("nameddest") || "";
|
7248 | let page = params.get("page") | 0;
|
7249 | if (!this._isValidPage(page) || checkNameddest && nameddest.length > 0) {
|
7250 | page = null;
|
7251 | }
|
7252 | return {
|
7253 | hash,
|
7254 | page,
|
7255 | rotation: this.linkService.rotation
|
7256 | };
|
7257 | }
|
7258 | _updateViewarea(_ref4) {
|
7259 | let {
|
7260 | location
|
7261 | } = _ref4;
|
7262 | if (this._updateViewareaTimeout) {
|
7263 | clearTimeout(this._updateViewareaTimeout);
|
7264 | this._updateViewareaTimeout = null;
|
7265 | }
|
7266 | this._position = {
|
7267 | hash: location.pdfOpenParams.substring(1),
|
7268 | page: this.linkService.page,
|
7269 | first: location.pageNumber,
|
7270 | rotation: location.rotation
|
7271 | };
|
7272 | if (this._popStateInProgress) {
|
7273 | return;
|
7274 | }
|
7275 | if (POSITION_UPDATED_THRESHOLD > 0 && this._isPagesLoaded && this._destination && !this._destination.page) {
|
7276 | this._numPositionUpdates++;
|
7277 | }
|
7278 | if (UPDATE_VIEWAREA_TIMEOUT > 0) {
|
7279 | this._updateViewareaTimeout = setTimeout(() => {
|
7280 | if (!this._popStateInProgress) {
|
7281 | this._tryPushCurrentPosition(true);
|
7282 | }
|
7283 | this._updateViewareaTimeout = null;
|
7284 | }, UPDATE_VIEWAREA_TIMEOUT);
|
7285 | }
|
7286 | }
|
7287 | _popState(_ref5) {
|
7288 | let {
|
7289 | state
|
7290 | } = _ref5;
|
7291 | const newHash = getCurrentHash(),
|
7292 | hashChanged = this._currentHash !== newHash;
|
7293 | this._currentHash = newHash;
|
7294 | if (!state) {
|
7295 | this._uid++;
|
7296 | const {
|
7297 | hash,
|
7298 | page,
|
7299 | rotation
|
7300 | } = this._parseCurrentHash();
|
7301 | this._pushOrReplaceState({
|
7302 | hash,
|
7303 | page,
|
7304 | rotation
|
7305 | }, true);
|
7306 | return;
|
7307 | }
|
7308 | if (!this._isValidState(state)) {
|
7309 | return;
|
7310 | }
|
7311 | this._popStateInProgress = true;
|
7312 | if (hashChanged) {
|
7313 | this._blockHashChange++;
|
7314 | (0,_event_utils_js__WEBPACK_IMPORTED_MODULE_1__.waitOnEventOrTimeout)({
|
7315 | target: window,
|
7316 | name: "hashchange",
|
7317 | delay: HASH_CHANGE_TIMEOUT
|
7318 | }).then(() => {
|
7319 | this._blockHashChange--;
|
7320 | });
|
7321 | }
|
7322 | const destination = state.destination;
|
7323 | this._updateInternalState(destination, state.uid, true);
|
7324 | if ((0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.isValidRotation)(destination.rotation)) {
|
7325 | this.linkService.rotation = destination.rotation;
|
7326 | }
|
7327 | if (destination.dest) {
|
7328 | this.linkService.goToDestination(destination.dest);
|
7329 | } else if (destination.hash) {
|
7330 | this.linkService.setHash(destination.hash);
|
7331 | } else if (destination.page) {
|
7332 | this.linkService.page = destination.page;
|
7333 | }
|
7334 | Promise.resolve().then(() => {
|
7335 | this._popStateInProgress = false;
|
7336 | });
|
7337 | }
|
7338 | _pageHide() {
|
7339 | if (!this._destination || this._destination.temporary) {
|
7340 | this._tryPushCurrentPosition();
|
7341 | }
|
7342 | }
|
7343 | _bindEvents() {
|
7344 | if (this._boundEvents) {
|
7345 | return;
|
7346 | }
|
7347 | this._boundEvents = {
|
7348 | updateViewarea: this._updateViewarea.bind(this),
|
7349 | popState: this._popState.bind(this),
|
7350 | pageHide: this._pageHide.bind(this)
|
7351 | };
|
7352 | this.eventBus._on("updateviewarea", this._boundEvents.updateViewarea);
|
7353 | window.addEventListener("popstate", this._boundEvents.popState);
|
7354 | window.addEventListener("pagehide", this._boundEvents.pageHide);
|
7355 | }
|
7356 | _unbindEvents() {
|
7357 | if (!this._boundEvents) {
|
7358 | return;
|
7359 | }
|
7360 | this.eventBus._off("updateviewarea", this._boundEvents.updateViewarea);
|
7361 | window.removeEventListener("popstate", this._boundEvents.popState);
|
7362 | window.removeEventListener("pagehide", this._boundEvents.pageHide);
|
7363 | this._boundEvents = null;
|
7364 | }
|
7365 | }
|
7366 | function isDestHashesEqual(destHash, pushHash) {
|
7367 | if (typeof destHash !== "string" || typeof pushHash !== "string") {
|
7368 | return false;
|
7369 | }
|
7370 | if (destHash === pushHash) {
|
7371 | return true;
|
7372 | }
|
7373 | const nameddest = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.parseQueryString)(destHash).get("nameddest");
|
7374 | if (nameddest === pushHash) {
|
7375 | return true;
|
7376 | }
|
7377 | return false;
|
7378 | }
|
7379 | function isDestArraysEqual(firstDest, secondDest) {
|
7380 | function isEntryEqual(first, second) {
|
7381 | if (typeof first !== typeof second) {
|
7382 | return false;
|
7383 | }
|
7384 | if (Array.isArray(first) || Array.isArray(second)) {
|
7385 | return false;
|
7386 | }
|
7387 | if (first !== null && typeof first === "object" && second !== null) {
|
7388 | if (Object.keys(first).length !== Object.keys(second).length) {
|
7389 | return false;
|
7390 | }
|
7391 | for (const key in first) {
|
7392 | if (!isEntryEqual(first[key], second[key])) {
|
7393 | return false;
|
7394 | }
|
7395 | }
|
7396 | return true;
|
7397 | }
|
7398 | return first === second || Number.isNaN(first) && Number.isNaN(second);
|
7399 | }
|
7400 | if (!(Array.isArray(firstDest) && Array.isArray(secondDest))) {
|
7401 | return false;
|
7402 | }
|
7403 | if (firstDest.length !== secondDest.length) {
|
7404 | return false;
|
7405 | }
|
7406 | for (let i = 0, ii = firstDest.length; i < ii; i++) {
|
7407 | if (!isEntryEqual(firstDest[i], secondDest[i])) {
|
7408 | return false;
|
7409 | }
|
7410 | }
|
7411 | return true;
|
7412 | }
|
7413 |
|
7414 |
|
7415 | /***/ }),
|
7416 |
|
7417 | /***/ 787:
|
7418 | /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
7419 |
|
7420 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
7421 | /* harmony export */ LinkTarget: () => (/* binding */ LinkTarget),
|
7422 | /* harmony export */ PDFLinkService: () => (/* binding */ PDFLinkService),
|
7423 | /* harmony export */ SimpleLinkService: () => (/* binding */ SimpleLinkService)
|
7424 | /* harmony export */ });
|
7425 | /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4114);
|
7426 | /* harmony import */ var core_js_modules_esnext_json_parse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(8335);
|
7427 | /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7256);
|
7428 |
|
7429 |
|
7430 |
|
7431 | const DEFAULT_LINK_REL = "noopener noreferrer nofollow";
|
7432 | const LinkTarget = {
|
7433 | NONE: 0,
|
7434 | SELF: 1,
|
7435 | BLANK: 2,
|
7436 | PARENT: 3,
|
7437 | TOP: 4
|
7438 | };
|
7439 | function addLinkAttributes(link) {
|
7440 | let {
|
7441 | url,
|
7442 | target,
|
7443 | rel,
|
7444 | enabled = true
|
7445 | } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
7446 | if (!url || typeof url !== "string") {
|
7447 | throw new Error('A valid "url" parameter must provided.');
|
7448 | }
|
7449 | if (enabled) {
|
7450 | link.href = link.title = url;
|
7451 | } else {
|
7452 | link.href = "";
|
7453 | link.title = `Disabled: ${url}`;
|
7454 | link.onclick = () => false;
|
7455 | }
|
7456 | let targetStr = "";
|
7457 | switch (target) {
|
7458 | case LinkTarget.NONE:
|
7459 | break;
|
7460 | case LinkTarget.SELF:
|
7461 | targetStr = "_self";
|
7462 | break;
|
7463 | case LinkTarget.BLANK:
|
7464 | targetStr = "_blank";
|
7465 | break;
|
7466 | case LinkTarget.PARENT:
|
7467 | targetStr = "_parent";
|
7468 | break;
|
7469 | case LinkTarget.TOP:
|
7470 | targetStr = "_top";
|
7471 | break;
|
7472 | }
|
7473 | link.target = targetStr;
|
7474 | link.rel = typeof rel === "string" ? rel : DEFAULT_LINK_REL;
|
7475 | }
|
7476 | class PDFLinkService {
|
7477 | #pagesRefCache = new Map();
|
7478 | constructor() {
|
7479 | let {
|
7480 | eventBus,
|
7481 | externalLinkTarget = null,
|
7482 | externalLinkRel = null,
|
7483 | ignoreDestinationZoom = false
|
7484 | } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
7485 | this.eventBus = eventBus;
|
7486 | this.externalLinkTarget = externalLinkTarget;
|
7487 | this.externalLinkRel = externalLinkRel;
|
7488 | this.externalLinkEnabled = true;
|
7489 | this._ignoreDestinationZoom = ignoreDestinationZoom;
|
7490 | this.baseUrl = null;
|
7491 | this.pdfDocument = null;
|
7492 | this.pdfViewer = null;
|
7493 | this.pdfHistory = null;
|
7494 | }
|
7495 | setDocument(pdfDocument) {
|
7496 | let baseUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
7497 | this.baseUrl = baseUrl;
|
7498 | this.pdfDocument = pdfDocument;
|
7499 | this.#pagesRefCache.clear();
|
7500 | }
|
7501 | setViewer(pdfViewer) {
|
7502 | this.pdfViewer = pdfViewer;
|
7503 | }
|
7504 | setHistory(pdfHistory) {
|
7505 | this.pdfHistory = pdfHistory;
|
7506 | }
|
7507 | get pagesCount() {
|
7508 | return this.pdfDocument ? this.pdfDocument.numPages : 0;
|
7509 | }
|
7510 | get page() {
|
7511 | return this.pdfViewer.currentPageNumber;
|
7512 | }
|
7513 | set page(value) {
|
7514 | this.pdfViewer.currentPageNumber = value;
|
7515 | }
|
7516 | get rotation() {
|
7517 | return this.pdfViewer.pagesRotation;
|
7518 | }
|
7519 | set rotation(value) {
|
7520 | this.pdfViewer.pagesRotation = value;
|
7521 | }
|
7522 | get isInPresentationMode() {
|
7523 | return this.pdfViewer.isInPresentationMode;
|
7524 | }
|
7525 | #goToDestinationHelper(rawDest) {
|
7526 | let namedDest = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
7527 | let explicitDest = arguments.length > 2 ? arguments[2] : undefined;
|
7528 | const destRef = explicitDest[0];
|
7529 | let pageNumber;
|
7530 | if (typeof destRef === "object" && destRef !== null) {
|
7531 | pageNumber = this._cachedPageNumber(destRef);
|
7532 | if (!pageNumber) {
|
7533 | this.pdfDocument.getPageIndex(destRef).then(pageIndex => {
|
7534 | this.cachePageRef(pageIndex + 1, destRef);
|
7535 | this.#goToDestinationHelper(rawDest, namedDest, explicitDest);
|
7536 | }).catch(() => {
|
7537 | console.error(`PDFLinkService.#goToDestinationHelper: "${destRef}" is not ` + `a valid page reference, for dest="${rawDest}".`);
|
7538 | });
|
7539 | return;
|
7540 | }
|
7541 | } else if (Number.isInteger(destRef)) {
|
7542 | pageNumber = destRef + 1;
|
7543 | } else {
|
7544 | console.error(`PDFLinkService.#goToDestinationHelper: "${destRef}" is not ` + `a valid destination reference, for dest="${rawDest}".`);
|
7545 | return;
|
7546 | }
|
7547 | if (!pageNumber || pageNumber < 1 || pageNumber > this.pagesCount) {
|
7548 | console.error(`PDFLinkService.#goToDestinationHelper: "${pageNumber}" is not ` + `a valid page number, for dest="${rawDest}".`);
|
7549 | return;
|
7550 | }
|
7551 | if (this.pdfHistory) {
|
7552 | this.pdfHistory.pushCurrentPosition();
|
7553 | this.pdfHistory.push({
|
7554 | namedDest,
|
7555 | explicitDest,
|
7556 | pageNumber
|
7557 | });
|
7558 | }
|
7559 | this.pdfViewer.scrollPageIntoView({
|
7560 | pageNumber,
|
7561 | destArray: explicitDest,
|
7562 | ignoreDestinationZoom: this._ignoreDestinationZoom
|
7563 | });
|
7564 | }
|
7565 | async goToDestination(dest) {
|
7566 | if (!this.pdfDocument) {
|
7567 | return;
|
7568 | }
|
7569 | let namedDest, explicitDest;
|
7570 | if (typeof dest === "string") {
|
7571 | namedDest = dest;
|
7572 | explicitDest = await this.pdfDocument.getDestination(dest);
|
7573 | } else {
|
7574 | namedDest = null;
|
7575 | explicitDest = await dest;
|
7576 | }
|
7577 | if (!Array.isArray(explicitDest)) {
|
7578 | console.error(`PDFLinkService.goToDestination: "${explicitDest}" is not ` + `a valid destination array, for dest="${dest}".`);
|
7579 | return;
|
7580 | }
|
7581 | this.#goToDestinationHelper(dest, namedDest, explicitDest);
|
7582 | }
|
7583 | goToPage(val) {
|
7584 | if (!this.pdfDocument) {
|
7585 | return;
|
7586 | }
|
7587 | const pageNumber = typeof val === "string" && this.pdfViewer.pageLabelToPageNumber(val) || val | 0;
|
7588 | if (!(Number.isInteger(pageNumber) && pageNumber > 0 && pageNumber <= this.pagesCount)) {
|
7589 | console.error(`PDFLinkService.goToPage: "${val}" is not a valid page.`);
|
7590 | return;
|
7591 | }
|
7592 | if (this.pdfHistory) {
|
7593 | this.pdfHistory.pushCurrentPosition();
|
7594 | this.pdfHistory.pushPage(pageNumber);
|
7595 | }
|
7596 | this.pdfViewer.scrollPageIntoView({
|
7597 | pageNumber
|
7598 | });
|
7599 | }
|
7600 | addLinkAttributes(link, url) {
|
7601 | let newWindow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
7602 | addLinkAttributes(link, {
|
7603 | url,
|
7604 | target: newWindow ? LinkTarget.BLANK : this.externalLinkTarget,
|
7605 | rel: this.externalLinkRel,
|
7606 | enabled: this.externalLinkEnabled
|
7607 | });
|
7608 | }
|
7609 | getDestinationHash(dest) {
|
7610 | if (typeof dest === "string") {
|
7611 | if (dest.length > 0) {
|
7612 | return this.getAnchorUrl("#" + escape(dest));
|
7613 | }
|
7614 | } else if (Array.isArray(dest)) {
|
7615 | const str = JSON.stringify(dest);
|
7616 | if (str.length > 0) {
|
7617 | return this.getAnchorUrl("#" + escape(str));
|
7618 | }
|
7619 | }
|
7620 | return this.getAnchorUrl("");
|
7621 | }
|
7622 | getAnchorUrl(anchor) {
|
7623 | return this.baseUrl ? this.baseUrl + anchor : anchor;
|
7624 | }
|
7625 | setHash(hash) {
|
7626 | if (!this.pdfDocument) {
|
7627 | return;
|
7628 | }
|
7629 | let pageNumber, dest;
|
7630 | if (hash.includes("=")) {
|
7631 | const params = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.parseQueryString)(hash);
|
7632 | if (params.has("search")) {
|
7633 | const query = params.get("search").replaceAll('"', ""),
|
7634 | phrase = params.get("phrase") === "true";
|
7635 | this.eventBus.dispatch("findfromurlhash", {
|
7636 | source: this,
|
7637 | query: phrase ? query : query.match(/\S+/g)
|
7638 | });
|
7639 | }
|
7640 | if (params.has("page")) {
|
7641 | pageNumber = params.get("page") | 0 || 1;
|
7642 | }
|
7643 | if (params.has("zoom")) {
|
7644 | const zoomArgs = params.get("zoom").split(",");
|
7645 | const zoomArg = zoomArgs[0];
|
7646 | const zoomArgNumber = parseFloat(zoomArg);
|
7647 | if (!zoomArg.includes("Fit")) {
|
7648 | dest = [null, {
|
7649 | name: "XYZ"
|
7650 | }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null, zoomArgs.length > 2 ? zoomArgs[2] | 0 : null, zoomArgNumber ? zoomArgNumber / 100 : zoomArg];
|
7651 | } else if (zoomArg === "Fit" || zoomArg === "FitB") {
|
7652 | dest = [null, {
|
7653 | name: zoomArg
|
7654 | }];
|
7655 | } else if (zoomArg === "FitH" || zoomArg === "FitBH" || zoomArg === "FitV" || zoomArg === "FitBV") {
|
7656 | dest = [null, {
|
7657 | name: zoomArg
|
7658 | }, zoomArgs.length > 1 ? zoomArgs[1] | 0 : null];
|
7659 | } else if (zoomArg === "FitR") {
|
7660 | if (zoomArgs.length !== 5) {
|
7661 | console.error('PDFLinkService.setHash: Not enough parameters for "FitR".');
|
7662 | } else {
|
7663 | dest = [null, {
|
7664 | name: zoomArg
|
7665 | }, zoomArgs[1] | 0, zoomArgs[2] | 0, zoomArgs[3] | 0, zoomArgs[4] | 0];
|
7666 | }
|
7667 | } else {
|
7668 | console.error(`PDFLinkService.setHash: "${zoomArg}" is not a valid zoom value.`);
|
7669 | }
|
7670 | }
|
7671 | if (dest) {
|
7672 | this.pdfViewer.scrollPageIntoView({
|
7673 | pageNumber: pageNumber || this.page,
|
7674 | destArray: dest,
|
7675 | allowNegativeOffset: true
|
7676 | });
|
7677 | } else if (pageNumber) {
|
7678 | this.page = pageNumber;
|
7679 | }
|
7680 | if (params.has("pagemode")) {
|
7681 | this.eventBus.dispatch("pagemode", {
|
7682 | source: this,
|
7683 | mode: params.get("pagemode")
|
7684 | });
|
7685 | }
|
7686 | if (params.has("nameddest")) {
|
7687 | this.goToDestination(params.get("nameddest"));
|
7688 | }
|
7689 | return;
|
7690 | }
|
7691 | dest = unescape(hash);
|
7692 | try {
|
7693 | dest = JSON.parse(dest);
|
7694 | if (!Array.isArray(dest)) {
|
7695 | dest = dest.toString();
|
7696 | }
|
7697 | } catch {}
|
7698 | if (typeof dest === "string" || PDFLinkService.#isValidExplicitDestination(dest)) {
|
7699 | this.goToDestination(dest);
|
7700 | return;
|
7701 | }
|
7702 | console.error(`PDFLinkService.setHash: "${unescape(hash)}" is not a valid destination.`);
|
7703 | }
|
7704 | executeNamedAction(action) {
|
7705 | switch (action) {
|
7706 | case "GoBack":
|
7707 | this.pdfHistory?.back();
|
7708 | break;
|
7709 | case "GoForward":
|
7710 | this.pdfHistory?.forward();
|
7711 | break;
|
7712 | case "NextPage":
|
7713 | this.pdfViewer.nextPage();
|
7714 | break;
|
7715 | case "PrevPage":
|
7716 | this.pdfViewer.previousPage();
|
7717 | break;
|
7718 | case "LastPage":
|
7719 | this.page = this.pagesCount;
|
7720 | break;
|
7721 | case "FirstPage":
|
7722 | this.page = 1;
|
7723 | break;
|
7724 | default:
|
7725 | break;
|
7726 | }
|
7727 | this.eventBus.dispatch("namedaction", {
|
7728 | source: this,
|
7729 | action
|
7730 | });
|
7731 | }
|
7732 | async executeSetOCGState(action) {
|
7733 | const pdfDocument = this.pdfDocument;
|
7734 | const optionalContentConfig = await this.pdfViewer.optionalContentConfigPromise;
|
7735 | if (pdfDocument !== this.pdfDocument) {
|
7736 | return;
|
7737 | }
|
7738 | optionalContentConfig.setOCGState(action);
|
7739 | this.pdfViewer.optionalContentConfigPromise = Promise.resolve(optionalContentConfig);
|
7740 | }
|
7741 | cachePageRef(pageNum, pageRef) {
|
7742 | if (!pageRef) {
|
7743 | return;
|
7744 | }
|
7745 | const refStr = pageRef.gen === 0 ? `${pageRef.num}R` : `${pageRef.num}R${pageRef.gen}`;
|
7746 | this.#pagesRefCache.set(refStr, pageNum);
|
7747 | }
|
7748 | _cachedPageNumber(pageRef) {
|
7749 | if (!pageRef) {
|
7750 | return null;
|
7751 | }
|
7752 | const refStr = pageRef.gen === 0 ? `${pageRef.num}R` : `${pageRef.num}R${pageRef.gen}`;
|
7753 | return this.#pagesRefCache.get(refStr) || null;
|
7754 | }
|
7755 | static #isValidExplicitDestination(dest) {
|
7756 | if (!Array.isArray(dest)) {
|
7757 | return false;
|
7758 | }
|
7759 | const destLength = dest.length;
|
7760 | if (destLength < 2) {
|
7761 | return false;
|
7762 | }
|
7763 | const page = dest[0];
|
7764 | if (!(typeof page === "object" && Number.isInteger(page.num) && Number.isInteger(page.gen)) && !(Number.isInteger(page) && page >= 0)) {
|
7765 | return false;
|
7766 | }
|
7767 | const zoom = dest[1];
|
7768 | if (!(typeof zoom === "object" && typeof zoom.name === "string")) {
|
7769 | return false;
|
7770 | }
|
7771 | let allowNull = true;
|
7772 | switch (zoom.name) {
|
7773 | case "XYZ":
|
7774 | if (destLength !== 5) {
|
7775 | return false;
|
7776 | }
|
7777 | break;
|
7778 | case "Fit":
|
7779 | case "FitB":
|
7780 | return destLength === 2;
|
7781 | case "FitH":
|
7782 | case "FitBH":
|
7783 | case "FitV":
|
7784 | case "FitBV":
|
7785 | if (destLength !== 3) {
|
7786 | return false;
|
7787 | }
|
7788 | break;
|
7789 | case "FitR":
|
7790 | if (destLength !== 6) {
|
7791 | return false;
|
7792 | }
|
7793 | allowNull = false;
|
7794 | break;
|
7795 | default:
|
7796 | return false;
|
7797 | }
|
7798 | for (let i = 2; i < destLength; i++) {
|
7799 | const param = dest[i];
|
7800 | if (!(typeof param === "number" || allowNull && param === null)) {
|
7801 | return false;
|
7802 | }
|
7803 | }
|
7804 | return true;
|
7805 | }
|
7806 | }
|
7807 | class SimpleLinkService {
|
7808 | constructor() {
|
7809 | this.externalLinkEnabled = true;
|
7810 | }
|
7811 | get pagesCount() {
|
7812 | return 0;
|
7813 | }
|
7814 | get page() {
|
7815 | return 0;
|
7816 | }
|
7817 | set page(value) {}
|
7818 | get rotation() {
|
7819 | return 0;
|
7820 | }
|
7821 | set rotation(value) {}
|
7822 | get isInPresentationMode() {
|
7823 | return false;
|
7824 | }
|
7825 | async goToDestination(dest) {}
|
7826 | goToPage(val) {}
|
7827 | addLinkAttributes(link, url) {
|
7828 | let newWindow = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
7829 | addLinkAttributes(link, {
|
7830 | url,
|
7831 | enabled: this.externalLinkEnabled
|
7832 | });
|
7833 | }
|
7834 | getDestinationHash(dest) {
|
7835 | return "#";
|
7836 | }
|
7837 | getAnchorUrl(hash) {
|
7838 | return "#";
|
7839 | }
|
7840 | setHash(hash) {}
|
7841 | executeNamedAction(action) {}
|
7842 | executeSetOCGState(action) {}
|
7843 | cachePageRef(pageNum, pageRef) {}
|
7844 | }
|
7845 |
|
7846 |
|
7847 | /***/ }),
|
7848 |
|
7849 | /***/ 9966:
|
7850 | /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
|
7851 |
|
7852 | __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
7853 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
7854 | /* harmony export */ PDFPageView: () => (/* binding */ PDFPageView)
|
7855 | /* harmony export */ });
|
7856 | /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4114);
|
7857 | /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2603);
|
7858 | /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7256);
|
7859 | /* harmony import */ var _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2664);
|
7860 | /* harmony import */ var _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(2707);
|
7861 | /* harmony import */ var _app_options_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9840);
|
7862 | /* harmony import */ var _draw_layer_builder_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(3088);
|
7863 | /* harmony import */ var web_null_l10n__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(410);
|
7864 | /* harmony import */ var _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(787);
|
7865 | /* harmony import */ var _struct_tree_layer_builder_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(6698);
|
7866 | /* harmony import */ var _text_accessibility_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(5860);
|
7867 | /* harmony import */ var _text_highlighter_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(2027);
|
7868 | /* harmony import */ var _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(7765);
|
7869 | /* harmony import */ var _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(2973);
|
7870 | var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__, _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__, _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_4__, _draw_layer_builder_js__WEBPACK_IMPORTED_MODULE_6__, web_null_l10n__WEBPACK_IMPORTED_MODULE_7__, _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_12__, _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_13__]);
|
7871 | ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__, _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__, _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_4__, _draw_layer_builder_js__WEBPACK_IMPORTED_MODULE_6__, web_null_l10n__WEBPACK_IMPORTED_MODULE_7__, _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_12__, _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_13__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
7872 |
|
7873 |
|
7874 |
|
7875 |
|
7876 |
|
7877 |
|
7878 |
|
7879 |
|
7880 |
|
7881 |
|
7882 |
|
7883 |
|
7884 |
|
7885 |
|
7886 | const DEFAULT_LAYER_PROPERTIES = {
|
7887 | annotationEditorUIManager: null,
|
7888 | annotationStorage: null,
|
7889 | downloadManager: null,
|
7890 | enableScripting: false,
|
7891 | fieldObjectsPromise: null,
|
7892 | findController: null,
|
7893 | hasJSActionsPromise: null,
|
7894 | get linkService() {
|
7895 | return new _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_8__.SimpleLinkService();
|
7896 | }
|
7897 | };
|
7898 | const LAYERS_ORDER = new Map([["canvasWrapper", 0], ["textLayer", 1], ["annotationLayer", 2], ["annotationEditorLayer", 3], ["xfaLayer", 3]]);
|
7899 | class PDFPageView {
|
7900 | #annotationMode = pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.AnnotationMode.ENABLE_FORMS;
|
7901 | #hasRestrictedScaling = false;
|
7902 | #layerProperties = null;
|
7903 | #loadingId = null;
|
7904 | #previousRotation = null;
|
7905 | #renderError = null;
|
7906 | #renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.INITIAL;
|
7907 | #textLayerMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.TextLayerMode.ENABLE;
|
7908 | #useThumbnailCanvas = {
|
7909 | directDrawing: true,
|
7910 | initialOptionalContent: true,
|
7911 | regularAnnotations: true
|
7912 | };
|
7913 | #viewportMap = new WeakMap();
|
7914 | #layers = [null, null, null, null];
|
7915 | constructor(options) {
|
7916 | const container = options.container;
|
7917 | const defaultViewport = options.defaultViewport;
|
7918 | this.id = options.id;
|
7919 | this.renderingId = "page" + this.id;
|
7920 | this.#layerProperties = options.layerProperties || DEFAULT_LAYER_PROPERTIES;
|
7921 | this.pdfPage = null;
|
7922 | this.pageLabel = null;
|
7923 | this.rotation = 0;
|
7924 | this.scale = options.scale || _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.DEFAULT_SCALE;
|
7925 | this.viewport = defaultViewport;
|
7926 | this.pdfPageRotate = defaultViewport.rotation;
|
7927 | this._optionalContentConfigPromise = options.optionalContentConfigPromise || null;
|
7928 | this.#textLayerMode = options.textLayerMode ?? _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.TextLayerMode.ENABLE;
|
7929 | this.#annotationMode = options.annotationMode ?? pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.AnnotationMode.ENABLE_FORMS;
|
7930 | this.imageResourcesPath = options.imageResourcesPath || "";
|
7931 | this.maxCanvasPixels = options.maxCanvasPixels ?? _app_options_js__WEBPACK_IMPORTED_MODULE_5__.AppOptions.get("maxCanvasPixels");
|
7932 | this.pageColors = options.pageColors || null;
|
7933 | this.eventBus = options.eventBus;
|
7934 | this.renderingQueue = options.renderingQueue;
|
7935 | this.l10n = options.l10n;
|
7936 | this.l10n ||= new web_null_l10n__WEBPACK_IMPORTED_MODULE_7__.GenericL10n();
|
7937 | this.renderTask = null;
|
7938 | this.resume = null;
|
7939 | this._isStandalone = !this.renderingQueue?.hasViewer();
|
7940 | this._container = container;
|
7941 | this._annotationCanvasMap = null;
|
7942 | this.annotationLayer = null;
|
7943 | this.annotationEditorLayer = null;
|
7944 | this.textLayer = null;
|
7945 | this.zoomLayer = null;
|
7946 | this.xfaLayer = null;
|
7947 | this.structTreeLayer = null;
|
7948 | this.drawLayer = null;
|
7949 | const div = document.createElement("div");
|
7950 | div.className = "page";
|
7951 | div.setAttribute("data-page-number", this.id);
|
7952 | div.setAttribute("role", "region");
|
7953 | div.setAttribute("data-l10n-id", "pdfjs-page-landmark");
|
7954 | div.setAttribute("data-l10n-args", JSON.stringify({
|
7955 | page: this.id
|
7956 | }));
|
7957 | this.div = div;
|
7958 | this.#setDimensions();
|
7959 | container?.append(div);
|
7960 | if (this._isStandalone) {
|
7961 | container?.style.setProperty("--scale-factor", this.scale * pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.PixelsPerInch.PDF_TO_CSS_UNITS);
|
7962 | const {
|
7963 | optionalContentConfigPromise
|
7964 | } = options;
|
7965 | if (optionalContentConfigPromise) {
|
7966 | optionalContentConfigPromise.then(optionalContentConfig => {
|
7967 | if (optionalContentConfigPromise !== this._optionalContentConfigPromise) {
|
7968 | return;
|
7969 | }
|
7970 | this.#useThumbnailCanvas.initialOptionalContent = optionalContentConfig.hasInitialVisibility;
|
7971 | });
|
7972 | }
|
7973 | if (!options.l10n) {
|
7974 | this.l10n.translate(this.div);
|
7975 | }
|
7976 | }
|
7977 | }
|
7978 | #addLayer(div, name) {
|
7979 | const pos = LAYERS_ORDER.get(name);
|
7980 | const oldDiv = this.#layers[pos];
|
7981 | this.#layers[pos] = div;
|
7982 | if (oldDiv) {
|
7983 | oldDiv.replaceWith(div);
|
7984 | return;
|
7985 | }
|
7986 | for (let i = pos - 1; i >= 0; i--) {
|
7987 | const layer = this.#layers[i];
|
7988 | if (layer) {
|
7989 | layer.after(div);
|
7990 | return;
|
7991 | }
|
7992 | }
|
7993 | this.div.prepend(div);
|
7994 | }
|
7995 | get renderingState() {
|
7996 | return this.#renderingState;
|
7997 | }
|
7998 | set renderingState(state) {
|
7999 | if (state === this.#renderingState) {
|
8000 | return;
|
8001 | }
|
8002 | this.#renderingState = state;
|
8003 | if (this.#loadingId) {
|
8004 | clearTimeout(this.#loadingId);
|
8005 | this.#loadingId = null;
|
8006 | }
|
8007 | switch (state) {
|
8008 | case _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.PAUSED:
|
8009 | this.div.classList.remove("loading");
|
8010 | break;
|
8011 | case _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.RUNNING:
|
8012 | this.div.classList.add("loadingIcon");
|
8013 | this.#loadingId = setTimeout(() => {
|
8014 | this.div.classList.add("loading");
|
8015 | this.#loadingId = null;
|
8016 | }, 0);
|
8017 | break;
|
8018 | case _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.INITIAL:
|
8019 | case _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.FINISHED:
|
8020 | this.div.classList.remove("loadingIcon", "loading");
|
8021 | break;
|
8022 | }
|
8023 | }
|
8024 | #setDimensions() {
|
8025 | const {
|
8026 | viewport
|
8027 | } = this;
|
8028 | if (this.pdfPage) {
|
8029 | if (this.#previousRotation === viewport.rotation) {
|
8030 | return;
|
8031 | }
|
8032 | this.#previousRotation = viewport.rotation;
|
8033 | }
|
8034 | (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.setLayerDimensions)(this.div, viewport, true, false);
|
8035 | }
|
8036 | setPdfPage(pdfPage) {
|
8037 | if (this._isStandalone && (this.pageColors?.foreground === "CanvasText" || this.pageColors?.background === "Canvas")) {
|
8038 | this._container?.style.setProperty("--hcm-highlight-filter", pdfPage.filterFactory.addHighlightHCMFilter("highlight", "CanvasText", "Canvas", "HighlightText", "Highlight"));
|
8039 | this._container?.style.setProperty("--hcm-highlight-selected-filter", pdfPage.filterFactory.addHighlightHCMFilter("highlight_selected", "CanvasText", "Canvas", "HighlightText", "Highlight"));
|
8040 | }
|
8041 | this.pdfPage = pdfPage;
|
8042 | this.pdfPageRotate = pdfPage.rotate;
|
8043 | const totalRotation = (this.rotation + this.pdfPageRotate) % 360;
|
8044 | this.viewport = pdfPage.getViewport({
|
8045 | scale: this.scale * pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.PixelsPerInch.PDF_TO_CSS_UNITS,
|
8046 | rotation: totalRotation
|
8047 | });
|
8048 | this.#setDimensions();
|
8049 | this.reset();
|
8050 | }
|
8051 | destroy() {
|
8052 | this.reset();
|
8053 | this.pdfPage?.cleanup();
|
8054 | }
|
8055 | get _textHighlighter() {
|
8056 | return (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.shadow)(this, "_textHighlighter", new _text_highlighter_js__WEBPACK_IMPORTED_MODULE_11__.TextHighlighter({
|
8057 | pageIndex: this.id - 1,
|
8058 | eventBus: this.eventBus,
|
8059 | findController: this.#layerProperties.findController
|
8060 | }));
|
8061 | }
|
8062 | async #renderAnnotationLayer() {
|
8063 | let error = null;
|
8064 | try {
|
8065 | await this.annotationLayer.render(this.viewport, "display");
|
8066 | } catch (ex) {
|
8067 | console.error(`#renderAnnotationLayer: "${ex}".`);
|
8068 | error = ex;
|
8069 | } finally {
|
8070 | this.eventBus.dispatch("annotationlayerrendered", {
|
8071 | source: this,
|
8072 | pageNumber: this.id,
|
8073 | error
|
8074 | });
|
8075 | }
|
8076 | }
|
8077 | async #renderAnnotationEditorLayer() {
|
8078 | let error = null;
|
8079 | try {
|
8080 | await this.annotationEditorLayer.render(this.viewport, "display");
|
8081 | } catch (ex) {
|
8082 | console.error(`#renderAnnotationEditorLayer: "${ex}".`);
|
8083 | error = ex;
|
8084 | } finally {
|
8085 | this.eventBus.dispatch("annotationeditorlayerrendered", {
|
8086 | source: this,
|
8087 | pageNumber: this.id,
|
8088 | error
|
8089 | });
|
8090 | }
|
8091 | }
|
8092 | async #renderDrawLayer() {
|
8093 | try {
|
8094 | await this.drawLayer.render("display");
|
8095 | } catch (ex) {
|
8096 | console.error(`#renderDrawLayer: "${ex}".`);
|
8097 | }
|
8098 | }
|
8099 | async #renderXfaLayer() {
|
8100 | let error = null;
|
8101 | try {
|
8102 | const result = await this.xfaLayer.render(this.viewport, "display");
|
8103 | if (result?.textDivs && this._textHighlighter) {
|
8104 | this.#buildXfaTextContentItems(result.textDivs);
|
8105 | }
|
8106 | } catch (ex) {
|
8107 | console.error(`#renderXfaLayer: "${ex}".`);
|
8108 | error = ex;
|
8109 | } finally {
|
8110 | if (this.xfaLayer?.div) {
|
8111 | this.l10n.pause();
|
8112 | this.#addLayer(this.xfaLayer.div, "xfaLayer");
|
8113 | this.l10n.resume();
|
8114 | }
|
8115 | this.eventBus.dispatch("xfalayerrendered", {
|
8116 | source: this,
|
8117 | pageNumber: this.id,
|
8118 | error
|
8119 | });
|
8120 | }
|
8121 | }
|
8122 | async #renderTextLayer() {
|
8123 | const {
|
8124 | pdfPage,
|
8125 | textLayer,
|
8126 | viewport
|
8127 | } = this;
|
8128 | if (!textLayer) {
|
8129 | return;
|
8130 | }
|
8131 | let error = null;
|
8132 | try {
|
8133 | if (!textLayer.renderingDone) {
|
8134 | const readableStream = pdfPage.streamTextContent({
|
8135 | includeMarkedContent: true,
|
8136 | disableNormalization: true
|
8137 | });
|
8138 | textLayer.setTextContentSource(readableStream);
|
8139 | }
|
8140 | await textLayer.render(viewport);
|
8141 | } catch (ex) {
|
8142 | if (ex instanceof pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.AbortException) {
|
8143 | return;
|
8144 | }
|
8145 | console.error(`#renderTextLayer: "${ex}".`);
|
8146 | error = ex;
|
8147 | }
|
8148 | this.eventBus.dispatch("textlayerrendered", {
|
8149 | source: this,
|
8150 | pageNumber: this.id,
|
8151 | numTextDivs: textLayer.numTextDivs,
|
8152 | error
|
8153 | });
|
8154 | this.#renderStructTreeLayer();
|
8155 | }
|
8156 | async #renderStructTreeLayer() {
|
8157 | if (!this.textLayer) {
|
8158 | return;
|
8159 | }
|
8160 | this.structTreeLayer ||= new _struct_tree_layer_builder_js__WEBPACK_IMPORTED_MODULE_9__.StructTreeLayerBuilder();
|
8161 | const tree = await (!this.structTreeLayer.renderingDone ? this.pdfPage.getStructTree() : null);
|
8162 | const treeDom = this.structTreeLayer?.render(tree);
|
8163 | if (treeDom) {
|
8164 | this.l10n.pause();
|
8165 | this.canvas?.append(treeDom);
|
8166 | this.l10n.resume();
|
8167 | }
|
8168 | this.structTreeLayer?.show();
|
8169 | }
|
8170 | async #buildXfaTextContentItems(textDivs) {
|
8171 | const text = await this.pdfPage.getTextContent();
|
8172 | const items = [];
|
8173 | for (const item of text.items) {
|
8174 | items.push(item.str);
|
8175 | }
|
8176 | this._textHighlighter.setTextMapping(textDivs, items);
|
8177 | this._textHighlighter.enable();
|
8178 | }
|
8179 | _resetZoomLayer() {
|
8180 | let removeFromDOM = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
8181 | if (!this.zoomLayer) {
|
8182 | return;
|
8183 | }
|
8184 | const zoomLayerCanvas = this.zoomLayer.firstChild;
|
8185 | this.#viewportMap.delete(zoomLayerCanvas);
|
8186 | zoomLayerCanvas.width = 0;
|
8187 | zoomLayerCanvas.height = 0;
|
8188 | if (removeFromDOM) {
|
8189 | this.zoomLayer.remove();
|
8190 | }
|
8191 | this.zoomLayer = null;
|
8192 | }
|
8193 | reset() {
|
8194 | let {
|
8195 | keepZoomLayer = false,
|
8196 | keepAnnotationLayer = false,
|
8197 | keepAnnotationEditorLayer = false,
|
8198 | keepXfaLayer = false,
|
8199 | keepTextLayer = false
|
8200 | } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
8201 | this.cancelRendering({
|
8202 | keepAnnotationLayer,
|
8203 | keepAnnotationEditorLayer,
|
8204 | keepXfaLayer,
|
8205 | keepTextLayer
|
8206 | });
|
8207 | this.renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.INITIAL;
|
8208 | const div = this.div;
|
8209 | const childNodes = div.childNodes,
|
8210 | zoomLayerNode = keepZoomLayer && this.zoomLayer || null,
|
8211 | annotationLayerNode = keepAnnotationLayer && this.annotationLayer?.div || null,
|
8212 | annotationEditorLayerNode = keepAnnotationEditorLayer && this.annotationEditorLayer?.div || null,
|
8213 | xfaLayerNode = keepXfaLayer && this.xfaLayer?.div || null,
|
8214 | textLayerNode = keepTextLayer && this.textLayer?.div || null;
|
8215 | for (let i = childNodes.length - 1; i >= 0; i--) {
|
8216 | const node = childNodes[i];
|
8217 | switch (node) {
|
8218 | case zoomLayerNode:
|
8219 | case annotationLayerNode:
|
8220 | case annotationEditorLayerNode:
|
8221 | case xfaLayerNode:
|
8222 | case textLayerNode:
|
8223 | continue;
|
8224 | }
|
8225 | node.remove();
|
8226 | const layerIndex = this.#layers.indexOf(node);
|
8227 | if (layerIndex >= 0) {
|
8228 | this.#layers[layerIndex] = null;
|
8229 | }
|
8230 | }
|
8231 | div.removeAttribute("data-loaded");
|
8232 | if (annotationLayerNode) {
|
8233 | this.annotationLayer.hide();
|
8234 | }
|
8235 | if (annotationEditorLayerNode) {
|
8236 | this.annotationEditorLayer.hide();
|
8237 | }
|
8238 | if (xfaLayerNode) {
|
8239 | this.xfaLayer.hide();
|
8240 | }
|
8241 | if (textLayerNode) {
|
8242 | this.textLayer.hide();
|
8243 | }
|
8244 | this.structTreeLayer?.hide();
|
8245 | if (!zoomLayerNode) {
|
8246 | if (this.canvas) {
|
8247 | this.#viewportMap.delete(this.canvas);
|
8248 | this.canvas.width = 0;
|
8249 | this.canvas.height = 0;
|
8250 | delete this.canvas;
|
8251 | }
|
8252 | this._resetZoomLayer();
|
8253 | }
|
8254 | }
|
8255 | update(_ref) {
|
8256 | let {
|
8257 | scale = 0,
|
8258 | rotation = null,
|
8259 | optionalContentConfigPromise = null,
|
8260 | drawingDelay = -1
|
8261 | } = _ref;
|
8262 | this.scale = scale || this.scale;
|
8263 | if (typeof rotation === "number") {
|
8264 | this.rotation = rotation;
|
8265 | }
|
8266 | if (optionalContentConfigPromise instanceof Promise) {
|
8267 | this._optionalContentConfigPromise = optionalContentConfigPromise;
|
8268 | optionalContentConfigPromise.then(optionalContentConfig => {
|
8269 | if (optionalContentConfigPromise !== this._optionalContentConfigPromise) {
|
8270 | return;
|
8271 | }
|
8272 | this.#useThumbnailCanvas.initialOptionalContent = optionalContentConfig.hasInitialVisibility;
|
8273 | });
|
8274 | }
|
8275 | this.#useThumbnailCanvas.directDrawing = true;
|
8276 | const totalRotation = (this.rotation + this.pdfPageRotate) % 360;
|
8277 | this.viewport = this.viewport.clone({
|
8278 | scale: this.scale * pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.PixelsPerInch.PDF_TO_CSS_UNITS,
|
8279 | rotation: totalRotation
|
8280 | });
|
8281 | this.#setDimensions();
|
8282 | if (this._isStandalone) {
|
8283 | this._container?.style.setProperty("--scale-factor", this.viewport.scale);
|
8284 | }
|
8285 | if (this.canvas) {
|
8286 | let onlyCssZoom = false;
|
8287 | if (this.#hasRestrictedScaling) {
|
8288 | if (this.maxCanvasPixels === 0) {
|
8289 | onlyCssZoom = true;
|
8290 | } else if (this.maxCanvasPixels > 0) {
|
8291 | const {
|
8292 | width,
|
8293 | height
|
8294 | } = this.viewport;
|
8295 | const {
|
8296 | sx,
|
8297 | sy
|
8298 | } = this.outputScale;
|
8299 | onlyCssZoom = (Math.floor(width) * sx | 0) * (Math.floor(height) * sy | 0) > this.maxCanvasPixels;
|
8300 | }
|
8301 | }
|
8302 | const postponeDrawing = !onlyCssZoom && drawingDelay >= 0 && drawingDelay < 1000;
|
8303 | if (postponeDrawing || onlyCssZoom) {
|
8304 | if (postponeDrawing && this.renderingState !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.FINISHED) {
|
8305 | this.cancelRendering({
|
8306 | keepZoomLayer: true,
|
8307 | keepAnnotationLayer: true,
|
8308 | keepAnnotationEditorLayer: true,
|
8309 | keepXfaLayer: true,
|
8310 | keepTextLayer: true,
|
8311 | cancelExtraDelay: drawingDelay
|
8312 | });
|
8313 | this.renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.FINISHED;
|
8314 | this.#useThumbnailCanvas.directDrawing = false;
|
8315 | }
|
8316 | this.cssTransform({
|
8317 | target: this.canvas,
|
8318 | redrawAnnotationLayer: true,
|
8319 | redrawAnnotationEditorLayer: true,
|
8320 | redrawXfaLayer: true,
|
8321 | redrawTextLayer: !postponeDrawing,
|
8322 | hideTextLayer: postponeDrawing
|
8323 | });
|
8324 | if (postponeDrawing) {
|
8325 | return;
|
8326 | }
|
8327 | this.eventBus.dispatch("pagerendered", {
|
8328 | source: this,
|
8329 | pageNumber: this.id,
|
8330 | cssTransform: true,
|
8331 | timestamp: performance.now(),
|
8332 | error: this.#renderError
|
8333 | });
|
8334 | return;
|
8335 | }
|
8336 | if (!this.zoomLayer && !this.canvas.hidden) {
|
8337 | this.zoomLayer = this.canvas.parentNode;
|
8338 | this.zoomLayer.style.position = "absolute";
|
8339 | }
|
8340 | }
|
8341 | if (this.zoomLayer) {
|
8342 | this.cssTransform({
|
8343 | target: this.zoomLayer.firstChild
|
8344 | });
|
8345 | }
|
8346 | this.reset({
|
8347 | keepZoomLayer: true,
|
8348 | keepAnnotationLayer: true,
|
8349 | keepAnnotationEditorLayer: true,
|
8350 | keepXfaLayer: true,
|
8351 | keepTextLayer: true
|
8352 | });
|
8353 | }
|
8354 | cancelRendering() {
|
8355 | let {
|
8356 | keepAnnotationLayer = false,
|
8357 | keepAnnotationEditorLayer = false,
|
8358 | keepXfaLayer = false,
|
8359 | keepTextLayer = false,
|
8360 | cancelExtraDelay = 0
|
8361 | } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
8362 | if (this.renderTask) {
|
8363 | this.renderTask.cancel(cancelExtraDelay);
|
8364 | this.renderTask = null;
|
8365 | }
|
8366 | this.resume = null;
|
8367 | if (this.textLayer && (!keepTextLayer || !this.textLayer.div)) {
|
8368 | this.textLayer.cancel();
|
8369 | this.textLayer = null;
|
8370 | }
|
8371 | if (this.structTreeLayer && !this.textLayer) {
|
8372 | this.structTreeLayer = null;
|
8373 | }
|
8374 | if (this.annotationLayer && (!keepAnnotationLayer || !this.annotationLayer.div)) {
|
8375 | this.annotationLayer.cancel();
|
8376 | this.annotationLayer = null;
|
8377 | this._annotationCanvasMap = null;
|
8378 | }
|
8379 | if (this.annotationEditorLayer && (!keepAnnotationEditorLayer || !this.annotationEditorLayer.div)) {
|
8380 | if (this.drawLayer) {
|
8381 | this.drawLayer.cancel();
|
8382 | this.drawLayer = null;
|
8383 | }
|
8384 | this.annotationEditorLayer.cancel();
|
8385 | this.annotationEditorLayer = null;
|
8386 | }
|
8387 | if (this.xfaLayer && (!keepXfaLayer || !this.xfaLayer.div)) {
|
8388 | this.xfaLayer.cancel();
|
8389 | this.xfaLayer = null;
|
8390 | this._textHighlighter?.disable();
|
8391 | }
|
8392 | }
|
8393 | cssTransform(_ref2) {
|
8394 | let {
|
8395 | target,
|
8396 | redrawAnnotationLayer = false,
|
8397 | redrawAnnotationEditorLayer = false,
|
8398 | redrawXfaLayer = false,
|
8399 | redrawTextLayer = false,
|
8400 | hideTextLayer = false
|
8401 | } = _ref2;
|
8402 | if (!target.hasAttribute("zooming")) {
|
8403 | target.setAttribute("zooming", true);
|
8404 | const {
|
8405 | style
|
8406 | } = target;
|
8407 | style.width = style.height = "";
|
8408 | }
|
8409 | const originalViewport = this.#viewportMap.get(target);
|
8410 | if (this.viewport !== originalViewport) {
|
8411 | const relativeRotation = this.viewport.rotation - originalViewport.rotation;
|
8412 | const absRotation = Math.abs(relativeRotation);
|
8413 | let scaleX = 1,
|
8414 | scaleY = 1;
|
8415 | if (absRotation === 90 || absRotation === 270) {
|
8416 | const {
|
8417 | width,
|
8418 | height
|
8419 | } = this.viewport;
|
8420 | scaleX = height / width;
|
8421 | scaleY = width / height;
|
8422 | }
|
8423 | target.style.transform = `rotate(${relativeRotation}deg) scale(${scaleX}, ${scaleY})`;
|
8424 | }
|
8425 | if (redrawAnnotationLayer && this.annotationLayer) {
|
8426 | this.#renderAnnotationLayer();
|
8427 | }
|
8428 | if (redrawAnnotationEditorLayer && this.annotationEditorLayer) {
|
8429 | if (this.drawLayer) {
|
8430 | this.#renderDrawLayer();
|
8431 | }
|
8432 | this.#renderAnnotationEditorLayer();
|
8433 | }
|
8434 | if (redrawXfaLayer && this.xfaLayer) {
|
8435 | this.#renderXfaLayer();
|
8436 | }
|
8437 | if (this.textLayer) {
|
8438 | if (hideTextLayer) {
|
8439 | this.textLayer.hide();
|
8440 | this.structTreeLayer?.hide();
|
8441 | } else if (redrawTextLayer) {
|
8442 | this.#renderTextLayer();
|
8443 | }
|
8444 | }
|
8445 | }
|
8446 | get width() {
|
8447 | return this.viewport.width;
|
8448 | }
|
8449 | get height() {
|
8450 | return this.viewport.height;
|
8451 | }
|
8452 | getPagePoint(x, y) {
|
8453 | return this.viewport.convertToPdfPoint(x, y);
|
8454 | }
|
8455 | async #finishRenderTask(renderTask) {
|
8456 | let error = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
8457 | if (renderTask === this.renderTask) {
|
8458 | this.renderTask = null;
|
8459 | }
|
8460 | if (error instanceof pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.RenderingCancelledException) {
|
8461 | this.#renderError = null;
|
8462 | return;
|
8463 | }
|
8464 | this.#renderError = error;
|
8465 | this.renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.FINISHED;
|
8466 | this._resetZoomLayer(true);
|
8467 | this.#useThumbnailCanvas.regularAnnotations = !renderTask.separateAnnots;
|
8468 | this.eventBus.dispatch("pagerendered", {
|
8469 | source: this,
|
8470 | pageNumber: this.id,
|
8471 | cssTransform: false,
|
8472 | timestamp: performance.now(),
|
8473 | error: this.#renderError
|
8474 | });
|
8475 | if (error) {
|
8476 | throw error;
|
8477 | }
|
8478 | }
|
8479 | async draw() {
|
8480 | if (this.renderingState !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.INITIAL) {
|
8481 | console.error("Must be in new state before drawing");
|
8482 | this.reset();
|
8483 | }
|
8484 | const {
|
8485 | div,
|
8486 | l10n,
|
8487 | pageColors,
|
8488 | pdfPage,
|
8489 | viewport
|
8490 | } = this;
|
8491 | if (!pdfPage) {
|
8492 | this.renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.FINISHED;
|
8493 | throw new Error("pdfPage is not loaded");
|
8494 | }
|
8495 | this.renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.RUNNING;
|
8496 | const canvasWrapper = document.createElement("div");
|
8497 | canvasWrapper.classList.add("canvasWrapper");
|
8498 | canvasWrapper.setAttribute("aria-hidden", true);
|
8499 | this.#addLayer(canvasWrapper, "canvasWrapper");
|
8500 | if (!this.textLayer && this.#textLayerMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.TextLayerMode.DISABLE && !pdfPage.isPureXfa) {
|
8501 | this._accessibilityManager ||= new _text_accessibility_js__WEBPACK_IMPORTED_MODULE_10__.TextAccessibilityManager();
|
8502 | this.textLayer = new _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_12__.TextLayerBuilder({
|
8503 | highlighter: this._textHighlighter,
|
8504 | accessibilityManager: this._accessibilityManager,
|
8505 | enablePermissions: this.#textLayerMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.TextLayerMode.ENABLE_PERMISSIONS,
|
8506 | onAppend: textLayerDiv => {
|
8507 | this.l10n.pause();
|
8508 | this.#addLayer(textLayerDiv, "textLayer");
|
8509 | this.l10n.resume();
|
8510 | }
|
8511 | });
|
8512 | }
|
8513 | if (!this.annotationLayer && this.#annotationMode !== pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.AnnotationMode.DISABLE) {
|
8514 | const {
|
8515 | annotationStorage,
|
8516 | downloadManager,
|
8517 | enableScripting,
|
8518 | fieldObjectsPromise,
|
8519 | hasJSActionsPromise,
|
8520 | linkService
|
8521 | } = this.#layerProperties;
|
8522 | this._annotationCanvasMap ||= new Map();
|
8523 | this.annotationLayer = new _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_4__.AnnotationLayerBuilder({
|
8524 | pdfPage,
|
8525 | annotationStorage,
|
8526 | imageResourcesPath: this.imageResourcesPath,
|
8527 | renderForms: this.#annotationMode === pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.AnnotationMode.ENABLE_FORMS,
|
8528 | linkService,
|
8529 | downloadManager,
|
8530 | enableScripting,
|
8531 | hasJSActionsPromise,
|
8532 | fieldObjectsPromise,
|
8533 | annotationCanvasMap: this._annotationCanvasMap,
|
8534 | accessibilityManager: this._accessibilityManager,
|
8535 | onAppend: annotationLayerDiv => {
|
8536 | this.#addLayer(annotationLayerDiv, "annotationLayer");
|
8537 | }
|
8538 | });
|
8539 | }
|
8540 | const renderContinueCallback = cont => {
|
8541 | showCanvas?.(false);
|
8542 | if (this.renderingQueue && !this.renderingQueue.isHighestPriority(this)) {
|
8543 | this.renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.PAUSED;
|
8544 | this.resume = () => {
|
8545 | this.renderingState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates.RUNNING;
|
8546 | cont();
|
8547 | };
|
8548 | return;
|
8549 | }
|
8550 | cont();
|
8551 | };
|
8552 | const {
|
8553 | width,
|
8554 | height
|
8555 | } = viewport;
|
8556 | const canvas = document.createElement("canvas");
|
8557 | canvas.setAttribute("role", "presentation");
|
8558 | canvas.hidden = true;
|
8559 | const hasHCM = !!(pageColors?.background && pageColors?.foreground);
|
8560 | let showCanvas = isLastShow => {
|
8561 | if (!hasHCM || isLastShow) {
|
8562 | canvas.hidden = false;
|
8563 | showCanvas = null;
|
8564 | }
|
8565 | };
|
8566 | canvasWrapper.append(canvas);
|
8567 | this.canvas = canvas;
|
8568 | const ctx = canvas.getContext("2d", {
|
8569 | alpha: false
|
8570 | });
|
8571 | const outputScale = this.outputScale = new _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.OutputScale();
|
8572 | if (this.maxCanvasPixels === 0) {
|
8573 | const invScale = 1 / this.scale;
|
8574 | outputScale.sx *= invScale;
|
8575 | outputScale.sy *= invScale;
|
8576 | this.#hasRestrictedScaling = true;
|
8577 | } else if (this.maxCanvasPixels > 0) {
|
8578 | const pixelsInViewport = width * height;
|
8579 | const maxScale = Math.sqrt(this.maxCanvasPixels / pixelsInViewport);
|
8580 | if (outputScale.sx > maxScale || outputScale.sy > maxScale) {
|
8581 | outputScale.sx = maxScale;
|
8582 | outputScale.sy = maxScale;
|
8583 | this.#hasRestrictedScaling = true;
|
8584 | } else {
|
8585 | this.#hasRestrictedScaling = false;
|
8586 | }
|
8587 | }
|
8588 | const sfx = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.approximateFraction)(outputScale.sx);
|
8589 | const sfy = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.approximateFraction)(outputScale.sy);
|
8590 | canvas.width = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.roundToDivide)(width * outputScale.sx, sfx[0]);
|
8591 | canvas.height = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.roundToDivide)(height * outputScale.sy, sfy[0]);
|
8592 | const {
|
8593 | style
|
8594 | } = canvas;
|
8595 | style.width = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.roundToDivide)(width, sfx[1]) + "px";
|
8596 | style.height = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.roundToDivide)(height, sfy[1]) + "px";
|
8597 | this.#viewportMap.set(canvas, viewport);
|
8598 | const transform = outputScale.scaled ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0] : null;
|
8599 | const renderContext = {
|
8600 | canvasContext: ctx,
|
8601 | transform,
|
8602 | viewport,
|
8603 | annotationMode: this.#annotationMode,
|
8604 | optionalContentConfigPromise: this._optionalContentConfigPromise,
|
8605 | annotationCanvasMap: this._annotationCanvasMap,
|
8606 | pageColors
|
8607 | };
|
8608 | const renderTask = this.renderTask = this.pdfPage.render(renderContext);
|
8609 | renderTask.onContinue = renderContinueCallback;
|
8610 | const resultPromise = renderTask.promise.then(async () => {
|
8611 | showCanvas?.(true);
|
8612 | await this.#finishRenderTask(renderTask);
|
8613 | this.#renderTextLayer();
|
8614 | if (this.annotationLayer) {
|
8615 | await this.#renderAnnotationLayer();
|
8616 | }
|
8617 | const {
|
8618 | annotationEditorUIManager
|
8619 | } = this.#layerProperties;
|
8620 | if (!annotationEditorUIManager) {
|
8621 | return;
|
8622 | }
|
8623 | this.drawLayer ||= new _draw_layer_builder_js__WEBPACK_IMPORTED_MODULE_6__.DrawLayerBuilder({
|
8624 | pageIndex: this.id
|
8625 | });
|
8626 | await this.#renderDrawLayer();
|
8627 | this.drawLayer.setParent(canvasWrapper);
|
8628 | if (!this.annotationEditorLayer) {
|
8629 | this.annotationEditorLayer = new _annotation_editor_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__.AnnotationEditorLayerBuilder({
|
8630 | uiManager: annotationEditorUIManager,
|
8631 | pdfPage,
|
8632 | l10n,
|
8633 | accessibilityManager: this._accessibilityManager,
|
8634 | annotationLayer: this.annotationLayer?.annotationLayer,
|
8635 | textLayer: this.textLayer,
|
8636 | drawLayer: this.drawLayer.getDrawLayer(),
|
8637 | onAppend: annotationEditorLayerDiv => {
|
8638 | this.#addLayer(annotationEditorLayerDiv, "annotationEditorLayer");
|
8639 | }
|
8640 | });
|
8641 | }
|
8642 | this.#renderAnnotationEditorLayer();
|
8643 | }, error => {
|
8644 | if (!(error instanceof pdfjs_lib__WEBPACK_IMPORTED_MODULE_1__.RenderingCancelledException)) {
|
8645 | showCanvas?.(true);
|
8646 | }
|
8647 | return this.#finishRenderTask(renderTask, error);
|
8648 | });
|
8649 | if (pdfPage.isPureXfa) {
|
8650 | if (!this.xfaLayer) {
|
8651 | const {
|
8652 | annotationStorage,
|
8653 | linkService
|
8654 | } = this.#layerProperties;
|
8655 | this.xfaLayer = new _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_13__.XfaLayerBuilder({
|
8656 | pdfPage,
|
8657 | annotationStorage,
|
8658 | linkService
|
8659 | });
|
8660 | }
|
8661 | this.#renderXfaLayer();
|
8662 | }
|
8663 | div.setAttribute("data-loaded", true);
|
8664 | this.eventBus.dispatch("pagerender", {
|
8665 | source: this,
|
8666 | pageNumber: this.id
|
8667 | });
|
8668 | return resultPromise;
|
8669 | }
|
8670 | setPageLabel(label) {
|
8671 | this.pageLabel = typeof label === "string" ? label : null;
|
8672 | this.div.setAttribute("data-l10n-args", JSON.stringify({
|
8673 | page: this.pageLabel ?? this.id
|
8674 | }));
|
8675 | if (this.pageLabel !== null) {
|
8676 | this.div.setAttribute("data-page-label", this.pageLabel);
|
8677 | } else {
|
8678 | this.div.removeAttribute("data-page-label");
|
8679 | }
|
8680 | }
|
8681 | get thumbnailCanvas() {
|
8682 | const {
|
8683 | directDrawing,
|
8684 | initialOptionalContent,
|
8685 | regularAnnotations
|
8686 | } = this.#useThumbnailCanvas;
|
8687 | return directDrawing && initialOptionalContent && regularAnnotations ? this.canvas : null;
|
8688 | }
|
8689 | }
|
8690 |
|
8691 | __webpack_async_result__();
|
8692 | } catch(e) { __webpack_async_result__(e); } });
|
8693 |
|
8694 | /***/ }),
|
8695 |
|
8696 | /***/ 6615:
|
8697 | /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
|
8698 |
|
8699 | __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
8700 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
8701 | /* harmony export */ PDFRenderingQueue: () => (/* binding */ PDFRenderingQueue)
|
8702 | /* harmony export */ });
|
8703 | /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
|
8704 | /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7256);
|
8705 | var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
|
8706 | pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
8707 |
|
8708 |
|
8709 | const CLEANUP_TIMEOUT = 30000;
|
8710 | class PDFRenderingQueue {
|
8711 | constructor() {
|
8712 | this.pdfViewer = null;
|
8713 | this.pdfThumbnailViewer = null;
|
8714 | this.onIdle = null;
|
8715 | this.highestPriorityPage = null;
|
8716 | this.idleTimeout = null;
|
8717 | this.printing = false;
|
8718 | this.isThumbnailViewEnabled = false;
|
8719 | Object.defineProperty(this, "hasViewer", {
|
8720 | value: () => !!this.pdfViewer
|
8721 | });
|
8722 | }
|
8723 | setViewer(pdfViewer) {
|
8724 | this.pdfViewer = pdfViewer;
|
8725 | }
|
8726 | setThumbnailViewer(pdfThumbnailViewer) {
|
8727 | this.pdfThumbnailViewer = pdfThumbnailViewer;
|
8728 | }
|
8729 | isHighestPriority(view) {
|
8730 | return this.highestPriorityPage === view.renderingId;
|
8731 | }
|
8732 | renderHighestPriority(currentlyVisiblePages) {
|
8733 | if (this.idleTimeout) {
|
8734 | clearTimeout(this.idleTimeout);
|
8735 | this.idleTimeout = null;
|
8736 | }
|
8737 | if (this.pdfViewer.forceRendering(currentlyVisiblePages)) {
|
8738 | return;
|
8739 | }
|
8740 | if (this.isThumbnailViewEnabled && this.pdfThumbnailViewer?.forceRendering()) {
|
8741 | return;
|
8742 | }
|
8743 | if (this.printing) {
|
8744 | return;
|
8745 | }
|
8746 | if (this.onIdle) {
|
8747 | this.idleTimeout = setTimeout(this.onIdle.bind(this), CLEANUP_TIMEOUT);
|
8748 | }
|
8749 | }
|
8750 | getHighestPriority(visible, views, scrolledDown) {
|
8751 | let preRenderExtra = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
8752 | const visibleViews = visible.views,
|
8753 | numVisible = visibleViews.length;
|
8754 | if (numVisible === 0) {
|
8755 | return null;
|
8756 | }
|
8757 | for (let i = 0; i < numVisible; i++) {
|
8758 | const view = visibleViews[i].view;
|
8759 | if (!this.isViewFinished(view)) {
|
8760 | return view;
|
8761 | }
|
8762 | }
|
8763 | const firstId = visible.first.id,
|
8764 | lastId = visible.last.id;
|
8765 | if (lastId - firstId + 1 > numVisible) {
|
8766 | const visibleIds = visible.ids;
|
8767 | for (let i = 1, ii = lastId - firstId; i < ii; i++) {
|
8768 | const holeId = scrolledDown ? firstId + i : lastId - i;
|
8769 | if (visibleIds.has(holeId)) {
|
8770 | continue;
|
8771 | }
|
8772 | const holeView = views[holeId - 1];
|
8773 | if (!this.isViewFinished(holeView)) {
|
8774 | return holeView;
|
8775 | }
|
8776 | }
|
8777 | }
|
8778 | let preRenderIndex = scrolledDown ? lastId : firstId - 2;
|
8779 | let preRenderView = views[preRenderIndex];
|
8780 | if (preRenderView && !this.isViewFinished(preRenderView)) {
|
8781 | return preRenderView;
|
8782 | }
|
8783 | if (preRenderExtra) {
|
8784 | preRenderIndex += scrolledDown ? 1 : -1;
|
8785 | preRenderView = views[preRenderIndex];
|
8786 | if (preRenderView && !this.isViewFinished(preRenderView)) {
|
8787 | return preRenderView;
|
8788 | }
|
8789 | }
|
8790 | return null;
|
8791 | }
|
8792 | isViewFinished(view) {
|
8793 | return view.renderingState === _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.RenderingStates.FINISHED;
|
8794 | }
|
8795 | renderView(view) {
|
8796 | switch (view.renderingState) {
|
8797 | case _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.RenderingStates.FINISHED:
|
8798 | return false;
|
8799 | case _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.RenderingStates.PAUSED:
|
8800 | this.highestPriorityPage = view.renderingId;
|
8801 | view.resume();
|
8802 | break;
|
8803 | case _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.RenderingStates.RUNNING:
|
8804 | this.highestPriorityPage = view.renderingId;
|
8805 | break;
|
8806 | case _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.RenderingStates.INITIAL:
|
8807 | this.highestPriorityPage = view.renderingId;
|
8808 | view.draw().finally(() => {
|
8809 | this.renderHighestPriority();
|
8810 | }).catch(reason => {
|
8811 | if (reason instanceof pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.RenderingCancelledException) {
|
8812 | return;
|
8813 | }
|
8814 | console.error(`renderView: "${reason}"`);
|
8815 | });
|
8816 | break;
|
8817 | }
|
8818 | return true;
|
8819 | }
|
8820 | }
|
8821 |
|
8822 | __webpack_async_result__();
|
8823 | } catch(e) { __webpack_async_result__(e); } });
|
8824 |
|
8825 | /***/ }),
|
8826 |
|
8827 | /***/ 2371:
|
8828 | /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
|
8829 |
|
8830 | __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
8831 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
8832 | /* harmony export */ PDFScriptingManager: () => (/* binding */ PDFScriptingManagerComponents)
|
8833 | /* harmony export */ });
|
8834 | /* harmony import */ var _generic_scripting_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(289);
|
8835 | /* harmony import */ var _pdf_scripting_manager_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5942);
|
8836 | var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_generic_scripting_js__WEBPACK_IMPORTED_MODULE_0__, _pdf_scripting_manager_js__WEBPACK_IMPORTED_MODULE_1__]);
|
8837 | ([_generic_scripting_js__WEBPACK_IMPORTED_MODULE_0__, _pdf_scripting_manager_js__WEBPACK_IMPORTED_MODULE_1__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
8838 |
|
8839 |
|
8840 | class PDFScriptingManagerComponents extends _pdf_scripting_manager_js__WEBPACK_IMPORTED_MODULE_1__.PDFScriptingManager {
|
8841 | constructor(options) {
|
8842 | if (!options.externalServices) {
|
8843 | window.addEventListener("updatefromsandbox", event => {
|
8844 | options.eventBus.dispatch("updatefromsandbox", {
|
8845 | source: window,
|
8846 | detail: event.detail
|
8847 | });
|
8848 | });
|
8849 | }
|
8850 | options.externalServices ||= {
|
8851 | createScripting: () => new _generic_scripting_js__WEBPACK_IMPORTED_MODULE_0__.GenericScripting(options.sandboxBundleSrc)
|
8852 | };
|
8853 | options.docProperties ||= pdfDocument => (0,_generic_scripting_js__WEBPACK_IMPORTED_MODULE_0__.docProperties)(pdfDocument);
|
8854 | super(options);
|
8855 | }
|
8856 | }
|
8857 |
|
8858 | __webpack_async_result__();
|
8859 | } catch(e) { __webpack_async_result__(e); } });
|
8860 |
|
8861 | /***/ }),
|
8862 |
|
8863 | /***/ 5942:
|
8864 | /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
|
8865 |
|
8866 | __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
8867 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
8868 | /* harmony export */ PDFScriptingManager: () => (/* binding */ PDFScriptingManager)
|
8869 | /* harmony export */ });
|
8870 | /* harmony import */ var core_js_modules_es_promise_with_resolvers_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4628);
|
8871 | /* harmony import */ var core_js_modules_esnext_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3375);
|
8872 | /* harmony import */ var core_js_modules_esnext_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9225);
|
8873 | /* harmony import */ var core_js_modules_esnext_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3972);
|
8874 | /* harmony import */ var core_js_modules_esnext_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9209);
|
8875 | /* harmony import */ var core_js_modules_esnext_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5714);
|
8876 | /* harmony import */ var core_js_modules_esnext_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7561);
|
8877 | /* harmony import */ var core_js_modules_esnext_set_union_v2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6197);
|
8878 | /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(7256);
|
8879 | /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2603);
|
8880 | var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_9__]);
|
8881 | pdfjs_lib__WEBPACK_IMPORTED_MODULE_9__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
8882 |
|
8883 |
|
8884 |
|
8885 |
|
8886 |
|
8887 |
|
8888 |
|
8889 |
|
8890 |
|
8891 |
|
8892 | class PDFScriptingManager {
|
8893 | #closeCapability = null;
|
8894 | #destroyCapability = null;
|
8895 | #docProperties = null;
|
8896 | #eventBus = null;
|
8897 | #externalServices = null;
|
8898 | #pdfDocument = null;
|
8899 | #pdfViewer = null;
|
8900 | #ready = false;
|
8901 | #scripting = null;
|
8902 | #willPrintCapability = null;
|
8903 | constructor(_ref) {
|
8904 | let {
|
8905 | eventBus,
|
8906 | externalServices = null,
|
8907 | docProperties = null
|
8908 | } = _ref;
|
8909 | this.#eventBus = eventBus;
|
8910 | this.#externalServices = externalServices;
|
8911 | this.#docProperties = docProperties;
|
8912 | }
|
8913 | setViewer(pdfViewer) {
|
8914 | this.#pdfViewer = pdfViewer;
|
8915 | }
|
8916 | async setDocument(pdfDocument) {
|
8917 | if (this.#pdfDocument) {
|
8918 | await this.#destroyScripting();
|
8919 | }
|
8920 | this.#pdfDocument = pdfDocument;
|
8921 | if (!pdfDocument) {
|
8922 | return;
|
8923 | }
|
8924 | const [objects, calculationOrder, docActions] = await Promise.all([pdfDocument.getFieldObjects(), pdfDocument.getCalculationOrderIds(), pdfDocument.getJSActions()]);
|
8925 | if (!objects && !docActions) {
|
8926 | await this.#destroyScripting();
|
8927 | return;
|
8928 | }
|
8929 | if (pdfDocument !== this.#pdfDocument) {
|
8930 | return;
|
8931 | }
|
8932 | try {
|
8933 | this.#scripting = this.#initScripting();
|
8934 | } catch (error) {
|
8935 | console.error(`setDocument: "${error.message}".`);
|
8936 | await this.#destroyScripting();
|
8937 | return;
|
8938 | }
|
8939 | this._internalEvents.set("updatefromsandbox", event => {
|
8940 | if (event?.source === window) {
|
8941 | this.#updateFromSandbox(event.detail);
|
8942 | }
|
8943 | });
|
8944 | this._internalEvents.set("dispatcheventinsandbox", event => {
|
8945 | this.#scripting?.dispatchEventInSandbox(event.detail);
|
8946 | });
|
8947 | this._internalEvents.set("pagechanging", _ref2 => {
|
8948 | let {
|
8949 | pageNumber,
|
8950 | previous
|
8951 | } = _ref2;
|
8952 | if (pageNumber === previous) {
|
8953 | return;
|
8954 | }
|
8955 | this.#dispatchPageClose(previous);
|
8956 | this.#dispatchPageOpen(pageNumber);
|
8957 | });
|
8958 | this._internalEvents.set("pagerendered", _ref3 => {
|
8959 | let {
|
8960 | pageNumber
|
8961 | } = _ref3;
|
8962 | if (!this._pageOpenPending.has(pageNumber)) {
|
8963 | return;
|
8964 | }
|
8965 | if (pageNumber !== this.#pdfViewer.currentPageNumber) {
|
8966 | return;
|
8967 | }
|
8968 | this.#dispatchPageOpen(pageNumber);
|
8969 | });
|
8970 | this._internalEvents.set("pagesdestroy", async () => {
|
8971 | await this.#dispatchPageClose(this.#pdfViewer.currentPageNumber);
|
8972 | await this.#scripting?.dispatchEventInSandbox({
|
8973 | id: "doc",
|
8974 | name: "WillClose"
|
8975 | });
|
8976 | this.#closeCapability?.resolve();
|
8977 | });
|
8978 | for (const [name, listener] of this._internalEvents) {
|
8979 | this.#eventBus._on(name, listener);
|
8980 | }
|
8981 | try {
|
8982 | const docProperties = await this.#docProperties(pdfDocument);
|
8983 | if (pdfDocument !== this.#pdfDocument) {
|
8984 | return;
|
8985 | }
|
8986 | await this.#scripting.createSandbox({
|
8987 | objects,
|
8988 | calculationOrder,
|
8989 | appInfo: {
|
8990 | platform: navigator.platform,
|
8991 | language: navigator.language
|
8992 | },
|
8993 | docInfo: {
|
8994 | ...docProperties,
|
8995 | actions: docActions
|
8996 | }
|
8997 | });
|
8998 | this.#eventBus.dispatch("sandboxcreated", {
|
8999 | source: this
|
9000 | });
|
9001 | } catch (error) {
|
9002 | console.error(`setDocument: "${error.message}".`);
|
9003 | await this.#destroyScripting();
|
9004 | return;
|
9005 | }
|
9006 | await this.#scripting?.dispatchEventInSandbox({
|
9007 | id: "doc",
|
9008 | name: "Open"
|
9009 | });
|
9010 | await this.#dispatchPageOpen(this.#pdfViewer.currentPageNumber, true);
|
9011 | Promise.resolve().then(() => {
|
9012 | if (pdfDocument === this.#pdfDocument) {
|
9013 | this.#ready = true;
|
9014 | }
|
9015 | });
|
9016 | }
|
9017 | async dispatchWillSave() {
|
9018 | return this.#scripting?.dispatchEventInSandbox({
|
9019 | id: "doc",
|
9020 | name: "WillSave"
|
9021 | });
|
9022 | }
|
9023 | async dispatchDidSave() {
|
9024 | return this.#scripting?.dispatchEventInSandbox({
|
9025 | id: "doc",
|
9026 | name: "DidSave"
|
9027 | });
|
9028 | }
|
9029 | async dispatchWillPrint() {
|
9030 | if (!this.#scripting) {
|
9031 | return;
|
9032 | }
|
9033 | await this.#willPrintCapability?.promise;
|
9034 | this.#willPrintCapability = Promise.withResolvers();
|
9035 | try {
|
9036 | await this.#scripting.dispatchEventInSandbox({
|
9037 | id: "doc",
|
9038 | name: "WillPrint"
|
9039 | });
|
9040 | } catch (ex) {
|
9041 | this.#willPrintCapability.resolve();
|
9042 | this.#willPrintCapability = null;
|
9043 | throw ex;
|
9044 | }
|
9045 | await this.#willPrintCapability.promise;
|
9046 | }
|
9047 | async dispatchDidPrint() {
|
9048 | return this.#scripting?.dispatchEventInSandbox({
|
9049 | id: "doc",
|
9050 | name: "DidPrint"
|
9051 | });
|
9052 | }
|
9053 | get destroyPromise() {
|
9054 | return this.#destroyCapability?.promise || null;
|
9055 | }
|
9056 | get ready() {
|
9057 | return this.#ready;
|
9058 | }
|
9059 | get _internalEvents() {
|
9060 | return (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_9__.shadow)(this, "_internalEvents", new Map());
|
9061 | }
|
9062 | get _pageOpenPending() {
|
9063 | return (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_9__.shadow)(this, "_pageOpenPending", new Set());
|
9064 | }
|
9065 | get _visitedPages() {
|
9066 | return (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_9__.shadow)(this, "_visitedPages", new Map());
|
9067 | }
|
9068 | async #updateFromSandbox(detail) {
|
9069 | const pdfViewer = this.#pdfViewer;
|
9070 | const isInPresentationMode = pdfViewer.isInPresentationMode || pdfViewer.isChangingPresentationMode;
|
9071 | const {
|
9072 | id,
|
9073 | siblings,
|
9074 | command,
|
9075 | value
|
9076 | } = detail;
|
9077 | if (!id) {
|
9078 | switch (command) {
|
9079 | case "clear":
|
9080 | console.clear();
|
9081 | break;
|
9082 | case "error":
|
9083 | console.error(value);
|
9084 | break;
|
9085 | case "layout":
|
9086 | if (!isInPresentationMode) {
|
9087 | const modes = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_8__.apiPageLayoutToViewerModes)(value);
|
9088 | pdfViewer.spreadMode = modes.spreadMode;
|
9089 | }
|
9090 | break;
|
9091 | case "page-num":
|
9092 | pdfViewer.currentPageNumber = value + 1;
|
9093 | break;
|
9094 | case "print":
|
9095 | await pdfViewer.pagesPromise;
|
9096 | this.#eventBus.dispatch("print", {
|
9097 | source: this
|
9098 | });
|
9099 | break;
|
9100 | case "println":
|
9101 | console.log(value);
|
9102 | break;
|
9103 | case "zoom":
|
9104 | if (!isInPresentationMode) {
|
9105 | pdfViewer.currentScaleValue = value;
|
9106 | }
|
9107 | break;
|
9108 | case "SaveAs":
|
9109 | this.#eventBus.dispatch("download", {
|
9110 | source: this
|
9111 | });
|
9112 | break;
|
9113 | case "FirstPage":
|
9114 | pdfViewer.currentPageNumber = 1;
|
9115 | break;
|
9116 | case "LastPage":
|
9117 | pdfViewer.currentPageNumber = pdfViewer.pagesCount;
|
9118 | break;
|
9119 | case "NextPage":
|
9120 | pdfViewer.nextPage();
|
9121 | break;
|
9122 | case "PrevPage":
|
9123 | pdfViewer.previousPage();
|
9124 | break;
|
9125 | case "ZoomViewIn":
|
9126 | if (!isInPresentationMode) {
|
9127 | pdfViewer.increaseScale();
|
9128 | }
|
9129 | break;
|
9130 | case "ZoomViewOut":
|
9131 | if (!isInPresentationMode) {
|
9132 | pdfViewer.decreaseScale();
|
9133 | }
|
9134 | break;
|
9135 | case "WillPrintFinished":
|
9136 | this.#willPrintCapability?.resolve();
|
9137 | this.#willPrintCapability = null;
|
9138 | break;
|
9139 | }
|
9140 | return;
|
9141 | }
|
9142 | if (isInPresentationMode && detail.focus) {
|
9143 | return;
|
9144 | }
|
9145 | delete detail.id;
|
9146 | delete detail.siblings;
|
9147 | const ids = siblings ? [id, ...siblings] : [id];
|
9148 | for (const elementId of ids) {
|
9149 | const element = document.querySelector(`[data-element-id="${elementId}"]`);
|
9150 | if (element) {
|
9151 | element.dispatchEvent(new CustomEvent("updatefromsandbox", {
|
9152 | detail
|
9153 | }));
|
9154 | } else {
|
9155 | this.#pdfDocument?.annotationStorage.setValue(elementId, detail);
|
9156 | }
|
9157 | }
|
9158 | }
|
9159 | async #dispatchPageOpen(pageNumber) {
|
9160 | let initialize = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
9161 | const pdfDocument = this.#pdfDocument,
|
9162 | visitedPages = this._visitedPages;
|
9163 | if (initialize) {
|
9164 | this.#closeCapability = Promise.withResolvers();
|
9165 | }
|
9166 | if (!this.#closeCapability) {
|
9167 | return;
|
9168 | }
|
9169 | const pageView = this.#pdfViewer.getPageView(pageNumber - 1);
|
9170 | if (pageView?.renderingState !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_8__.RenderingStates.FINISHED) {
|
9171 | this._pageOpenPending.add(pageNumber);
|
9172 | return;
|
9173 | }
|
9174 | this._pageOpenPending.delete(pageNumber);
|
9175 | const actionsPromise = (async () => {
|
9176 | const actions = await (!visitedPages.has(pageNumber) ? pageView.pdfPage?.getJSActions() : null);
|
9177 | if (pdfDocument !== this.#pdfDocument) {
|
9178 | return;
|
9179 | }
|
9180 | await this.#scripting?.dispatchEventInSandbox({
|
9181 | id: "page",
|
9182 | name: "PageOpen",
|
9183 | pageNumber,
|
9184 | actions
|
9185 | });
|
9186 | })();
|
9187 | visitedPages.set(pageNumber, actionsPromise);
|
9188 | }
|
9189 | async #dispatchPageClose(pageNumber) {
|
9190 | const pdfDocument = this.#pdfDocument,
|
9191 | visitedPages = this._visitedPages;
|
9192 | if (!this.#closeCapability) {
|
9193 | return;
|
9194 | }
|
9195 | if (this._pageOpenPending.has(pageNumber)) {
|
9196 | return;
|
9197 | }
|
9198 | const actionsPromise = visitedPages.get(pageNumber);
|
9199 | if (!actionsPromise) {
|
9200 | return;
|
9201 | }
|
9202 | visitedPages.set(pageNumber, null);
|
9203 | await actionsPromise;
|
9204 | if (pdfDocument !== this.#pdfDocument) {
|
9205 | return;
|
9206 | }
|
9207 | await this.#scripting?.dispatchEventInSandbox({
|
9208 | id: "page",
|
9209 | name: "PageClose",
|
9210 | pageNumber
|
9211 | });
|
9212 | }
|
9213 | #initScripting() {
|
9214 | this.#destroyCapability = Promise.withResolvers();
|
9215 | if (this.#scripting) {
|
9216 | throw new Error("#initScripting: Scripting already exists.");
|
9217 | }
|
9218 | return this.#externalServices.createScripting();
|
9219 | }
|
9220 | async #destroyScripting() {
|
9221 | if (!this.#scripting) {
|
9222 | this.#pdfDocument = null;
|
9223 | this.#destroyCapability?.resolve();
|
9224 | return;
|
9225 | }
|
9226 | if (this.#closeCapability) {
|
9227 | await Promise.race([this.#closeCapability.promise, new Promise(resolve => {
|
9228 | setTimeout(resolve, 1000);
|
9229 | })]).catch(() => {});
|
9230 | this.#closeCapability = null;
|
9231 | }
|
9232 | this.#pdfDocument = null;
|
9233 | try {
|
9234 | await this.#scripting.destroySandbox();
|
9235 | } catch {}
|
9236 | this.#willPrintCapability?.reject(new Error("Scripting destroyed."));
|
9237 | this.#willPrintCapability = null;
|
9238 | for (const [name, listener] of this._internalEvents) {
|
9239 | this.#eventBus._off(name, listener);
|
9240 | }
|
9241 | this._internalEvents.clear();
|
9242 | this._pageOpenPending.clear();
|
9243 | this._visitedPages.clear();
|
9244 | this.#scripting = null;
|
9245 | this.#ready = false;
|
9246 | this.#destroyCapability?.resolve();
|
9247 | }
|
9248 | }
|
9249 |
|
9250 | __webpack_async_result__();
|
9251 | } catch(e) { __webpack_async_result__(e); } });
|
9252 |
|
9253 | /***/ }),
|
9254 |
|
9255 | /***/ 1838:
|
9256 | /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
|
9257 |
|
9258 | __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
9259 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
9260 | /* harmony export */ PDFSinglePageViewer: () => (/* binding */ PDFSinglePageViewer)
|
9261 | /* harmony export */ });
|
9262 | /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
|
9263 | /* harmony import */ var _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6285);
|
9264 | var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_pdf_viewer_js__WEBPACK_IMPORTED_MODULE_1__]);
|
9265 | _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
9266 |
|
9267 |
|
9268 | class PDFSinglePageViewer extends _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_1__.PDFViewer {
|
9269 | _resetView() {
|
9270 | super._resetView();
|
9271 | this._scrollMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.ScrollMode.PAGE;
|
9272 | this._spreadMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.SpreadMode.NONE;
|
9273 | }
|
9274 | set scrollMode(mode) {}
|
9275 | _updateScrollMode() {}
|
9276 | set spreadMode(mode) {}
|
9277 | _updateSpreadMode() {}
|
9278 | }
|
9279 |
|
9280 | __webpack_async_result__();
|
9281 | } catch(e) { __webpack_async_result__(e); } });
|
9282 |
|
9283 | /***/ }),
|
9284 |
|
9285 | /***/ 624:
|
9286 | /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
|
9287 |
|
9288 | __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
9289 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
9290 | /* harmony export */ AnnotationLayerBuilder: () => (/* reexport safe */ _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__.AnnotationLayerBuilder),
|
9291 | /* harmony export */ DownloadManager: () => (/* reexport safe */ _download_manager_js__WEBPACK_IMPORTED_MODULE_4__.DownloadManager),
|
9292 | /* harmony export */ EventBus: () => (/* reexport safe */ _event_utils_js__WEBPACK_IMPORTED_MODULE_5__.EventBus),
|
9293 | /* harmony export */ FindState: () => (/* reexport safe */ _pdf_find_controller_js__WEBPACK_IMPORTED_MODULE_0__.FindState),
|
9294 | /* harmony export */ GenericL10n: () => (/* reexport safe */ _genericl10n_js__WEBPACK_IMPORTED_MODULE_6__.GenericL10n),
|
9295 | /* harmony export */ LinkTarget: () => (/* reexport safe */ _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_1__.LinkTarget),
|
9296 | /* harmony export */ PDFFindController: () => (/* reexport safe */ _pdf_find_controller_js__WEBPACK_IMPORTED_MODULE_0__.PDFFindController),
|
9297 | /* harmony export */ PDFHistory: () => (/* reexport safe */ _pdf_history_js__WEBPACK_IMPORTED_MODULE_7__.PDFHistory),
|
9298 | /* harmony export */ PDFLinkService: () => (/* reexport safe */ _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_1__.PDFLinkService),
|
9299 | /* harmony export */ PDFPageView: () => (/* reexport safe */ _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_8__.PDFPageView),
|
9300 | /* harmony export */ PDFScriptingManager: () => (/* reexport safe */ _pdf_scripting_manager_component_js__WEBPACK_IMPORTED_MODULE_9__.PDFScriptingManager),
|
9301 | /* harmony export */ PDFSinglePageViewer: () => (/* reexport safe */ _pdf_single_page_viewer_js__WEBPACK_IMPORTED_MODULE_10__.PDFSinglePageViewer),
|
9302 | /* harmony export */ PDFViewer: () => (/* reexport safe */ _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_11__.PDFViewer),
|
9303 | /* harmony export */ ProgressBar: () => (/* reexport safe */ _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.ProgressBar),
|
9304 | /* harmony export */ RenderingStates: () => (/* reexport safe */ _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingStates),
|
9305 | /* harmony export */ ScrollMode: () => (/* reexport safe */ _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.ScrollMode),
|
9306 | /* harmony export */ SimpleLinkService: () => (/* reexport safe */ _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_1__.SimpleLinkService),
|
9307 | /* harmony export */ SpreadMode: () => (/* reexport safe */ _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.SpreadMode),
|
9308 | /* harmony export */ StructTreeLayerBuilder: () => (/* reexport safe */ _struct_tree_layer_builder_js__WEBPACK_IMPORTED_MODULE_12__.StructTreeLayerBuilder),
|
9309 | /* harmony export */ TextLayerBuilder: () => (/* reexport safe */ _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_13__.TextLayerBuilder),
|
9310 | /* harmony export */ XfaLayerBuilder: () => (/* reexport safe */ _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_14__.XfaLayerBuilder),
|
9311 | /* harmony export */ parseQueryString: () => (/* reexport safe */ _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.parseQueryString)
|
9312 | /* harmony export */ });
|
9313 | /* harmony import */ var _pdf_find_controller_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9814);
|
9314 | /* harmony import */ var _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(787);
|
9315 | /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7256);
|
9316 | /* harmony import */ var _annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(2707);
|
9317 | /* harmony import */ var _download_manager_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1544);
|
9318 | /* harmony import */ var _event_utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5656);
|
9319 | /* harmony import */ var _genericl10n_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(410);
|
9320 | /* harmony import */ var _pdf_history_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(8543);
|
9321 | /* harmony import */ var _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(9966);
|
9322 | /* harmony import */ var _pdf_scripting_manager_component_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(2371);
|
9323 | /* harmony import */ var _pdf_single_page_viewer_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(1838);
|
9324 | /* harmony import */ var _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(6285);
|
9325 | /* harmony import */ var _struct_tree_layer_builder_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(6698);
|
9326 | /* harmony import */ var _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(7765);
|
9327 | /* harmony import */ var _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(2973);
|
9328 | var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__, _download_manager_js__WEBPACK_IMPORTED_MODULE_4__, _genericl10n_js__WEBPACK_IMPORTED_MODULE_6__, _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_8__, _pdf_scripting_manager_component_js__WEBPACK_IMPORTED_MODULE_9__, _pdf_single_page_viewer_js__WEBPACK_IMPORTED_MODULE_10__, _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_11__, _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_13__, _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_14__]);
|
9329 | ([_annotation_layer_builder_js__WEBPACK_IMPORTED_MODULE_3__, _download_manager_js__WEBPACK_IMPORTED_MODULE_4__, _genericl10n_js__WEBPACK_IMPORTED_MODULE_6__, _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_8__, _pdf_scripting_manager_component_js__WEBPACK_IMPORTED_MODULE_9__, _pdf_single_page_viewer_js__WEBPACK_IMPORTED_MODULE_10__, _pdf_viewer_js__WEBPACK_IMPORTED_MODULE_11__, _text_layer_builder_js__WEBPACK_IMPORTED_MODULE_13__, _xfa_layer_builder_js__WEBPACK_IMPORTED_MODULE_14__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
9330 |
|
9331 |
|
9332 |
|
9333 |
|
9334 |
|
9335 |
|
9336 |
|
9337 |
|
9338 |
|
9339 |
|
9340 |
|
9341 |
|
9342 |
|
9343 |
|
9344 |
|
9345 | const pdfjsVersion = "4.1.392";
|
9346 | const pdfjsBuild = "fcb76a78d";
|
9347 |
|
9348 | __webpack_async_result__();
|
9349 | } catch(e) { __webpack_async_result__(e); } });
|
9350 |
|
9351 | /***/ }),
|
9352 |
|
9353 | /***/ 6285:
|
9354 | /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
|
9355 |
|
9356 | __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
9357 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
9358 | /* harmony export */ PDFViewer: () => (/* binding */ PDFViewer)
|
9359 | /* harmony export */ });
|
9360 | /* unused harmony exports PagesCountLimit, PDFPageViewBuffer */
|
9361 | /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4114);
|
9362 | /* harmony import */ var core_js_modules_es_promise_with_resolvers_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4628);
|
9363 | /* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8992);
|
9364 | /* harmony import */ var core_js_modules_esnext_iterator_every_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3215);
|
9365 | /* harmony import */ var core_js_modules_esnext_iterator_map_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1454);
|
9366 | /* harmony import */ var core_js_modules_esnext_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(3375);
|
9367 | /* harmony import */ var core_js_modules_esnext_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(9225);
|
9368 | /* harmony import */ var core_js_modules_esnext_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(3972);
|
9369 | /* harmony import */ var core_js_modules_esnext_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(9209);
|
9370 | /* harmony import */ var core_js_modules_esnext_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(5714);
|
9371 | /* harmony import */ var core_js_modules_esnext_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(7561);
|
9372 | /* harmony import */ var core_js_modules_esnext_set_union_v2_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(6197);
|
9373 | /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(2603);
|
9374 | /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(7256);
|
9375 | /* harmony import */ var web_null_l10n__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(410);
|
9376 | /* harmony import */ var _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(9966);
|
9377 | /* harmony import */ var _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(6615);
|
9378 | /* harmony import */ var _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(787);
|
9379 | var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__, web_null_l10n__WEBPACK_IMPORTED_MODULE_14__, _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_15__, _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_16__]);
|
9380 | ([pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__, web_null_l10n__WEBPACK_IMPORTED_MODULE_14__, _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_15__, _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_16__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__);
|
9381 |
|
9382 |
|
9383 |
|
9384 |
|
9385 |
|
9386 |
|
9387 |
|
9388 |
|
9389 |
|
9390 |
|
9391 |
|
9392 |
|
9393 |
|
9394 |
|
9395 |
|
9396 |
|
9397 |
|
9398 |
|
9399 | const DEFAULT_CACHE_SIZE = 10;
|
9400 | const PagesCountLimit = {
|
9401 | FORCE_SCROLL_MODE_PAGE: 15000,
|
9402 | FORCE_LAZY_PAGE_INIT: 7500,
|
9403 | PAUSE_EAGER_PAGE_INIT: 250
|
9404 | };
|
9405 | function isValidAnnotationEditorMode(mode) {
|
9406 | return Object.values(pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationEditorType).includes(mode) && mode !== pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationEditorType.DISABLE;
|
9407 | }
|
9408 | class PDFPageViewBuffer {
|
9409 | #buf = new Set();
|
9410 | #size = 0;
|
9411 | constructor(size) {
|
9412 | this.#size = size;
|
9413 | }
|
9414 | push(view) {
|
9415 | const buf = this.#buf;
|
9416 | if (buf.has(view)) {
|
9417 | buf.delete(view);
|
9418 | }
|
9419 | buf.add(view);
|
9420 | if (buf.size > this.#size) {
|
9421 | this.#destroyFirstView();
|
9422 | }
|
9423 | }
|
9424 | resize(newSize) {
|
9425 | let idsToKeep = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
9426 | this.#size = newSize;
|
9427 | const buf = this.#buf;
|
9428 | if (idsToKeep) {
|
9429 | const ii = buf.size;
|
9430 | let i = 1;
|
9431 | for (const view of buf) {
|
9432 | if (idsToKeep.has(view.id)) {
|
9433 | buf.delete(view);
|
9434 | buf.add(view);
|
9435 | }
|
9436 | if (++i > ii) {
|
9437 | break;
|
9438 | }
|
9439 | }
|
9440 | }
|
9441 | while (buf.size > this.#size) {
|
9442 | this.#destroyFirstView();
|
9443 | }
|
9444 | }
|
9445 | has(view) {
|
9446 | return this.#buf.has(view);
|
9447 | }
|
9448 | [Symbol.iterator]() {
|
9449 | return this.#buf.keys();
|
9450 | }
|
9451 | #destroyFirstView() {
|
9452 | const firstView = this.#buf.keys().next().value;
|
9453 | firstView?.destroy();
|
9454 | this.#buf.delete(firstView);
|
9455 | }
|
9456 | }
|
9457 | class PDFViewer {
|
9458 | #buffer = null;
|
9459 | #altTextManager = null;
|
9460 | #annotationEditorHighlightColors = null;
|
9461 | #annotationEditorMode = pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationEditorType.NONE;
|
9462 | #annotationEditorUIManager = null;
|
9463 | #annotationMode = pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationMode.ENABLE_FORMS;
|
9464 | #containerTopLeft = null;
|
9465 | #copyCallbackBound = null;
|
9466 | #enableHighlightFloatingButton = false;
|
9467 | #enablePermissions = false;
|
9468 | #mlManager = null;
|
9469 | #getAllTextInProgress = false;
|
9470 | #hiddenCopyElement = null;
|
9471 | #interruptCopyCondition = false;
|
9472 | #previousContainerHeight = 0;
|
9473 | #resizeObserver = new ResizeObserver(this.#resizeObserverCallback.bind(this));
|
9474 | #scrollModePageState = null;
|
9475 | #onVisibilityChange = null;
|
9476 | #scaleTimeoutId = null;
|
9477 | #textLayerMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.TextLayerMode.ENABLE;
|
9478 | constructor(options) {
|
9479 | const viewerVersion = "4.1.392";
|
9480 | if (pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.version !== viewerVersion) {
|
9481 | throw new Error(`The API version "${pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.version}" does not match the Viewer version "${viewerVersion}".`);
|
9482 | }
|
9483 | this.container = options.container;
|
9484 | this.viewer = options.viewer || options.container.firstElementChild;
|
9485 | if (this.container?.tagName !== "DIV" || this.viewer?.tagName !== "DIV") {
|
9486 | throw new Error("Invalid `container` and/or `viewer` option.");
|
9487 | }
|
9488 | if (this.container.offsetParent && getComputedStyle(this.container).position !== "absolute") {
|
9489 | throw new Error("The `container` must be absolutely positioned.");
|
9490 | }
|
9491 | this.#resizeObserver.observe(this.container);
|
9492 | this.eventBus = options.eventBus;
|
9493 | this.linkService = options.linkService || new _pdf_link_service_js__WEBPACK_IMPORTED_MODULE_17__.SimpleLinkService();
|
9494 | this.downloadManager = options.downloadManager || null;
|
9495 | this.findController = options.findController || null;
|
9496 | this.#altTextManager = options.altTextManager || null;
|
9497 | if (this.findController) {
|
9498 | this.findController.onIsPageVisible = pageNumber => this._getVisiblePages().ids.has(pageNumber);
|
9499 | }
|
9500 | this._scriptingManager = options.scriptingManager || null;
|
9501 | this.#textLayerMode = options.textLayerMode ?? _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.TextLayerMode.ENABLE;
|
9502 | this.#annotationMode = options.annotationMode ?? pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationMode.ENABLE_FORMS;
|
9503 | this.#annotationEditorMode = options.annotationEditorMode ?? pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationEditorType.NONE;
|
9504 | this.#annotationEditorHighlightColors = options.annotationEditorHighlightColors || null;
|
9505 | this.#enableHighlightFloatingButton = options.enableHighlightFloatingButton === true;
|
9506 | this.imageResourcesPath = options.imageResourcesPath || "";
|
9507 | this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
|
9508 | this.removePageBorders = options.removePageBorders || false;
|
9509 | this.maxCanvasPixels = options.maxCanvasPixels;
|
9510 | this.l10n = options.l10n;
|
9511 | this.l10n ||= new web_null_l10n__WEBPACK_IMPORTED_MODULE_14__.GenericL10n();
|
9512 | this.#enablePermissions = options.enablePermissions || false;
|
9513 | this.pageColors = options.pageColors || null;
|
9514 | this.#mlManager = options.mlManager || null;
|
9515 | this.defaultRenderingQueue = !options.renderingQueue;
|
9516 | if (this.defaultRenderingQueue) {
|
9517 | this.renderingQueue = new _pdf_rendering_queue_js__WEBPACK_IMPORTED_MODULE_16__.PDFRenderingQueue();
|
9518 | this.renderingQueue.setViewer(this);
|
9519 | } else {
|
9520 | this.renderingQueue = options.renderingQueue;
|
9521 | }
|
9522 | this.scroll = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.watchScroll)(this.container, this._scrollUpdate.bind(this));
|
9523 | this.presentationModeState = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.PresentationModeState.UNKNOWN;
|
9524 | this._onBeforeDraw = this._onAfterDraw = null;
|
9525 | this._resetView();
|
9526 | if (this.removePageBorders) {
|
9527 | this.viewer.classList.add("removePageBorders");
|
9528 | }
|
9529 | this.#updateContainerHeightCss();
|
9530 | this.eventBus._on("thumbnailrendered", _ref => {
|
9531 | let {
|
9532 | pageNumber,
|
9533 | pdfPage
|
9534 | } = _ref;
|
9535 | const pageView = this._pages[pageNumber - 1];
|
9536 | if (!this.#buffer.has(pageView)) {
|
9537 | pdfPage?.cleanup();
|
9538 | }
|
9539 | });
|
9540 | if (!options.l10n) {
|
9541 | this.l10n.translate(this.container);
|
9542 | }
|
9543 | }
|
9544 | get pagesCount() {
|
9545 | return this._pages.length;
|
9546 | }
|
9547 | getPageView(index) {
|
9548 | return this._pages[index];
|
9549 | }
|
9550 | getCachedPageViews() {
|
9551 | return new Set(this.#buffer);
|
9552 | }
|
9553 | get pageViewsReady() {
|
9554 | return this._pages.every(pageView => pageView?.pdfPage);
|
9555 | }
|
9556 | get renderForms() {
|
9557 | return this.#annotationMode === pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationMode.ENABLE_FORMS;
|
9558 | }
|
9559 | get enableScripting() {
|
9560 | return !!this._scriptingManager;
|
9561 | }
|
9562 | get currentPageNumber() {
|
9563 | return this._currentPageNumber;
|
9564 | }
|
9565 | set currentPageNumber(val) {
|
9566 | if (!Number.isInteger(val)) {
|
9567 | throw new Error("Invalid page number.");
|
9568 | }
|
9569 | if (!this.pdfDocument) {
|
9570 | return;
|
9571 | }
|
9572 | if (!this._setCurrentPageNumber(val, true)) {
|
9573 | console.error(`currentPageNumber: "${val}" is not a valid page.`);
|
9574 | }
|
9575 | }
|
9576 | _setCurrentPageNumber(val) {
|
9577 | let resetCurrentPageView = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
9578 | if (this._currentPageNumber === val) {
|
9579 | if (resetCurrentPageView) {
|
9580 | this.#resetCurrentPageView();
|
9581 | }
|
9582 | return true;
|
9583 | }
|
9584 | if (!(0 < val && val <= this.pagesCount)) {
|
9585 | return false;
|
9586 | }
|
9587 | const previous = this._currentPageNumber;
|
9588 | this._currentPageNumber = val;
|
9589 | this.eventBus.dispatch("pagechanging", {
|
9590 | source: this,
|
9591 | pageNumber: val,
|
9592 | pageLabel: this._pageLabels?.[val - 1] ?? null,
|
9593 | previous
|
9594 | });
|
9595 | if (resetCurrentPageView) {
|
9596 | this.#resetCurrentPageView();
|
9597 | }
|
9598 | return true;
|
9599 | }
|
9600 | get currentPageLabel() {
|
9601 | return this._pageLabels?.[this._currentPageNumber - 1] ?? null;
|
9602 | }
|
9603 | set currentPageLabel(val) {
|
9604 | if (!this.pdfDocument) {
|
9605 | return;
|
9606 | }
|
9607 | let page = val | 0;
|
9608 | if (this._pageLabels) {
|
9609 | const i = this._pageLabels.indexOf(val);
|
9610 | if (i >= 0) {
|
9611 | page = i + 1;
|
9612 | }
|
9613 | }
|
9614 | if (!this._setCurrentPageNumber(page, true)) {
|
9615 | console.error(`currentPageLabel: "${val}" is not a valid page.`);
|
9616 | }
|
9617 | }
|
9618 | get currentScale() {
|
9619 | return this._currentScale !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.UNKNOWN_SCALE ? this._currentScale : _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.DEFAULT_SCALE;
|
9620 | }
|
9621 | set currentScale(val) {
|
9622 | if (isNaN(val)) {
|
9623 | throw new Error("Invalid numeric scale.");
|
9624 | }
|
9625 | if (!this.pdfDocument) {
|
9626 | return;
|
9627 | }
|
9628 | this.#setScale(val, {
|
9629 | noScroll: false
|
9630 | });
|
9631 | }
|
9632 | get currentScaleValue() {
|
9633 | return this._currentScaleValue;
|
9634 | }
|
9635 | set currentScaleValue(val) {
|
9636 | if (!this.pdfDocument) {
|
9637 | return;
|
9638 | }
|
9639 | this.#setScale(val, {
|
9640 | noScroll: false
|
9641 | });
|
9642 | }
|
9643 | get pagesRotation() {
|
9644 | return this._pagesRotation;
|
9645 | }
|
9646 | set pagesRotation(rotation) {
|
9647 | if (!(0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.isValidRotation)(rotation)) {
|
9648 | throw new Error("Invalid pages rotation angle.");
|
9649 | }
|
9650 | if (!this.pdfDocument) {
|
9651 | return;
|
9652 | }
|
9653 | rotation %= 360;
|
9654 | if (rotation < 0) {
|
9655 | rotation += 360;
|
9656 | }
|
9657 | if (this._pagesRotation === rotation) {
|
9658 | return;
|
9659 | }
|
9660 | this._pagesRotation = rotation;
|
9661 | const pageNumber = this._currentPageNumber;
|
9662 | this.refresh(true, {
|
9663 | rotation
|
9664 | });
|
9665 | if (this._currentScaleValue) {
|
9666 | this.#setScale(this._currentScaleValue, {
|
9667 | noScroll: true
|
9668 | });
|
9669 | }
|
9670 | this.eventBus.dispatch("rotationchanging", {
|
9671 | source: this,
|
9672 | pagesRotation: rotation,
|
9673 | pageNumber
|
9674 | });
|
9675 | if (this.defaultRenderingQueue) {
|
9676 | this.update();
|
9677 | }
|
9678 | }
|
9679 | get firstPagePromise() {
|
9680 | return this.pdfDocument ? this._firstPageCapability.promise : null;
|
9681 | }
|
9682 | get onePageRendered() {
|
9683 | return this.pdfDocument ? this._onePageRenderedCapability.promise : null;
|
9684 | }
|
9685 | get pagesPromise() {
|
9686 | return this.pdfDocument ? this._pagesCapability.promise : null;
|
9687 | }
|
9688 | get _layerProperties() {
|
9689 | const self = this;
|
9690 | return (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.shadow)(this, "_layerProperties", {
|
9691 | get annotationEditorUIManager() {
|
9692 | return self.#annotationEditorUIManager;
|
9693 | },
|
9694 | get annotationStorage() {
|
9695 | return self.pdfDocument?.annotationStorage;
|
9696 | },
|
9697 | get downloadManager() {
|
9698 | return self.downloadManager;
|
9699 | },
|
9700 | get enableScripting() {
|
9701 | return !!self._scriptingManager;
|
9702 | },
|
9703 | get fieldObjectsPromise() {
|
9704 | return self.pdfDocument?.getFieldObjects();
|
9705 | },
|
9706 | get findController() {
|
9707 | return self.findController;
|
9708 | },
|
9709 | get hasJSActionsPromise() {
|
9710 | return self.pdfDocument?.hasJSActions();
|
9711 | },
|
9712 | get linkService() {
|
9713 | return self.linkService;
|
9714 | }
|
9715 | });
|
9716 | }
|
9717 | #initializePermissions(permissions) {
|
9718 | const params = {
|
9719 | annotationEditorMode: this.#annotationEditorMode,
|
9720 | annotationMode: this.#annotationMode,
|
9721 | textLayerMode: this.#textLayerMode
|
9722 | };
|
9723 | if (!permissions) {
|
9724 | return params;
|
9725 | }
|
9726 | if (!permissions.includes(pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PermissionFlag.COPY) && this.#textLayerMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.TextLayerMode.ENABLE) {
|
9727 | params.textLayerMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.TextLayerMode.ENABLE_PERMISSIONS;
|
9728 | }
|
9729 | if (!permissions.includes(pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PermissionFlag.MODIFY_CONTENTS)) {
|
9730 | params.annotationEditorMode = pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationEditorType.DISABLE;
|
9731 | }
|
9732 | if (!permissions.includes(pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PermissionFlag.MODIFY_ANNOTATIONS) && !permissions.includes(pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PermissionFlag.FILL_INTERACTIVE_FORMS) && this.#annotationMode === pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationMode.ENABLE_FORMS) {
|
9733 | params.annotationMode = pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationMode.ENABLE;
|
9734 | }
|
9735 | return params;
|
9736 | }
|
9737 | async #onePageRenderedOrForceFetch() {
|
9738 | if (document.visibilityState === "hidden" || !this.container.offsetParent || this._getVisiblePages().views.length === 0) {
|
9739 | return;
|
9740 | }
|
9741 | const visibilityChangePromise = new Promise(resolve => {
|
9742 | this.#onVisibilityChange = () => {
|
9743 | if (document.visibilityState !== "hidden") {
|
9744 | return;
|
9745 | }
|
9746 | resolve();
|
9747 | };
|
9748 | document.addEventListener("visibilitychange", this.#onVisibilityChange);
|
9749 | });
|
9750 | await Promise.race([this._onePageRenderedCapability.promise, visibilityChangePromise]);
|
9751 | document.removeEventListener("visibilitychange", this.#onVisibilityChange);
|
9752 | this.#onVisibilityChange = null;
|
9753 | }
|
9754 | async getAllText() {
|
9755 | const texts = [];
|
9756 | const buffer = [];
|
9757 | for (let pageNum = 1, pagesCount = this.pdfDocument.numPages; pageNum <= pagesCount; ++pageNum) {
|
9758 | if (this.#interruptCopyCondition) {
|
9759 | return null;
|
9760 | }
|
9761 | buffer.length = 0;
|
9762 | const page = await this.pdfDocument.getPage(pageNum);
|
9763 | const {
|
9764 | items
|
9765 | } = await page.getTextContent();
|
9766 | for (const item of items) {
|
9767 | if (item.str) {
|
9768 | buffer.push(item.str);
|
9769 | }
|
9770 | if (item.hasEOL) {
|
9771 | buffer.push("\n");
|
9772 | }
|
9773 | }
|
9774 | texts.push((0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.removeNullCharacters)(buffer.join("")));
|
9775 | }
|
9776 | return texts.join("\n");
|
9777 | }
|
9778 | #copyCallback(textLayerMode, event) {
|
9779 | const selection = document.getSelection();
|
9780 | const {
|
9781 | focusNode,
|
9782 | anchorNode
|
9783 | } = selection;
|
9784 | if (anchorNode && focusNode && selection.containsNode(this.#hiddenCopyElement)) {
|
9785 | if (this.#getAllTextInProgress || textLayerMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.TextLayerMode.ENABLE_PERMISSIONS) {
|
9786 | event.preventDefault();
|
9787 | event.stopPropagation();
|
9788 | return;
|
9789 | }
|
9790 | this.#getAllTextInProgress = true;
|
9791 | const savedCursor = this.container.style.cursor;
|
9792 | this.container.style.cursor = "wait";
|
9793 | const interruptCopy = ev => this.#interruptCopyCondition = ev.key === "Escape";
|
9794 | window.addEventListener("keydown", interruptCopy);
|
9795 | this.getAllText().then(async text => {
|
9796 | if (text !== null) {
|
9797 | await navigator.clipboard.writeText(text);
|
9798 | }
|
9799 | }).catch(reason => {
|
9800 | console.warn(`Something goes wrong when extracting the text: ${reason.message}`);
|
9801 | }).finally(() => {
|
9802 | this.#getAllTextInProgress = false;
|
9803 | this.#interruptCopyCondition = false;
|
9804 | window.removeEventListener("keydown", interruptCopy);
|
9805 | this.container.style.cursor = savedCursor;
|
9806 | });
|
9807 | event.preventDefault();
|
9808 | event.stopPropagation();
|
9809 | }
|
9810 | }
|
9811 | setDocument(pdfDocument) {
|
9812 | if (this.pdfDocument) {
|
9813 | this.eventBus.dispatch("pagesdestroy", {
|
9814 | source: this
|
9815 | });
|
9816 | this._cancelRendering();
|
9817 | this._resetView();
|
9818 | this.findController?.setDocument(null);
|
9819 | this._scriptingManager?.setDocument(null);
|
9820 | if (this.#annotationEditorUIManager) {
|
9821 | this.#annotationEditorUIManager.destroy();
|
9822 | this.#annotationEditorUIManager = null;
|
9823 | }
|
9824 | }
|
9825 | this.pdfDocument = pdfDocument;
|
9826 | if (!pdfDocument) {
|
9827 | return;
|
9828 | }
|
9829 | const pagesCount = pdfDocument.numPages;
|
9830 | const firstPagePromise = pdfDocument.getPage(1);
|
9831 | const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig({
|
9832 | intent: "display"
|
9833 | });
|
9834 | const permissionsPromise = this.#enablePermissions ? pdfDocument.getPermissions() : Promise.resolve();
|
9835 | if (pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) {
|
9836 | console.warn("Forcing PAGE-scrolling for performance reasons, given the length of the document.");
|
9837 | const mode = this._scrollMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE;
|
9838 | this.eventBus.dispatch("scrollmodechanged", {
|
9839 | source: this,
|
9840 | mode
|
9841 | });
|
9842 | }
|
9843 | this._pagesCapability.promise.then(() => {
|
9844 | this.eventBus.dispatch("pagesloaded", {
|
9845 | source: this,
|
9846 | pagesCount
|
9847 | });
|
9848 | }, () => {});
|
9849 | this._onBeforeDraw = evt => {
|
9850 | const pageView = this._pages[evt.pageNumber - 1];
|
9851 | if (!pageView) {
|
9852 | return;
|
9853 | }
|
9854 | this.#buffer.push(pageView);
|
9855 | };
|
9856 | this.eventBus._on("pagerender", this._onBeforeDraw);
|
9857 | this._onAfterDraw = evt => {
|
9858 | if (evt.cssTransform) {
|
9859 | return;
|
9860 | }
|
9861 | this._onePageRenderedCapability.resolve({
|
9862 | timestamp: evt.timestamp
|
9863 | });
|
9864 | this.eventBus._off("pagerendered", this._onAfterDraw);
|
9865 | this._onAfterDraw = null;
|
9866 | };
|
9867 | this.eventBus._on("pagerendered", this._onAfterDraw);
|
9868 | Promise.all([firstPagePromise, permissionsPromise]).then(_ref2 => {
|
9869 | let [firstPdfPage, permissions] = _ref2;
|
9870 | if (pdfDocument !== this.pdfDocument) {
|
9871 | return;
|
9872 | }
|
9873 | this._firstPageCapability.resolve(firstPdfPage);
|
9874 | this._optionalContentConfigPromise = optionalContentConfigPromise;
|
9875 | const {
|
9876 | annotationEditorMode,
|
9877 | annotationMode,
|
9878 | textLayerMode
|
9879 | } = this.#initializePermissions(permissions);
|
9880 | if (textLayerMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.TextLayerMode.DISABLE) {
|
9881 | const element = this.#hiddenCopyElement = document.createElement("div");
|
9882 | element.id = "hiddenCopyElement";
|
9883 | this.viewer.before(element);
|
9884 | }
|
9885 | if (annotationEditorMode !== pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationEditorType.DISABLE) {
|
9886 | const mode = annotationEditorMode;
|
9887 | if (pdfDocument.isPureXfa) {
|
9888 | console.warn("Warning: XFA-editing is not implemented.");
|
9889 | } else if (isValidAnnotationEditorMode(mode)) {
|
9890 | this.#annotationEditorUIManager = new pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationEditorUIManager(this.container, this.viewer, this.#altTextManager, this.eventBus, pdfDocument, this.pageColors, this.#annotationEditorHighlightColors, this.#enableHighlightFloatingButton, this.#mlManager);
|
9891 | this.eventBus.dispatch("annotationeditoruimanager", {
|
9892 | source: this,
|
9893 | uiManager: this.#annotationEditorUIManager
|
9894 | });
|
9895 | if (mode !== pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationEditorType.NONE) {
|
9896 | this.#annotationEditorUIManager.updateMode(mode);
|
9897 | }
|
9898 | } else {
|
9899 | console.error(`Invalid AnnotationEditor mode: ${mode}`);
|
9900 | }
|
9901 | }
|
9902 | const viewerElement = this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE ? null : this.viewer;
|
9903 | const scale = this.currentScale;
|
9904 | const viewport = firstPdfPage.getViewport({
|
9905 | scale: scale * pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PixelsPerInch.PDF_TO_CSS_UNITS
|
9906 | });
|
9907 | this.viewer.style.setProperty("--scale-factor", viewport.scale);
|
9908 | if (this.pageColors?.foreground === "CanvasText" || this.pageColors?.background === "Canvas") {
|
9909 | this.viewer.style.setProperty("--hcm-highlight-filter", pdfDocument.filterFactory.addHighlightHCMFilter("highlight", "CanvasText", "Canvas", "HighlightText", "Highlight"));
|
9910 | this.viewer.style.setProperty("--hcm-highlight-selected-filter", pdfDocument.filterFactory.addHighlightHCMFilter("highlight_selected", "CanvasText", "Canvas", "HighlightText", "ButtonText"));
|
9911 | }
|
9912 | for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {
|
9913 | const pageView = new _pdf_page_view_js__WEBPACK_IMPORTED_MODULE_15__.PDFPageView({
|
9914 | container: viewerElement,
|
9915 | eventBus: this.eventBus,
|
9916 | id: pageNum,
|
9917 | scale,
|
9918 | defaultViewport: viewport.clone(),
|
9919 | optionalContentConfigPromise,
|
9920 | renderingQueue: this.renderingQueue,
|
9921 | textLayerMode,
|
9922 | annotationMode,
|
9923 | imageResourcesPath: this.imageResourcesPath,
|
9924 | maxCanvasPixels: this.maxCanvasPixels,
|
9925 | pageColors: this.pageColors,
|
9926 | l10n: this.l10n,
|
9927 | layerProperties: this._layerProperties
|
9928 | });
|
9929 | this._pages.push(pageView);
|
9930 | }
|
9931 | const firstPageView = this._pages[0];
|
9932 | if (firstPageView) {
|
9933 | firstPageView.setPdfPage(firstPdfPage);
|
9934 | this.linkService.cachePageRef(1, firstPdfPage.ref);
|
9935 | }
|
9936 | if (this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE) {
|
9937 | this.#ensurePageViewVisible();
|
9938 | } else if (this._spreadMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SpreadMode.NONE) {
|
9939 | this._updateSpreadMode();
|
9940 | }
|
9941 | this.#onePageRenderedOrForceFetch().then(async () => {
|
9942 | this.findController?.setDocument(pdfDocument);
|
9943 | this._scriptingManager?.setDocument(pdfDocument);
|
9944 | if (this.#hiddenCopyElement) {
|
9945 | this.#copyCallbackBound = this.#copyCallback.bind(this, textLayerMode);
|
9946 | document.addEventListener("copy", this.#copyCallbackBound);
|
9947 | }
|
9948 | if (this.#annotationEditorUIManager) {
|
9949 | this.eventBus.dispatch("annotationeditormodechanged", {
|
9950 | source: this,
|
9951 | mode: this.#annotationEditorMode
|
9952 | });
|
9953 | }
|
9954 | if (pdfDocument.loadingParams.disableAutoFetch || pagesCount > PagesCountLimit.FORCE_LAZY_PAGE_INIT) {
|
9955 | this._pagesCapability.resolve();
|
9956 | return;
|
9957 | }
|
9958 | let getPagesLeft = pagesCount - 1;
|
9959 | if (getPagesLeft <= 0) {
|
9960 | this._pagesCapability.resolve();
|
9961 | return;
|
9962 | }
|
9963 | for (let pageNum = 2; pageNum <= pagesCount; ++pageNum) {
|
9964 | const promise = pdfDocument.getPage(pageNum).then(pdfPage => {
|
9965 | const pageView = this._pages[pageNum - 1];
|
9966 | if (!pageView.pdfPage) {
|
9967 | pageView.setPdfPage(pdfPage);
|
9968 | }
|
9969 | this.linkService.cachePageRef(pageNum, pdfPage.ref);
|
9970 | if (--getPagesLeft === 0) {
|
9971 | this._pagesCapability.resolve();
|
9972 | }
|
9973 | }, reason => {
|
9974 | console.error(`Unable to get page ${pageNum} to initialize viewer`, reason);
|
9975 | if (--getPagesLeft === 0) {
|
9976 | this._pagesCapability.resolve();
|
9977 | }
|
9978 | });
|
9979 | if (pageNum % PagesCountLimit.PAUSE_EAGER_PAGE_INIT === 0) {
|
9980 | await promise;
|
9981 | }
|
9982 | }
|
9983 | });
|
9984 | this.eventBus.dispatch("pagesinit", {
|
9985 | source: this
|
9986 | });
|
9987 | pdfDocument.getMetadata().then(_ref3 => {
|
9988 | let {
|
9989 | info
|
9990 | } = _ref3;
|
9991 | if (pdfDocument !== this.pdfDocument) {
|
9992 | return;
|
9993 | }
|
9994 | if (info.Language) {
|
9995 | this.viewer.lang = info.Language;
|
9996 | }
|
9997 | });
|
9998 | if (this.defaultRenderingQueue) {
|
9999 | this.update();
|
10000 | }
|
10001 | }).catch(reason => {
|
10002 | console.error("Unable to initialize viewer", reason);
|
10003 | this._pagesCapability.reject(reason);
|
10004 | });
|
10005 | }
|
10006 | setPageLabels(labels) {
|
10007 | if (!this.pdfDocument) {
|
10008 | return;
|
10009 | }
|
10010 | if (!labels) {
|
10011 | this._pageLabels = null;
|
10012 | } else if (!(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)) {
|
10013 | this._pageLabels = null;
|
10014 | console.error(`setPageLabels: Invalid page labels.`);
|
10015 | } else {
|
10016 | this._pageLabels = labels;
|
10017 | }
|
10018 | for (let i = 0, ii = this._pages.length; i < ii; i++) {
|
10019 | this._pages[i].setPageLabel(this._pageLabels?.[i] ?? null);
|
10020 | }
|
10021 | }
|
10022 | _resetView() {
|
10023 | this._pages = [];
|
10024 | this._currentPageNumber = 1;
|
10025 | this._currentScale = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.UNKNOWN_SCALE;
|
10026 | this._currentScaleValue = null;
|
10027 | this._pageLabels = null;
|
10028 | this.#buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE);
|
10029 | this._location = null;
|
10030 | this._pagesRotation = 0;
|
10031 | this._optionalContentConfigPromise = null;
|
10032 | this._firstPageCapability = Promise.withResolvers();
|
10033 | this._onePageRenderedCapability = Promise.withResolvers();
|
10034 | this._pagesCapability = Promise.withResolvers();
|
10035 | this._scrollMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.VERTICAL;
|
10036 | this._previousScrollMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.UNKNOWN;
|
10037 | this._spreadMode = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SpreadMode.NONE;
|
10038 | this.#scrollModePageState = {
|
10039 | previousPageNumber: 1,
|
10040 | scrollDown: true,
|
10041 | pages: []
|
10042 | };
|
10043 | if (this._onBeforeDraw) {
|
10044 | this.eventBus._off("pagerender", this._onBeforeDraw);
|
10045 | this._onBeforeDraw = null;
|
10046 | }
|
10047 | if (this._onAfterDraw) {
|
10048 | this.eventBus._off("pagerendered", this._onAfterDraw);
|
10049 | this._onAfterDraw = null;
|
10050 | }
|
10051 | if (this.#onVisibilityChange) {
|
10052 | document.removeEventListener("visibilitychange", this.#onVisibilityChange);
|
10053 | this.#onVisibilityChange = null;
|
10054 | }
|
10055 | this.viewer.textContent = "";
|
10056 | this._updateScrollMode();
|
10057 | this.viewer.removeAttribute("lang");
|
10058 | if (this.#hiddenCopyElement) {
|
10059 | document.removeEventListener("copy", this.#copyCallbackBound);
|
10060 | this.#copyCallbackBound = null;
|
10061 | this.#hiddenCopyElement.remove();
|
10062 | this.#hiddenCopyElement = null;
|
10063 | }
|
10064 | }
|
10065 | #ensurePageViewVisible() {
|
10066 | if (this._scrollMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE) {
|
10067 | throw new Error("#ensurePageViewVisible: Invalid scrollMode value.");
|
10068 | }
|
10069 | const pageNumber = this._currentPageNumber,
|
10070 | state = this.#scrollModePageState,
|
10071 | viewer = this.viewer;
|
10072 | viewer.textContent = "";
|
10073 | state.pages.length = 0;
|
10074 | if (this._spreadMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SpreadMode.NONE && !this.isInPresentationMode) {
|
10075 | const pageView = this._pages[pageNumber - 1];
|
10076 | viewer.append(pageView.div);
|
10077 | state.pages.push(pageView);
|
10078 | } else {
|
10079 | const pageIndexSet = new Set(),
|
10080 | parity = this._spreadMode - 1;
|
10081 | if (parity === -1) {
|
10082 | pageIndexSet.add(pageNumber - 1);
|
10083 | } else if (pageNumber % 2 !== parity) {
|
10084 | pageIndexSet.add(pageNumber - 1);
|
10085 | pageIndexSet.add(pageNumber);
|
10086 | } else {
|
10087 | pageIndexSet.add(pageNumber - 2);
|
10088 | pageIndexSet.add(pageNumber - 1);
|
10089 | }
|
10090 | const spread = document.createElement("div");
|
10091 | spread.className = "spread";
|
10092 | if (this.isInPresentationMode) {
|
10093 | const dummyPage = document.createElement("div");
|
10094 | dummyPage.className = "dummyPage";
|
10095 | spread.append(dummyPage);
|
10096 | }
|
10097 | for (const i of pageIndexSet) {
|
10098 | const pageView = this._pages[i];
|
10099 | if (!pageView) {
|
10100 | continue;
|
10101 | }
|
10102 | spread.append(pageView.div);
|
10103 | state.pages.push(pageView);
|
10104 | }
|
10105 | viewer.append(spread);
|
10106 | }
|
10107 | state.scrollDown = pageNumber >= state.previousPageNumber;
|
10108 | state.previousPageNumber = pageNumber;
|
10109 | }
|
10110 | _scrollUpdate() {
|
10111 | if (this.pagesCount === 0) {
|
10112 | return;
|
10113 | }
|
10114 | this.update();
|
10115 | }
|
10116 | #scrollIntoView(pageView) {
|
10117 | let pageSpot = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
|
10118 | const {
|
10119 | div,
|
10120 | id
|
10121 | } = pageView;
|
10122 | if (this._currentPageNumber !== id) {
|
10123 | this._setCurrentPageNumber(id);
|
10124 | }
|
10125 | if (this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE) {
|
10126 | this.#ensurePageViewVisible();
|
10127 | this.update();
|
10128 | }
|
10129 | if (!pageSpot && !this.isInPresentationMode) {
|
10130 | const left = div.offsetLeft + div.clientLeft,
|
10131 | right = left + div.clientWidth;
|
10132 | const {
|
10133 | scrollLeft,
|
10134 | clientWidth
|
10135 | } = this.container;
|
10136 | if (this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.HORIZONTAL || left < scrollLeft || right > scrollLeft + clientWidth) {
|
10137 | pageSpot = {
|
10138 | left: 0,
|
10139 | top: 0
|
10140 | };
|
10141 | }
|
10142 | }
|
10143 | (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.scrollIntoView)(div, pageSpot);
|
10144 | if (!this._currentScaleValue && this._location) {
|
10145 | this._location = null;
|
10146 | }
|
10147 | }
|
10148 | #isSameScale(newScale) {
|
10149 | return newScale === this._currentScale || Math.abs(newScale - this._currentScale) < 1e-15;
|
10150 | }
|
10151 | #setScaleUpdatePages(newScale, newValue, _ref4) {
|
10152 | let {
|
10153 | noScroll = false,
|
10154 | preset = false,
|
10155 | drawingDelay = -1
|
10156 | } = _ref4;
|
10157 | this._currentScaleValue = newValue.toString();
|
10158 | if (this.#isSameScale(newScale)) {
|
10159 | if (preset) {
|
10160 | this.eventBus.dispatch("scalechanging", {
|
10161 | source: this,
|
10162 | scale: newScale,
|
10163 | presetValue: newValue
|
10164 | });
|
10165 | }
|
10166 | return;
|
10167 | }
|
10168 | this.viewer.style.setProperty("--scale-factor", newScale * pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PixelsPerInch.PDF_TO_CSS_UNITS);
|
10169 | const postponeDrawing = drawingDelay >= 0 && drawingDelay < 1000;
|
10170 | this.refresh(true, {
|
10171 | scale: newScale,
|
10172 | drawingDelay: postponeDrawing ? drawingDelay : -1
|
10173 | });
|
10174 | if (postponeDrawing) {
|
10175 | this.#scaleTimeoutId = setTimeout(() => {
|
10176 | this.#scaleTimeoutId = null;
|
10177 | this.refresh();
|
10178 | }, drawingDelay);
|
10179 | }
|
10180 | this._currentScale = newScale;
|
10181 | if (!noScroll) {
|
10182 | let page = this._currentPageNumber,
|
10183 | dest;
|
10184 | if (this._location && !(this.isInPresentationMode || this.isChangingPresentationMode)) {
|
10185 | page = this._location.pageNumber;
|
10186 | dest = [null, {
|
10187 | name: "XYZ"
|
10188 | }, this._location.left, this._location.top, null];
|
10189 | }
|
10190 | this.scrollPageIntoView({
|
10191 | pageNumber: page,
|
10192 | destArray: dest,
|
10193 | allowNegativeOffset: true
|
10194 | });
|
10195 | }
|
10196 | this.eventBus.dispatch("scalechanging", {
|
10197 | source: this,
|
10198 | scale: newScale,
|
10199 | presetValue: preset ? newValue : undefined
|
10200 | });
|
10201 | if (this.defaultRenderingQueue) {
|
10202 | this.update();
|
10203 | }
|
10204 | }
|
10205 | get #pageWidthScaleFactor() {
|
10206 | if (this._spreadMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SpreadMode.NONE && this._scrollMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.HORIZONTAL) {
|
10207 | return 2;
|
10208 | }
|
10209 | return 1;
|
10210 | }
|
10211 | #setScale(value, options) {
|
10212 | let scale = parseFloat(value);
|
10213 | if (scale > 0) {
|
10214 | options.preset = false;
|
10215 | this.#setScaleUpdatePages(scale, value, options);
|
10216 | } else {
|
10217 | const currentPage = this._pages[this._currentPageNumber - 1];
|
10218 | if (!currentPage) {
|
10219 | return;
|
10220 | }
|
10221 | let hPadding = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SCROLLBAR_PADDING,
|
10222 | vPadding = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.VERTICAL_PADDING;
|
10223 | if (this.isInPresentationMode) {
|
10224 | hPadding = vPadding = 4;
|
10225 | if (this._spreadMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SpreadMode.NONE) {
|
10226 | hPadding *= 2;
|
10227 | }
|
10228 | } else if (this.removePageBorders) {
|
10229 | hPadding = vPadding = 0;
|
10230 | } else if (this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.HORIZONTAL) {
|
10231 | [hPadding, vPadding] = [vPadding, hPadding];
|
10232 | }
|
10233 | const pageWidthScale = (this.container.clientWidth - hPadding) / currentPage.width * currentPage.scale / this.#pageWidthScaleFactor;
|
10234 | const pageHeightScale = (this.container.clientHeight - vPadding) / currentPage.height * currentPage.scale;
|
10235 | switch (value) {
|
10236 | case "page-actual":
|
10237 | scale = 1;
|
10238 | break;
|
10239 | case "page-width":
|
10240 | scale = pageWidthScale;
|
10241 | break;
|
10242 | case "page-height":
|
10243 | scale = pageHeightScale;
|
10244 | break;
|
10245 | case "page-fit":
|
10246 | scale = Math.min(pageWidthScale, pageHeightScale);
|
10247 | break;
|
10248 | case "auto":
|
10249 | const horizontalScale = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.isPortraitOrientation)(currentPage) ? pageWidthScale : Math.min(pageHeightScale, pageWidthScale);
|
10250 | scale = Math.min(_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.MAX_AUTO_SCALE, horizontalScale);
|
10251 | break;
|
10252 | default:
|
10253 | console.error(`#setScale: "${value}" is an unknown zoom value.`);
|
10254 | return;
|
10255 | }
|
10256 | options.preset = true;
|
10257 | this.#setScaleUpdatePages(scale, value, options);
|
10258 | }
|
10259 | }
|
10260 | #resetCurrentPageView() {
|
10261 | const pageView = this._pages[this._currentPageNumber - 1];
|
10262 | if (this.isInPresentationMode) {
|
10263 | this.#setScale(this._currentScaleValue, {
|
10264 | noScroll: true
|
10265 | });
|
10266 | }
|
10267 | this.#scrollIntoView(pageView);
|
10268 | }
|
10269 | pageLabelToPageNumber(label) {
|
10270 | if (!this._pageLabels) {
|
10271 | return null;
|
10272 | }
|
10273 | const i = this._pageLabels.indexOf(label);
|
10274 | if (i < 0) {
|
10275 | return null;
|
10276 | }
|
10277 | return i + 1;
|
10278 | }
|
10279 | scrollPageIntoView(_ref5) {
|
10280 | let {
|
10281 | pageNumber,
|
10282 | destArray = null,
|
10283 | allowNegativeOffset = false,
|
10284 | ignoreDestinationZoom = false
|
10285 | } = _ref5;
|
10286 | if (!this.pdfDocument) {
|
10287 | return;
|
10288 | }
|
10289 | const pageView = Number.isInteger(pageNumber) && this._pages[pageNumber - 1];
|
10290 | if (!pageView) {
|
10291 | console.error(`scrollPageIntoView: "${pageNumber}" is not a valid pageNumber parameter.`);
|
10292 | return;
|
10293 | }
|
10294 | if (this.isInPresentationMode || !destArray) {
|
10295 | this._setCurrentPageNumber(pageNumber, true);
|
10296 | return;
|
10297 | }
|
10298 | let x = 0,
|
10299 | y = 0;
|
10300 | let width = 0,
|
10301 | height = 0,
|
10302 | widthScale,
|
10303 | heightScale;
|
10304 | const changeOrientation = pageView.rotation % 180 !== 0;
|
10305 | const pageWidth = (changeOrientation ? pageView.height : pageView.width) / pageView.scale / pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PixelsPerInch.PDF_TO_CSS_UNITS;
|
10306 | const pageHeight = (changeOrientation ? pageView.width : pageView.height) / pageView.scale / pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PixelsPerInch.PDF_TO_CSS_UNITS;
|
10307 | let scale = 0;
|
10308 | switch (destArray[1].name) {
|
10309 | case "XYZ":
|
10310 | x = destArray[2];
|
10311 | y = destArray[3];
|
10312 | scale = destArray[4];
|
10313 | x = x !== null ? x : 0;
|
10314 | y = y !== null ? y : pageHeight;
|
10315 | break;
|
10316 | case "Fit":
|
10317 | case "FitB":
|
10318 | scale = "page-fit";
|
10319 | break;
|
10320 | case "FitH":
|
10321 | case "FitBH":
|
10322 | y = destArray[2];
|
10323 | scale = "page-width";
|
10324 | if (y === null && this._location) {
|
10325 | x = this._location.left;
|
10326 | y = this._location.top;
|
10327 | } else if (typeof y !== "number" || y < 0) {
|
10328 | y = pageHeight;
|
10329 | }
|
10330 | break;
|
10331 | case "FitV":
|
10332 | case "FitBV":
|
10333 | x = destArray[2];
|
10334 | width = pageWidth;
|
10335 | height = pageHeight;
|
10336 | scale = "page-height";
|
10337 | break;
|
10338 | case "FitR":
|
10339 | x = destArray[2];
|
10340 | y = destArray[3];
|
10341 | width = destArray[4] - x;
|
10342 | height = destArray[5] - y;
|
10343 | let hPadding = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SCROLLBAR_PADDING,
|
10344 | vPadding = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.VERTICAL_PADDING;
|
10345 | if (this.removePageBorders) {
|
10346 | hPadding = vPadding = 0;
|
10347 | }
|
10348 | widthScale = (this.container.clientWidth - hPadding) / width / pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PixelsPerInch.PDF_TO_CSS_UNITS;
|
10349 | heightScale = (this.container.clientHeight - vPadding) / height / pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.PixelsPerInch.PDF_TO_CSS_UNITS;
|
10350 | scale = Math.min(Math.abs(widthScale), Math.abs(heightScale));
|
10351 | break;
|
10352 | default:
|
10353 | console.error(`scrollPageIntoView: "${destArray[1].name}" is not a valid destination type.`);
|
10354 | return;
|
10355 | }
|
10356 | if (!ignoreDestinationZoom) {
|
10357 | if (scale && scale !== this._currentScale) {
|
10358 | this.currentScaleValue = scale;
|
10359 | } else if (this._currentScale === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.UNKNOWN_SCALE) {
|
10360 | this.currentScaleValue = _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.DEFAULT_SCALE_VALUE;
|
10361 | }
|
10362 | }
|
10363 | if (scale === "page-fit" && !destArray[4]) {
|
10364 | this.#scrollIntoView(pageView);
|
10365 | return;
|
10366 | }
|
10367 | const boundingRect = [pageView.viewport.convertToViewportPoint(x, y), pageView.viewport.convertToViewportPoint(x + width, y + height)];
|
10368 | let left = Math.min(boundingRect[0][0], boundingRect[1][0]);
|
10369 | let top = Math.min(boundingRect[0][1], boundingRect[1][1]);
|
10370 | if (!allowNegativeOffset) {
|
10371 | left = Math.max(left, 0);
|
10372 | top = Math.max(top, 0);
|
10373 | }
|
10374 | this.#scrollIntoView(pageView, {
|
10375 | left,
|
10376 | top
|
10377 | });
|
10378 | }
|
10379 | _updateLocation(firstPage) {
|
10380 | const currentScale = this._currentScale;
|
10381 | const currentScaleValue = this._currentScaleValue;
|
10382 | const normalizedScaleValue = parseFloat(currentScaleValue) === currentScale ? Math.round(currentScale * 10000) / 100 : currentScaleValue;
|
10383 | const pageNumber = firstPage.id;
|
10384 | const currentPageView = this._pages[pageNumber - 1];
|
10385 | const container = this.container;
|
10386 | const topLeft = currentPageView.getPagePoint(container.scrollLeft - firstPage.x, container.scrollTop - firstPage.y);
|
10387 | const intLeft = Math.round(topLeft[0]);
|
10388 | const intTop = Math.round(topLeft[1]);
|
10389 | let pdfOpenParams = `#page=${pageNumber}`;
|
10390 | if (!this.isInPresentationMode) {
|
10391 | pdfOpenParams += `&zoom=${normalizedScaleValue},${intLeft},${intTop}`;
|
10392 | }
|
10393 | this._location = {
|
10394 | pageNumber,
|
10395 | scale: normalizedScaleValue,
|
10396 | top: intTop,
|
10397 | left: intLeft,
|
10398 | rotation: this._pagesRotation,
|
10399 | pdfOpenParams
|
10400 | };
|
10401 | }
|
10402 | update() {
|
10403 | const visible = this._getVisiblePages();
|
10404 | const visiblePages = visible.views,
|
10405 | numVisiblePages = visiblePages.length;
|
10406 | if (numVisiblePages === 0) {
|
10407 | return;
|
10408 | }
|
10409 | const newCacheSize = Math.max(DEFAULT_CACHE_SIZE, 2 * numVisiblePages + 1);
|
10410 | this.#buffer.resize(newCacheSize, visible.ids);
|
10411 | this.renderingQueue.renderHighestPriority(visible);
|
10412 | const isSimpleLayout = this._spreadMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SpreadMode.NONE && (this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE || this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.VERTICAL);
|
10413 | const currentId = this._currentPageNumber;
|
10414 | let stillFullyVisible = false;
|
10415 | for (const page of visiblePages) {
|
10416 | if (page.percent < 100) {
|
10417 | break;
|
10418 | }
|
10419 | if (page.id === currentId && isSimpleLayout) {
|
10420 | stillFullyVisible = true;
|
10421 | break;
|
10422 | }
|
10423 | }
|
10424 | this._setCurrentPageNumber(stillFullyVisible ? currentId : visiblePages[0].id);
|
10425 | this._updateLocation(visible.first);
|
10426 | this.eventBus.dispatch("updateviewarea", {
|
10427 | source: this,
|
10428 | location: this._location
|
10429 | });
|
10430 | }
|
10431 | containsElement(element) {
|
10432 | return this.container.contains(element);
|
10433 | }
|
10434 | focus() {
|
10435 | this.container.focus();
|
10436 | }
|
10437 | get _isContainerRtl() {
|
10438 | return getComputedStyle(this.container).direction === "rtl";
|
10439 | }
|
10440 | get isInPresentationMode() {
|
10441 | return this.presentationModeState === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.PresentationModeState.FULLSCREEN;
|
10442 | }
|
10443 | get isChangingPresentationMode() {
|
10444 | return this.presentationModeState === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.PresentationModeState.CHANGING;
|
10445 | }
|
10446 | get isHorizontalScrollbarEnabled() {
|
10447 | return this.isInPresentationMode ? false : this.container.scrollWidth > this.container.clientWidth;
|
10448 | }
|
10449 | get isVerticalScrollbarEnabled() {
|
10450 | return this.isInPresentationMode ? false : this.container.scrollHeight > this.container.clientHeight;
|
10451 | }
|
10452 | _getVisiblePages() {
|
10453 | const views = this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE ? this.#scrollModePageState.pages : this._pages,
|
10454 | horizontal = this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.HORIZONTAL,
|
10455 | rtl = horizontal && this._isContainerRtl;
|
10456 | return (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.getVisibleElements)({
|
10457 | scrollEl: this.container,
|
10458 | views,
|
10459 | sortByVisibility: true,
|
10460 | horizontal,
|
10461 | rtl
|
10462 | });
|
10463 | }
|
10464 | cleanup() {
|
10465 | for (const pageView of this._pages) {
|
10466 | if (pageView.renderingState !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.RenderingStates.FINISHED) {
|
10467 | pageView.reset();
|
10468 | }
|
10469 | }
|
10470 | }
|
10471 | _cancelRendering() {
|
10472 | for (const pageView of this._pages) {
|
10473 | pageView.cancelRendering();
|
10474 | }
|
10475 | }
|
10476 | async #ensurePdfPageLoaded(pageView) {
|
10477 | if (pageView.pdfPage) {
|
10478 | return pageView.pdfPage;
|
10479 | }
|
10480 | try {
|
10481 | const pdfPage = await this.pdfDocument.getPage(pageView.id);
|
10482 | if (!pageView.pdfPage) {
|
10483 | pageView.setPdfPage(pdfPage);
|
10484 | }
|
10485 | if (!this.linkService._cachedPageNumber?.(pdfPage.ref)) {
|
10486 | this.linkService.cachePageRef(pageView.id, pdfPage.ref);
|
10487 | }
|
10488 | return pdfPage;
|
10489 | } catch (reason) {
|
10490 | console.error("Unable to get page for page view", reason);
|
10491 | return null;
|
10492 | }
|
10493 | }
|
10494 | #getScrollAhead(visible) {
|
10495 | if (visible.first?.id === 1) {
|
10496 | return true;
|
10497 | } else if (visible.last?.id === this.pagesCount) {
|
10498 | return false;
|
10499 | }
|
10500 | switch (this._scrollMode) {
|
10501 | case _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE:
|
10502 | return this.#scrollModePageState.scrollDown;
|
10503 | case _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.HORIZONTAL:
|
10504 | return this.scroll.right;
|
10505 | }
|
10506 | return this.scroll.down;
|
10507 | }
|
10508 | forceRendering(currentlyVisiblePages) {
|
10509 | const visiblePages = currentlyVisiblePages || this._getVisiblePages();
|
10510 | const scrollAhead = this.#getScrollAhead(visiblePages);
|
10511 | const preRenderExtra = this._spreadMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SpreadMode.NONE && this._scrollMode !== _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.HORIZONTAL;
|
10512 | const pageView = this.renderingQueue.getHighestPriority(visiblePages, this._pages, scrollAhead, preRenderExtra);
|
10513 | if (pageView) {
|
10514 | this.#ensurePdfPageLoaded(pageView).then(() => {
|
10515 | this.renderingQueue.renderView(pageView);
|
10516 | });
|
10517 | return true;
|
10518 | }
|
10519 | return false;
|
10520 | }
|
10521 | get hasEqualPageSizes() {
|
10522 | const firstPageView = this._pages[0];
|
10523 | for (let i = 1, ii = this._pages.length; i < ii; ++i) {
|
10524 | const pageView = this._pages[i];
|
10525 | if (pageView.width !== firstPageView.width || pageView.height !== firstPageView.height) {
|
10526 | return false;
|
10527 | }
|
10528 | }
|
10529 | return true;
|
10530 | }
|
10531 | getPagesOverview() {
|
10532 | let initialOrientation;
|
10533 | return this._pages.map(pageView => {
|
10534 | const viewport = pageView.pdfPage.getViewport({
|
10535 | scale: 1
|
10536 | });
|
10537 | const orientation = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.isPortraitOrientation)(viewport);
|
10538 | if (initialOrientation === undefined) {
|
10539 | initialOrientation = orientation;
|
10540 | } else if (this.enablePrintAutoRotate && orientation !== initialOrientation) {
|
10541 | return {
|
10542 | width: viewport.height,
|
10543 | height: viewport.width,
|
10544 | rotation: (viewport.rotation - 90) % 360
|
10545 | };
|
10546 | }
|
10547 | return {
|
10548 | width: viewport.width,
|
10549 | height: viewport.height,
|
10550 | rotation: viewport.rotation
|
10551 | };
|
10552 | });
|
10553 | }
|
10554 | get optionalContentConfigPromise() {
|
10555 | if (!this.pdfDocument) {
|
10556 | return Promise.resolve(null);
|
10557 | }
|
10558 | if (!this._optionalContentConfigPromise) {
|
10559 | console.error("optionalContentConfigPromise: Not initialized yet.");
|
10560 | return this.pdfDocument.getOptionalContentConfig({
|
10561 | intent: "display"
|
10562 | });
|
10563 | }
|
10564 | return this._optionalContentConfigPromise;
|
10565 | }
|
10566 | set optionalContentConfigPromise(promise) {
|
10567 | if (!(promise instanceof Promise)) {
|
10568 | throw new Error(`Invalid optionalContentConfigPromise: ${promise}`);
|
10569 | }
|
10570 | if (!this.pdfDocument) {
|
10571 | return;
|
10572 | }
|
10573 | if (!this._optionalContentConfigPromise) {
|
10574 | return;
|
10575 | }
|
10576 | this._optionalContentConfigPromise = promise;
|
10577 | this.refresh(false, {
|
10578 | optionalContentConfigPromise: promise
|
10579 | });
|
10580 | this.eventBus.dispatch("optionalcontentconfigchanged", {
|
10581 | source: this,
|
10582 | promise
|
10583 | });
|
10584 | }
|
10585 | get scrollMode() {
|
10586 | return this._scrollMode;
|
10587 | }
|
10588 | set scrollMode(mode) {
|
10589 | if (this._scrollMode === mode) {
|
10590 | return;
|
10591 | }
|
10592 | if (!(0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.isValidScrollMode)(mode)) {
|
10593 | throw new Error(`Invalid scroll mode: ${mode}`);
|
10594 | }
|
10595 | if (this.pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) {
|
10596 | return;
|
10597 | }
|
10598 | this._previousScrollMode = this._scrollMode;
|
10599 | this._scrollMode = mode;
|
10600 | this.eventBus.dispatch("scrollmodechanged", {
|
10601 | source: this,
|
10602 | mode
|
10603 | });
|
10604 | this._updateScrollMode(this._currentPageNumber);
|
10605 | }
|
10606 | _updateScrollMode() {
|
10607 | let pageNumber = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
10608 | const scrollMode = this._scrollMode,
|
10609 | viewer = this.viewer;
|
10610 | viewer.classList.toggle("scrollHorizontal", scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.HORIZONTAL);
|
10611 | viewer.classList.toggle("scrollWrapped", scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.WRAPPED);
|
10612 | if (!this.pdfDocument || !pageNumber) {
|
10613 | return;
|
10614 | }
|
10615 | if (scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE) {
|
10616 | this.#ensurePageViewVisible();
|
10617 | } else if (this._previousScrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE) {
|
10618 | this._updateSpreadMode();
|
10619 | }
|
10620 | if (this._currentScaleValue && isNaN(this._currentScaleValue)) {
|
10621 | this.#setScale(this._currentScaleValue, {
|
10622 | noScroll: true
|
10623 | });
|
10624 | }
|
10625 | this._setCurrentPageNumber(pageNumber, true);
|
10626 | this.update();
|
10627 | }
|
10628 | get spreadMode() {
|
10629 | return this._spreadMode;
|
10630 | }
|
10631 | set spreadMode(mode) {
|
10632 | if (this._spreadMode === mode) {
|
10633 | return;
|
10634 | }
|
10635 | if (!(0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.isValidSpreadMode)(mode)) {
|
10636 | throw new Error(`Invalid spread mode: ${mode}`);
|
10637 | }
|
10638 | this._spreadMode = mode;
|
10639 | this.eventBus.dispatch("spreadmodechanged", {
|
10640 | source: this,
|
10641 | mode
|
10642 | });
|
10643 | this._updateSpreadMode(this._currentPageNumber);
|
10644 | }
|
10645 | _updateSpreadMode() {
|
10646 | let pageNumber = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
|
10647 | if (!this.pdfDocument) {
|
10648 | return;
|
10649 | }
|
10650 | const viewer = this.viewer,
|
10651 | pages = this._pages;
|
10652 | if (this._scrollMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE) {
|
10653 | this.#ensurePageViewVisible();
|
10654 | } else {
|
10655 | viewer.textContent = "";
|
10656 | if (this._spreadMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SpreadMode.NONE) {
|
10657 | for (const pageView of this._pages) {
|
10658 | viewer.append(pageView.div);
|
10659 | }
|
10660 | } else {
|
10661 | const parity = this._spreadMode - 1;
|
10662 | let spread = null;
|
10663 | for (let i = 0, ii = pages.length; i < ii; ++i) {
|
10664 | if (spread === null) {
|
10665 | spread = document.createElement("div");
|
10666 | spread.className = "spread";
|
10667 | viewer.append(spread);
|
10668 | } else if (i % 2 === parity) {
|
10669 | spread = spread.cloneNode(false);
|
10670 | viewer.append(spread);
|
10671 | }
|
10672 | spread.append(pages[i].div);
|
10673 | }
|
10674 | }
|
10675 | }
|
10676 | if (!pageNumber) {
|
10677 | return;
|
10678 | }
|
10679 | if (this._currentScaleValue && isNaN(this._currentScaleValue)) {
|
10680 | this.#setScale(this._currentScaleValue, {
|
10681 | noScroll: true
|
10682 | });
|
10683 | }
|
10684 | this._setCurrentPageNumber(pageNumber, true);
|
10685 | this.update();
|
10686 | }
|
10687 | _getPageAdvance(currentPageNumber) {
|
10688 | let previous = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
10689 | switch (this._scrollMode) {
|
10690 | case _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.WRAPPED:
|
10691 | {
|
10692 | const {
|
10693 | views
|
10694 | } = this._getVisiblePages(),
|
10695 | pageLayout = new Map();
|
10696 | for (const {
|
10697 | id,
|
10698 | y,
|
10699 | percent,
|
10700 | widthPercent
|
10701 | } of views) {
|
10702 | if (percent === 0 || widthPercent < 100) {
|
10703 | continue;
|
10704 | }
|
10705 | let yArray = pageLayout.get(y);
|
10706 | if (!yArray) {
|
10707 | pageLayout.set(y, yArray ||= []);
|
10708 | }
|
10709 | yArray.push(id);
|
10710 | }
|
10711 | for (const yArray of pageLayout.values()) {
|
10712 | const currentIndex = yArray.indexOf(currentPageNumber);
|
10713 | if (currentIndex === -1) {
|
10714 | continue;
|
10715 | }
|
10716 | const numPages = yArray.length;
|
10717 | if (numPages === 1) {
|
10718 | break;
|
10719 | }
|
10720 | if (previous) {
|
10721 | for (let i = currentIndex - 1, ii = 0; i >= ii; i--) {
|
10722 | const currentId = yArray[i],
|
10723 | expectedId = yArray[i + 1] - 1;
|
10724 | if (currentId < expectedId) {
|
10725 | return currentPageNumber - expectedId;
|
10726 | }
|
10727 | }
|
10728 | } else {
|
10729 | for (let i = currentIndex + 1, ii = numPages; i < ii; i++) {
|
10730 | const currentId = yArray[i],
|
10731 | expectedId = yArray[i - 1] + 1;
|
10732 | if (currentId > expectedId) {
|
10733 | return expectedId - currentPageNumber;
|
10734 | }
|
10735 | }
|
10736 | }
|
10737 | if (previous) {
|
10738 | const firstId = yArray[0];
|
10739 | if (firstId < currentPageNumber) {
|
10740 | return currentPageNumber - firstId + 1;
|
10741 | }
|
10742 | } else {
|
10743 | const lastId = yArray[numPages - 1];
|
10744 | if (lastId > currentPageNumber) {
|
10745 | return lastId - currentPageNumber + 1;
|
10746 | }
|
10747 | }
|
10748 | break;
|
10749 | }
|
10750 | break;
|
10751 | }
|
10752 | case _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.HORIZONTAL:
|
10753 | {
|
10754 | break;
|
10755 | }
|
10756 | case _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.PAGE:
|
10757 | case _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.ScrollMode.VERTICAL:
|
10758 | {
|
10759 | if (this._spreadMode === _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.SpreadMode.NONE) {
|
10760 | break;
|
10761 | }
|
10762 | const parity = this._spreadMode - 1;
|
10763 | if (previous && currentPageNumber % 2 !== parity) {
|
10764 | break;
|
10765 | } else if (!previous && currentPageNumber % 2 === parity) {
|
10766 | break;
|
10767 | }
|
10768 | const {
|
10769 | views
|
10770 | } = this._getVisiblePages(),
|
10771 | expectedId = previous ? currentPageNumber - 1 : currentPageNumber + 1;
|
10772 | for (const {
|
10773 | id,
|
10774 | percent,
|
10775 | widthPercent
|
10776 | } of views) {
|
10777 | if (id !== expectedId) {
|
10778 | continue;
|
10779 | }
|
10780 | if (percent > 0 && widthPercent === 100) {
|
10781 | return 2;
|
10782 | }
|
10783 | break;
|
10784 | }
|
10785 | break;
|
10786 | }
|
10787 | }
|
10788 | return 1;
|
10789 | }
|
10790 | nextPage() {
|
10791 | const currentPageNumber = this._currentPageNumber,
|
10792 | pagesCount = this.pagesCount;
|
10793 | if (currentPageNumber >= pagesCount) {
|
10794 | return false;
|
10795 | }
|
10796 | const advance = this._getPageAdvance(currentPageNumber, false) || 1;
|
10797 | this.currentPageNumber = Math.min(currentPageNumber + advance, pagesCount);
|
10798 | return true;
|
10799 | }
|
10800 | previousPage() {
|
10801 | const currentPageNumber = this._currentPageNumber;
|
10802 | if (currentPageNumber <= 1) {
|
10803 | return false;
|
10804 | }
|
10805 | const advance = this._getPageAdvance(currentPageNumber, true) || 1;
|
10806 | this.currentPageNumber = Math.max(currentPageNumber - advance, 1);
|
10807 | return true;
|
10808 | }
|
10809 | increaseScale() {
|
10810 | let {
|
10811 | drawingDelay,
|
10812 | scaleFactor,
|
10813 | steps
|
10814 | } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
10815 | if (!this.pdfDocument) {
|
10816 | return;
|
10817 | }
|
10818 | let newScale = this._currentScale;
|
10819 | if (scaleFactor > 1) {
|
10820 | newScale = Math.round(newScale * scaleFactor * 100) / 100;
|
10821 | } else {
|
10822 | steps ??= 1;
|
10823 | do {
|
10824 | newScale = Math.ceil((newScale * _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.DEFAULT_SCALE_DELTA).toFixed(2) * 10) / 10;
|
10825 | } while (--steps > 0 && newScale < _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.MAX_SCALE);
|
10826 | }
|
10827 | this.#setScale(Math.min(_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.MAX_SCALE, newScale), {
|
10828 | noScroll: false,
|
10829 | drawingDelay
|
10830 | });
|
10831 | }
|
10832 | decreaseScale() {
|
10833 | let {
|
10834 | drawingDelay,
|
10835 | scaleFactor,
|
10836 | steps
|
10837 | } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
10838 | if (!this.pdfDocument) {
|
10839 | return;
|
10840 | }
|
10841 | let newScale = this._currentScale;
|
10842 | if (scaleFactor > 0 && scaleFactor < 1) {
|
10843 | newScale = Math.round(newScale * scaleFactor * 100) / 100;
|
10844 | } else {
|
10845 | steps ??= 1;
|
10846 | do {
|
10847 | newScale = Math.floor((newScale / _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.DEFAULT_SCALE_DELTA).toFixed(2) * 10) / 10;
|
10848 | } while (--steps > 0 && newScale > _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.MIN_SCALE);
|
10849 | }
|
10850 | this.#setScale(Math.max(_ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.MIN_SCALE, newScale), {
|
10851 | noScroll: false,
|
10852 | drawingDelay
|
10853 | });
|
10854 | }
|
10855 | #updateContainerHeightCss() {
|
10856 | let height = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.container.clientHeight;
|
10857 | if (height !== this.#previousContainerHeight) {
|
10858 | this.#previousContainerHeight = height;
|
10859 | _ui_utils_js__WEBPACK_IMPORTED_MODULE_13__.docStyle.setProperty("--viewer-container-height", `${height}px`);
|
10860 | }
|
10861 | }
|
10862 | #resizeObserverCallback(entries) {
|
10863 | for (const entry of entries) {
|
10864 | if (entry.target === this.container) {
|
10865 | this.#updateContainerHeightCss(Math.floor(entry.borderBoxSize[0].blockSize));
|
10866 | this.#containerTopLeft = null;
|
10867 | break;
|
10868 | }
|
10869 | }
|
10870 | }
|
10871 | get containerTopLeft() {
|
10872 | return this.#containerTopLeft ||= [this.container.offsetTop, this.container.offsetLeft];
|
10873 | }
|
10874 | get annotationEditorMode() {
|
10875 | return this.#annotationEditorUIManager ? this.#annotationEditorMode : pdfjs_lib__WEBPACK_IMPORTED_MODULE_12__.AnnotationEditorType.DISABLE;
|
10876 | }
|
10877 | set annotationEditorMode(_ref6) {
|
10878 | let {
|
10879 | mode,
|
10880 | editId = null,
|
10881 | isFromKeyboard = false
|
10882 | } = _ref6;
|
10883 | if (!this.#annotationEditorUIManager) {
|
10884 | throw new Error(`The AnnotationEditor is not enabled.`);
|
10885 | }
|
10886 | if (this.#annotationEditorMode === mode) {
|
10887 | return;
|
10888 | }
|
10889 | if (!isValidAnnotationEditorMode(mode)) {
|
10890 | throw new Error(`Invalid AnnotationEditor mode: ${mode}`);
|
10891 | }
|
10892 | if (!this.pdfDocument) {
|
10893 | return;
|
10894 | }
|
10895 | this.#annotationEditorMode = mode;
|
10896 | this.eventBus.dispatch("annotationeditormodechanged", {
|
10897 | source: this,
|
10898 | mode
|
10899 | });
|
10900 | this.#annotationEditorUIManager.updateMode(mode, editId, isFromKeyboard);
|
10901 | }
|
10902 | set annotationEditorParams(_ref7) {
|
10903 | let {
|
10904 | type,
|
10905 | value
|
10906 | } = _ref7;
|
10907 | if (!this.#annotationEditorUIManager) {
|
10908 | throw new Error(`The AnnotationEditor is not enabled.`);
|
10909 | }
|
10910 | this.#annotationEditorUIManager.updateParams(type, value);
|
10911 | }
|
10912 | refresh() {
|
10913 | let noUpdate = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
10914 | let updateArgs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : Object.create(null);
|
10915 | if (!this.pdfDocument) {
|
10916 | return;
|
10917 | }
|
10918 | for (const pageView of this._pages) {
|
10919 | pageView.update(updateArgs);
|
10920 | }
|
10921 | if (this.#scaleTimeoutId !== null) {
|
10922 | clearTimeout(this.#scaleTimeoutId);
|
10923 | this.#scaleTimeoutId = null;
|
10924 | }
|
10925 | if (!noUpdate) {
|
10926 | this.update();
|
10927 | }
|
10928 | }
|
10929 | }
|
10930 |
|
10931 | __webpack_async_result__();
|
10932 | } catch(e) { __webpack_async_result__(e); } });
|
10933 |
|
10934 | /***/ }),
|
10935 |
|
10936 | /***/ 2603:
|
10937 | /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
|
10938 |
|
10939 | __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
10940 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
10941 | /* harmony export */ AbortException: () => (/* binding */ AbortException),
|
10942 | /* harmony export */ AnnotationEditorLayer: () => (/* binding */ AnnotationEditorLayer),
|
10943 | /* harmony export */ AnnotationEditorType: () => (/* binding */ AnnotationEditorType),
|
10944 | /* harmony export */ AnnotationEditorUIManager: () => (/* binding */ AnnotationEditorUIManager),
|
10945 | /* harmony export */ AnnotationLayer: () => (/* binding */ AnnotationLayer),
|
10946 | /* harmony export */ AnnotationMode: () => (/* binding */ AnnotationMode),
|
10947 | /* harmony export */ DrawLayer: () => (/* binding */ DrawLayer),
|
10948 | /* harmony export */ PermissionFlag: () => (/* binding */ PermissionFlag),
|
10949 | /* harmony export */ PixelsPerInch: () => (/* binding */ PixelsPerInch),
|
10950 | /* harmony export */ RenderingCancelledException: () => (/* binding */ RenderingCancelledException),
|
10951 | /* harmony export */ XfaLayer: () => (/* binding */ XfaLayer),
|
10952 | /* harmony export */ createValidAbsoluteUrl: () => (/* binding */ createValidAbsoluteUrl),
|
10953 | /* harmony export */ fetchData: () => (/* binding */ fetchData),
|
10954 | /* harmony export */ getPdfFilenameFromUrl: () => (/* binding */ getPdfFilenameFromUrl),
|
10955 | /* harmony export */ isPdfFile: () => (/* binding */ isPdfFile),
|
10956 | /* harmony export */ normalizeUnicode: () => (/* binding */ normalizeUnicode),
|
10957 | /* harmony export */ renderTextLayer: () => (/* binding */ renderTextLayer),
|
10958 | /* harmony export */ setLayerDimensions: () => (/* binding */ setLayerDimensions),
|
10959 | /* harmony export */ shadow: () => (/* binding */ shadow),
|
10960 | /* harmony export */ updateTextLayer: () => (/* binding */ updateTextLayer),
|
10961 | /* harmony export */ version: () => (/* binding */ version)
|
10962 | /* harmony export */ });
|
10963 | /* unused harmony exports AnnotationEditorParamsType, build, CMapCompressionType, ColorPicker, DOMSVGFactory, FeatureTest, getDocument, getFilenameFromUrl, getXfaPageViewport, GlobalWorkerOptions, ImageKind, InvalidPDFException, isDataScheme, MissingPDFException, noContextMenu, OPS, Outliner, PasswordResponses, PDFDataRangeTransport, PDFDateString, PDFWorker, UnexpectedResponseException, Util, VerbosityLevel */
|
10964 | if (!globalThis.pdfjsLib) {
|
10965 | await globalThis.pdfjsLibPromise;
|
10966 | }
|
10967 | const {
|
10968 | AbortException,
|
10969 | AnnotationEditorLayer,
|
10970 | AnnotationEditorParamsType,
|
10971 | AnnotationEditorType,
|
10972 | AnnotationEditorUIManager,
|
10973 | AnnotationLayer,
|
10974 | AnnotationMode,
|
10975 | build,
|
10976 | CMapCompressionType,
|
10977 | ColorPicker,
|
10978 | createValidAbsoluteUrl,
|
10979 | DOMSVGFactory,
|
10980 | DrawLayer,
|
10981 | FeatureTest,
|
10982 | fetchData,
|
10983 | getDocument,
|
10984 | getFilenameFromUrl,
|
10985 | getPdfFilenameFromUrl,
|
10986 | getXfaPageViewport,
|
10987 | GlobalWorkerOptions,
|
10988 | ImageKind,
|
10989 | InvalidPDFException,
|
10990 | isDataScheme,
|
10991 | isPdfFile,
|
10992 | MissingPDFException,
|
10993 | noContextMenu,
|
10994 | normalizeUnicode,
|
10995 | OPS,
|
10996 | Outliner,
|
10997 | PasswordResponses,
|
10998 | PDFDataRangeTransport,
|
10999 | PDFDateString,
|
11000 | PDFWorker,
|
11001 | PermissionFlag,
|
11002 | PixelsPerInch,
|
11003 | RenderingCancelledException,
|
11004 | renderTextLayer,
|
11005 | setLayerDimensions,
|
11006 | shadow,
|
11007 | UnexpectedResponseException,
|
11008 | updateTextLayer,
|
11009 | Util,
|
11010 | VerbosityLevel,
|
11011 | version,
|
11012 | XfaLayer
|
11013 | } = globalThis.pdfjsLib;
|
11014 |
|
11015 | __webpack_async_result__();
|
11016 | } catch(e) { __webpack_async_result__(e); } }, 1);
|
11017 |
|
11018 | /***/ }),
|
11019 |
|
11020 | /***/ 6698:
|
11021 | /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
11022 |
|
11023 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
11024 | /* harmony export */ StructTreeLayerBuilder: () => (/* binding */ StructTreeLayerBuilder)
|
11025 | /* harmony export */ });
|
11026 | /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7256);
|
11027 |
|
11028 | const PDF_ROLE_TO_HTML_ROLE = {
|
11029 | Document: null,
|
11030 | DocumentFragment: null,
|
11031 | Part: "group",
|
11032 | Sect: "group",
|
11033 | Div: "group",
|
11034 | Aside: "note",
|
11035 | NonStruct: "none",
|
11036 | P: null,
|
11037 | H: "heading",
|
11038 | Title: null,
|
11039 | FENote: "note",
|
11040 | Sub: "group",
|
11041 | Lbl: null,
|
11042 | Span: null,
|
11043 | Em: null,
|
11044 | Strong: null,
|
11045 | Link: "link",
|
11046 | Annot: "note",
|
11047 | Form: "form",
|
11048 | Ruby: null,
|
11049 | RB: null,
|
11050 | RT: null,
|
11051 | RP: null,
|
11052 | Warichu: null,
|
11053 | WT: null,
|
11054 | WP: null,
|
11055 | L: "list",
|
11056 | LI: "listitem",
|
11057 | LBody: null,
|
11058 | Table: "table",
|
11059 | TR: "row",
|
11060 | TH: "columnheader",
|
11061 | TD: "cell",
|
11062 | THead: "columnheader",
|
11063 | TBody: null,
|
11064 | TFoot: null,
|
11065 | Caption: null,
|
11066 | Figure: "figure",
|
11067 | Formula: null,
|
11068 | Artifact: null
|
11069 | };
|
11070 | const HEADING_PATTERN = /^H(\d+)$/;
|
11071 | class StructTreeLayerBuilder {
|
11072 | #treeDom = undefined;
|
11073 | get renderingDone() {
|
11074 | return this.#treeDom !== undefined;
|
11075 | }
|
11076 | render(structTree) {
|
11077 | if (this.#treeDom !== undefined) {
|
11078 | return this.#treeDom;
|
11079 | }
|
11080 | const treeDom = this.#walk(structTree);
|
11081 | treeDom?.classList.add("structTree");
|
11082 | return this.#treeDom = treeDom;
|
11083 | }
|
11084 | hide() {
|
11085 | if (this.#treeDom && !this.#treeDom.hidden) {
|
11086 | this.#treeDom.hidden = true;
|
11087 | }
|
11088 | }
|
11089 | show() {
|
11090 | if (this.#treeDom?.hidden) {
|
11091 | this.#treeDom.hidden = false;
|
11092 | }
|
11093 | }
|
11094 | #setAttributes(structElement, htmlElement) {
|
11095 | const {
|
11096 | alt,
|
11097 | id,
|
11098 | lang
|
11099 | } = structElement;
|
11100 | if (alt !== undefined) {
|
11101 | htmlElement.setAttribute("aria-label", (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.removeNullCharacters)(alt));
|
11102 | }
|
11103 | if (id !== undefined) {
|
11104 | htmlElement.setAttribute("aria-owns", id);
|
11105 | }
|
11106 | if (lang !== undefined) {
|
11107 | htmlElement.setAttribute("lang", (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_0__.removeNullCharacters)(lang, true));
|
11108 | }
|
11109 | }
|
11110 | #walk(node) {
|
11111 | if (!node) {
|
11112 | return null;
|
11113 | }
|
11114 | const element = document.createElement("span");
|
11115 | if ("role" in node) {
|
11116 | const {
|
11117 | role
|
11118 | } = node;
|
11119 | const match = role.match(HEADING_PATTERN);
|
11120 | if (match) {
|
11121 | element.setAttribute("role", "heading");
|
11122 | element.setAttribute("aria-level", match[1]);
|
11123 | } else if (PDF_ROLE_TO_HTML_ROLE[role]) {
|
11124 | element.setAttribute("role", PDF_ROLE_TO_HTML_ROLE[role]);
|
11125 | }
|
11126 | }
|
11127 | this.#setAttributes(node, element);
|
11128 | if (node.children) {
|
11129 | if (node.children.length === 1 && "id" in node.children[0]) {
|
11130 | this.#setAttributes(node.children[0], element);
|
11131 | } else {
|
11132 | for (const kid of node.children) {
|
11133 | element.append(this.#walk(kid));
|
11134 | }
|
11135 | }
|
11136 | }
|
11137 | return element;
|
11138 | }
|
11139 | }
|
11140 |
|
11141 |
|
11142 | /***/ }),
|
11143 |
|
11144 | /***/ 5860:
|
11145 | /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
11146 |
|
11147 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
11148 | /* harmony export */ TextAccessibilityManager: () => (/* binding */ TextAccessibilityManager)
|
11149 | /* harmony export */ });
|
11150 | /* harmony import */ var core_js_modules_esnext_iterator_constructor_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8992);
|
11151 | /* harmony import */ var core_js_modules_esnext_iterator_filter_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4520);
|
11152 | /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7256);
|
11153 |
|
11154 |
|
11155 |
|
11156 | class TextAccessibilityManager {
|
11157 | #enabled = false;
|
11158 | #textChildren = null;
|
11159 | #textNodes = new Map();
|
11160 | #waitingElements = new Map();
|
11161 | setTextMapping(textDivs) {
|
11162 | this.#textChildren = textDivs;
|
11163 | }
|
11164 | static #compareElementPositions(e1, e2) {
|
11165 | const rect1 = e1.getBoundingClientRect();
|
11166 | const rect2 = e2.getBoundingClientRect();
|
11167 | if (rect1.width === 0 && rect1.height === 0) {
|
11168 | return +1;
|
11169 | }
|
11170 | if (rect2.width === 0 && rect2.height === 0) {
|
11171 | return -1;
|
11172 | }
|
11173 | const top1 = rect1.y;
|
11174 | const bot1 = rect1.y + rect1.height;
|
11175 | const mid1 = rect1.y + rect1.height / 2;
|
11176 | const top2 = rect2.y;
|
11177 | const bot2 = rect2.y + rect2.height;
|
11178 | const mid2 = rect2.y + rect2.height / 2;
|
11179 | if (mid1 <= top2 && mid2 >= bot1) {
|
11180 | return -1;
|
11181 | }
|
11182 | if (mid2 <= top1 && mid1 >= bot2) {
|
11183 | return +1;
|
11184 | }
|
11185 | const centerX1 = rect1.x + rect1.width / 2;
|
11186 | const centerX2 = rect2.x + rect2.width / 2;
|
11187 | return centerX1 - centerX2;
|
11188 | }
|
11189 | enable() {
|
11190 | if (this.#enabled) {
|
11191 | throw new Error("TextAccessibilityManager is already enabled.");
|
11192 | }
|
11193 | if (!this.#textChildren) {
|
11194 | throw new Error("Text divs and strings have not been set.");
|
11195 | }
|
11196 | this.#enabled = true;
|
11197 | this.#textChildren = this.#textChildren.slice();
|
11198 | this.#textChildren.sort(TextAccessibilityManager.#compareElementPositions);
|
11199 | if (this.#textNodes.size > 0) {
|
11200 | const textChildren = this.#textChildren;
|
11201 | for (const [id, nodeIndex] of this.#textNodes) {
|
11202 | const element = document.getElementById(id);
|
11203 | if (!element) {
|
11204 | this.#textNodes.delete(id);
|
11205 | continue;
|
11206 | }
|
11207 | this.#addIdToAriaOwns(id, textChildren[nodeIndex]);
|
11208 | }
|
11209 | }
|
11210 | for (const [element, isRemovable] of this.#waitingElements) {
|
11211 | this.addPointerInTextLayer(element, isRemovable);
|
11212 | }
|
11213 | this.#waitingElements.clear();
|
11214 | }
|
11215 | disable() {
|
11216 | if (!this.#enabled) {
|
11217 | return;
|
11218 | }
|
11219 | this.#waitingElements.clear();
|
11220 | this.#textChildren = null;
|
11221 | this.#enabled = false;
|
11222 | }
|
11223 | removePointerInTextLayer(element) {
|
11224 | if (!this.#enabled) {
|
11225 | this.#waitingElements.delete(element);
|
11226 | return;
|
11227 | }
|
11228 | const children = this.#textChildren;
|
11229 | if (!children || children.length === 0) {
|
11230 | return;
|
11231 | }
|
11232 | const {
|
11233 | id
|
11234 | } = element;
|
11235 | const nodeIndex = this.#textNodes.get(id);
|
11236 | if (nodeIndex === undefined) {
|
11237 | return;
|
11238 | }
|
11239 | const node = children[nodeIndex];
|
11240 | this.#textNodes.delete(id);
|
11241 | let owns = node.getAttribute("aria-owns");
|
11242 | if (owns?.includes(id)) {
|
11243 | owns = owns.split(" ").filter(x => x !== id).join(" ");
|
11244 | if (owns) {
|
11245 | node.setAttribute("aria-owns", owns);
|
11246 | } else {
|
11247 | node.removeAttribute("aria-owns");
|
11248 | node.setAttribute("role", "presentation");
|
11249 | }
|
11250 | }
|
11251 | }
|
11252 | #addIdToAriaOwns(id, node) {
|
11253 | const owns = node.getAttribute("aria-owns");
|
11254 | if (!owns?.includes(id)) {
|
11255 | node.setAttribute("aria-owns", owns ? `${owns} ${id}` : id);
|
11256 | }
|
11257 | node.removeAttribute("role");
|
11258 | }
|
11259 | addPointerInTextLayer(element, isRemovable) {
|
11260 | const {
|
11261 | id
|
11262 | } = element;
|
11263 | if (!id) {
|
11264 | return null;
|
11265 | }
|
11266 | if (!this.#enabled) {
|
11267 | this.#waitingElements.set(element, isRemovable);
|
11268 | return null;
|
11269 | }
|
11270 | if (isRemovable) {
|
11271 | this.removePointerInTextLayer(element);
|
11272 | }
|
11273 | const children = this.#textChildren;
|
11274 | if (!children || children.length === 0) {
|
11275 | return null;
|
11276 | }
|
11277 | const index = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.binarySearchFirstItem)(children, node => TextAccessibilityManager.#compareElementPositions(element, node) < 0);
|
11278 | const nodeIndex = Math.max(0, index - 1);
|
11279 | const child = children[nodeIndex];
|
11280 | this.#addIdToAriaOwns(id, child);
|
11281 | this.#textNodes.set(id, nodeIndex);
|
11282 | const parent = child.parentNode;
|
11283 | return parent?.classList.contains("markedContent") ? parent.id : null;
|
11284 | }
|
11285 | moveElementInDOM(container, element, contentElement, isRemovable) {
|
11286 | const id = this.addPointerInTextLayer(contentElement, isRemovable);
|
11287 | if (!container.hasChildNodes()) {
|
11288 | container.append(element);
|
11289 | return id;
|
11290 | }
|
11291 | const children = Array.from(container.childNodes).filter(node => node !== element);
|
11292 | if (children.length === 0) {
|
11293 | return id;
|
11294 | }
|
11295 | const elementToCompare = contentElement || element;
|
11296 | const index = (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_2__.binarySearchFirstItem)(children, node => TextAccessibilityManager.#compareElementPositions(elementToCompare, node) < 0);
|
11297 | if (index === 0) {
|
11298 | children[0].before(element);
|
11299 | } else {
|
11300 | children[index - 1].after(element);
|
11301 | }
|
11302 | return id;
|
11303 | }
|
11304 | }
|
11305 |
|
11306 |
|
11307 | /***/ }),
|
11308 |
|
11309 | /***/ 2027:
|
11310 | /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
11311 |
|
11312 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
11313 | /* harmony export */ TextHighlighter: () => (/* binding */ TextHighlighter)
|
11314 | /* harmony export */ });
|
11315 | /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4114);
|
11316 |
|
11317 | class TextHighlighter {
|
11318 | constructor(_ref) {
|
11319 | let {
|
11320 | findController,
|
11321 | eventBus,
|
11322 | pageIndex
|
11323 | } = _ref;
|
11324 | this.findController = findController;
|
11325 | this.matches = [];
|
11326 | this.eventBus = eventBus;
|
11327 | this.pageIdx = pageIndex;
|
11328 | this._onUpdateTextLayerMatches = null;
|
11329 | this.textDivs = null;
|
11330 | this.textContentItemsStr = null;
|
11331 | this.enabled = false;
|
11332 | }
|
11333 | setTextMapping(divs, texts) {
|
11334 | this.textDivs = divs;
|
11335 | this.textContentItemsStr = texts;
|
11336 | }
|
11337 | enable() {
|
11338 | if (!this.textDivs || !this.textContentItemsStr) {
|
11339 | throw new Error("Text divs and strings have not been set.");
|
11340 | }
|
11341 | if (this.enabled) {
|
11342 | throw new Error("TextHighlighter is already enabled.");
|
11343 | }
|
11344 | this.enabled = true;
|
11345 | if (!this._onUpdateTextLayerMatches) {
|
11346 | this._onUpdateTextLayerMatches = evt => {
|
11347 | if (evt.pageIndex === this.pageIdx || evt.pageIndex === -1) {
|
11348 | this._updateMatches();
|
11349 | }
|
11350 | };
|
11351 | this.eventBus._on("updatetextlayermatches", this._onUpdateTextLayerMatches);
|
11352 | }
|
11353 | this._updateMatches();
|
11354 | }
|
11355 | disable() {
|
11356 | if (!this.enabled) {
|
11357 | return;
|
11358 | }
|
11359 | this.enabled = false;
|
11360 | if (this._onUpdateTextLayerMatches) {
|
11361 | this.eventBus._off("updatetextlayermatches", this._onUpdateTextLayerMatches);
|
11362 | this._onUpdateTextLayerMatches = null;
|
11363 | }
|
11364 | this._updateMatches(true);
|
11365 | }
|
11366 | _convertMatches(matches, matchesLength) {
|
11367 | if (!matches) {
|
11368 | return [];
|
11369 | }
|
11370 | const {
|
11371 | textContentItemsStr
|
11372 | } = this;
|
11373 | let i = 0,
|
11374 | iIndex = 0;
|
11375 | const end = textContentItemsStr.length - 1;
|
11376 | const result = [];
|
11377 | for (let m = 0, mm = matches.length; m < mm; m++) {
|
11378 | let matchIdx = matches[m];
|
11379 | while (i !== end && matchIdx >= iIndex + textContentItemsStr[i].length) {
|
11380 | iIndex += textContentItemsStr[i].length;
|
11381 | i++;
|
11382 | }
|
11383 | if (i === textContentItemsStr.length) {
|
11384 | console.error("Could not find a matching mapping");
|
11385 | }
|
11386 | const match = {
|
11387 | begin: {
|
11388 | divIdx: i,
|
11389 | offset: matchIdx - iIndex
|
11390 | }
|
11391 | };
|
11392 | matchIdx += matchesLength[m];
|
11393 | while (i !== end && matchIdx > iIndex + textContentItemsStr[i].length) {
|
11394 | iIndex += textContentItemsStr[i].length;
|
11395 | i++;
|
11396 | }
|
11397 | match.end = {
|
11398 | divIdx: i,
|
11399 | offset: matchIdx - iIndex
|
11400 | };
|
11401 | result.push(match);
|
11402 | }
|
11403 | return result;
|
11404 | }
|
11405 | _renderMatches(matches) {
|
11406 | if (matches.length === 0) {
|
11407 | return;
|
11408 | }
|
11409 | const {
|
11410 | findController,
|
11411 | pageIdx
|
11412 | } = this;
|
11413 | const {
|
11414 | textContentItemsStr,
|
11415 | textDivs
|
11416 | } = this;
|
11417 | const isSelectedPage = pageIdx === findController.selected.pageIdx;
|
11418 | const selectedMatchIdx = findController.selected.matchIdx;
|
11419 | const highlightAll = findController.state.highlightAll;
|
11420 | let prevEnd = null;
|
11421 | const infinity = {
|
11422 | divIdx: -1,
|
11423 | offset: undefined
|
11424 | };
|
11425 | function beginText(begin, className) {
|
11426 | const divIdx = begin.divIdx;
|
11427 | textDivs[divIdx].textContent = "";
|
11428 | return appendTextToDiv(divIdx, 0, begin.offset, className);
|
11429 | }
|
11430 | function appendTextToDiv(divIdx, fromOffset, toOffset, className) {
|
11431 | let div = textDivs[divIdx];
|
11432 | if (div.nodeType === Node.TEXT_NODE) {
|
11433 | const span = document.createElement("span");
|
11434 | div.before(span);
|
11435 | span.append(div);
|
11436 | textDivs[divIdx] = span;
|
11437 | div = span;
|
11438 | }
|
11439 | const content = textContentItemsStr[divIdx].substring(fromOffset, toOffset);
|
11440 | const node = document.createTextNode(content);
|
11441 | if (className) {
|
11442 | const span = document.createElement("span");
|
11443 | span.className = `${className} appended`;
|
11444 | span.append(node);
|
11445 | div.append(span);
|
11446 | return className.includes("selected") ? span.offsetLeft : 0;
|
11447 | }
|
11448 | div.append(node);
|
11449 | return 0;
|
11450 | }
|
11451 | let i0 = selectedMatchIdx,
|
11452 | i1 = i0 + 1;
|
11453 | if (highlightAll) {
|
11454 | i0 = 0;
|
11455 | i1 = matches.length;
|
11456 | } else if (!isSelectedPage) {
|
11457 | return;
|
11458 | }
|
11459 | let lastDivIdx = -1;
|
11460 | let lastOffset = -1;
|
11461 | for (let i = i0; i < i1; i++) {
|
11462 | const match = matches[i];
|
11463 | const begin = match.begin;
|
11464 | if (begin.divIdx === lastDivIdx && begin.offset === lastOffset) {
|
11465 | continue;
|
11466 | }
|
11467 | lastDivIdx = begin.divIdx;
|
11468 | lastOffset = begin.offset;
|
11469 | const end = match.end;
|
11470 | const isSelected = isSelectedPage && i === selectedMatchIdx;
|
11471 | const highlightSuffix = isSelected ? " selected" : "";
|
11472 | let selectedLeft = 0;
|
11473 | if (!prevEnd || begin.divIdx !== prevEnd.divIdx) {
|
11474 | if (prevEnd !== null) {
|
11475 | appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);
|
11476 | }
|
11477 | beginText(begin);
|
11478 | } else {
|
11479 | appendTextToDiv(prevEnd.divIdx, prevEnd.offset, begin.offset);
|
11480 | }
|
11481 | if (begin.divIdx === end.divIdx) {
|
11482 | selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, end.offset, "highlight" + highlightSuffix);
|
11483 | } else {
|
11484 | selectedLeft = appendTextToDiv(begin.divIdx, begin.offset, infinity.offset, "highlight begin" + highlightSuffix);
|
11485 | for (let n0 = begin.divIdx + 1, n1 = end.divIdx; n0 < n1; n0++) {
|
11486 | textDivs[n0].className = "highlight middle" + highlightSuffix;
|
11487 | }
|
11488 | beginText(end, "highlight end" + highlightSuffix);
|
11489 | }
|
11490 | prevEnd = end;
|
11491 | if (isSelected) {
|
11492 | findController.scrollMatchIntoView({
|
11493 | element: textDivs[begin.divIdx],
|
11494 | selectedLeft,
|
11495 | pageIndex: pageIdx,
|
11496 | matchIndex: selectedMatchIdx
|
11497 | });
|
11498 | }
|
11499 | }
|
11500 | if (prevEnd) {
|
11501 | appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);
|
11502 | }
|
11503 | }
|
11504 | _updateMatches() {
|
11505 | let reset = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
11506 | if (!this.enabled && !reset) {
|
11507 | return;
|
11508 | }
|
11509 | const {
|
11510 | findController,
|
11511 | matches,
|
11512 | pageIdx
|
11513 | } = this;
|
11514 | const {
|
11515 | textContentItemsStr,
|
11516 | textDivs
|
11517 | } = this;
|
11518 | let clearedUntilDivIdx = -1;
|
11519 | for (const match of matches) {
|
11520 | const begin = Math.max(clearedUntilDivIdx, match.begin.divIdx);
|
11521 | for (let n = begin, end = match.end.divIdx; n <= end; n++) {
|
11522 | const div = textDivs[n];
|
11523 | div.textContent = textContentItemsStr[n];
|
11524 | div.className = "";
|
11525 | }
|
11526 | clearedUntilDivIdx = match.end.divIdx + 1;
|
11527 | }
|
11528 | if (!findController?.highlightMatches || reset) {
|
11529 | return;
|
11530 | }
|
11531 | const pageMatches = findController.pageMatches[pageIdx] || null;
|
11532 | const pageMatchesLength = findController.pageMatchesLength[pageIdx] || null;
|
11533 | this.matches = this._convertMatches(pageMatches, pageMatchesLength);
|
11534 | this._renderMatches(this.matches);
|
11535 | }
|
11536 | }
|
11537 |
|
11538 |
|
11539 | /***/ }),
|
11540 |
|
11541 | /***/ 7765:
|
11542 | /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
|
11543 |
|
11544 | __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
11545 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
11546 | /* harmony export */ TextLayerBuilder: () => (/* binding */ TextLayerBuilder)
|
11547 | /* harmony export */ });
|
11548 | /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
|
11549 | /* harmony import */ var _ui_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7256);
|
11550 | var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
|
11551 | pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
11552 |
|
11553 |
|
11554 | class TextLayerBuilder {
|
11555 | #enablePermissions = false;
|
11556 | #onAppend = null;
|
11557 | #rotation = 0;
|
11558 | #scale = 0;
|
11559 | #textContentSource = null;
|
11560 | constructor(_ref) {
|
11561 | let {
|
11562 | highlighter = null,
|
11563 | accessibilityManager = null,
|
11564 | enablePermissions = false,
|
11565 | onAppend = null
|
11566 | } = _ref;
|
11567 | this.textContentItemsStr = [];
|
11568 | this.renderingDone = false;
|
11569 | this.textDivs = [];
|
11570 | this.textDivProperties = new WeakMap();
|
11571 | this.textLayerRenderTask = null;
|
11572 | this.highlighter = highlighter;
|
11573 | this.accessibilityManager = accessibilityManager;
|
11574 | this.#enablePermissions = enablePermissions === true;
|
11575 | this.#onAppend = onAppend;
|
11576 | this.div = document.createElement("div");
|
11577 | this.div.tabIndex = 0;
|
11578 | this.div.className = "textLayer";
|
11579 | }
|
11580 | #finishRendering() {
|
11581 | this.renderingDone = true;
|
11582 | const endOfContent = document.createElement("div");
|
11583 | endOfContent.className = "endOfContent";
|
11584 | this.div.append(endOfContent);
|
11585 | this.#bindMouse();
|
11586 | }
|
11587 | get numTextDivs() {
|
11588 | return this.textDivs.length;
|
11589 | }
|
11590 | async render(viewport) {
|
11591 | if (!this.#textContentSource) {
|
11592 | throw new Error('No "textContentSource" parameter specified.');
|
11593 | }
|
11594 | const scale = viewport.scale * (globalThis.devicePixelRatio || 1);
|
11595 | const {
|
11596 | rotation
|
11597 | } = viewport;
|
11598 | if (this.renderingDone) {
|
11599 | const mustRotate = rotation !== this.#rotation;
|
11600 | const mustRescale = scale !== this.#scale;
|
11601 | if (mustRotate || mustRescale) {
|
11602 | this.hide();
|
11603 | (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.updateTextLayer)({
|
11604 | container: this.div,
|
11605 | viewport,
|
11606 | textDivs: this.textDivs,
|
11607 | textDivProperties: this.textDivProperties,
|
11608 | mustRescale,
|
11609 | mustRotate
|
11610 | });
|
11611 | this.#scale = scale;
|
11612 | this.#rotation = rotation;
|
11613 | }
|
11614 | this.show();
|
11615 | return;
|
11616 | }
|
11617 | this.cancel();
|
11618 | this.highlighter?.setTextMapping(this.textDivs, this.textContentItemsStr);
|
11619 | this.accessibilityManager?.setTextMapping(this.textDivs);
|
11620 | this.textLayerRenderTask = (0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.renderTextLayer)({
|
11621 | textContentSource: this.#textContentSource,
|
11622 | container: this.div,
|
11623 | viewport,
|
11624 | textDivs: this.textDivs,
|
11625 | textDivProperties: this.textDivProperties,
|
11626 | textContentItemsStr: this.textContentItemsStr
|
11627 | });
|
11628 | await this.textLayerRenderTask.promise;
|
11629 | this.#finishRendering();
|
11630 | this.#scale = scale;
|
11631 | this.#rotation = rotation;
|
11632 | this.#onAppend?.(this.div);
|
11633 | this.highlighter?.enable();
|
11634 | this.accessibilityManager?.enable();
|
11635 | }
|
11636 | hide() {
|
11637 | if (!this.div.hidden && this.renderingDone) {
|
11638 | this.highlighter?.disable();
|
11639 | this.div.hidden = true;
|
11640 | }
|
11641 | }
|
11642 | show() {
|
11643 | if (this.div.hidden && this.renderingDone) {
|
11644 | this.div.hidden = false;
|
11645 | this.highlighter?.enable();
|
11646 | }
|
11647 | }
|
11648 | cancel() {
|
11649 | if (this.textLayerRenderTask) {
|
11650 | this.textLayerRenderTask.cancel();
|
11651 | this.textLayerRenderTask = null;
|
11652 | }
|
11653 | this.highlighter?.disable();
|
11654 | this.accessibilityManager?.disable();
|
11655 | this.textContentItemsStr.length = 0;
|
11656 | this.textDivs.length = 0;
|
11657 | this.textDivProperties = new WeakMap();
|
11658 | }
|
11659 | setTextContentSource(source) {
|
11660 | this.cancel();
|
11661 | this.#textContentSource = source;
|
11662 | }
|
11663 | #bindMouse() {
|
11664 | const {
|
11665 | div
|
11666 | } = this;
|
11667 | div.addEventListener("mousedown", evt => {
|
11668 | const end = div.querySelector(".endOfContent");
|
11669 | if (!end) {
|
11670 | return;
|
11671 | }
|
11672 | let adjustTop = evt.target !== div;
|
11673 | adjustTop &&= getComputedStyle(end).getPropertyValue("-moz-user-select") !== "none";
|
11674 | if (adjustTop) {
|
11675 | const divBounds = div.getBoundingClientRect();
|
11676 | const r = Math.max(0, (evt.pageY - divBounds.top) / divBounds.height);
|
11677 | end.style.top = (r * 100).toFixed(2) + "%";
|
11678 | }
|
11679 | end.classList.add("active");
|
11680 | });
|
11681 | div.addEventListener("mouseup", () => {
|
11682 | const end = div.querySelector(".endOfContent");
|
11683 | if (!end) {
|
11684 | return;
|
11685 | }
|
11686 | end.style.top = "";
|
11687 | end.classList.remove("active");
|
11688 | });
|
11689 | div.addEventListener("copy", event => {
|
11690 | if (!this.#enablePermissions) {
|
11691 | const selection = document.getSelection();
|
11692 | event.clipboardData.setData("text/plain", (0,_ui_utils_js__WEBPACK_IMPORTED_MODULE_1__.removeNullCharacters)((0,pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.normalizeUnicode)(selection.toString())));
|
11693 | }
|
11694 | event.preventDefault();
|
11695 | event.stopPropagation();
|
11696 | });
|
11697 | }
|
11698 | }
|
11699 |
|
11700 | __webpack_async_result__();
|
11701 | } catch(e) { __webpack_async_result__(e); } });
|
11702 |
|
11703 | /***/ }),
|
11704 |
|
11705 | /***/ 7256:
|
11706 | /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
|
11707 |
|
11708 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
11709 | /* harmony export */ DEFAULT_SCALE: () => (/* binding */ DEFAULT_SCALE),
|
11710 | /* harmony export */ DEFAULT_SCALE_DELTA: () => (/* binding */ DEFAULT_SCALE_DELTA),
|
11711 | /* harmony export */ DEFAULT_SCALE_VALUE: () => (/* binding */ DEFAULT_SCALE_VALUE),
|
11712 | /* harmony export */ MAX_AUTO_SCALE: () => (/* binding */ MAX_AUTO_SCALE),
|
11713 | /* harmony export */ MAX_SCALE: () => (/* binding */ MAX_SCALE),
|
11714 | /* harmony export */ MIN_SCALE: () => (/* binding */ MIN_SCALE),
|
11715 | /* harmony export */ OutputScale: () => (/* binding */ OutputScale),
|
11716 | /* harmony export */ PresentationModeState: () => (/* binding */ PresentationModeState),
|
11717 | /* harmony export */ ProgressBar: () => (/* binding */ ProgressBar),
|
11718 | /* harmony export */ RenderingStates: () => (/* binding */ RenderingStates),
|
11719 | /* harmony export */ SCROLLBAR_PADDING: () => (/* binding */ SCROLLBAR_PADDING),
|
11720 | /* harmony export */ ScrollMode: () => (/* binding */ ScrollMode),
|
11721 | /* harmony export */ SpreadMode: () => (/* binding */ SpreadMode),
|
11722 | /* harmony export */ TextLayerMode: () => (/* binding */ TextLayerMode),
|
11723 | /* harmony export */ UNKNOWN_SCALE: () => (/* binding */ UNKNOWN_SCALE),
|
11724 | /* harmony export */ VERTICAL_PADDING: () => (/* binding */ VERTICAL_PADDING),
|
11725 | /* harmony export */ apiPageLayoutToViewerModes: () => (/* binding */ apiPageLayoutToViewerModes),
|
11726 | /* harmony export */ approximateFraction: () => (/* binding */ approximateFraction),
|
11727 | /* harmony export */ binarySearchFirstItem: () => (/* binding */ binarySearchFirstItem),
|
11728 | /* harmony export */ docStyle: () => (/* binding */ docStyle),
|
11729 | /* harmony export */ getVisibleElements: () => (/* binding */ getVisibleElements),
|
11730 | /* harmony export */ isPortraitOrientation: () => (/* binding */ isPortraitOrientation),
|
11731 | /* harmony export */ isValidRotation: () => (/* binding */ isValidRotation),
|
11732 | /* harmony export */ isValidScrollMode: () => (/* binding */ isValidScrollMode),
|
11733 | /* harmony export */ isValidSpreadMode: () => (/* binding */ isValidSpreadMode),
|
11734 | /* harmony export */ parseQueryString: () => (/* binding */ parseQueryString),
|
11735 | /* harmony export */ removeNullCharacters: () => (/* binding */ removeNullCharacters),
|
11736 | /* harmony export */ roundToDivide: () => (/* binding */ roundToDivide),
|
11737 | /* harmony export */ scrollIntoView: () => (/* binding */ scrollIntoView),
|
11738 | /* harmony export */ watchScroll: () => (/* binding */ watchScroll)
|
11739 | /* harmony export */ });
|
11740 | /* unused harmony exports animationStarted, apiPageModeToSidebarView, AutoPrintRegExp, backtrackBeforeAllVisibleElements, CursorTool, getActiveOrFocusedElement, getPageSizeInches, normalizeWheelEventDelta, normalizeWheelEventDirection, SidebarView, toggleCheckedBtn, toggleExpandedBtn */
|
11741 | /* harmony import */ var core_js_modules_es_array_push_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(4114);
|
11742 | /* harmony import */ var core_js_modules_esnext_set_difference_v2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3375);
|
11743 | /* harmony import */ var core_js_modules_esnext_set_intersection_v2_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(9225);
|
11744 | /* harmony import */ var core_js_modules_esnext_set_is_disjoint_from_v2_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3972);
|
11745 | /* harmony import */ var core_js_modules_esnext_set_is_subset_of_v2_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(9209);
|
11746 | /* harmony import */ var core_js_modules_esnext_set_is_superset_of_v2_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(5714);
|
11747 | /* harmony import */ var core_js_modules_esnext_set_symmetric_difference_v2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(7561);
|
11748 | /* harmony import */ var core_js_modules_esnext_set_union_v2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(6197);
|
11749 | /* harmony import */ var core_js_modules_web_url_search_params_delete_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(4603);
|
11750 | /* harmony import */ var core_js_modules_web_url_search_params_has_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(7566);
|
11751 | /* harmony import */ var core_js_modules_web_url_search_params_size_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(8721);
|
11752 |
|
11753 |
|
11754 |
|
11755 |
|
11756 |
|
11757 |
|
11758 |
|
11759 |
|
11760 |
|
11761 |
|
11762 |
|
11763 | const DEFAULT_SCALE_VALUE = "auto";
|
11764 | const DEFAULT_SCALE = 1.0;
|
11765 | const DEFAULT_SCALE_DELTA = 1.1;
|
11766 | const MIN_SCALE = 0.1;
|
11767 | const MAX_SCALE = 10.0;
|
11768 | const UNKNOWN_SCALE = 0;
|
11769 | const MAX_AUTO_SCALE = 1.25;
|
11770 | const SCROLLBAR_PADDING = 40;
|
11771 | const VERTICAL_PADDING = 5;
|
11772 | const RenderingStates = {
|
11773 | INITIAL: 0,
|
11774 | RUNNING: 1,
|
11775 | PAUSED: 2,
|
11776 | FINISHED: 3
|
11777 | };
|
11778 | const PresentationModeState = {
|
11779 | UNKNOWN: 0,
|
11780 | NORMAL: 1,
|
11781 | CHANGING: 2,
|
11782 | FULLSCREEN: 3
|
11783 | };
|
11784 | const SidebarView = {
|
11785 | UNKNOWN: -1,
|
11786 | NONE: 0,
|
11787 | THUMBS: 1,
|
11788 | OUTLINE: 2,
|
11789 | ATTACHMENTS: 3,
|
11790 | LAYERS: 4
|
11791 | };
|
11792 | const TextLayerMode = {
|
11793 | DISABLE: 0,
|
11794 | ENABLE: 1,
|
11795 | ENABLE_PERMISSIONS: 2
|
11796 | };
|
11797 | const ScrollMode = {
|
11798 | UNKNOWN: -1,
|
11799 | VERTICAL: 0,
|
11800 | HORIZONTAL: 1,
|
11801 | WRAPPED: 2,
|
11802 | PAGE: 3
|
11803 | };
|
11804 | const SpreadMode = {
|
11805 | UNKNOWN: -1,
|
11806 | NONE: 0,
|
11807 | ODD: 1,
|
11808 | EVEN: 2
|
11809 | };
|
11810 | const CursorTool = {
|
11811 | SELECT: 0,
|
11812 | HAND: 1,
|
11813 | ZOOM: 2
|
11814 | };
|
11815 | const AutoPrintRegExp = /\bprint\s*\(/;
|
11816 | class OutputScale {
|
11817 | constructor() {
|
11818 | const pixelRatio = window.devicePixelRatio || 1;
|
11819 | this.sx = pixelRatio;
|
11820 | this.sy = pixelRatio;
|
11821 | }
|
11822 | get scaled() {
|
11823 | return this.sx !== 1 || this.sy !== 1;
|
11824 | }
|
11825 | }
|
11826 | function scrollIntoView(element, spot) {
|
11827 | let scrollMatches = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
11828 | let parent = element.offsetParent;
|
11829 | if (!parent) {
|
11830 | console.error("offsetParent is not set -- cannot scroll");
|
11831 | return;
|
11832 | }
|
11833 | let offsetY = element.offsetTop + element.clientTop;
|
11834 | let offsetX = element.offsetLeft + element.clientLeft;
|
11835 | while (parent.clientHeight === parent.scrollHeight && parent.clientWidth === parent.scrollWidth || scrollMatches && (parent.classList.contains("markedContent") || getComputedStyle(parent).overflow === "hidden")) {
|
11836 | offsetY += parent.offsetTop;
|
11837 | offsetX += parent.offsetLeft;
|
11838 | parent = parent.offsetParent;
|
11839 | if (!parent) {
|
11840 | return;
|
11841 | }
|
11842 | }
|
11843 | if (spot) {
|
11844 | if (spot.top !== undefined) {
|
11845 | offsetY += spot.top;
|
11846 | }
|
11847 | if (spot.left !== undefined) {
|
11848 | offsetX += spot.left;
|
11849 | parent.scrollLeft = offsetX;
|
11850 | }
|
11851 | }
|
11852 | parent.scrollTop = offsetY;
|
11853 | }
|
11854 | function watchScroll(viewAreaElement, callback) {
|
11855 | const debounceScroll = function (evt) {
|
11856 | if (rAF) {
|
11857 | return;
|
11858 | }
|
11859 | rAF = window.requestAnimationFrame(function viewAreaElementScrolled() {
|
11860 | rAF = null;
|
11861 | const currentX = viewAreaElement.scrollLeft;
|
11862 | const lastX = state.lastX;
|
11863 | if (currentX !== lastX) {
|
11864 | state.right = currentX > lastX;
|
11865 | }
|
11866 | state.lastX = currentX;
|
11867 | const currentY = viewAreaElement.scrollTop;
|
11868 | const lastY = state.lastY;
|
11869 | if (currentY !== lastY) {
|
11870 | state.down = currentY > lastY;
|
11871 | }
|
11872 | state.lastY = currentY;
|
11873 | callback(state);
|
11874 | });
|
11875 | };
|
11876 | const state = {
|
11877 | right: true,
|
11878 | down: true,
|
11879 | lastX: viewAreaElement.scrollLeft,
|
11880 | lastY: viewAreaElement.scrollTop,
|
11881 | _eventHandler: debounceScroll
|
11882 | };
|
11883 | let rAF = null;
|
11884 | viewAreaElement.addEventListener("scroll", debounceScroll, true);
|
11885 | return state;
|
11886 | }
|
11887 | function parseQueryString(query) {
|
11888 | const params = new Map();
|
11889 | for (const [key, value] of new URLSearchParams(query)) {
|
11890 | params.set(key.toLowerCase(), value);
|
11891 | }
|
11892 | return params;
|
11893 | }
|
11894 | const InvisibleCharsRegExp = /[\x00-\x1F]/g;
|
11895 | function removeNullCharacters(str) {
|
11896 | let replaceInvisible = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
11897 | if (!InvisibleCharsRegExp.test(str)) {
|
11898 | return str;
|
11899 | }
|
11900 | if (replaceInvisible) {
|
11901 | return str.replaceAll(InvisibleCharsRegExp, m => m === "\x00" ? "" : " ");
|
11902 | }
|
11903 | return str.replaceAll("\x00", "");
|
11904 | }
|
11905 | function binarySearchFirstItem(items, condition) {
|
11906 | let start = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
11907 | let minIndex = start;
|
11908 | let maxIndex = items.length - 1;
|
11909 | if (maxIndex < 0 || !condition(items[maxIndex])) {
|
11910 | return items.length;
|
11911 | }
|
11912 | if (condition(items[minIndex])) {
|
11913 | return minIndex;
|
11914 | }
|
11915 | while (minIndex < maxIndex) {
|
11916 | const currentIndex = minIndex + maxIndex >> 1;
|
11917 | const currentItem = items[currentIndex];
|
11918 | if (condition(currentItem)) {
|
11919 | maxIndex = currentIndex;
|
11920 | } else {
|
11921 | minIndex = currentIndex + 1;
|
11922 | }
|
11923 | }
|
11924 | return minIndex;
|
11925 | }
|
11926 | function approximateFraction(x) {
|
11927 | if (Math.floor(x) === x) {
|
11928 | return [x, 1];
|
11929 | }
|
11930 | const xinv = 1 / x;
|
11931 | const limit = 8;
|
11932 | if (xinv > limit) {
|
11933 | return [1, limit];
|
11934 | } else if (Math.floor(xinv) === xinv) {
|
11935 | return [1, xinv];
|
11936 | }
|
11937 | const x_ = x > 1 ? xinv : x;
|
11938 | let a = 0,
|
11939 | b = 1,
|
11940 | c = 1,
|
11941 | d = 1;
|
11942 | while (true) {
|
11943 | const p = a + c,
|
11944 | q = b + d;
|
11945 | if (q > limit) {
|
11946 | break;
|
11947 | }
|
11948 | if (x_ <= p / q) {
|
11949 | c = p;
|
11950 | d = q;
|
11951 | } else {
|
11952 | a = p;
|
11953 | b = q;
|
11954 | }
|
11955 | }
|
11956 | let result;
|
11957 | if (x_ - a / b < c / d - x_) {
|
11958 | result = x_ === x ? [a, b] : [b, a];
|
11959 | } else {
|
11960 | result = x_ === x ? [c, d] : [d, c];
|
11961 | }
|
11962 | return result;
|
11963 | }
|
11964 | function roundToDivide(x, div) {
|
11965 | const r = x % div;
|
11966 | return r === 0 ? x : Math.round(x - r + div);
|
11967 | }
|
11968 | function getPageSizeInches(_ref) {
|
11969 | let {
|
11970 | view,
|
11971 | userUnit,
|
11972 | rotate
|
11973 | } = _ref;
|
11974 | const [x1, y1, x2, y2] = view;
|
11975 | const changeOrientation = rotate % 180 !== 0;
|
11976 | const width = (x2 - x1) / 72 * userUnit;
|
11977 | const height = (y2 - y1) / 72 * userUnit;
|
11978 | return {
|
11979 | width: changeOrientation ? height : width,
|
11980 | height: changeOrientation ? width : height
|
11981 | };
|
11982 | }
|
11983 | function backtrackBeforeAllVisibleElements(index, views, top) {
|
11984 | if (index < 2) {
|
11985 | return index;
|
11986 | }
|
11987 | let elt = views[index].div;
|
11988 | let pageTop = elt.offsetTop + elt.clientTop;
|
11989 | if (pageTop >= top) {
|
11990 | elt = views[index - 1].div;
|
11991 | pageTop = elt.offsetTop + elt.clientTop;
|
11992 | }
|
11993 | for (let i = index - 2; i >= 0; --i) {
|
11994 | elt = views[i].div;
|
11995 | if (elt.offsetTop + elt.clientTop + elt.clientHeight <= pageTop) {
|
11996 | break;
|
11997 | }
|
11998 | index = i;
|
11999 | }
|
12000 | return index;
|
12001 | }
|
12002 | function getVisibleElements(_ref2) {
|
12003 | let {
|
12004 | scrollEl,
|
12005 | views,
|
12006 | sortByVisibility = false,
|
12007 | horizontal = false,
|
12008 | rtl = false
|
12009 | } = _ref2;
|
12010 | const top = scrollEl.scrollTop,
|
12011 | bottom = top + scrollEl.clientHeight;
|
12012 | const left = scrollEl.scrollLeft,
|
12013 | right = left + scrollEl.clientWidth;
|
12014 | function isElementBottomAfterViewTop(view) {
|
12015 | const element = view.div;
|
12016 | const elementBottom = element.offsetTop + element.clientTop + element.clientHeight;
|
12017 | return elementBottom > top;
|
12018 | }
|
12019 | function isElementNextAfterViewHorizontally(view) {
|
12020 | const element = view.div;
|
12021 | const elementLeft = element.offsetLeft + element.clientLeft;
|
12022 | const elementRight = elementLeft + element.clientWidth;
|
12023 | return rtl ? elementLeft < right : elementRight > left;
|
12024 | }
|
12025 | const visible = [],
|
12026 | ids = new Set(),
|
12027 | numViews = views.length;
|
12028 | let firstVisibleElementInd = binarySearchFirstItem(views, horizontal ? isElementNextAfterViewHorizontally : isElementBottomAfterViewTop);
|
12029 | if (firstVisibleElementInd > 0 && firstVisibleElementInd < numViews && !horizontal) {
|
12030 | firstVisibleElementInd = backtrackBeforeAllVisibleElements(firstVisibleElementInd, views, top);
|
12031 | }
|
12032 | let lastEdge = horizontal ? right : -1;
|
12033 | for (let i = firstVisibleElementInd; i < numViews; i++) {
|
12034 | const view = views[i],
|
12035 | element = view.div;
|
12036 | const currentWidth = element.offsetLeft + element.clientLeft;
|
12037 | const currentHeight = element.offsetTop + element.clientTop;
|
12038 | const viewWidth = element.clientWidth,
|
12039 | viewHeight = element.clientHeight;
|
12040 | const viewRight = currentWidth + viewWidth;
|
12041 | const viewBottom = currentHeight + viewHeight;
|
12042 | if (lastEdge === -1) {
|
12043 | if (viewBottom >= bottom) {
|
12044 | lastEdge = viewBottom;
|
12045 | }
|
12046 | } else if ((horizontal ? currentWidth : currentHeight) > lastEdge) {
|
12047 | break;
|
12048 | }
|
12049 | if (viewBottom <= top || currentHeight >= bottom || viewRight <= left || currentWidth >= right) {
|
12050 | continue;
|
12051 | }
|
12052 | const hiddenHeight = Math.max(0, top - currentHeight) + Math.max(0, viewBottom - bottom);
|
12053 | const hiddenWidth = Math.max(0, left - currentWidth) + Math.max(0, viewRight - right);
|
12054 | const fractionHeight = (viewHeight - hiddenHeight) / viewHeight,
|
12055 | fractionWidth = (viewWidth - hiddenWidth) / viewWidth;
|
12056 | const percent = fractionHeight * fractionWidth * 100 | 0;
|
12057 | visible.push({
|
12058 | id: view.id,
|
12059 | x: currentWidth,
|
12060 | y: currentHeight,
|
12061 | view,
|
12062 | percent,
|
12063 | widthPercent: fractionWidth * 100 | 0
|
12064 | });
|
12065 | ids.add(view.id);
|
12066 | }
|
12067 | const first = visible[0],
|
12068 | last = visible.at(-1);
|
12069 | if (sortByVisibility) {
|
12070 | visible.sort(function (a, b) {
|
12071 | const pc = a.percent - b.percent;
|
12072 | if (Math.abs(pc) > 0.001) {
|
12073 | return -pc;
|
12074 | }
|
12075 | return a.id - b.id;
|
12076 | });
|
12077 | }
|
12078 | return {
|
12079 | first,
|
12080 | last,
|
12081 | views: visible,
|
12082 | ids
|
12083 | };
|
12084 | }
|
12085 | function normalizeWheelEventDirection(evt) {
|
12086 | let delta = Math.hypot(evt.deltaX, evt.deltaY);
|
12087 | const angle = Math.atan2(evt.deltaY, evt.deltaX);
|
12088 | if (-0.25 * Math.PI < angle && angle < 0.75 * Math.PI) {
|
12089 | delta = -delta;
|
12090 | }
|
12091 | return delta;
|
12092 | }
|
12093 | function normalizeWheelEventDelta(evt) {
|
12094 | const deltaMode = evt.deltaMode;
|
12095 | let delta = normalizeWheelEventDirection(evt);
|
12096 | const MOUSE_PIXELS_PER_LINE = 30;
|
12097 | const MOUSE_LINES_PER_PAGE = 30;
|
12098 | if (deltaMode === WheelEvent.DOM_DELTA_PIXEL) {
|
12099 | delta /= MOUSE_PIXELS_PER_LINE * MOUSE_LINES_PER_PAGE;
|
12100 | } else if (deltaMode === WheelEvent.DOM_DELTA_LINE) {
|
12101 | delta /= MOUSE_LINES_PER_PAGE;
|
12102 | }
|
12103 | return delta;
|
12104 | }
|
12105 | function isValidRotation(angle) {
|
12106 | return Number.isInteger(angle) && angle % 90 === 0;
|
12107 | }
|
12108 | function isValidScrollMode(mode) {
|
12109 | return Number.isInteger(mode) && Object.values(ScrollMode).includes(mode) && mode !== ScrollMode.UNKNOWN;
|
12110 | }
|
12111 | function isValidSpreadMode(mode) {
|
12112 | return Number.isInteger(mode) && Object.values(SpreadMode).includes(mode) && mode !== SpreadMode.UNKNOWN;
|
12113 | }
|
12114 | function isPortraitOrientation(size) {
|
12115 | return size.width <= size.height;
|
12116 | }
|
12117 | const animationStarted = new Promise(function (resolve) {
|
12118 | window.requestAnimationFrame(resolve);
|
12119 | });
|
12120 | const docStyle = document.documentElement.style;
|
12121 | function clamp(v, min, max) {
|
12122 | return Math.min(Math.max(v, min), max);
|
12123 | }
|
12124 | class ProgressBar {
|
12125 | #classList = null;
|
12126 | #disableAutoFetchTimeout = null;
|
12127 | #percent = 0;
|
12128 | #style = null;
|
12129 | #visible = true;
|
12130 | constructor(bar) {
|
12131 | this.#classList = bar.classList;
|
12132 | this.#style = bar.style;
|
12133 | }
|
12134 | get percent() {
|
12135 | return this.#percent;
|
12136 | }
|
12137 | set percent(val) {
|
12138 | this.#percent = clamp(val, 0, 100);
|
12139 | if (isNaN(val)) {
|
12140 | this.#classList.add("indeterminate");
|
12141 | return;
|
12142 | }
|
12143 | this.#classList.remove("indeterminate");
|
12144 | this.#style.setProperty("--progressBar-percent", `${this.#percent}%`);
|
12145 | }
|
12146 | setWidth(viewer) {
|
12147 | if (!viewer) {
|
12148 | return;
|
12149 | }
|
12150 | const container = viewer.parentNode;
|
12151 | const scrollbarWidth = container.offsetWidth - viewer.offsetWidth;
|
12152 | if (scrollbarWidth > 0) {
|
12153 | this.#style.setProperty("--progressBar-end-offset", `${scrollbarWidth}px`);
|
12154 | }
|
12155 | }
|
12156 | setDisableAutoFetch() {
|
12157 | let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 5000;
|
12158 | if (isNaN(this.#percent)) {
|
12159 | return;
|
12160 | }
|
12161 | if (this.#disableAutoFetchTimeout) {
|
12162 | clearTimeout(this.#disableAutoFetchTimeout);
|
12163 | }
|
12164 | this.show();
|
12165 | this.#disableAutoFetchTimeout = setTimeout(() => {
|
12166 | this.#disableAutoFetchTimeout = null;
|
12167 | this.hide();
|
12168 | }, delay);
|
12169 | }
|
12170 | hide() {
|
12171 | if (!this.#visible) {
|
12172 | return;
|
12173 | }
|
12174 | this.#visible = false;
|
12175 | this.#classList.add("hidden");
|
12176 | }
|
12177 | show() {
|
12178 | if (this.#visible) {
|
12179 | return;
|
12180 | }
|
12181 | this.#visible = true;
|
12182 | this.#classList.remove("hidden");
|
12183 | }
|
12184 | }
|
12185 | function getActiveOrFocusedElement() {
|
12186 | let curRoot = document;
|
12187 | let curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus");
|
12188 | while (curActiveOrFocused?.shadowRoot) {
|
12189 | curRoot = curActiveOrFocused.shadowRoot;
|
12190 | curActiveOrFocused = curRoot.activeElement || curRoot.querySelector(":focus");
|
12191 | }
|
12192 | return curActiveOrFocused;
|
12193 | }
|
12194 | function apiPageLayoutToViewerModes(layout) {
|
12195 | let scrollMode = ScrollMode.VERTICAL,
|
12196 | spreadMode = SpreadMode.NONE;
|
12197 | switch (layout) {
|
12198 | case "SinglePage":
|
12199 | scrollMode = ScrollMode.PAGE;
|
12200 | break;
|
12201 | case "OneColumn":
|
12202 | break;
|
12203 | case "TwoPageLeft":
|
12204 | scrollMode = ScrollMode.PAGE;
|
12205 | case "TwoColumnLeft":
|
12206 | spreadMode = SpreadMode.ODD;
|
12207 | break;
|
12208 | case "TwoPageRight":
|
12209 | scrollMode = ScrollMode.PAGE;
|
12210 | case "TwoColumnRight":
|
12211 | spreadMode = SpreadMode.EVEN;
|
12212 | break;
|
12213 | }
|
12214 | return {
|
12215 | scrollMode,
|
12216 | spreadMode
|
12217 | };
|
12218 | }
|
12219 | function apiPageModeToSidebarView(mode) {
|
12220 | switch (mode) {
|
12221 | case "UseNone":
|
12222 | return SidebarView.NONE;
|
12223 | case "UseThumbs":
|
12224 | return SidebarView.THUMBS;
|
12225 | case "UseOutlines":
|
12226 | return SidebarView.OUTLINE;
|
12227 | case "UseAttachments":
|
12228 | return SidebarView.ATTACHMENTS;
|
12229 | case "UseOC":
|
12230 | return SidebarView.LAYERS;
|
12231 | }
|
12232 | return SidebarView.NONE;
|
12233 | }
|
12234 | function toggleCheckedBtn(button, toggle) {
|
12235 | let view = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
12236 | button.classList.toggle("toggled", toggle);
|
12237 | button.setAttribute("aria-checked", toggle);
|
12238 | view?.classList.toggle("hidden", !toggle);
|
12239 | }
|
12240 | function toggleExpandedBtn(button, toggle) {
|
12241 | let view = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
|
12242 | button.classList.toggle("toggled", toggle);
|
12243 | button.setAttribute("aria-expanded", toggle);
|
12244 | view?.classList.toggle("hidden", !toggle);
|
12245 | }
|
12246 |
|
12247 |
|
12248 | /***/ }),
|
12249 |
|
12250 | /***/ 2973:
|
12251 | /***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => {
|
12252 |
|
12253 | __webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try {
|
12254 | /* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
12255 | /* harmony export */ XfaLayerBuilder: () => (/* binding */ XfaLayerBuilder)
|
12256 | /* harmony export */ });
|
12257 | /* harmony import */ var pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2603);
|
12258 | var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__]);
|
12259 | pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
|
12260 |
|
12261 | class XfaLayerBuilder {
|
12262 | constructor(_ref) {
|
12263 | let {
|
12264 | pdfPage,
|
12265 | annotationStorage = null,
|
12266 | linkService,
|
12267 | xfaHtml = null
|
12268 | } = _ref;
|
12269 | this.pdfPage = pdfPage;
|
12270 | this.annotationStorage = annotationStorage;
|
12271 | this.linkService = linkService;
|
12272 | this.xfaHtml = xfaHtml;
|
12273 | this.div = null;
|
12274 | this._cancelled = false;
|
12275 | }
|
12276 | async render(viewport) {
|
12277 | let intent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "display";
|
12278 | if (intent === "print") {
|
12279 | const parameters = {
|
12280 | viewport: viewport.clone({
|
12281 | dontFlip: true
|
12282 | }),
|
12283 | div: this.div,
|
12284 | xfaHtml: this.xfaHtml,
|
12285 | annotationStorage: this.annotationStorage,
|
12286 | linkService: this.linkService,
|
12287 | intent
|
12288 | };
|
12289 | this.div = document.createElement("div");
|
12290 | parameters.div = this.div;
|
12291 | return pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.XfaLayer.render(parameters);
|
12292 | }
|
12293 | const xfaHtml = await this.pdfPage.getXfa();
|
12294 | if (this._cancelled || !xfaHtml) {
|
12295 | return {
|
12296 | textDivs: []
|
12297 | };
|
12298 | }
|
12299 | const parameters = {
|
12300 | viewport: viewport.clone({
|
12301 | dontFlip: true
|
12302 | }),
|
12303 | div: this.div,
|
12304 | xfaHtml,
|
12305 | annotationStorage: this.annotationStorage,
|
12306 | linkService: this.linkService,
|
12307 | intent
|
12308 | };
|
12309 | if (this.div) {
|
12310 | return pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.XfaLayer.update(parameters);
|
12311 | }
|
12312 | this.div = document.createElement("div");
|
12313 | parameters.div = this.div;
|
12314 | return pdfjs_lib__WEBPACK_IMPORTED_MODULE_0__.XfaLayer.render(parameters);
|
12315 | }
|
12316 | cancel() {
|
12317 | this._cancelled = true;
|
12318 | }
|
12319 | hide() {
|
12320 | if (!this.div) {
|
12321 | return;
|
12322 | }
|
12323 | this.div.hidden = true;
|
12324 | }
|
12325 | }
|
12326 |
|
12327 | __webpack_async_result__();
|
12328 | } catch(e) { __webpack_async_result__(e); } });
|
12329 |
|
12330 | /***/ })
|
12331 |
|
12332 | /******/ });
|
12333 | /************************************************************************/
|
12334 | /******/ // The module cache
|
12335 | /******/ var __webpack_module_cache__ = {};
|
12336 | /******/
|
12337 | /******/ // The require function
|
12338 | /******/ function __webpack_require__(moduleId) {
|
12339 | /******/ // Check if module is in cache
|
12340 | /******/ var cachedModule = __webpack_module_cache__[moduleId];
|
12341 | /******/ if (cachedModule !== undefined) {
|
12342 | /******/ return cachedModule.exports;
|
12343 | /******/ }
|
12344 | /******/ // Create a new module (and put it into the cache)
|
12345 | /******/ var module = __webpack_module_cache__[moduleId] = {
|
12346 | /******/ // no module.id needed
|
12347 | /******/ // no module.loaded needed
|
12348 | /******/ exports: {}
|
12349 | /******/ };
|
12350 | /******/
|
12351 | /******/ // Execute the module function
|
12352 | /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
12353 | /******/
|
12354 | /******/ // Return the exports of the module
|
12355 | /******/ return module.exports;
|
12356 | /******/ }
|
12357 | /******/
|
12358 | /************************************************************************/
|
12359 | /******/ /* webpack/runtime/async module */
|
12360 | /******/ (() => {
|
12361 | /******/ var webpackQueues = typeof Symbol === "function" ? Symbol("webpack queues") : "__webpack_queues__";
|
12362 | /******/ var webpackExports = typeof Symbol === "function" ? Symbol("webpack exports") : "__webpack_exports__";
|
12363 | /******/ var webpackError = typeof Symbol === "function" ? Symbol("webpack error") : "__webpack_error__";
|
12364 | /******/ var resolveQueue = (queue) => {
|
12365 | /******/ if(queue && queue.d < 1) {
|
12366 | /******/ queue.d = 1;
|
12367 | /******/ queue.forEach((fn) => (fn.r--));
|
12368 | /******/ queue.forEach((fn) => (fn.r-- ? fn.r++ : fn()));
|
12369 | /******/ }
|
12370 | /******/ }
|
12371 | /******/ var wrapDeps = (deps) => (deps.map((dep) => {
|
12372 | /******/ if(dep !== null && typeof dep === "object") {
|
12373 | /******/ if(dep[webpackQueues]) return dep;
|
12374 | /******/ if(dep.then) {
|
12375 | /******/ var queue = [];
|
12376 | /******/ queue.d = 0;
|
12377 | /******/ dep.then((r) => {
|
12378 | /******/ obj[webpackExports] = r;
|
12379 | /******/ resolveQueue(queue);
|
12380 | /******/ }, (e) => {
|
12381 | /******/ obj[webpackError] = e;
|
12382 | /******/ resolveQueue(queue);
|
12383 | /******/ });
|
12384 | /******/ var obj = {};
|
12385 | /******/ obj[webpackQueues] = (fn) => (fn(queue));
|
12386 | /******/ return obj;
|
12387 | /******/ }
|
12388 | /******/ }
|
12389 | /******/ var ret = {};
|
12390 | /******/ ret[webpackQueues] = x => {};
|
12391 | /******/ ret[webpackExports] = dep;
|
12392 | /******/ return ret;
|
12393 | /******/ }));
|
12394 | /******/ __webpack_require__.a = (module, body, hasAwait) => {
|
12395 | /******/ var queue;
|
12396 | /******/ hasAwait && ((queue = []).d = -1);
|
12397 | /******/ var depQueues = new Set();
|
12398 | /******/ var exports = module.exports;
|
12399 | /******/ var currentDeps;
|
12400 | /******/ var outerResolve;
|
12401 | /******/ var reject;
|
12402 | /******/ var promise = new Promise((resolve, rej) => {
|
12403 | /******/ reject = rej;
|
12404 | /******/ outerResolve = resolve;
|
12405 | /******/ });
|
12406 | /******/ promise[webpackExports] = exports;
|
12407 | /******/ promise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise["catch"](x => {}));
|
12408 | /******/ module.exports = promise;
|
12409 | /******/ body((deps) => {
|
12410 | /******/ currentDeps = wrapDeps(deps);
|
12411 | /******/ var fn;
|
12412 | /******/ var getResult = () => (currentDeps.map((d) => {
|
12413 | /******/ if(d[webpackError]) throw d[webpackError];
|
12414 | /******/ return d[webpackExports];
|
12415 | /******/ }))
|
12416 | /******/ var promise = new Promise((resolve) => {
|
12417 | /******/ fn = () => (resolve(getResult));
|
12418 | /******/ fn.r = 0;
|
12419 | /******/ var fnQueue = (q) => (q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn))));
|
12420 | /******/ currentDeps.map((dep) => (dep[webpackQueues](fnQueue)));
|
12421 | /******/ });
|
12422 | /******/ return fn.r ? promise : getResult();
|
12423 | /******/ }, (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue)));
|
12424 | /******/ queue && queue.d < 0 && (queue.d = 0);
|
12425 | /******/ };
|
12426 | /******/ })();
|
12427 | /******/
|
12428 | /******/ /* webpack/runtime/define property getters */
|
12429 | /******/ (() => {
|
12430 | /******/ // define getter functions for harmony exports
|
12431 | /******/ __webpack_require__.d = (exports, definition) => {
|
12432 | /******/ for(var key in definition) {
|
12433 | /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
12434 | /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
12435 | /******/ }
|
12436 | /******/ }
|
12437 | /******/ };
|
12438 | /******/ })();
|
12439 | /******/
|
12440 | /******/ /* webpack/runtime/hasOwnProperty shorthand */
|
12441 | /******/ (() => {
|
12442 | /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
12443 | /******/ })();
|
12444 | /******/
|
12445 | /************************************************************************/
|
12446 | /******/
|
12447 | /******/ // startup
|
12448 | /******/ // Load entry module and return exports
|
12449 | /******/ // This entry module used 'module' so it can't be inlined
|
12450 | /******/ var __webpack_exports__ = __webpack_require__(624);
|
12451 | /******/ __webpack_exports__ = globalThis.pdfjsViewer = await (globalThis.pdfjsViewerPromise = __webpack_exports__);
|
12452 | /******/ var __webpack_exports__AnnotationLayerBuilder = __webpack_exports__.AnnotationLayerBuilder;
|
12453 | /******/ var __webpack_exports__DownloadManager = __webpack_exports__.DownloadManager;
|
12454 | /******/ var __webpack_exports__EventBus = __webpack_exports__.EventBus;
|
12455 | /******/ var __webpack_exports__FindState = __webpack_exports__.FindState;
|
12456 | /******/ var __webpack_exports__GenericL10n = __webpack_exports__.GenericL10n;
|
12457 | /******/ var __webpack_exports__LinkTarget = __webpack_exports__.LinkTarget;
|
12458 | /******/ var __webpack_exports__PDFFindController = __webpack_exports__.PDFFindController;
|
12459 | /******/ var __webpack_exports__PDFHistory = __webpack_exports__.PDFHistory;
|
12460 | /******/ var __webpack_exports__PDFLinkService = __webpack_exports__.PDFLinkService;
|
12461 | /******/ var __webpack_exports__PDFPageView = __webpack_exports__.PDFPageView;
|
12462 | /******/ var __webpack_exports__PDFScriptingManager = __webpack_exports__.PDFScriptingManager;
|
12463 | /******/ var __webpack_exports__PDFSinglePageViewer = __webpack_exports__.PDFSinglePageViewer;
|
12464 | /******/ var __webpack_exports__PDFViewer = __webpack_exports__.PDFViewer;
|
12465 | /******/ var __webpack_exports__ProgressBar = __webpack_exports__.ProgressBar;
|
12466 | /******/ var __webpack_exports__RenderingStates = __webpack_exports__.RenderingStates;
|
12467 | /******/ var __webpack_exports__ScrollMode = __webpack_exports__.ScrollMode;
|
12468 | /******/ var __webpack_exports__SimpleLinkService = __webpack_exports__.SimpleLinkService;
|
12469 | /******/ var __webpack_exports__SpreadMode = __webpack_exports__.SpreadMode;
|
12470 | /******/ var __webpack_exports__StructTreeLayerBuilder = __webpack_exports__.StructTreeLayerBuilder;
|
12471 | /******/ var __webpack_exports__TextLayerBuilder = __webpack_exports__.TextLayerBuilder;
|
12472 | /******/ var __webpack_exports__XfaLayerBuilder = __webpack_exports__.XfaLayerBuilder;
|
12473 | /******/ var __webpack_exports__parseQueryString = __webpack_exports__.parseQueryString;
|
12474 | /******/ export { __webpack_exports__AnnotationLayerBuilder as AnnotationLayerBuilder, __webpack_exports__DownloadManager as DownloadManager, __webpack_exports__EventBus as EventBus, __webpack_exports__FindState as FindState, __webpack_exports__GenericL10n as GenericL10n, __webpack_exports__LinkTarget as LinkTarget, __webpack_exports__PDFFindController as PDFFindController, __webpack_exports__PDFHistory as PDFHistory, __webpack_exports__PDFLinkService as PDFLinkService, __webpack_exports__PDFPageView as PDFPageView, __webpack_exports__PDFScriptingManager as PDFScriptingManager, __webpack_exports__PDFSinglePageViewer as PDFSinglePageViewer, __webpack_exports__PDFViewer as PDFViewer, __webpack_exports__ProgressBar as ProgressBar, __webpack_exports__RenderingStates as RenderingStates, __webpack_exports__ScrollMode as ScrollMode, __webpack_exports__SimpleLinkService as SimpleLinkService, __webpack_exports__SpreadMode as SpreadMode, __webpack_exports__StructTreeLayerBuilder as StructTreeLayerBuilder, __webpack_exports__TextLayerBuilder as TextLayerBuilder, __webpack_exports__XfaLayerBuilder as XfaLayerBuilder, __webpack_exports__parseQueryString as parseQueryString };
|
12475 | /******/
|
12476 |
|
12477 | //# sourceMappingURL=pdf_viewer.mjs.map |
\ | No newline at end of file |