ngx-extended-pdf-viewer
Version:
Embedding PDF files in your Angular application. Highly configurable viewer including the toolbar, sidebar, and all the features you're used to.
18,748 lines • 665 kB
JavaScript
/**
* @licstart The following is the entire license notice for the
* JavaScript code in this page
*
* Copyright 2024 Mozilla Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* @licend The above is the entire license notice for the
* JavaScript code in this page
*/
/**
* pdfjsVersion = 6.5.1523
* pdfjsBuild = d757f8ee7
*/
/******/ var __webpack_modules__ = ({
/***/ 463
(module) {
var $TypeError = TypeError;
module.exports = function (argument) {
if (typeof argument == 'string') return argument;
throw new $TypeError('Argument is not a string');
};
/***/ },
/***/ 804
(module) {
var commonAlphabet = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var base64Alphabet = commonAlphabet + '+/';
var base64UrlAlphabet = commonAlphabet + '-_';
var inverse = function (characters) {
// TODO: use `Object.create(null)` in `core-js@4`
var result = {};
var index = 0;
for (; index < 64; index++) result[characters.charAt(index)] = index;
return result;
};
module.exports = {
i2c: base64Alphabet,
c2i: inverse(base64Alphabet),
i2cUrl: base64UrlAlphabet,
c2iUrl: inverse(base64UrlAlphabet)
};
/***/ },
/***/ 837
(module) {
var $TypeError = TypeError;
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
module.exports = function (it) {
if (it > MAX_SAFE_INTEGER) throw new $TypeError('Maximum allowed index exceeded');
return it;
};
/***/ },
/***/ 2
(module) {
module.exports = {
IndexSizeError: { s: 'INDEX_SIZE_ERR', c: 1, m: 1 },
DOMStringSizeError: { s: 'DOMSTRING_SIZE_ERR', c: 2, m: 0 },
HierarchyRequestError: { s: 'HIERARCHY_REQUEST_ERR', c: 3, m: 1 },
WrongDocumentError: { s: 'WRONG_DOCUMENT_ERR', c: 4, m: 1 },
InvalidCharacterError: { s: 'INVALID_CHARACTER_ERR', c: 5, m: 1 },
NoDataAllowedError: { s: 'NO_DATA_ALLOWED_ERR', c: 6, m: 0 },
NoModificationAllowedError: { s: 'NO_MODIFICATION_ALLOWED_ERR', c: 7, m: 1 },
NotFoundError: { s: 'NOT_FOUND_ERR', c: 8, m: 1 },
NotSupportedError: { s: 'NOT_SUPPORTED_ERR', c: 9, m: 1 },
InUseAttributeError: { s: 'INUSE_ATTRIBUTE_ERR', c: 10, m: 1 },
InvalidStateError: { s: 'INVALID_STATE_ERR', c: 11, m: 1 },
SyntaxError: { s: 'SYNTAX_ERR', c: 12, m: 1 },
InvalidModificationError: { s: 'INVALID_MODIFICATION_ERR', c: 13, m: 1 },
NamespaceError: { s: 'NAMESPACE_ERR', c: 14, m: 1 },
InvalidAccessError: { s: 'INVALID_ACCESS_ERR', c: 15, m: 1 },
ValidationError: { s: 'VALIDATION_ERR', c: 16, m: 0 },
TypeMismatchError: { s: 'TYPE_MISMATCH_ERR', c: 17, m: 1 },
SecurityError: { s: 'SECURITY_ERR', c: 18, m: 1 },
NetworkError: { s: 'NETWORK_ERR', c: 19, m: 1 },
AbortError: { s: 'ABORT_ERR', c: 20, m: 1 },
URLMismatchError: { s: 'URL_MISMATCH_ERR', c: 21, m: 1 },
QuotaExceededError: { s: 'QUOTA_EXCEEDED_ERR', c: 22, m: 1 },
TimeoutError: { s: 'TIMEOUT_ERR', c: 23, m: 1 },
InvalidNodeTypeError: { s: 'INVALID_NODE_TYPE_ERR', c: 24, m: 1 },
DataCloneError: { s: 'DATA_CLONE_ERR', c: 25, m: 1 }
};
/***/ },
/***/ 944
(module) {
var $TypeError = TypeError;
module.exports = function (options) {
var alphabet = options && options.alphabet;
if (alphabet === undefined || alphabet === 'base64' || alphabet === 'base64url') return alphabet || 'base64';
throw new $TypeError('Incorrect `alphabet` option');
};
/***/ },
/***/ 767
(module) {
// `GetIteratorDirect(obj)` abstract operation
// https://tc39.es/ecma262/#sec-getiteratordirect
module.exports = function (obj) {
return {
iterator: obj,
next: obj.next,
done: false
};
};
/***/ },
/***/ 117
(module) {
// we can't use just `it == null` since of `document.all` special case
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
module.exports = function (it) {
return it === null || it === undefined;
};
/***/ },
/***/ 859
(module) {
// release references held by exhausted / closed iterator helpers to allow GC of the source chain
module.exports = function (state) {
state.iterator = state.next = state.nextHandler = state.mapper = state.predicate = state.inner =
state.iterables = state.iters = state.openIters = state.padding = state.finishResults = state.buffer = null;
};
/***/ },
/***/ 684
(module) {
// Should throw an error on invalid iterator
// https://issues.chromium.org/issues/336839115
module.exports = function (methodName, argument) {
// eslint-disable-next-line es/no-iterator -- required for testing
var method = typeof Iterator == 'function' && Iterator.prototype[methodName];
if (method) try {
method.call({ next: null }, argument).next();
} catch (error) {
return true;
}
};
/***/ },
/***/ 650
(module) {
module.exports = Object.create ? Object.create(null) : {};
/***/ },
/***/ 164
(module, __unused_webpack_exports, __webpack_require__) {
var sign = __webpack_require__(782);
var roundTiesToEven = __webpack_require__(602);
var abs = Math.abs;
var EPSILON = 2.220446049250313e-16; // Number.EPSILON
module.exports = function (x, FLOAT_EPSILON, FLOAT_MAX_VALUE, FLOAT_MIN_VALUE) {
var n = +x;
var absolute = abs(n);
var s = sign(n);
if (absolute < FLOAT_MIN_VALUE) return s * roundTiesToEven(absolute / FLOAT_MIN_VALUE / FLOAT_EPSILON) * FLOAT_MIN_VALUE * FLOAT_EPSILON;
var a = (1 + FLOAT_EPSILON / EPSILON) * absolute;
var result = a - (a - absolute);
// eslint-disable-next-line no-self-compare -- NaN check
if (result > FLOAT_MAX_VALUE || result !== result) return s * Infinity;
return s * result;
};
/***/ },
/***/ 602
(module) {
var EPSILON = 2.220446049250313e-16; // Number.EPSILON
var INVERSE_EPSILON = 1 / EPSILON;
module.exports = function (n) {
return n + INVERSE_EPSILON - INVERSE_EPSILON;
};
/***/ },
/***/ 782
(module) {
// `Math.sign` method implementation
// https://tc39.es/ecma262/#sec-math.sign
// eslint-disable-next-line es/no-math-sign -- safe
module.exports = Math.sign || function sign(x) {
var n = +x;
// eslint-disable-next-line no-self-compare -- NaN check
return n === 0 || n !== n ? n : n < 0 ? -1 : 1;
};
/***/ },
/***/ 741
(module) {
var ceil = Math.ceil;
var floor = Math.floor;
// `Math.trunc` method
// https://tc39.es/ecma262/#sec-math.trunc
// eslint-disable-next-line es/no-math-trunc -- safe
module.exports = Math.trunc || function trunc(x) {
var n = +x;
return (n > 0 ? floor : ceil)(n);
};
/***/ },
/***/ 149
(module) {
var $RangeError = RangeError;
module.exports = function (it) {
// eslint-disable-next-line no-self-compare -- NaN check
if (it === it) return it;
throw new $RangeError('NaN is not allowed');
};
/***/ },
/***/ 717
(__unused_webpack_module, exports) {
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
exports.f = Object.getOwnPropertySymbols;
/***/ },
/***/ 103
(module) {
module.exports = function (exec) {
try {
return { error: false, value: exec() };
} catch (error) {
return { error: true, value: error };
}
};
/***/ },
/***/ 835
(module) {
// Should get iterator record of a set-like object before cloning this
// https://bugs.webkit.org/show_bug.cgi?id=289430
module.exports = function (METHOD_NAME) {
try {
// eslint-disable-next-line es/no-set -- needed for test
var baseSet = new Set();
var setLike = {
size: 0,
has: function () { return true; },
keys: function () {
// eslint-disable-next-line es/no-object-defineproperty -- needed for test
return Object.defineProperty({}, 'next', {
get: function () {
baseSet.clear();
baseSet.add(4);
return function () {
return { done: true };
};
}
});
}
};
var result = baseSet[METHOD_NAME](setLike);
return result.size === 1 && result.values().next().value === 4;
} catch (error) {
return false;
}
};
/***/ },
/***/ 319
(module) {
var floor = Math.floor;
// https://tc39.es/ecma262/#sec-touint8clamp
module.exports = function (it) {
var number = +it;
// eslint-disable-next-line no-self-compare -- NaN check
if (number !== number || number <= 0) return 0;
if (number >= 0xFF) return 0xFF;
var f = floor(number);
if (f + 0.5 < number) return f + 1;
if (number < f + 0.5) return f;
// round-half-to-even (banker's rounding)
return f % 2 === 0 ? f : f + 1;
};
/***/ }
/******/ });
/************************************************************************/
/******/ // The module cache
/******/ const __webpack_module_cache__ = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/ // Check if module is in cache
/******/ const cachedModule = __webpack_module_cache__[moduleId];
/******/ if (cachedModule !== undefined) {
/******/ return cachedModule.exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ const module = __webpack_module_cache__[moduleId] = {
/******/ // no module.id needed
/******/ // no module.loaded needed
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/************************************************************************/
/******/ /* webpack/runtime/concatenation wrap */
/******/ // wrap a concatenated module body as a lazy, memoized accessor; mod is
/******/ // set before the body runs so re-entrant calls (require cycles) observe
/******/ // the partial exports like Node.js
/******/ __webpack_require__.cw = (body) => {
/******/ var mod;
/******/ return () => {
/******/ if (body) {
/******/ var fn = body;
/******/ body = 0;
/******/ mod = { exports: {} };
/******/ fn.call(mod.exports, mod, mod.exports);
/******/ }
/******/ return mod.exports;
/******/ };
/******/ };
/******/
/************************************************************************/
// MODULE: ./node_modules/core-js/internals/a-callable.js
var a_callable_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var isCallable = (is_callable_namespaceFn());
var tryToString = (try_to_string_namespaceFn());
var $TypeError = TypeError;
// `Assert: IsCallable(argument) is true`
module.exports = function (argument) {
if (isCallable(argument)) return argument;
throw new $TypeError(tryToString(argument) + ' is not a function');
};
});
// MODULE: ./node_modules/core-js/internals/a-constructor.js
var a_constructor_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var isConstructor = (is_constructor_namespaceFn());
var tryToString = (try_to_string_namespaceFn());
var $TypeError = TypeError;
// `Assert: IsConstructor(argument) is true`
module.exports = function (argument) {
if (isConstructor(argument)) return argument;
throw new $TypeError(tryToString(argument) + ' is not a constructor');
};
});
// MODULE: ./node_modules/core-js/internals/a-possible-prototype.js
var a_possible_prototype_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var isPossiblePrototype = (is_possible_prototype_namespaceFn());
var $String = String;
var $TypeError = TypeError;
module.exports = function (argument) {
if (isPossiblePrototype(argument)) return argument;
throw new $TypeError("Can't set " + $String(argument) + ' as a prototype');
};
});
// MODULE: ./node_modules/core-js/internals/a-set.js
var a_set_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var has = (set_helpers_namespaceFn().has);
// Perform ? RequireInternalSlot(M, [[SetData]])
module.exports = function (it) {
has(it);
return it;
};
});
// EXTERNAL MODULE: ./node_modules/core-js/internals/a-string.js
var a_string_namespaceFn = () => {
return __webpack_require__(463);
};
// MODULE: ./node_modules/core-js/internals/a-weak-key.js
var a_weak_key_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var WeakMapHelpers = (weak_map_helpers_namespaceFn());
var weakmap = new WeakMapHelpers.WeakMap();
var set = WeakMapHelpers.set;
var remove = WeakMapHelpers.remove;
module.exports = function (key) {
set(weakmap, key, 1);
remove(weakmap, key);
return key;
};
});
// MODULE: ./node_modules/core-js/internals/a-weak-map.js
var a_weak_map_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var has = (weak_map_helpers_namespaceFn().has);
// Perform ? RequireInternalSlot(M, [[WeakMapData]])
module.exports = function (it) {
has(it);
return it;
};
});
// MODULE: ./node_modules/core-js/internals/add-to-unscopables.js
var add_to_unscopables_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var create = (object_create_namespaceFn());
var defineProperty = (object_define_property_namespaceFn().f);
var UNSCOPABLES = wellKnownSymbol('unscopables');
var ArrayPrototype = Array.prototype;
// Array.prototype[@@unscopables]
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
if (ArrayPrototype[UNSCOPABLES] === undefined) {
defineProperty(ArrayPrototype, UNSCOPABLES, {
configurable: true,
value: create(null)
});
}
// add a key to Array.prototype[@@unscopables]
module.exports = function (key) {
ArrayPrototype[UNSCOPABLES][key] = true;
};
});
// MODULE: ./node_modules/core-js/internals/advance-string-index.js
var advance_string_index_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var charAt = (string_multibyte_namespaceFn().charAt);
// `AdvanceStringIndex` abstract operation
// https://tc39.es/ecma262/#sec-advancestringindex
module.exports = function (S, index, unicode) {
return index + (unicode ? charAt(S, index).length || 1 : 1);
};
});
// MODULE: ./node_modules/core-js/internals/an-instance.js
var an_instance_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var isPrototypeOf = (object_is_prototype_of_namespaceFn());
var $TypeError = TypeError;
module.exports = function (it, Prototype) {
if (isPrototypeOf(Prototype, it)) return it;
throw new $TypeError('Incorrect invocation');
};
});
// MODULE: ./node_modules/core-js/internals/an-object-or-undefined.js
var an_object_or_undefined_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var isObject = (is_object_namespaceFn());
var $String = String;
var $TypeError = TypeError;
module.exports = function (argument) {
if (argument === undefined || isObject(argument)) return argument;
throw new $TypeError($String(argument) + ' is not an object or undefined');
};
});
// MODULE: ./node_modules/core-js/internals/an-object.js
var an_object_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var isObject = (is_object_namespaceFn());
var $String = String;
var $TypeError = TypeError;
// `Assert: Type(argument) is Object`
module.exports = function (argument) {
if (isObject(argument)) return argument;
throw new $TypeError($String(argument) + ' is not an object');
};
});
// MODULE: ./node_modules/core-js/internals/an-uint8-array.js
var an_uint8_array_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var classof = (classof_namespaceFn());
var $TypeError = TypeError;
// Perform ? RequireInternalSlot(argument, [[TypedArrayName]])
// If argument.[[TypedArrayName]] is not "Uint8Array", throw a TypeError exception
module.exports = function (argument) {
if (classof(argument) === 'Uint8Array') return argument;
throw new $TypeError('Argument is not an Uint8Array');
};
});
// MODULE: ./node_modules/core-js/internals/array-buffer-basic-detection.js
var array_buffer_basic_detection_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
// eslint-disable-next-line es/no-typed-arrays -- safe
module.exports = typeof ArrayBuffer != 'undefined' && typeof DataView != 'undefined';
});
// MODULE: ./node_modules/core-js/internals/array-buffer-byte-length.js
var array_buffer_byte_length_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
var uncurryThisAccessor = (function_uncurry_this_accessor_namespaceFn());
var classof = (classof_raw_namespaceFn());
var ArrayBuffer = globalThis.ArrayBuffer;
var TypeError = globalThis.TypeError;
// Includes
// - Perform ? RequireInternalSlot(O, [[ArrayBufferData]]).
// - If IsSharedArrayBuffer(O) is true, throw a TypeError exception.
module.exports = ArrayBuffer && uncurryThisAccessor(ArrayBuffer.prototype, 'byteLength', 'get') || function (O) {
if (classof(O) !== 'ArrayBuffer') throw new TypeError('ArrayBuffer expected');
return O.byteLength;
};
});
// MODULE: ./node_modules/core-js/internals/array-buffer-is-detached.js
var array_buffer_is_detached_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
var NATIVE_ARRAY_BUFFER = (array_buffer_basic_detection_namespaceFn());
var arrayBufferByteLength = (array_buffer_byte_length_namespaceFn());
var DataView = globalThis.DataView;
module.exports = function (O) {
if (!NATIVE_ARRAY_BUFFER || arrayBufferByteLength(O) !== 0) return false;
try {
// eslint-disable-next-line no-new -- thrower
new DataView(O);
return false;
} catch (error) {
return true;
}
};
});
// MODULE: ./node_modules/core-js/internals/array-buffer-not-detached.js
var array_buffer_not_detached_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var isDetached = (array_buffer_is_detached_namespaceFn());
var $TypeError = TypeError;
module.exports = function (it) {
if (isDetached(it)) throw new $TypeError('ArrayBuffer is detached');
return it;
};
});
// MODULE: ./node_modules/core-js/internals/array-buffer-transfer.js
var array_buffer_transfer_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var uncurryThisAccessor = (function_uncurry_this_accessor_namespaceFn());
var toIndex = (to_index_namespaceFn());
var notDetached = (array_buffer_not_detached_namespaceFn());
var arrayBufferByteLength = (array_buffer_byte_length_namespaceFn());
var detachTransferable = (detach_transferable_namespaceFn());
var PROPER_STRUCTURED_CLONE_TRANSFER = (structured_clone_proper_transfer_namespaceFn());
var structuredClone = globalThis.structuredClone;
var ArrayBuffer = globalThis.ArrayBuffer;
var DataView = globalThis.DataView;
var max = Math.max;
var min = Math.min;
var ArrayBufferPrototype = ArrayBuffer.prototype;
var DataViewPrototype = DataView.prototype;
var slice = uncurryThis(ArrayBufferPrototype.slice);
var isResizable = uncurryThisAccessor(ArrayBufferPrototype, 'resizable', 'get');
var maxByteLength = uncurryThisAccessor(ArrayBufferPrototype, 'maxByteLength', 'get');
var getInt8 = uncurryThis(DataViewPrototype.getInt8);
var setInt8 = uncurryThis(DataViewPrototype.setInt8);
module.exports = (PROPER_STRUCTURED_CLONE_TRANSFER || detachTransferable) && function (arrayBuffer, newLength, preserveResizability) {
var byteLength = arrayBufferByteLength(arrayBuffer);
var newByteLength = newLength === undefined ? byteLength : toIndex(newLength);
var fixedLength = !isResizable || !isResizable(arrayBuffer);
var newBuffer;
notDetached(arrayBuffer);
if (PROPER_STRUCTURED_CLONE_TRANSFER) {
arrayBuffer = structuredClone(arrayBuffer, { transfer: [arrayBuffer] });
if (byteLength === newByteLength && (preserveResizability || fixedLength)) return arrayBuffer;
}
if (byteLength >= newByteLength && (!preserveResizability || fixedLength)) {
newBuffer = slice(arrayBuffer, 0, newByteLength);
} else {
var options = preserveResizability && !fixedLength && maxByteLength
? { maxByteLength: max(newByteLength, maxByteLength(arrayBuffer)) }
: undefined;
newBuffer = new ArrayBuffer(newByteLength, options);
var a = new DataView(arrayBuffer);
var b = new DataView(newBuffer);
var copyLength = min(newByteLength, byteLength);
for (var i = 0; i < copyLength; i++) setInt8(b, i, getInt8(a, i));
}
if (!PROPER_STRUCTURED_CLONE_TRANSFER) detachTransferable(arrayBuffer);
return newBuffer;
};
});
// MODULE: ./node_modules/core-js/internals/array-buffer-view-core.js
var array_buffer_view_core_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var NATIVE_ARRAY_BUFFER = (array_buffer_basic_detection_namespaceFn());
var DESCRIPTORS = (descriptors_namespaceFn());
var globalThis = (global_this_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var isObject = (is_object_namespaceFn());
var hasOwn = (has_own_property_namespaceFn());
var classof = (classof_namespaceFn());
var tryToString = (try_to_string_namespaceFn());
var createNonEnumerableProperty = (create_non_enumerable_property_namespaceFn());
var defineBuiltIn = (define_built_in_namespaceFn());
var defineBuiltInAccessor = (define_built_in_accessor_namespaceFn());
var isPrototypeOf = (object_is_prototype_of_namespaceFn());
var getPrototypeOf = (object_get_prototype_of_namespaceFn());
var setPrototypeOf = (object_set_prototype_of_namespaceFn());
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var uid = (uid_namespaceFn());
var InternalStateModule = (internal_state_namespaceFn());
var enforceInternalState = InternalStateModule.enforce;
var getInternalState = InternalStateModule.get;
var Int8Array = globalThis.Int8Array;
var Int8ArrayPrototype = Int8Array && Int8Array.prototype;
var Uint8ClampedArray = globalThis.Uint8ClampedArray;
var Uint8ClampedArrayPrototype = Uint8ClampedArray && Uint8ClampedArray.prototype;
var TypedArray = Int8Array && getPrototypeOf(Int8Array);
var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);
var ObjectPrototype = Object.prototype;
var TypeError = globalThis.TypeError;
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var TYPED_ARRAY_TAG = uid('TYPED_ARRAY_TAG');
var TYPED_ARRAY_CONSTRUCTOR = 'TypedArrayConstructor';
// Fixing native typed arrays in Opera Presto crashes the browser, see #595
var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(globalThis.opera) !== 'Opera';
var TYPED_ARRAY_TAG_REQUIRED = false;
var NAME, Constructor, Prototype;
var TypedArrayConstructorsList = {
Int8Array: 1,
Uint8Array: 1,
Uint8ClampedArray: 1,
Int16Array: 2,
Uint16Array: 2,
Int32Array: 4,
Uint32Array: 4,
Float32Array: 4,
Float64Array: 8
};
var BigIntArrayConstructorsList = {
BigInt64Array: 8,
BigUint64Array: 8
};
var isView = function isView(it) {
if (!isObject(it)) return false;
var klass = classof(it);
return klass === 'DataView'
|| hasOwn(TypedArrayConstructorsList, klass)
|| hasOwn(BigIntArrayConstructorsList, klass);
};
var getTypedArrayConstructor = function (it) {
var proto = getPrototypeOf(it);
if (!isObject(proto)) return;
var state = getInternalState(proto);
return (state && hasOwn(state, TYPED_ARRAY_CONSTRUCTOR)) ? state[TYPED_ARRAY_CONSTRUCTOR] : getTypedArrayConstructor(proto);
};
var isTypedArray = function (it) {
if (!isObject(it)) return false;
var klass = classof(it);
return hasOwn(TypedArrayConstructorsList, klass)
|| hasOwn(BigIntArrayConstructorsList, klass);
};
var aTypedArray = function (it) {
if (isTypedArray(it)) return it;
throw new TypeError('Target is not a typed array');
};
var aTypedArrayConstructor = function (C) {
if (isCallable(C) && (!setPrototypeOf || isPrototypeOf(TypedArray, C))) return C;
throw new TypeError(tryToString(C) + ' is not a typed array constructor');
};
var exportTypedArrayMethod = function (KEY, property, forced, options) {
if (!DESCRIPTORS) return;
if (forced) for (var ARRAY in TypedArrayConstructorsList) {
var TypedArrayConstructor = globalThis[ARRAY];
if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY)) try {
delete TypedArrayConstructor.prototype[KEY];
} catch (error) {
// old WebKit bug - some methods are non-configurable
try {
TypedArrayConstructor.prototype[KEY] = property;
} catch (error2) { /* empty */ }
}
}
if (!TypedArrayPrototype[KEY] || forced) {
defineBuiltIn(TypedArrayPrototype, KEY, forced ? property
: NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options);
}
};
var exportTypedArrayStaticMethod = function (KEY, property, forced) {
var ARRAY, TypedArrayConstructor;
if (!DESCRIPTORS) return;
if (setPrototypeOf) {
if (forced) for (ARRAY in TypedArrayConstructorsList) {
TypedArrayConstructor = globalThis[ARRAY];
if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY)) try {
delete TypedArrayConstructor[KEY];
} catch (error) { /* empty */ }
}
if (!TypedArray[KEY] || forced) {
// V8 ~ Chrome 49-50 `%TypedArray%` methods are non-writable non-configurable
try {
return defineBuiltIn(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property);
} catch (error) { /* empty */ }
} else return;
}
for (ARRAY in TypedArrayConstructorsList) {
TypedArrayConstructor = globalThis[ARRAY];
if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {
defineBuiltIn(TypedArrayConstructor, KEY, property);
}
}
};
for (NAME in TypedArrayConstructorsList) {
Constructor = globalThis[NAME];
Prototype = Constructor && Constructor.prototype;
if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;
else NATIVE_ARRAY_BUFFER_VIEWS = false;
}
for (NAME in BigIntArrayConstructorsList) {
Constructor = globalThis[NAME];
Prototype = Constructor && Constructor.prototype;
if (Prototype) enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;
}
// WebKit bug - typed arrays constructors prototype is Object.prototype
if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {
// eslint-disable-next-line no-shadow -- safe
TypedArray = function TypedArray() {
throw new TypeError('Incorrect invocation');
};
if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
if (globalThis[NAME]) setPrototypeOf(globalThis[NAME], TypedArray);
}
}
if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {
TypedArrayPrototype = TypedArray.prototype;
if (NATIVE_ARRAY_BUFFER_VIEWS) for (NAME in TypedArrayConstructorsList) {
if (globalThis[NAME]) setPrototypeOf(globalThis[NAME].prototype, TypedArrayPrototype);
}
}
// WebKit bug - one more object in Uint8ClampedArray prototype chain
if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {
setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);
}
if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) {
TYPED_ARRAY_TAG_REQUIRED = true;
defineBuiltInAccessor(TypedArrayPrototype, TO_STRING_TAG, {
configurable: true,
get: function () {
return isObject(this) ? this[TYPED_ARRAY_TAG] : undefined;
}
});
for (NAME in TypedArrayConstructorsList) if (globalThis[NAME]) {
createNonEnumerableProperty(globalThis[NAME].prototype, TYPED_ARRAY_TAG, NAME);
}
}
module.exports = {
NATIVE_ARRAY_BUFFER_VIEWS: NATIVE_ARRAY_BUFFER_VIEWS,
TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG,
aTypedArray: aTypedArray,
aTypedArrayConstructor: aTypedArrayConstructor,
exportTypedArrayMethod: exportTypedArrayMethod,
exportTypedArrayStaticMethod: exportTypedArrayStaticMethod,
getTypedArrayConstructor: getTypedArrayConstructor,
isView: isView,
isTypedArray: isTypedArray,
TypedArray: TypedArray,
TypedArrayPrototype: TypedArrayPrototype
};
});
// MODULE: ./node_modules/core-js/internals/array-buffer.js
var array_buffer_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var DESCRIPTORS = (descriptors_namespaceFn());
var NATIVE_ARRAY_BUFFER = (array_buffer_basic_detection_namespaceFn());
var FunctionName = (function_name_namespaceFn());
var createNonEnumerableProperty = (create_non_enumerable_property_namespaceFn());
var defineBuiltInAccessor = (define_built_in_accessor_namespaceFn());
var defineBuiltIns = (define_built_ins_namespaceFn());
var fails = (fails_namespaceFn());
var anInstance = (an_instance_namespaceFn());
var toIntegerOrInfinity = (to_integer_or_infinity_namespaceFn());
var toIndex = (to_index_namespaceFn());
var fround = (math_fround_namespaceFn());
var IEEE754 = (ieee754_namespaceFn());
var getPrototypeOf = (object_get_prototype_of_namespaceFn());
var setPrototypeOf = (object_set_prototype_of_namespaceFn());
var arrayFill = (array_fill_namespaceFn());
var arraySlice = (array_slice_namespaceFn());
var inheritIfRequired = (inherit_if_required_namespaceFn());
var copyConstructorProperties = (copy_constructor_properties_namespaceFn());
var setToStringTag = (set_to_string_tag_namespaceFn());
var InternalStateModule = (internal_state_namespaceFn());
var PROPER_FUNCTION_NAME = FunctionName.PROPER;
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
var ARRAY_BUFFER = 'ArrayBuffer';
var DATA_VIEW = 'DataView';
var PROTOTYPE = 'prototype';
var WRONG_LENGTH = 'Wrong length';
var WRONG_INDEX = 'Wrong index';
var getInternalArrayBufferState = InternalStateModule.getterFor(ARRAY_BUFFER);
var getInternalDataViewState = InternalStateModule.getterFor(DATA_VIEW);
var setInternalState = InternalStateModule.set;
var NativeArrayBuffer = globalThis[ARRAY_BUFFER];
var $ArrayBuffer = NativeArrayBuffer;
var ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE];
var $DataView = globalThis[DATA_VIEW];
var DataViewPrototype = $DataView && $DataView[PROTOTYPE];
var ObjectPrototype = Object.prototype;
var Array = globalThis.Array;
var RangeError = globalThis.RangeError;
var fill = uncurryThis(arrayFill);
var reverse = uncurryThis([].reverse);
var packIEEE754 = IEEE754.pack;
var unpackIEEE754 = IEEE754.unpack;
var packInt8 = function (number) {
return [number & 0xFF];
};
var packInt16 = function (number) {
return [number & 0xFF, number >> 8 & 0xFF];
};
var packInt32 = function (number) {
return [number & 0xFF, number >> 8 & 0xFF, number >> 16 & 0xFF, number >> 24 & 0xFF];
};
var unpackInt32 = function (buffer) {
return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0];
};
var packFloat32 = function (number) {
return packIEEE754(fround(number), 23, 4);
};
var packFloat64 = function (number) {
return packIEEE754(number, 52, 8);
};
var addGetter = function (Constructor, key, getInternalState) {
defineBuiltInAccessor(Constructor[PROTOTYPE], key, {
configurable: true,
get: function () {
return getInternalState(this)[key];
}
});
};
var get = function (view, count, index, isLittleEndian) {
var store = getInternalDataViewState(view);
var intIndex = toIndex(index);
var boolIsLittleEndian = !!isLittleEndian;
if (intIndex + count > store.byteLength) throw new RangeError(WRONG_INDEX);
var bytes = store.bytes;
var start = intIndex + store.byteOffset;
var pack = arraySlice(bytes, start, start + count);
return boolIsLittleEndian ? pack : reverse(pack);
};
var set = function (view, count, index, conversion, value, isLittleEndian) {
var store = getInternalDataViewState(view);
var intIndex = toIndex(index);
var pack = conversion(+value);
var boolIsLittleEndian = !!isLittleEndian;
if (intIndex + count > store.byteLength) throw new RangeError(WRONG_INDEX);
var bytes = store.bytes;
var start = intIndex + store.byteOffset;
for (var i = 0; i < count; i++) bytes[start + i] = pack[boolIsLittleEndian ? i : count - i - 1];
};
if (!NATIVE_ARRAY_BUFFER) {
$ArrayBuffer = function ArrayBuffer(length) {
anInstance(this, ArrayBufferPrototype);
var byteLength = toIndex(length);
setInternalState(this, {
type: ARRAY_BUFFER,
bytes: fill(Array(byteLength), 0),
byteLength: byteLength
});
if (!DESCRIPTORS) {
this.byteLength = byteLength;
this.detached = false;
}
};
ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE];
$DataView = function DataView(buffer, byteOffset, byteLength) {
anInstance(this, DataViewPrototype);
anInstance(buffer, ArrayBufferPrototype);
var bufferState = getInternalArrayBufferState(buffer);
var bufferLength = bufferState.byteLength;
var offset = toIntegerOrInfinity(byteOffset);
if (offset < 0 || offset > bufferLength) throw new RangeError('Wrong offset');
byteLength = byteLength === undefined ? bufferLength - offset : toIndex(byteLength);
if (offset + byteLength > bufferLength) throw new RangeError(WRONG_LENGTH);
setInternalState(this, {
type: DATA_VIEW,
buffer: buffer,
byteLength: byteLength,
byteOffset: offset,
bytes: bufferState.bytes
});
if (!DESCRIPTORS) {
this.buffer = buffer;
this.byteLength = byteLength;
this.byteOffset = offset;
}
};
DataViewPrototype = $DataView[PROTOTYPE];
if (DESCRIPTORS) {
addGetter($ArrayBuffer, 'byteLength', getInternalArrayBufferState);
addGetter($DataView, 'buffer', getInternalDataViewState);
addGetter($DataView, 'byteLength', getInternalDataViewState);
addGetter($DataView, 'byteOffset', getInternalDataViewState);
}
defineBuiltIns(DataViewPrototype, {
getInt8: function getInt8(byteOffset) {
return get(this, 1, byteOffset)[0] << 24 >> 24;
},
getUint8: function getUint8(byteOffset) {
return get(this, 1, byteOffset)[0];
},
getInt16: function getInt16(byteOffset /* , littleEndian */) {
var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false);
return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
},
getUint16: function getUint16(byteOffset /* , littleEndian */) {
var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false);
return bytes[1] << 8 | bytes[0];
},
getInt32: function getInt32(byteOffset /* , littleEndian */) {
return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false));
},
getUint32: function getUint32(byteOffset /* , littleEndian */) {
return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false)) >>> 0;
},
getFloat32: function getFloat32(byteOffset /* , littleEndian */) {
return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false), 23);
},
getFloat64: function getFloat64(byteOffset /* , littleEndian */) {
return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : false), 52);
},
setInt8: function setInt8(byteOffset, value) {
set(this, 1, byteOffset, packInt8, value);
},
setUint8: function setUint8(byteOffset, value) {
set(this, 1, byteOffset, packInt8, value);
},
setInt16: function setInt16(byteOffset, value /* , littleEndian */) {
set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false);
},
setUint16: function setUint16(byteOffset, value /* , littleEndian */) {
set(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false);
},
setInt32: function setInt32(byteOffset, value /* , littleEndian */) {
set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false);
},
setUint32: function setUint32(byteOffset, value /* , littleEndian */) {
set(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false);
},
setFloat32: function setFloat32(byteOffset, value /* , littleEndian */) {
set(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : false);
},
setFloat64: function setFloat64(byteOffset, value /* , littleEndian */) {
set(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : false);
}
});
} else {
var INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME && NativeArrayBuffer.name !== ARRAY_BUFFER;
/* eslint-disable no-new, sonarjs/inconsistent-function-call -- required for testing */
if (!fails(function () {
NativeArrayBuffer(1);
}) || !fails(function () {
new NativeArrayBuffer(-1);
}) || fails(function () {
new NativeArrayBuffer();
new NativeArrayBuffer(1.5);
new NativeArrayBuffer(NaN);
return NativeArrayBuffer.length !== 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;
})) {
/* eslint-enable no-new, sonarjs/inconsistent-function-call -- required for testing */
$ArrayBuffer = function ArrayBuffer(length) {
anInstance(this, ArrayBufferPrototype);
return inheritIfRequired(new NativeArrayBuffer(toIndex(length)), this, $ArrayBuffer);
};
$ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype;
ArrayBufferPrototype.constructor = $ArrayBuffer;
copyConstructorProperties($ArrayBuffer, NativeArrayBuffer);
} else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) {
createNonEnumerableProperty(NativeArrayBuffer, 'name', ARRAY_BUFFER);
}
// WebKit bug - the same parent prototype for typed arrays and data view
if (setPrototypeOf && getPrototypeOf(DataViewPrototype) !== ObjectPrototype) {
setPrototypeOf(DataViewPrototype, ObjectPrototype);
}
// iOS Safari 7.x bug
var testView = new $DataView(new $ArrayBuffer(2));
var $setInt8 = uncurryThis(DataViewPrototype.setInt8);
testView.setInt8(0, 2147483648);
testView.setInt8(1, 2147483649);
if (testView.getInt8(0) || !testView.getInt8(1)) defineBuiltIns(DataViewPrototype, {
setInt8: function setInt8(byteOffset, value) {
$setInt8(this, byteOffset, value << 24 >> 24);
},
setUint8: function setUint8(byteOffset, value) {
$setInt8(this, byteOffset, value << 24 >> 24);
}
}, { unsafe: true });
}
setToStringTag($ArrayBuffer, ARRAY_BUFFER);
setToStringTag($DataView, DATA_VIEW);
module.exports = {
ArrayBuffer: $ArrayBuffer,
DataView: $DataView
};
});
// MODULE: ./node_modules/core-js/internals/array-fill.js
var array_fill_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var toObject = (to_object_namespaceFn());
var toAbsoluteIndex = (to_absolute_index_namespaceFn());
var lengthOfArrayLike = (length_of_array_like_namespaceFn());
// `Array.prototype.fill` method implementation
// https://tc39.es/ecma262/#sec-array.prototype.fill
// eslint-disable-next-line es/no-array-prototype-fill -- fallback included
module.exports = [].fill || function fill(value /* , start = 0, end = @length */) {
var O = toObject(this);
var length = lengthOfArrayLike(O);
var argumentsLength = arguments.length;
var index = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : undefined, length);
var end = argumentsLength > 2 ? arguments[2] : undefined;
var endPos = end === undefined ? length : toAbsoluteIndex(end, length);
while (endPos > index) O[index++] = value;
return O;
};
});
// MODULE: ./node_modules/core-js/internals/array-from-constructor-and-list.js
var array_from_constructor_and_list_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var lengthOfArrayLike = (length_of_array_like_namespaceFn());
module.exports = function (Constructor, list, $length) {
var index = 0;
var length = arguments.length > 2 ? $length : lengthOfArrayLike(list);
var result = new Constructor(length);
while (length > index) result[index] = list[index++];
return result;
};
});
// MODULE: ./node_modules/core-js/internals/array-from.js
var array_from_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var bind = (function_bind_context_namespaceFn());
var call = (function_call_namespaceFn());
var toObject = (to_object_namespaceFn());
var callWithSafeIterationClosing = (call_with_safe_iteration_closing_namespaceFn());
var isArrayIteratorMethod = (is_array_iterator_method_namespaceFn());
var isConstructor = (is_constructor_namespaceFn());
var lengthOfArrayLike = (length_of_array_like_namespaceFn());
var createProperty = (create_property_namespaceFn());
var setArrayLength = (array_set_length_namespaceFn());
var getIterator = (get_iterator_internal_namespaceFn());
var getIteratorMethod = (get_iterator_method_internal_namespaceFn());
var iteratorClose = (iterator_close_namespaceFn());
var doesNotExceedSafeInteger = (does_not_exceed_safe_integer_namespaceFn());
var $Array = Array;
// `Array.from` method implementation
// https://tc39.es/ecma262/#sec-array.from
module.exports = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
var IS_CONSTRUCTOR = isConstructor(this);
var argumentsLength = arguments.length;
var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
if (mapping) mapfn = bind(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
var O = toObject(arrayLike);
var iteratorMethod = getIteratorMethod(O);
var index = 0;
var length, result, step, iterator, next, value;
// if the target is not iterable or it's an array with the default iterator - use a simple case
if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
result = IS_CONSTRUCTOR ? new this() : [];
iterator = getIterator(O, iteratorMethod);
next = iterator.next;
for (;!(step = call(next, iterator)).done; index++) {
try {
doesNotExceedSafeInteger(index);
} catch (error) {
iteratorClose(iterator, 'throw', error);
}
value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
try {
createProperty(result, index, value);
} catch (error) {
iteratorClose(iterator, 'throw', error);
}
}
} else {
length = lengthOfArrayLike(O);
result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
for (;length > index; index++) {
value = mapping ? mapfn(O[index], index) : O[index];
createProperty(result, index, value);
}
}
setArrayLength(result, index);
return result;
};
});
// MODULE: ./node_modules/core-js/internals/array-includes.js
var array_includes_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var toIndexedObject = (to_indexed_object_namespaceFn());
var toAbsoluteIndex = (to_absolute_index_namespaceFn());
var lengthOfArrayLike = (length_of_array_like_namespaceFn());
// `Array.prototype.{ indexOf, includes }` methods implementation
var createMethod = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = toIndexedObject($this);
var length = lengthOfArrayLike(O);
if (length === 0) return !IS_INCLUDES && -1;
var index = toAbsoluteIndex(fromIndex, length);
var value;
// Array#includes uses SameValueZero equality algorithm
// eslint-disable-next-line no-self-compare -- NaN check
if (IS_INCLUDES && el !== el) while (length > index) {
value = O[index++];
// eslint-disable-next-line no-self-compare -- NaN check
if (value !== value) return true;
// Array#indexOf ignores holes, Array#includes - not
} else for (;length > index; index++) {
if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
} return !IS_INCLUDES && -1;
};
};
module.exports = {
// `Array.prototype.includes` method
// https://tc39.es/ecma262/#sec-array.prototype.includes
includes: createMethod(true),
// `Array.prototype.indexOf` method
// https://tc39.es/ecma262/#sec-array.prototype.indexof
indexOf: createMethod(false)
};
});
// MODULE: ./node_modules/core-js/internals/array-iteration-from-last.js
var array_iteration_from_last_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var bind = (function_bind_context_namespaceFn());
var IndexedObject = (indexed_object_namespaceFn());
var toObject = (to_object_namespaceFn());
var lengthOfArrayLike = (length_of_array_like_namespaceFn());
// `Array.prototype.{ findLast, findLastIndex }` methods implementation
var createMethod = function (TYPE) {
var IS_FIND_LAST_INDEX = TYPE === 1;
return function ($this, callbackfn, that) {
var O = toObject($this);
var self = IndexedObject(O);
var index = lengthOfArrayLike(self);
var boundFunction = bind(callbackfn, that);
var value, result;
while (index-- > 0) {
value = self[index];
result = boundFunction(value, index, O);
if (result) switch (TYPE) {
case 0: return value; // findLast
case 1: return index; // findLastIndex
}
}
return IS_FIND_LAST_INDEX ? -1 : undefined;
};
};
module.exports = {
// `Array.prototype.findLast` method
// https://github.com/tc39/proposal-array-find-from-last
findLast: createMethod(0),
// `Array.prototype.findLastIndex` method
// https://github.com/tc39/proposal-array-find-from-last
findLastIndex: createMethod(1)
};
});
// MODULE: ./node_modules/core-js/internals/array-iteration.js
var array_iteration_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var bind = (function_bind_context_namespaceFn());
var IndexedObject = (indexed_object_namespaceFn());
var toObject = (to_object_namespaceFn());
var lengthOfArrayLike = (length_of_array_like_namespaceFn());
var arraySpeciesCreate = (array_species_create_namespaceFn());
var createProperty = (create_property_namespaceFn());
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
var createMethod = function (TYPE) {
var IS_MAP = TYPE === 1;
var IS_FILTER = TYPE === 2;
var IS_SOME = TYPE === 3;
var IS_EVERY = TYPE === 4;
var IS_FIND_INDEX = TYPE === 6;
var IS_FILTER_REJECT = TYPE === 7;
var NO_HOLES = TYPE === 5 || IS_FIND_INDEX;
return function ($this, callbackfn, that) {
var O = toObject($this);
var self = IndexedObject(O);
var length = lengthOfArrayLike(self);
var boundFunction = bind(callbackfn, that);
var index = 0;
var resIndex = 0;
var target = IS_MAP ? arraySpeciesCreate($this, length) : IS_FILTER || IS_FILTER_REJECT ? arraySpeciesCreate($this, 0) : undefined;
var value, result;
for (;length > index; index++) if (NO_HOLES || index in self) {
value = self[index];
result = boundFunction(value, index, O);
if (TYPE) {
if (IS_MAP) createProperty(target, index, result); // map
else if (result) switch (TYPE) {
case 3: return true; // some
case 5: return value; // find
case 6: return index; // findIndex
case 2: createProperty(target, resIndex++, value); // filter
} else switch (TYPE) {
case 4: return false; // every
case 7: createProperty(target, resIndex++, value); // filterReject
}
}
}
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
};
};
module.exports = {
// `Array.prototype.forEach` method
// https://tc39.es/ecma262/#sec-array.prototype.foreach
forEach: createMethod(0),
// `Array.prototype.map` method
// https://tc39.es/ecma262/#sec-array.prototype.map
...void (createMethod(1)),
// `Array.prototype.filter` method
// https://tc39.es/ecma262/#sec-array.prototype.filter
...void (createMethod(2)),
// `Array.prototype.some` method
// https://tc39.es/ecma262/#sec-array.prototype.some
...void (createMethod(3)),
// `Array.prototype.every` method
// https://tc39.es/ecma262/#sec-array.prototype.every
...void (createMethod(4)),
// `Array.prototype.find` method
// https://tc39.es/ecma262/#sec-array.prototype.find
...void (createMethod(5)),
// `Array.prototype.findIndex` method
// https://tc39.es/ecma262/#sec-array.prototype.findIndex
...void (createMethod(6)),
// `Array.prototype.filterReject` method
// https://github.com/tc39/proposal-array-filtering
...void (createMethod(7))
};
});
// MODULE: ./node_modules/core-js/internals/array-set-length.js
var array_set_length_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var DESCRIPTORS = (descriptors_namespaceFn());
var isArray = (is_array_namespaceFn());
var $TypeError = TypeError;
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
// Safari < 13 does not throw an error in this case
var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function () {
// makes no sense without proper strict mode support
if (this !== undefined) return true;
try {
// eslint-disable-next-line es/no-object-defineproperty -- safe
Object.defineProperty([], 'length', { writable: false }).length = 1;
} catch (error) {
return error instanceof TypeError;
}
}();
module.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
if (isArray(O) && !getOwnPropertyDescriptor(O, 'length').writable) {
throw new $TypeError('Cannot set read only .length');
} return O.length = length;
} : function (O, length) {
return O.length = length;
};
});
// MODULE: ./node_modules/core-js/internals/array-slice.js
var array_slice_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
module.exports = uncurryThis([].slice);
});
// MODULE: ./node_modules/core-js/internals/array-sort.js
var array_sort_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var arraySlice = (array_slice_namespaceFn());
var floor = Math.floor;
var sort = function (array, comparefn) {
var length = array.length;
if (length < 8) {
// insertion sort
var i = 1;
var element, j;
while (i < length) {
j = i;
element = array[i];
while (j && comparefn(array[j - 1], element) > 0) {
array[j] = array[--j];
}
if (j !== i++) array[j] = element;
}
} else {
// merge sort
var middle = floor(length / 2);
var left = sort(arraySlice(array, 0, middle), comparefn);
var right = sort(arraySlice(array, middle), comparefn);
var llength = left.length;
var rlength = right.length;
var lindex = 0;
var rindex = 0;
while (lindex < llength || rindex < rlength) {
array[lindex + rindex] = (lindex < llength && rindex < rlength)
? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
: lindex < llength ? left[lindex++] : right[rindex++];
}
}
return array;
};
module.exports = sort;
});
// MODULE: ./node_modules/core-js/internals/array-species-constructor.js
var array_species_constructor_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var isArray = (is_array_namespaceFn());
var isConstructor = (is_constructor_namespaceFn());
var isObject = (is_object_namespaceFn());
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var SPECIES = wellKnownSymbol('species');
var $Array = Array;
// a part of `ArraySpeciesCreate` abstract operation
// https://tc39.es/ecma262/#sec-arrayspeciescreate
module.exports = function (originalArray) {
var C;
if (isArray(originalArray)) {
C = originalArray.constructor;
// cross-realm fallback
if (isConstructor(C) && (C === $Array || isArray(C.prototype))) C = undefined;
else if (isObject(C)) {
C = C[SPECIES];
if (C === null) C = undefined;
}
} return C === undefined ? $Array : C;
};
});
// MODULE: ./node_modules/core-js/internals/array-species-create.js
var array_species_create_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var arraySpeciesConstructor = (array_species_constructor_namespaceFn());
// `ArraySpeciesCreate` abstract operation
// https://tc39.es/ecma262/#sec-arrayspeciescreate
module.exports = function (originalArray, length) {
return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
};
});
// EXTERNAL MODULE: ./node_modules/core-js/internals/base64-map.js
var base64_map_namespaceFn = () => {
return __webpack_require__(804);
};
// MODULE: ./node_modules/core-js/internals/call-with-safe-iteration-closing.js
var call_with_safe_iteration_closing_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var anObject = (an_object_namespaceFn());
var iteratorClose = (iterator_close_namespaceFn());
// call something on iterator step with safe closing on error
module.exports = function (iterator, fn, value, ENTRIES) {
try {
return ENTRIES ? fn(anObject(value)[0], value[1]) : fn(value);
} catch (error) {
iteratorClose(iterator, 'throw', error);
}
};
});
// MODULE: ./node_modules/core-js/internals/check-correctness-of-iteration.js
var check_correctness_of_iteration_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var ITERATOR = wellKnownSymbol('iterator');
var SAFE_CLOSING = false;
try {
var called = 0;
var iteratorWithReturn = {
next: function () {
return { done: !!called++ };
},
'return': function () {
SAFE_CLOSING = true;
}
};
// eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
iteratorWithReturn[ITERATOR] = function () {
return this;
};
// eslint-disable-next-line es/no-array-from, no-throw-literal -- required for testing
Array.from(iteratorWithReturn, function () { throw 2; });
} catch (error) { /* empty */ }
module.exports = function (exec, SKIP_CLOSING) {
try {
if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
} catch (error) { return false; } // workaround of old WebKit + `eval` bug
var ITERATION_SUPPORT = false;
try {
var object = {};
// eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
object[ITERATOR] = function () {
return {
next: function () {
return { done: ITERATION_SUPPORT = true };
}
};
};
exec(object);
} catch (error) { /* empty */ }
return ITERATION_SUPPORT;
};
});
// MODULE: ./node_modules/core-js/internals/classof-raw.js
var classof_raw_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
var toString = uncurryThis({}.toString);
var stringSlice = uncurryThis(''.slice);
module.exports = function (it) {
return stringSlice(toString(it), 8, -1);
};
});
// MODULE: ./node_modules/core-js/internals/classof.js
var classof_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var TO_STRING_TAG_SUPPORT = (to_string_tag_support_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var classofRaw = (classof_raw_namespaceFn());
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var $Object = Object;
// ES3 wrong here
var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';
// fallback for IE11 Script Access Denied error
var tryGet = function (it, key) {
try {
return it[key];
} catch (error) { /* empty */ }
};
// getting tag from ES6+ `Object.prototype.toString`
module.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
var O, tag, result;
return it === undefined ? 'Undefined' : it === null ? 'Null'
// @@toStringTag case
: typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag
// builtinTag case
: CORRECT_ARGUMENTS ? classofRaw(O)
// ES3 arguments fallback
: (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;
};
});
// MODULE: ./node_modules/core-js/internals/copy-constructor-properties.js
var copy_constructor_properties_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var hasOwn = (has_own_property_namespaceFn());
var ownKeys = (own_keys_namespaceFn());
var getOwnPropertyDescriptorModule = (object_get_own_property_descriptor_namespaceFn());
var definePropertyModule = (object_define_property_namespaceFn());
module.exports = function (target, source, exceptions) {
var keys = ownKeys(source);
var defineProperty = definePropertyModule.f;
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
}
}
};
});
// MODULE: ./node_modules/core-js/internals/correct-prototype-getter.js
var correct_prototype_getter_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var fails = (fails_namespaceFn());
module.exports = !fails(function () {
function F() { /* empty */ }
F.prototype.constructor = null;
// eslint-disable-next-line es/no-object-getprototypeof -- required for testing
return Object.getPrototypeOf(new F()) !== F.prototype;
});
});
// MODULE: ./node_modules/core-js/internals/create-iter-result-object.js
var create_iter_result_object_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
// `CreateIterResultObject` abstract operation
// https://tc39.es/ecma262/#sec-createiterresultobject
module.exports = function (value, done) {
return { value: value, done: done };
};
});
// MODULE: ./node_modules/core-js/internals/create-non-enumerable-property.js
var create_non_enumerable_property_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var DESCRIPTORS = (descriptors_namespaceFn());
var definePropertyModule = (object_define_property_namespaceFn());
var createPropertyDescriptor = (create_property_descriptor_namespaceFn());
module.exports = DESCRIPTORS ? function (object, key, value) {
return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
});
// MODULE: ./node_modules/core-js/internals/create-property-descriptor.js
var create_property_descriptor_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
module.exports = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
});
// MODULE: ./node_modules/core-js/internals/create-property.js
var create_property_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var DESCRIPTORS = (descriptors_namespaceFn());
var definePropertyModule = (object_define_property_namespaceFn());
var createPropertyDescriptor = (create_property_descriptor_namespaceFn());
module.exports = function (object, key, value) {
if (DESCRIPTORS) definePropertyModule.f(object, key, createPropertyDescriptor(0, value));
else object[key] = value;
};
});
// MODULE: ./node_modules/core-js/internals/define-built-in-accessor.js
var define_built_in_accessor_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var makeBuiltIn = (make_built_in_namespaceFn());
var defineProperty = (object_define_property_namespaceFn());
module.exports = function (target, name, descriptor) {
if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
return defineProperty.f(target, name, descriptor);
};
});
// MODULE: ./node_modules/core-js/internals/define-built-in.js
var define_built_in_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var isCallable = (is_callable_namespaceFn());
var definePropertyModule = (object_define_property_namespaceFn());
var makeBuiltIn = (make_built_in_namespaceFn());
var defineGlobalProperty = (define_global_property_namespaceFn());
module.exports = function (O, key, value, options) {
if (!options) options = {};
var simple = options.enumerable;
var name = options.name !== undefined ? options.name : key;
if (isCallable(value)) makeBuiltIn(value, name, options);
if (options.global) {
if (simple) O[key] = value;
else defineGlobalProperty(key, value);
} else {
try {
if (!options.unsafe) delete O[key];
else if (O[key]) simple = true;
} catch (error) { /* empty */ }
if (simple) O[key] = value;
else definePropertyModule.f(O, key, {
value: value,
enumerable: false,
configurable: !options.nonConfigurable,
writable: !options.nonWritable
});
} return O;
};
});
// MODULE: ./node_modules/core-js/internals/define-built-ins.js
var define_built_ins_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var defineBuiltIn = (define_built_in_namespaceFn());
module.exports = function (target, src, options) {
for (var key in src) defineBuiltIn(target, key, src[key], options);
return target;
};
});
// MODULE: ./node_modules/core-js/internals/define-global-property.js
var define_global_property_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
// eslint-disable-next-line es/no-object-defineproperty -- safe
var defineProperty = Object.defineProperty;
module.exports = function (key, value) {
try {
defineProperty(globalThis, key, { value: value, configurable: true, writable: true });
} catch (error) {
globalThis[key] = value;
} return value;
};
});
// MODULE: ./node_modules/core-js/internals/descriptors.js
var descriptors_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var fails = (fails_namespaceFn());
// Detect IE8's incomplete defineProperty implementation
module.exports = !fails(function () {
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7;
});
});
// MODULE: ./node_modules/core-js/internals/detach-transferable.js
var detach_transferable_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
var getBuiltInNodeModule = (get_built_in_node_module_namespaceFn());
var PROPER_STRUCTURED_CLONE_TRANSFER = (structured_clone_proper_transfer_namespaceFn());
var structuredClone = globalThis.structuredClone;
var $ArrayBuffer = globalThis.ArrayBuffer;
var $MessageChannel = globalThis.MessageChannel;
var detach = false;
var WorkerThreads, channel, buffer, $detach;
if (PROPER_STRUCTURED_CLONE_TRANSFER) {
detach = function (transferable) {
structuredClone(transferable, { transfer: [transferable] });
};
} else if ($ArrayBuffer) try {
if (!$MessageChannel) {
WorkerThreads = getBuiltInNodeModule('worker_threads');
if (WorkerThreads) $MessageChannel = WorkerThreads.MessageChannel;
}
if ($MessageChannel) {
channel = new $MessageChannel();
buffer = new $ArrayBuffer(2);
$detach = function (transferable) {
channel.port1.postMessage(null, [transferable]);
};
if (buffer.byteLength === 2) {
$detach(buffer);
if (buffer.byteLength === 0) detach = $detach;
}
}
} catch (error) { /* empty */ }
module.exports = detach;
});
// MODULE: ./node_modules/core-js/internals/document-create-element.js
var document_create_element_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
var isObject = (is_object_namespaceFn());
var document = globalThis.document;
// typeof document.createElement is 'object' in old IE
var EXISTS = isObject(document) && isObject(document.createElement);
module.exports = function (it) {
return EXISTS ? document.createElement(it) : {};
};
});
// EXTERNAL MODULE: ./node_modules/core-js/internals/does-not-exceed-safe-integer.js
var does_not_exceed_safe_integer_namespaceFn = () => {
return __webpack_require__(837);
};
// EXTERNAL MODULE: ./node_modules/core-js/internals/dom-exception-constants.js
var dom_exception_constants_namespaceFn = () => {
return __webpack_require__(2);
};
// MODULE: ./node_modules/core-js/internals/enum-bug-keys.js
var enum_bug_keys_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
// IE8- don't enum bug keys
module.exports = [
'constructor',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'toLocaleString',
'toString',
'valueOf'
];
});
// MODULE: ./node_modules/core-js/internals/environment-ff-version.js
var environment_ff_version_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var userAgent = (environment_user_agent_namespaceFn());
var firefox = userAgent.match(/firefox\/(\d+)/i);
module.exports = !!firefox && +firefox[1];
});
// MODULE: ./node_modules/core-js/internals/environment-is-ie-or-edge.js
var environment_is_ie_or_edge_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var UA = (environment_user_agent_namespaceFn());
module.exports = /MSIE|Trident/.test(UA);
});
// MODULE: ./node_modules/core-js/internals/environment-is-node.js
var environment_is_node_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var ENVIRONMENT = (environment_namespaceFn());
module.exports = ENVIRONMENT === 'NODE';
});
// MODULE: ./node_modules/core-js/internals/environment-user-agent.js
var environment_user_agent_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
var navigator = globalThis.navigator;
var userAgent = navigator && navigator.userAgent;
module.exports = userAgent ? String(userAgent) : '';
});
// MODULE: ./node_modules/core-js/internals/environment-v8-version.js
var environment_v8_version_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
var userAgent = (environment_user_agent_namespaceFn());
var process = globalThis.process;
var Deno = globalThis.Deno;
var versions = process && process.versions || Deno && Deno.version;
var v8 = versions && versions.v8;
var match, version;
if (v8) {
match = v8.split('.');
// in old Chrome, versions of V8 isn't V8 = Chrome / 10
// but their correct versions are not interesting for us
version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
}
// BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
// so check `userAgent` even if `.v8` exists, but 0
if (!version && userAgent) {
match = userAgent.match(/Edge\/(\d+)/);
if (!match || match[1] >= 74) {
match = userAgent.match(/Chrome\/(\d+)/);
if (match) version = +match[1];
}
}
module.exports = version;
});
// MODULE: ./node_modules/core-js/internals/environment-webkit-version.js
var environment_webkit_version_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var userAgent = (environment_user_agent_namespaceFn());
var webkit = userAgent.match(/AppleWebKit\/(\d+)\./);
module.exports = !!webkit && +webkit[1];
});
// MODULE: ./node_modules/core-js/internals/environment.js
var environment_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
/* global Bun, Deno -- detection */
var globalThis = (global_this_namespaceFn());
var userAgent = (environment_user_agent_namespaceFn());
var classof = (classof_raw_namespaceFn());
var userAgentStartsWith = function (string) {
return userAgent.slice(0, string.length) === string;
};
module.exports = (function () {
if (userAgentStartsWith('Bun/')) return 'BUN';
if (userAgentStartsWith('Cloudflare-Workers')) return 'CLOUDFLARE';
if (userAgentStartsWith('Deno/')) return 'DENO';
if (userAgentStartsWith('Node.js/')) return 'NODE';
if (globalThis.Bun && typeof Bun.version == 'string') return 'BUN';
if (globalThis.Deno && typeof Deno.version == 'object') return 'DENO';
if (classof(globalThis.process) === 'process') return 'NODE';
if (globalThis.window && globalThis.document) return 'BROWSER';
return 'REST';
})();
});
// MODULE: ./node_modules/core-js/internals/error-stack-clear.js
var error_stack_clear_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
var $Error = Error;
var replace = uncurryThis(''.replace);
var TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd');
// eslint-disable-next-line redos/no-vulnerable -- safe
var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
module.exports = function (stack, dropEntries) {
if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {
while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');
} return stack;
};
});
// MODULE: ./node_modules/core-js/internals/error-stack-install.js
var error_stack_install_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var createNonEnumerableProperty = (create_non_enumerable_property_namespaceFn());
var clearErrorStack = (error_stack_clear_namespaceFn());
var ERROR_STACK_INSTALLABLE = (error_stack_installable_namespaceFn());
// non-standard V8
// eslint-disable-next-line es/no-nonstandard-error-properties -- safe
var captureStackTrace = Error.captureStackTrace;
module.exports = function (error, C, stack, dropEntries) {
if (ERROR_STACK_INSTALLABLE) {
if (captureStackTrace) captureStackTrace(error, C);
else createNonEnumerableProperty(error, 'stack', clearErrorStack(stack, dropEntries));
}
};
});
// MODULE: ./node_modules/core-js/internals/error-stack-installable.js
var error_stack_installable_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var fails = (fails_namespaceFn());
var createPropertyDescriptor = (create_property_descriptor_namespaceFn());
module.exports = !fails(function () {
var error = new Error('a');
if (!('stack' in error)) return true;
// eslint-disable-next-line es/no-object-defineproperty -- safe
Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));
return error.stack !== 7;
});
});
// MODULE: ./node_modules/core-js/internals/export.js
var export_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
var getOwnPropertyDescriptor = (object_get_own_property_descriptor_namespaceFn().f);
var createNonEnumerableProperty = (create_non_enumerable_property_namespaceFn());
var defineBuiltIn = (define_built_in_namespaceFn());
var defineGlobalProperty = (define_global_property_namespaceFn());
var copyConstructorProperties = (copy_constructor_properties_namespaceFn());
var isForced = (is_forced_namespaceFn());
/*
options.target - name of the target object
options.global - target is the global object
options.stat - export as static methods of target
options.proto - export as prototype methods of target
options.real - real prototype method for the `pure` version
options.forced - export even if the native feature is available
options.bind - bind methods to the target, required for the `pure` version
options.wrap - wrap constructors to preventing global pollution, required for the `pure` version
options.unsafe - use the simple assignment of property instead of delete + defineProperty
options.sham - add a flag to not completely full polyfills
options.enumerable - export as enumerable property
options.dontCallGetSet - prevent calling a getter on target
options.name - the .name of the function if it does not match the key
*/
module.exports = function (options, source) {
var TARGET = options.target;
var GLOBAL = options.global;
var STATIC = options.stat;
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
if (GLOBAL) {
target = globalThis;
} else if (STATIC) {
target = globalThis[TARGET] || defineGlobalProperty(TARGET, {});
} else {
target = globalThis[TARGET] && globalThis[TARGET].prototype;
}
if (target) for (key in source) {
sourceProperty = source[key];
if (options.dontCallGetSet) {
descriptor = getOwnPropertyDescriptor(target, key);
targetProperty = descriptor && descriptor.value;
} else targetProperty = target[key];
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
// contained in target
if (!FORCED && targetProperty !== undefined) {
if (typeof sourceProperty == typeof targetProperty) continue;
copyConstructorProperties(sourceProperty, targetProperty);
}
// add a flag to not completely full polyfills
if (options.sham || (targetProperty && targetProperty.sham)) {
createNonEnumerableProperty(sourceProperty, 'sham', true);
}
defineBuiltIn(target, key, sourceProperty, options);
}
};
});
// MODULE: ./node_modules/core-js/internals/fails.js
var fails_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
module.exports = function (exec) {
try {
return !!exec();
} catch (error) {
return true;
}
};
});
// MODULE: ./node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js
var fix_regexp_well_known_symbol_logic_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
// TODO: Remove from `core-js@4` since it's moved to entry points
(es_regexp_exec_namespaceFn());
var call = (function_call_namespaceFn());
var defineBuiltIn = (define_built_in_namespaceFn());
var regexpExec = (regexp_exec_namespaceFn());
var fails = (fails_namespaceFn());
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var createNonEnumerableProperty = (create_non_enumerable_property_namespaceFn());
var SPECIES = wellKnownSymbol('species');
var RegExpPrototype = RegExp.prototype;
module.exports = function (KEY, exec, FORCED, SHAM) {
var SYMBOL = wellKnownSymbol(KEY);
var DELEGATES_TO_SYMBOL = !fails(function () {
// String methods call symbol-named RegExp methods
var O = {};
// eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
O[SYMBOL] = function () { return 7; };
return ''[KEY](O) !== 7;
});
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function () {
// Symbol-named RegExp methods call .exec
var execCalled = false;
var re = /a/;
if (KEY === 'split') {
// We can't use real regex here since it causes deoptimization
// and serious performance degradation in V8
// https://github.com/zloirock/core-js/issues/306
// RegExp[@@split] doesn't call the regex's exec method, but first creates
// a new one. We need to return the patched regex when creating the new one.
var constructor = {};
// eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
constructor[SPECIES] = function () { return re; };
re = { constructor: constructor, flags: '' };
// eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
re[SYMBOL] = /./[SYMBOL];
}
re.exec = function () {
execCalled = true;
return null;
};
re[SYMBOL]('');
return !execCalled;
});
if (
!DELEGATES_TO_SYMBOL ||
!DELEGATES_TO_EXEC ||
FORCED
) {
var nativeRegExpMethod = /./[SYMBOL];
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
var $exec = regexp.exec;
if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
// The native String method already delegates to @@method (this
// polyfilled function), leasing to infinite recursion.
// We avoid it by directly calling the native @@method method.
return { done: true, value: call(nativeRegExpMethod, regexp, str, arg2) };
}
return { done: true, value: call(nativeMethod, str, regexp, arg2) };
}
return { done: false };
});
defineBuiltIn(String.prototype, KEY, methods[0]);
defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
}
if (SHAM) createNonEnumerableProperty(RegExpPrototype[SYMBOL], 'sham', true);
};
});
// MODULE: ./node_modules/core-js/internals/function-apply.js
var function_apply_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var NATIVE_BIND = (function_bind_native_namespaceFn());
var FunctionPrototype = Function.prototype;
var apply = FunctionPrototype.apply;
var call = FunctionPrototype.call;
// eslint-disable-next-line es/no-function-prototype-bind, es/no-reflect -- safe
module.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {
return call.apply(apply, arguments);
});
});
// MODULE: ./node_modules/core-js/internals/function-bind-context.js
var function_bind_context_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_clause_namespaceFn());
var aCallable = (a_callable_namespaceFn());
var NATIVE_BIND = (function_bind_native_namespaceFn());
var bind = uncurryThis(uncurryThis.bind);
// optional / simple context binding
module.exports = function (fn, that) {
aCallable(fn);
return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) {
return fn.apply(that, arguments);
};
};
});
// MODULE: ./node_modules/core-js/internals/function-bind-native.js
var function_bind_native_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var fails = (fails_namespaceFn());
module.exports = !fails(function () {
// eslint-disable-next-line es/no-function-prototype-bind -- safe
var test = function () { /* empty */ }.bind();
// eslint-disable-next-line no-prototype-builtins -- safe
return typeof test != 'function' || test.hasOwnProperty('prototype');
});
});
// MODULE: ./node_modules/core-js/internals/function-call.js
var function_call_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var NATIVE_BIND = (function_bind_native_namespaceFn());
var call = Function.prototype.call;
// eslint-disable-next-line es/no-function-prototype-bind -- safe
module.exports = NATIVE_BIND ? call.bind(call) : function () {
return call.apply(call, arguments);
};
});
// MODULE: ./node_modules/core-js/internals/function-name.js
var function_name_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var DESCRIPTORS = (descriptors_namespaceFn());
var hasOwn = (has_own_property_namespaceFn());
var FunctionPrototype = Function.prototype;
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
var EXISTS = hasOwn(FunctionPrototype, 'name');
// additional protection from minified / mangled / dropped function names
var PROPER = EXISTS && function something() { /* empty */ }.name === 'something';
var CONFIGURABLE = EXISTS && (!DESCRIPTORS || (DESCRIPTORS && getDescriptor(FunctionPrototype, 'name').configurable));
module.exports = {
EXISTS: EXISTS,
PROPER: PROPER,
CONFIGURABLE: CONFIGURABLE
};
});
// MODULE: ./node_modules/core-js/internals/function-uncurry-this-accessor.js
var function_uncurry_this_accessor_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
var aCallable = (a_callable_namespaceFn());
module.exports = function (object, key, method) {
try {
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
} catch (error) { /* empty */ }
};
});
// MODULE: ./node_modules/core-js/internals/function-uncurry-this-clause.js
var function_uncurry_this_clause_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var classofRaw = (classof_raw_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
module.exports = function (fn) {
// Nashorn bug:
// https://github.com/zloirock/core-js/issues/1128
// https://github.com/zloirock/core-js/issues/1130
if (classofRaw(fn) === 'Function') return uncurryThis(fn);
};
});
// MODULE: ./node_modules/core-js/internals/function-uncurry-this.js
var function_uncurry_this_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var NATIVE_BIND = (function_bind_native_namespaceFn());
var FunctionPrototype = Function.prototype;
var call = FunctionPrototype.call;
// eslint-disable-next-line es/no-function-prototype-bind -- safe
var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
module.exports = NATIVE_BIND ? uncurryThisWithBind : function (fn) {
return function () {
return call.apply(fn, arguments);
};
};
});
// EXTERNAL MODULE: ./node_modules/core-js/internals/get-alphabet-option.js
var get_alphabet_option_namespaceFn = () => {
return __webpack_require__(944);
};
// MODULE: ./node_modules/core-js/internals/get-built-in-node-module.js
var get_built_in_node_module_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
var IS_NODE = (environment_is_node_namespaceFn());
module.exports = function (name) {
if (IS_NODE) {
try {
return globalThis.process.getBuiltinModule(name);
} catch (error) { /* empty */ }
try {
// eslint-disable-next-line no-new-func -- safe
return Function('return require("' + name + '")')();
} catch (error) { /* empty */ }
}
};
});
// MODULE: ./node_modules/core-js/internals/get-built-in.js
var get_built_in_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var aFunction = function (argument) {
return isCallable(argument) ? argument : undefined;
};
module.exports = function (namespace, method) {
return arguments.length < 2 ? aFunction(globalThis[namespace]) : globalThis[namespace] && globalThis[namespace][method];
};
});
// EXTERNAL MODULE: ./node_modules/core-js/internals/get-iterator-direct.js
var get_iterator_direct_namespaceFn = () => {
return __webpack_require__(767);
};
// MODULE: ./node_modules/core-js/internals/get-iterator-internal.js
var get_iterator_internal_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var call = (function_call_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var anObject = (an_object_namespaceFn());
var tryToString = (try_to_string_namespaceFn());
var getIteratorMethod = (get_iterator_method_internal_namespaceFn());
var $TypeError = TypeError;
module.exports = function (argument, usingIterator) {
var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
if (isCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument));
throw new $TypeError(tryToString(argument) + ' is not iterable');
};
});
// MODULE: ./node_modules/core-js/internals/get-iterator-method-internal.js
var get_iterator_method_internal_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var classof = (classof_raw_namespaceFn());
var isNullOrUndefined = (is_null_or_undefined_namespaceFn());
var getMethod = (get_method_namespaceFn());
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var ITERATOR = wellKnownSymbol('iterator');
var ArrayPrototype = Array.prototype;
module.exports = function (it) {
if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR)
|| getMethod(it, '@@iterator')
|| (classof(it) === 'Arguments' ? ArrayPrototype[ITERATOR] : undefined);
};
});
// MODULE: ./node_modules/core-js/internals/get-method.js
var get_method_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var aCallable = (a_callable_namespaceFn());
var isNullOrUndefined = (is_null_or_undefined_namespaceFn());
// `GetMethod` abstract operation
// https://tc39.es/ecma262/#sec-getmethod
module.exports = function (V, P) {
var func = V[P];
return isNullOrUndefined(func) ? undefined : aCallable(func);
};
});
// MODULE: ./node_modules/core-js/internals/get-set-record.js
var get_set_record_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var aCallable = (a_callable_namespaceFn());
var anObject = (an_object_namespaceFn());
var call = (function_call_namespaceFn());
var toIntegerOrInfinity = (to_integer_or_infinity_namespaceFn());
var getIteratorDirect = (get_iterator_direct_namespaceFn());
var INVALID_SIZE = 'Invalid size';
var $RangeError = RangeError;
var $TypeError = TypeError;
var max = Math.max;
var SetRecord = function (set, intSize) {
this.set = set;
this.size = max(intSize, 0);
this.has = aCallable(set.has);
this.keys = aCallable(set.keys);
};
SetRecord.prototype = {
getIterator: function () {
return getIteratorDirect(anObject(call(this.keys, this.set)));
},
includes: function (it) {
return call(this.has, this.set, it);
}
};
// `GetSetRecord` abstract operation
// https://tc39.es/proposal-set-methods/#sec-getsetrecord
module.exports = function (obj) {
anObject(obj);
var numSize = +obj.size;
// NOTE: If size is undefined, then numSize will be NaN
// eslint-disable-next-line no-self-compare -- NaN check
if (numSize !== numSize) throw new $TypeError(INVALID_SIZE);
var intSize = toIntegerOrInfinity(numSize);
if (intSize < 0) throw new $RangeError(INVALID_SIZE);
return new SetRecord(obj, intSize);
};
});
// MODULE: ./node_modules/core-js/internals/get-substitution.js
var get_substitution_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
var toObject = (to_object_namespaceFn());
var floor = Math.floor;
var charAt = uncurryThis(''.charAt);
var replace = uncurryThis(''.replace);
var stringSlice = uncurryThis(''.slice);
// eslint-disable-next-line redos/no-vulnerable -- safe
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
// `GetSubstitution` abstract operation
// https://tc39.es/ecma262/#sec-getsubstitution
module.exports = function (matched, str, position, captures, namedCaptures, replacement) {
var tailPos = position + matched.length;
var m = captures.length;
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
if (namedCaptures !== undefined) {
namedCaptures = toObject(namedCaptures);
symbols = SUBSTITUTION_SYMBOLS;
}
return replace(replacement, symbols, function (match, ch) {
var capture;
switch (charAt(ch, 0)) {
case '$': return '$';
case '&': return matched;
case '`': return stringSlice(str, 0, position);
case "'": return stringSlice(str, tailPos);
case '<':
capture = namedCaptures[stringSlice(ch, 1, -1)];
break;
default: // \d\d?
var n = +ch;
if (n === 0) return match;
if (n > m) {
var f = floor(n / 10);
if (f === 0) return match;
if (f <= m) return captures[f - 1] === undefined ? charAt(ch, 1) : captures[f - 1] + charAt(ch, 1);
return match;
}
capture = captures[n - 1];
}
return capture === undefined ? '' : capture;
});
};
});
// MODULE: ./node_modules/core-js/internals/global-this.js
var global_this_namespaceFn = /*#__PURE__*/__webpack_require__.cw(function(module) {
var check = function (it) {
return it && it.Math === Math && it;
};
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
module.exports =
// eslint-disable-next-line es/no-global-this -- safe
check(typeof globalThis == 'object' && globalThis) ||
check(typeof window == 'object' && window) ||
// eslint-disable-next-line no-restricted-globals -- safe
check(typeof self == 'object' && self) ||
check(typeof global == 'object' && global) ||
check(typeof this == 'object' && this) ||
// eslint-disable-next-line no-new-func -- fallback
(function () { return this; })() || Function('return this')();
});
// MODULE: ./node_modules/core-js/internals/has-own-property.js
var has_own_property_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
var toObject = (to_object_namespaceFn());
var hasOwnProperty = uncurryThis({}.hasOwnProperty);
// `HasOwnProperty` abstract operation
// https://tc39.es/ecma262/#sec-hasownproperty
// eslint-disable-next-line es/no-object-hasown -- safe
module.exports = Object.hasOwn || function hasOwn(it, key) {
return hasOwnProperty(toObject(it), key);
};
});
// MODULE: ./node_modules/core-js/internals/hidden-keys.js
var hidden_keys_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
module.exports = {};
});
// MODULE: ./node_modules/core-js/internals/html.js
var html_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var getBuiltIn = (get_built_in_namespaceFn());
module.exports = getBuiltIn('document', 'documentElement');
});
// MODULE: ./node_modules/core-js/internals/ie8-dom-define.js
var ie8_dom_define_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var DESCRIPTORS = (descriptors_namespaceFn());
var fails = (fails_namespaceFn());
var createElement = (document_create_element_namespaceFn());
// Thanks to IE8 for its funny defineProperty
module.exports = !DESCRIPTORS && !fails(function () {
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
return Object.defineProperty(createElement('div'), 'a', {
get: function () { return 7; }
}).a !== 7;
});
});
// MODULE: ./node_modules/core-js/internals/ieee754.js
var ieee754_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
// IEEE754 conversions based on https://github.com/feross/ieee754
var $Array = Array;
var abs = Math.abs;
var pow = Math.pow;
var floor = Math.floor;
var log = Math.log;
var LN2 = Math.LN2;
var pack = function (number, mantissaLength, bytes) {
var buffer = $Array(bytes);
var exponentLength = bytes * 8 - mantissaLength - 1;
var eMax = (1 << exponentLength) - 1;
var eBias = eMax >> 1;
var rt = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;
var sign = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;
var index = 0;
var exponent, mantissa, c;
number = abs(number);
// eslint-disable-next-line no-self-compare -- NaN check
if (number !== number || number === Infinity) {
// eslint-disable-next-line no-self-compare -- NaN check
mantissa = number !== number ? 1 : 0;
exponent = eMax;
} else {
exponent = floor(log(number) / LN2);
c = pow(2, -exponent);
if (number * c < 1) {
exponent--;
c *= 2;
}
if (exponent + eBias >= 1) {
number += rt / c;
} else {
number += rt * pow(2, 1 - eBias);
}
if (number * c >= 2) {
exponent++;
c /= 2;
}
if (exponent + eBias >= eMax) {
mantissa = 0;
exponent = eMax;
} else if (exponent + eBias >= 1) {
mantissa = (number * c - 1) * pow(2, mantissaLength);
exponent += eBias;
} else {
mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);
exponent = 0;
}
}
while (mantissaLength >= 8) {
buffer[index++] = mantissa & 255;
mantissa /= 256;
mantissaLength -= 8;
}
exponent = exponent << mantissaLength | mantissa;
exponentLength += mantissaLength;
while (exponentLength > 0) {
buffer[index++] = exponent & 255;
exponent /= 256;
exponentLength -= 8;
}
buffer[index - 1] |= sign * 128;
return buffer;
};
var unpack = function (buffer, mantissaLength) {
var bytes = buffer.length;
var exponentLength = bytes * 8 - mantissaLength - 1;
var eMax = (1 << exponentLength) - 1;
var eBias = eMax >> 1;
var nBits = exponentLength - 7;
var index = bytes - 1;
var sign = buffer[index--];
var exponent = sign & 127;
var mantissa;
sign >>= 7;
while (nBits > 0) {
exponent = exponent * 256 + buffer[index--];
nBits -= 8;
}
mantissa = exponent & (1 << -nBits) - 1;
exponent >>= -nBits;
nBits += mantissaLength;
while (nBits > 0) {
mantissa = mantissa * 256 + buffer[index--];
nBits -= 8;
}
if (exponent === 0) {
exponent = 1 - eBias;
} else if (exponent === eMax) {
return mantissa ? NaN : sign ? -Infinity : Infinity;
} else {
mantissa += pow(2, mantissaLength);
exponent -= eBias;
} return (sign ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
};
module.exports = {
pack: pack,
unpack: unpack
};
});
// MODULE: ./node_modules/core-js/internals/indexed-object.js
var indexed_object_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
var fails = (fails_namespaceFn());
var classof = (classof_raw_namespaceFn());
var $Object = Object;
var split = uncurryThis(''.split);
// fallback for non-array-like ES3 and non-enumerable old V8 strings
module.exports = fails(function () {
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
// eslint-disable-next-line no-prototype-builtins -- safe
return !$Object('z').propertyIsEnumerable(0);
}) ? function (it) {
return classof(it) === 'String' ? split(it, '') : $Object(it);
} : $Object;
});
// MODULE: ./node_modules/core-js/internals/inherit-if-required.js
var inherit_if_required_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var isCallable = (is_callable_namespaceFn());
var isObject = (is_object_namespaceFn());
var setPrototypeOf = (object_set_prototype_of_namespaceFn());
// makes subclassing work correct for wrapped built-ins
module.exports = function ($this, dummy, Wrapper) {
var NewTarget, NewTargetPrototype;
if (
// it can work only with native `setPrototypeOf`
setPrototypeOf &&
// we haven't completely correct pre-ES6 way for getting `new.target`, so use this
isCallable(NewTarget = dummy.constructor) &&
NewTarget !== Wrapper &&
isObject(NewTargetPrototype = NewTarget.prototype) &&
NewTargetPrototype !== Wrapper.prototype
) setPrototypeOf($this, NewTargetPrototype);
return $this;
};
});
// MODULE: ./node_modules/core-js/internals/inspect-source.js
var inspect_source_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var store = (shared_store_namespaceFn());
var functionToString = uncurryThis(Function.toString);
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
if (!isCallable(store.inspectSource)) {
store.inspectSource = function (it) {
return functionToString(it);
};
}
module.exports = store.inspectSource;
});
// MODULE: ./node_modules/core-js/internals/install-error-cause.js
var install_error_cause_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var isObject = (is_object_namespaceFn());
var createNonEnumerableProperty = (create_non_enumerable_property_namespaceFn());
// `InstallErrorCause` abstract operation
// https://tc39.es/ecma262/#sec-installerrorcause
module.exports = function (O, options) {
if (isObject(options) && 'cause' in options) {
createNonEnumerableProperty(O, 'cause', options.cause);
}
};
});
// MODULE: ./node_modules/core-js/internals/internal-state.js
var internal_state_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var NATIVE_WEAK_MAP = (weak_map_basic_detection_namespaceFn());
var globalThis = (global_this_namespaceFn());
var isObject = (is_object_namespaceFn());
var createNonEnumerableProperty = (create_non_enumerable_property_namespaceFn());
var hasOwn = (has_own_property_namespaceFn());
var shared = (shared_store_namespaceFn());
var sharedKey = (shared_key_namespaceFn());
var hiddenKeys = (hidden_keys_namespaceFn());
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
var TypeError = globalThis.TypeError;
var WeakMap = globalThis.WeakMap;
var set, get, has;
var enforce = function (it) {
return has(it) ? get(it) : set(it, {});
};
var getterFor = function (TYPE) {
return function (it) {
var state;
if (!isObject(it) || (state = get(it)).type !== TYPE) {
throw new TypeError('Incompatible receiver, ' + TYPE + ' required');
} return state;
};
};
if (NATIVE_WEAK_MAP || shared.state) {
var store = shared.state || (shared.state = new WeakMap());
/* eslint-disable no-self-assign -- prototype methods protection */
store.get = store.get;
store.has = store.has;
store.set = store.set;
/* eslint-enable no-self-assign -- prototype methods protection */
set = function (it, metadata) {
if (store.has(it)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
metadata.facade = it;
store.set(it, metadata);
return metadata;
};
get = function (it) {
return store.get(it) || {};
};
has = function (it) {
return store.has(it);
};
} else {
var STATE = sharedKey('state');
hiddenKeys[STATE] = true;
set = function (it, metadata) {
if (hasOwn(it, STATE)) throw new TypeError(OBJECT_ALREADY_INITIALIZED);
metadata.facade = it;
createNonEnumerableProperty(it, STATE, metadata);
return metadata;
};
get = function (it) {
return hasOwn(it, STATE) ? it[STATE] : {};
};
has = function (it) {
return hasOwn(it, STATE);
};
}
module.exports = {
set: set,
get: get,
has: has,
enforce: enforce,
getterFor: getterFor
};
});
// MODULE: ./node_modules/core-js/internals/is-array-iterator-method.js
var is_array_iterator_method_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var Iterators = (iterators_namespaceFn());
var ITERATOR = wellKnownSymbol('iterator');
var ArrayPrototype = Array.prototype;
// check on default Array iterator
module.exports = function (it) {
return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it);
};
});
// MODULE: ./node_modules/core-js/internals/is-array.js
var is_array_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var classof = (classof_raw_namespaceFn());
// `IsArray` abstract operation
// https://tc39.es/ecma262/#sec-isarray
// eslint-disable-next-line es/no-array-isarray -- safe
module.exports = Array.isArray || function isArray(argument) {
return classof(argument) === 'Array';
};
});
// MODULE: ./node_modules/core-js/internals/is-big-int-array.js
var is_big_int_array_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var classof = (classof_namespaceFn());
module.exports = function (it) {
var klass = classof(it);
return klass === 'BigInt64Array' || klass === 'BigUint64Array';
};
});
// MODULE: ./node_modules/core-js/internals/is-callable.js
var is_callable_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
var documentAll = typeof document == 'object' && document.all;
// `IsCallable` abstract operation
// https://tc39.es/ecma262/#sec-iscallable
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
module.exports = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) {
return typeof argument == 'function' || argument === documentAll;
} : function (argument) {
return typeof argument == 'function';
};
});
// MODULE: ./node_modules/core-js/internals/is-constructor.js
var is_constructor_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
var fails = (fails_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var classof = (classof_namespaceFn());
var getBuiltIn = (get_built_in_namespaceFn());
var inspectSource = (inspect_source_namespaceFn());
var noop = function () { /* empty */ };
var construct = getBuiltIn('Reflect', 'construct');
var constructorRegExp = /^\s*(?:class|function)\b/;
var exec = uncurryThis(constructorRegExp.exec);
var INCORRECT_TO_STRING = !constructorRegExp.test(noop);
var isConstructorModern = function isConstructor(argument) {
if (!isCallable(argument)) return false;
try {
construct(noop, [], argument);
return true;
} catch (error) {
return false;
}
};
var isConstructorLegacy = function isConstructor(argument) {
if (!isCallable(argument)) return false;
switch (classof(argument)) {
case 'AsyncFunction':
case 'GeneratorFunction':
case 'AsyncGeneratorFunction': return false;
}
try {
// we can't check .prototype since constructors produced by .bind haven't it
// `Function#toString` throws on some built-it function in some legacy engines
// (for example, `DOMQuad` and similar in FF41-)
return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
} catch (error) {
return true;
}
};
isConstructorLegacy.sham = true;
// `IsConstructor` abstract operation
// https://tc39.es/ecma262/#sec-isconstructor
module.exports = !construct || fails(function () {
var called;
return isConstructorModern(isConstructorModern.call)
|| !isConstructorModern(Object)
|| !isConstructorModern(function () { called = true; })
|| called;
}) ? isConstructorLegacy : isConstructorModern;
});
// MODULE: ./node_modules/core-js/internals/is-forced.js
var is_forced_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var fails = (fails_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var replacement = /#|\.prototype\./;
var isForced = function (feature, detection) {
var value = data[normalize(feature)];
return value === POLYFILL ? true
: value === NATIVE ? false
: isCallable(detection) ? fails(detection)
: !!detection;
};
var normalize = isForced.normalize = function (string) {
return String(string).replace(replacement, '.').toLowerCase();
};
var data = isForced.data = {};
var NATIVE = isForced.NATIVE = 'N';
var POLYFILL = isForced.POLYFILL = 'P';
module.exports = isForced;
});
// MODULE: ./node_modules/core-js/internals/is-integral-number.js
var is_integral_number_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var isObject = (is_object_namespaceFn());
var floor = Math.floor;
// `IsIntegralNumber` abstract operation
// https://tc39.es/ecma262/#sec-isintegralnumber
// eslint-disable-next-line es/no-number-isinteger -- safe
module.exports = Number.isInteger || function isInteger(it) {
return !isObject(it) && isFinite(it) && floor(it) === it;
};
});
// EXTERNAL MODULE: ./node_modules/core-js/internals/is-null-or-undefined.js
var is_null_or_undefined_namespaceFn = () => {
return __webpack_require__(117);
};
// MODULE: ./node_modules/core-js/internals/is-object.js
var is_object_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var isCallable = (is_callable_namespaceFn());
module.exports = function (it) {
return typeof it == 'object' ? it !== null : isCallable(it);
};
});
// MODULE: ./node_modules/core-js/internals/is-possible-prototype.js
var is_possible_prototype_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var isObject = (is_object_namespaceFn());
module.exports = function (argument) {
return isObject(argument) || argument === null;
};
});
// MODULE: ./node_modules/core-js/internals/is-pure.js
var is_pure_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
module.exports = false;
});
// MODULE: ./node_modules/core-js/internals/is-raw-json.js
var is_raw_json_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var isObject = (is_object_namespaceFn());
var getInternalState = (internal_state_namespaceFn().get);
module.exports = function isRawJSON(O) {
if (!isObject(O)) return false;
var state = getInternalState(O);
return !!state && state.type === 'RawJSON';
};
});
// MODULE: ./node_modules/core-js/internals/is-regexp.js
var is_regexp_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var isObject = (is_object_namespaceFn());
var classof = (classof_raw_namespaceFn());
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var MATCH = wellKnownSymbol('match');
// `IsRegExp` abstract operation
// https://tc39.es/ecma262/#sec-isregexp
module.exports = function (it) {
var isRegExp;
return isObject(it) && ((isRegExp = it[MATCH]) !== undefined ? !!isRegExp : classof(it) === 'RegExp');
};
});
// MODULE: ./node_modules/core-js/internals/is-symbol.js
var is_symbol_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var getBuiltIn = (get_built_in_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var isPrototypeOf = (object_is_prototype_of_namespaceFn());
var USE_SYMBOL_AS_UID = (use_symbol_as_uid_namespaceFn());
var $Object = Object;
module.exports = USE_SYMBOL_AS_UID ? function (it) {
return typeof it == 'symbol';
} : function (it) {
var $Symbol = getBuiltIn('Symbol');
return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it));
};
});
// MODULE: ./node_modules/core-js/internals/iterate-simple.js
var iterate_simple_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var call = (function_call_namespaceFn());
module.exports = function (record, fn, ITERATOR_INSTEAD_OF_RECORD) {
var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator;
var next = record.next;
var step, result;
while (!(step = call(next, iterator)).done) {
result = fn(step.value);
if (result !== undefined) return result;
}
};
});
// MODULE: ./node_modules/core-js/internals/iterate.js
var iterate_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var bind = (function_bind_context_namespaceFn());
var call = (function_call_namespaceFn());
var anObject = (an_object_namespaceFn());
var tryToString = (try_to_string_namespaceFn());
var isArrayIteratorMethod = (is_array_iterator_method_namespaceFn());
var lengthOfArrayLike = (length_of_array_like_namespaceFn());
var isPrototypeOf = (object_is_prototype_of_namespaceFn());
var getIterator = (get_iterator_internal_namespaceFn());
var getIteratorMethod = (get_iterator_method_internal_namespaceFn());
var iteratorClose = (iterator_close_namespaceFn());
var $TypeError = TypeError;
var Result = function (stopped, result) {
this.stopped = stopped;
this.result = result;
};
var ResultPrototype = Result.prototype;
module.exports = function (iterable, unboundFunction, options) {
var that = options && options.that;
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
var IS_RECORD = !!(options && options.IS_RECORD);
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
var INTERRUPTED = !!(options && options.INTERRUPTED);
var fn = bind(unboundFunction, that);
var iterator, iterFn, index, length, result, next, step;
var stop = function (condition) {
var $iterator = iterator;
iterator = undefined;
if ($iterator) iteratorClose($iterator, 'normal');
return new Result(true, condition);
};
var callFn = function (value) {
if (AS_ENTRIES) {
anObject(value);
return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
} return INTERRUPTED ? fn(value, stop) : fn(value);
};
if (IS_RECORD) {
iterator = iterable.iterator;
} else if (IS_ITERATOR) {
iterator = iterable;
} else {
iterFn = getIteratorMethod(iterable);
if (!iterFn) throw new $TypeError(tryToString(iterable) + ' is not iterable');
// optimisation for array iterators
if (isArrayIteratorMethod(iterFn)) {
for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
result = callFn(iterable[index]);
if (result && isPrototypeOf(ResultPrototype, result)) return result;
} return new Result(false);
}
iterator = getIterator(iterable, iterFn);
}
next = IS_RECORD ? iterable.next : iterator.next;
while (!(step = call(next, iterator)).done) {
// `IteratorValue` errors should propagate without closing the iterator
var value = step.value;
try {
result = callFn(value);
} catch (error) {
if (iterator) iteratorClose(iterator, 'throw', error);
else throw error;
}
if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result;
} return new Result(false);
};
});
// EXTERNAL MODULE: ./node_modules/core-js/internals/iterator-cleanup-state.js
var iterator_cleanup_state_namespaceFn = () => {
return __webpack_require__(859);
};
// MODULE: ./node_modules/core-js/internals/iterator-close-all.js
var iterator_close_all_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var iteratorClose = (iterator_close_namespaceFn());
module.exports = function (iters, kind, value) {
for (var i = iters.length - 1; i >= 0; i--) {
if (iters[i] === undefined) continue;
try {
value = iteratorClose(iters[i].iterator, kind, value);
} catch (error) {
kind = 'throw';
value = error;
}
}
if (kind === 'throw') throw value;
return value;
};
});
// MODULE: ./node_modules/core-js/internals/iterator-close.js
var iterator_close_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var call = (function_call_namespaceFn());
var anObject = (an_object_namespaceFn());
var getMethod = (get_method_namespaceFn());
module.exports = function (iterator, kind, value) {
var innerResult, innerError;
anObject(iterator);
try {
innerResult = getMethod(iterator, 'return');
if (!innerResult) {
if (kind === 'throw') throw value;
return value;
}
innerResult = call(innerResult, iterator);
} catch (error) {
innerError = true;
innerResult = error;
}
if (kind === 'throw') throw value;
if (innerError) throw innerResult;
anObject(innerResult);
return value;
};
});
// MODULE: ./node_modules/core-js/internals/iterator-create-constructor.js
var iterator_create_constructor_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var IteratorPrototype = (iterators_core_namespaceFn().IteratorPrototype);
var create = (object_create_namespaceFn());
var createPropertyDescriptor = (create_property_descriptor_namespaceFn());
var setToStringTag = (set_to_string_tag_namespaceFn());
var Iterators = (iterators_namespaceFn());
var returnThis = function () { return this; };
module.exports = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
var TO_STRING_TAG = NAME + ' Iterator';
IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
Iterators[TO_STRING_TAG] = returnThis;
return IteratorConstructor;
};
});
// MODULE: ./node_modules/core-js/internals/iterator-create-proxy.js
var iterator_create_proxy_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var call = (function_call_namespaceFn());
var create = (object_create_namespaceFn());
var createNonEnumerableProperty = (create_non_enumerable_property_namespaceFn());
var defineBuiltIns = (define_built_ins_namespaceFn());
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var InternalStateModule = (internal_state_namespaceFn());
var getMethod = (get_method_namespaceFn());
var IteratorPrototype = (iterators_core_namespaceFn().IteratorPrototype);
var createIterResultObject = (create_iter_result_object_namespaceFn());
var iteratorClose = (iterator_close_namespaceFn());
var iteratorCloseAll = (iterator_close_all_namespaceFn());
var cleanupState = (iterator_cleanup_state_namespaceFn());
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var ITERATOR_HELPER = 'IteratorHelper';
var WRAP_FOR_VALID_ITERATOR = 'WrapForValidIterator';
var NORMAL = 'normal';
var THROW = 'throw';
var setInternalState = InternalStateModule.set;
var createIteratorProxyPrototype = function (IS_ITERATOR) {
var getInternalState = InternalStateModule.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER);
return defineBuiltIns(create(IteratorPrototype), {
next: function next() {
var state = getInternalState(this);
// for simplification:
// for `%WrapForValidIteratorPrototype%.next` or with `state.returnHandlerResult` our `nextHandler` returns `IterResultObject`
// for `%IteratorHelperPrototype%.next` - just a value
if (IS_ITERATOR) return state.nextHandler();
if (state.done) return createIterResultObject(undefined, true);
try {
var result = state.nextHandler();
if (state.done) cleanupState(state);
return state.returnHandlerResult ? result : createIterResultObject(result, state.done);
} catch (error) {
state.done = true;
cleanupState(state);
throw error;
}
},
'return': function () {
var state = getInternalState(this);
var iterator = state.iterator;
var inner = state.inner;
var openIters = state.openIters;
var done = state.done;
state.done = true;
if (IS_ITERATOR) {
var returnMethod = getMethod(iterator, 'return');
return returnMethod ? call(returnMethod, iterator) : createIterResultObject(undefined, true);
}
cleanupState(state);
if (done) return createIterResultObject(undefined, true);
if (inner) try {
iteratorClose(inner.iterator, NORMAL);
} catch (error) {
return iteratorClose(iterator, THROW, error);
}
if (openIters) try {
iteratorCloseAll(openIters, NORMAL);
} catch (error) {
if (iterator) return iteratorClose(iterator, THROW, error);
throw error;
}
if (iterator) iteratorClose(iterator, NORMAL);
return createIterResultObject(undefined, true);
}
});
};
var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true);
var IteratorHelperPrototype = createIteratorProxyPrototype(false);
createNonEnumerableProperty(IteratorHelperPrototype, TO_STRING_TAG, 'Iterator Helper');
module.exports = function (nextHandler, IS_ITERATOR, RETURN_HANDLER_RESULT) {
var IteratorProxy = function Iterator(record, state) {
if (state) {
state.iterator = record.iterator;
state.next = record.next;
} else state = record;
state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
state.returnHandlerResult = !!RETURN_HANDLER_RESULT;
state.nextHandler = nextHandler;
state.counter = 0;
state.done = false;
setInternalState(this, state);
};
IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype;
return IteratorProxy;
};
});
// MODULE: ./node_modules/core-js/internals/iterator-define.js
var iterator_define_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var $ = (export_namespaceFn());
var call = (function_call_namespaceFn());
var IS_PURE = (is_pure_namespaceFn());
var FunctionName = (function_name_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var createIteratorConstructor = (iterator_create_constructor_namespaceFn());
var getPrototypeOf = (object_get_prototype_of_namespaceFn());
var setPrototypeOf = (object_set_prototype_of_namespaceFn());
var setToStringTag = (set_to_string_tag_namespaceFn());
var createNonEnumerableProperty = (create_non_enumerable_property_namespaceFn());
var defineBuiltIn = (define_built_in_namespaceFn());
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var Iterators = (iterators_namespaceFn());
var IteratorsCore = (iterators_core_namespaceFn());
var PROPER_FUNCTION_NAME = FunctionName.PROPER;
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
var IteratorPrototype = IteratorsCore.IteratorPrototype;
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
var ITERATOR = wellKnownSymbol('iterator');
var KEYS = 'keys';
var VALUES = 'values';
var ENTRIES = 'entries';
var returnThis = function () { return this; };
module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
createIteratorConstructor(IteratorConstructor, NAME, next);
var getIterationMethod = function (KIND) {
if (KIND === DEFAULT && defaultIterator) return defaultIterator;
if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype) return IterablePrototype[KIND];
switch (KIND) {
case KEYS: return function keys() { return new IteratorConstructor(this, KIND); };
case VALUES: return function values() { return new IteratorConstructor(this, KIND); };
case ENTRIES: return function entries() { return new IteratorConstructor(this, KIND); };
}
return function () { return new IteratorConstructor(this); };
};
var TO_STRING_TAG = NAME + ' Iterator';
var INCORRECT_VALUES_NAME = false;
var IterablePrototype = Iterable.prototype;
var nativeIterator = IterablePrototype[ITERATOR]
|| IterablePrototype['@@iterator']
|| DEFAULT && IterablePrototype[DEFAULT];
var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
var anyNativeIterator = NAME === 'Array' ? IterablePrototype.entries || nativeIterator : nativeIterator;
var CurrentIteratorPrototype, methods, KEY;
// fix native
if (anyNativeIterator) {
CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
if (setPrototypeOf) {
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
} else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
}
}
// Set @@toStringTag to native iterators
setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
if (IS_PURE) Iterators[TO_STRING_TAG] = returnThis;
}
}
// fix Array.prototype.{ values, @@iterator }.name in V8 / FF
if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
createNonEnumerableProperty(IterablePrototype, 'name', VALUES);
} else {
INCORRECT_VALUES_NAME = true;
defaultIterator = function values() { return call(nativeIterator, this); };
}
}
// export additional methods
if (DEFAULT) {
methods = {
values: getIterationMethod(VALUES),
keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
entries: getIterationMethod(ENTRIES)
};
if (FORCED) for (KEY in methods) {
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
}
} else $({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
}
// define iterator
if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
}
Iterators[NAME] = defaultIterator;
return methods;
};
});
// EXTERNAL MODULE: ./node_modules/core-js/internals/iterator-helper-throws-on-invalid-iterator.js
var iterator_helper_throws_on_invalid_iterator_namespaceFn = () => {
return __webpack_require__(684);
};
// MODULE: ./node_modules/core-js/internals/iterator-helper-without-closing-on-early-error.js
var iterator_helper_without_closing_on_early_error_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
// https://github.com/tc39/ecma262/pull/3467
module.exports = function (METHOD_NAME, ExpectedError) {
var Iterator = globalThis.Iterator;
var IteratorPrototype = Iterator && Iterator.prototype;
var method = IteratorPrototype && IteratorPrototype[METHOD_NAME];
var CLOSED = false;
if (method) try {
method.call({
next: function () { return { done: true }; },
'return': function () { CLOSED = true; }
}, -1);
} catch (error) {
// https://bugs.webkit.org/show_bug.cgi?id=291195
if (!(error instanceof ExpectedError)) CLOSED = false;
}
if (!CLOSED) return method;
};
});
// MODULE: ./node_modules/core-js/internals/iterators-core.js
var iterators_core_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var fails = (fails_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var isObject = (is_object_namespaceFn());
var create = (object_create_namespaceFn());
var getPrototypeOf = (object_get_prototype_of_namespaceFn());
var defineBuiltIn = (define_built_in_namespaceFn());
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var IS_PURE = (is_pure_namespaceFn());
var ITERATOR = wellKnownSymbol('iterator');
var BUGGY_SAFARI_ITERATORS = false;
// `%IteratorPrototype%` object
// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
var IteratorPrototype, PrototypeOfArrayIteratorPrototype, arrayIterator;
/* eslint-disable es/no-array-prototype-keys -- safe */
if ([].keys) {
arrayIterator = [].keys();
// Safari 8 has buggy iterators w/o `next`
if (!('next' in arrayIterator)) BUGGY_SAFARI_ITERATORS = true;
else {
PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype = PrototypeOfArrayIteratorPrototype;
}
}
var NEW_ITERATOR_PROTOTYPE = !isObject(IteratorPrototype) || fails(function () {
var test = {};
// FF44- legacy iterators case
return IteratorPrototype[ITERATOR].call(test) !== test;
});
if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype = {};
else if (IS_PURE) IteratorPrototype = create(IteratorPrototype);
// `%IteratorPrototype%[@@iterator]()` method
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
if (!isCallable(IteratorPrototype[ITERATOR])) {
defineBuiltIn(IteratorPrototype, ITERATOR, function () {
return this;
});
}
module.exports = {
IteratorPrototype: IteratorPrototype,
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS
};
});
// EXTERNAL MODULE: ./node_modules/core-js/internals/iterators.js
var iterators_namespaceFn = () => {
return __webpack_require__(650);
};
// MODULE: ./node_modules/core-js/internals/length-of-array-like.js
var length_of_array_like_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var toLength = (to_length_namespaceFn());
// `LengthOfArrayLike` abstract operation
// https://tc39.es/ecma262/#sec-lengthofarraylike
module.exports = function (obj) {
return toLength(obj.length);
};
});
// MODULE: ./node_modules/core-js/internals/make-built-in.js
var make_built_in_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
var fails = (fails_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var hasOwn = (has_own_property_namespaceFn());
var DESCRIPTORS = (descriptors_namespaceFn());
var CONFIGURABLE_FUNCTION_NAME = (function_name_namespaceFn().CONFIGURABLE);
var inspectSource = (inspect_source_namespaceFn());
var InternalStateModule = (internal_state_namespaceFn());
var enforceInternalState = InternalStateModule.enforce;
var getInternalState = InternalStateModule.get;
var $String = String;
// eslint-disable-next-line es/no-object-defineproperty -- safe
var defineProperty = Object.defineProperty;
var stringSlice = uncurryThis(''.slice);
var replace = uncurryThis(''.replace);
var join = uncurryThis([].join);
var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function () {
return defineProperty(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
});
var TEMPLATE = String(String).split('String');
var makeBuiltIn = module.exports = function (value, name, options) {
if (stringSlice($String(name), 0, 7) === 'Symbol(') {
name = '[' + replace($String(name), /^Symbol\(([^)]*)\).*$/, '$1') + ']';
}
if (options && options.getter) name = 'get ' + name;
if (options && options.setter) name = 'set ' + name;
if (!hasOwn(value, 'name') || (CONFIGURABLE_FUNCTION_NAME && value.name !== name)) {
if (DESCRIPTORS) defineProperty(value, 'name', { value: name, configurable: true });
else value.name = name;
}
if (CONFIGURABLE_LENGTH && options && hasOwn(options, 'arity') && value.length !== options.arity) {
defineProperty(value, 'length', { value: options.arity });
}
try {
if (options && hasOwn(options, 'constructor') && options.constructor) {
if (DESCRIPTORS) defineProperty(value, 'prototype', { writable: false });
// in V8 ~ Chrome 53, prototypes of some methods, like `Array.prototype.values`, are non-writable
} else if (value.prototype) value.prototype = undefined;
} catch (error) { /* empty */ }
var state = enforceInternalState(value);
if (!hasOwn(state, 'source')) {
state.source = join(TEMPLATE, typeof name == 'string' ? name : '');
} return value;
};
// add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
// eslint-disable-next-line no-extend-native -- required
Function.prototype.toString = makeBuiltIn(function toString() {
return isCallable(this) && getInternalState(this).source || inspectSource(this);
}, 'toString');
});
// MODULE: ./node_modules/core-js/internals/map-helpers.js
var map_helpers_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
// eslint-disable-next-line es/no-map -- safe
var MapPrototype = Map.prototype;
module.exports = {
// eslint-disable-next-line es/no-map -- safe
Map: Map,
set: uncurryThis(MapPrototype.set),
get: uncurryThis(MapPrototype.get),
has: uncurryThis(MapPrototype.has),
remove: uncurryThis(MapPrototype['delete']),
proto: MapPrototype
};
});
// EXTERNAL MODULE: ./node_modules/core-js/internals/math-float-round.js
var math_float_round_namespaceFn = () => {
return __webpack_require__(164);
};
// MODULE: ./node_modules/core-js/internals/math-fround.js
var math_fround_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var floatRound = (math_float_round_namespaceFn());
var FLOAT32_EPSILON = 1.1920928955078125e-7; // 2 ** -23;
var FLOAT32_MAX_VALUE = 3.4028234663852886e+38; // 2 ** 128 - 2 ** 104
var FLOAT32_MIN_VALUE = 1.1754943508222875e-38; // 2 ** -126;
// `Math.fround` method implementation
// https://tc39.es/ecma262/#sec-math.fround
// eslint-disable-next-line es/no-math-fround -- safe
module.exports = Math.fround || function fround(x) {
return floatRound(x, FLOAT32_EPSILON, FLOAT32_MAX_VALUE, FLOAT32_MIN_VALUE);
};
});
// EXTERNAL MODULE: ./node_modules/core-js/internals/math-trunc.js
var math_trunc_namespaceFn = () => {
return __webpack_require__(741);
};
// MODULE: ./node_modules/core-js/internals/native-raw-json.js
var native_raw_json_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
/* eslint-disable es/no-json -- safe */
var fails = (fails_namespaceFn());
module.exports = !fails(function () {
var unsafeInt = '9007199254740993';
// eslint-disable-next-line es/no-json-rawjson -- feature detection
var raw = JSON.rawJSON(unsafeInt);
// eslint-disable-next-line es/no-json-israwjson -- feature detection
return !JSON.isRawJSON(raw) || JSON.stringify(raw) !== unsafeInt;
});
});
// MODULE: ./node_modules/core-js/internals/new-promise-capability.js
var new_promise_capability_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var aCallable = (a_callable_namespaceFn());
var $TypeError = TypeError;
var PromiseCapability = function (C) {
var resolve, reject;
this.promise = new C(function ($$resolve, $$reject) {
if (resolve !== undefined || reject !== undefined) throw new $TypeError('Bad Promise constructor');
resolve = $$resolve;
reject = $$reject;
});
this.resolve = aCallable(resolve);
this.reject = aCallable(reject);
};
// `NewPromiseCapability` abstract operation
// https://tc39.es/ecma262/#sec-newpromisecapability
module.exports.f = function (C) {
return new PromiseCapability(C);
};
});
// MODULE: ./node_modules/core-js/internals/normalize-string-argument.js
var normalize_string_argument_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var toString = (to_string_namespaceFn());
module.exports = function (argument, $default) {
return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);
};
});
// EXTERNAL MODULE: ./node_modules/core-js/internals/not-a-nan.js
var not_a_nan_namespaceFn = () => {
return __webpack_require__(149);
};
// MODULE: ./node_modules/core-js/internals/object-assign.js
var object_assign_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var DESCRIPTORS = (descriptors_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var call = (function_call_namespaceFn());
var fails = (fails_namespaceFn());
var objectKeys = (object_keys_namespaceFn());
var getOwnPropertySymbolsModule = (object_get_own_property_symbols_namespaceFn());
var propertyIsEnumerableModule = (object_property_is_enumerable_namespaceFn());
var toObject = (to_object_namespaceFn());
var IndexedObject = (indexed_object_namespaceFn());
// eslint-disable-next-line es/no-object-assign -- safe
var $assign = Object.assign;
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
var defineProperty = Object.defineProperty;
var concat = uncurryThis([].concat);
// `Object.assign` method
// https://tc39.es/ecma262/#sec-object.assign
module.exports = !$assign || fails(function () {
// should have correct order of operations (Edge bug)
if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, 'a', {
enumerable: true,
get: function () {
defineProperty(this, 'b', {
value: 3,
enumerable: false
});
}
}), { b: 2 })).b !== 1) return true;
// should work with symbols and should have deterministic property order (V8 bug)
var A = {};
var B = {};
// eslint-disable-next-line es/no-symbol -- safe
var symbol = Symbol('assign detection');
var alphabet = 'abcdefghijklmnopqrst';
A[symbol] = 7;
// eslint-disable-next-line es/no-array-prototype-foreach -- safe
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
return $assign({}, A)[symbol] !== 7 || objectKeys($assign({}, B)).join('') !== alphabet;
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
var T = toObject(target);
var argumentsLength = arguments.length;
var index = 1;
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
var propertyIsEnumerable = propertyIsEnumerableModule.f;
while (argumentsLength > index) {
var S = IndexedObject(arguments[index++]);
var keys = getOwnPropertySymbols ? concat(objectKeys(S), getOwnPropertySymbols(S)) : objectKeys(S);
var length = keys.length;
var j = 0;
var key;
while (length > j) {
key = keys[j++];
if (!DESCRIPTORS || call(propertyIsEnumerable, S, key)) T[key] = S[key];
}
} return T;
} : $assign;
});
// MODULE: ./node_modules/core-js/internals/object-create.js
var object_create_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
/* global ActiveXObject -- old IE, WSH */
var anObject = (an_object_namespaceFn());
var definePropertiesModule = (object_define_properties_namespaceFn());
var enumBugKeys = (enum_bug_keys_namespaceFn());
var hiddenKeys = (hidden_keys_namespaceFn());
var html = (html_namespaceFn());
var documentCreateElement = (document_create_element_namespaceFn());
var sharedKey = (shared_key_namespaceFn());
var GT = '>';
var LT = '<';
var PROTOTYPE = 'prototype';
var SCRIPT = 'script';
var IE_PROTO = sharedKey('IE_PROTO');
var EmptyConstructor = function () { /* empty */ };
var scriptTag = function (content) {
return LT + SCRIPT + GT + content + LT + '/' + SCRIPT + GT;
};
// Create object with fake `null` prototype: use ActiveX Object with cleared prototype
var NullProtoObjectViaActiveX = function (activeXDocument) {
activeXDocument.write(scriptTag(''));
activeXDocument.close();
var temp = activeXDocument.parentWindow.Object;
// eslint-disable-next-line no-useless-assignment -- avoid memory leak
activeXDocument = null;
return temp;
};
// Create object with fake `null` prototype: use iframe Object with cleared prototype
var NullProtoObjectViaIFrame = function () {
// Thrash, waste and sodomy: IE GC bug
var iframe = documentCreateElement('iframe');
var JS = 'java' + SCRIPT + ':';
var iframeDocument;
iframe.style.display = 'none';
html.appendChild(iframe);
// https://github.com/zloirock/core-js/issues/475
iframe.src = String(JS);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(scriptTag('document.F=Object'));
iframeDocument.close();
return iframeDocument.F;
};
// Check for document.domain and active x support
// No need to use active x approach when document.domain is not set
// see https://github.com/es-shims/es5-shim/issues/150
// variation of https://github.com/kitcambridge/es5-shim/commit/4f738ac066346
// avoid IE GC bug
var activeXDocument;
var NullProtoObject = function () {
try {
activeXDocument = new ActiveXObject('htmlfile');
} catch (error) { /* ignore */ }
NullProtoObject = typeof document != 'undefined'
? document.domain && activeXDocument
? NullProtoObjectViaActiveX(activeXDocument) // old IE
: NullProtoObjectViaIFrame()
: NullProtoObjectViaActiveX(activeXDocument); // WSH
var length = enumBugKeys.length;
while (length--) delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
return NullProtoObject();
};
hiddenKeys[IE_PROTO] = true;
// `Object.create` method
// https://tc39.es/ecma262/#sec-object.create
// eslint-disable-next-line es/no-object-create -- safe
module.exports = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
EmptyConstructor[PROTOTYPE] = anObject(O);
result = new EmptyConstructor();
EmptyConstructor[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO] = O;
} else result = NullProtoObject();
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
};
});
// MODULE: ./node_modules/core-js/internals/object-define-properties.js
var object_define_properties_namespaceFn = /*#__PURE__*/__webpack_require__.cw((__unused_webpack_module, exports) => {
var DESCRIPTORS = (descriptors_namespaceFn());
var V8_PROTOTYPE_DEFINE_BUG = (v8_prototype_define_bug_namespaceFn());
var definePropertyModule = (object_define_property_namespaceFn());
var anObject = (an_object_namespaceFn());
var toIndexedObject = (to_indexed_object_namespaceFn());
var objectKeys = (object_keys_namespaceFn());
// `Object.defineProperties` method
// https://tc39.es/ecma262/#sec-object.defineproperties
// eslint-disable-next-line es/no-object-defineproperties -- safe
exports.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
anObject(O);
var props = toIndexedObject(Properties);
var keys = objectKeys(Properties);
var length = keys.length;
var index = 0;
var key;
while (length > index) definePropertyModule.f(O, key = keys[index++], props[key]);
return O;
};
});
// MODULE: ./node_modules/core-js/internals/object-define-property.js
var object_define_property_namespaceFn = /*#__PURE__*/__webpack_require__.cw((__unused_webpack_module, exports) => {
var DESCRIPTORS = (descriptors_namespaceFn());
var IE8_DOM_DEFINE = (ie8_dom_define_namespaceFn());
var V8_PROTOTYPE_DEFINE_BUG = (v8_prototype_define_bug_namespaceFn());
var anObject = (an_object_namespaceFn());
var toPropertyKey = (to_property_key_namespaceFn());
var $TypeError = TypeError;
// eslint-disable-next-line es/no-object-defineproperty -- safe
var $defineProperty = Object.defineProperty;
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var ENUMERABLE = 'enumerable';
var CONFIGURABLE = 'configurable';
var WRITABLE = 'writable';
// `Object.defineProperty` method
// https://tc39.es/ecma262/#sec-object.defineproperty
exports.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O, P, Attributes) {
anObject(O);
P = toPropertyKey(P);
anObject(Attributes);
if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
var current = $getOwnPropertyDescriptor(O, P);
if (current && current[WRITABLE]) {
O[P] = Attributes.value;
Attributes = {
configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
writable: false
};
}
} return $defineProperty(O, P, Attributes);
} : $defineProperty : function defineProperty(O, P, Attributes) {
anObject(O);
P = toPropertyKey(P);
anObject(Attributes);
if (IE8_DOM_DEFINE) try {
return $defineProperty(O, P, Attributes);
} catch (error) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw new $TypeError('Accessors not supported');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
});
// MODULE: ./node_modules/core-js/internals/object-get-own-property-descriptor.js
var object_get_own_property_descriptor_namespaceFn = /*#__PURE__*/__webpack_require__.cw((__unused_webpack_module, exports) => {
var DESCRIPTORS = (descriptors_namespaceFn());
var call = (function_call_namespaceFn());
var propertyIsEnumerableModule = (object_property_is_enumerable_namespaceFn());
var createPropertyDescriptor = (create_property_descriptor_namespaceFn());
var toIndexedObject = (to_indexed_object_namespaceFn());
var toPropertyKey = (to_property_key_namespaceFn());
var hasOwn = (has_own_property_namespaceFn());
var IE8_DOM_DEFINE = (ie8_dom_define_namespaceFn());
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
// `Object.getOwnPropertyDescriptor` method
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
exports.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
O = toIndexedObject(O);
P = toPropertyKey(P);
if (IE8_DOM_DEFINE) try {
return $getOwnPropertyDescriptor(O, P);
} catch (error) { /* empty */ }
if (hasOwn(O, P)) return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O, P), O[P]);
};
});
// MODULE: ./node_modules/core-js/internals/object-get-own-property-names.js
var object_get_own_property_names_namespaceFn = /*#__PURE__*/__webpack_require__.cw((__unused_webpack_module, exports) => {
var internalObjectKeys = (object_keys_internal_namespaceFn());
var enumBugKeys = (enum_bug_keys_namespaceFn());
var hiddenKeys = enumBugKeys.concat('length', 'prototype');
// `Object.getOwnPropertyNames` method
// https://tc39.es/ecma262/#sec-object.getownpropertynames
// eslint-disable-next-line es/no-object-getownpropertynames -- safe
exports.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
return internalObjectKeys(O, hiddenKeys);
};
});
// EXTERNAL MODULE: ./node_modules/core-js/internals/object-get-own-property-symbols.js
var object_get_own_property_symbols_namespaceFn = () => {
return __webpack_require__(717);
};
// MODULE: ./node_modules/core-js/internals/object-get-prototype-of.js
var object_get_prototype_of_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var hasOwn = (has_own_property_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var toObject = (to_object_namespaceFn());
var sharedKey = (shared_key_namespaceFn());
var CORRECT_PROTOTYPE_GETTER = (correct_prototype_getter_namespaceFn());
var IE_PROTO = sharedKey('IE_PROTO');
var $Object = Object;
var ObjectPrototype = $Object.prototype;
// `Object.getPrototypeOf` method
// https://tc39.es/ecma262/#sec-object.getprototypeof
// eslint-disable-next-line es/no-object-getprototypeof -- safe
module.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function (O) {
var object = toObject(O);
if (hasOwn(object, IE_PROTO)) return object[IE_PROTO];
var constructor = object.constructor;
if (isCallable(constructor) && object instanceof constructor) {
return constructor.prototype;
} return object instanceof $Object ? ObjectPrototype : null;
};
});
// MODULE: ./node_modules/core-js/internals/object-is-prototype-of.js
var object_is_prototype_of_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
module.exports = uncurryThis({}.isPrototypeOf);
});
// MODULE: ./node_modules/core-js/internals/object-keys-internal.js
var object_keys_internal_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
var hasOwn = (has_own_property_namespaceFn());
var toIndexedObject = (to_indexed_object_namespaceFn());
var indexOf = (array_includes_namespaceFn().indexOf);
var hiddenKeys = (hidden_keys_namespaceFn());
var push = uncurryThis([].push);
module.exports = function (object, names) {
var O = toIndexedObject(object);
var i = 0;
var result = [];
var key;
for (key in O) !hasOwn(hiddenKeys, key) && hasOwn(O, key) && push(result, key);
// Don't enum bug & hidden keys
while (names.length > i) if (hasOwn(O, key = names[i++])) {
~indexOf(result, key) || push(result, key);
}
return result;
};
});
// MODULE: ./node_modules/core-js/internals/object-keys.js
var object_keys_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var internalObjectKeys = (object_keys_internal_namespaceFn());
var enumBugKeys = (enum_bug_keys_namespaceFn());
// `Object.keys` method
// https://tc39.es/ecma262/#sec-object.keys
// eslint-disable-next-line es/no-object-keys -- safe
module.exports = Object.keys || function keys(O) {
return internalObjectKeys(O, enumBugKeys);
};
});
// MODULE: ./node_modules/core-js/internals/object-property-is-enumerable.js
var object_property_is_enumerable_namespaceFn = /*#__PURE__*/__webpack_require__.cw((__unused_webpack_module, exports) => {
var $propertyIsEnumerable = {}.propertyIsEnumerable;
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
// Nashorn ~ JDK8 bug
var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
// `Object.prototype.propertyIsEnumerable` method implementation
// https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
exports.f = NASHORN_BUG ? function propertyIsEnumerable(V) {
var descriptor = getOwnPropertyDescriptor(this, V);
return !!descriptor && descriptor.enumerable;
} : $propertyIsEnumerable;
});
// MODULE: ./node_modules/core-js/internals/object-set-prototype-of.js
var object_set_prototype_of_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
/* eslint-disable no-proto -- safe */
var uncurryThisAccessor = (function_uncurry_this_accessor_namespaceFn());
var isObject = (is_object_namespaceFn());
var requireObjectCoercible = (require_object_coercible_namespaceFn());
var aPossiblePrototype = (a_possible_prototype_namespaceFn());
// `Object.setPrototypeOf` method
// https://tc39.es/ecma262/#sec-object.setprototypeof
// Works with __proto__ only. Old v8 can't work with null proto objects.
// eslint-disable-next-line es/no-object-setprototypeof -- safe
module.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {
var CORRECT_SETTER = false;
var test = {};
var setter;
try {
setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');
setter(test, []);
CORRECT_SETTER = test instanceof Array;
} catch (error) { /* empty */ }
return function setPrototypeOf(O, proto) {
requireObjectCoercible(O);
aPossiblePrototype(proto);
if (!isObject(O)) return O;
if (CORRECT_SETTER) setter(O, proto);
else O.__proto__ = proto;
return O;
};
}() : undefined);
});
// MODULE: ./node_modules/core-js/internals/ordinary-to-primitive.js
var ordinary_to_primitive_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var call = (function_call_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var isObject = (is_object_namespaceFn());
var $TypeError = TypeError;
// `OrdinaryToPrimitive` abstract operation
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
module.exports = function (input, pref) {
var fn, val;
if (pref === 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
if (isCallable(fn = input.valueOf) && !isObject(val = call(fn, input))) return val;
if (pref !== 'string' && isCallable(fn = input.toString) && !isObject(val = call(fn, input))) return val;
throw new $TypeError("Can't convert object to primitive value");
};
});
// MODULE: ./node_modules/core-js/internals/own-keys.js
var own_keys_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var getBuiltIn = (get_built_in_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var getOwnPropertyNamesModule = (object_get_own_property_names_namespaceFn());
var getOwnPropertySymbolsModule = (object_get_own_property_symbols_namespaceFn());
var anObject = (an_object_namespaceFn());
var concat = uncurryThis([].concat);
// all object keys, includes non-enumerable and symbols
module.exports = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) {
var keys = getOwnPropertyNamesModule.f(anObject(it));
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys;
};
});
// MODULE: ./node_modules/core-js/internals/parse-json-string.js
var parse_json_string_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
var hasOwn = (has_own_property_namespaceFn());
var $SyntaxError = SyntaxError;
var $parseInt = parseInt;
var fromCharCode = String.fromCharCode;
var at = uncurryThis(''.charAt);
var slice = uncurryThis(''.slice);
var exec = uncurryThis(/./.exec);
var codePoints = {
'\\"': '"',
'\\\\': '\\',
'\\/': '/',
'\\b': '\b',
'\\f': '\f',
'\\n': '\n',
'\\r': '\r',
'\\t': '\t'
};
var IS_4_HEX_DIGITS = /^[\da-f]{4}$/i;
// eslint-disable-next-line regexp/no-control-character -- safe
var IS_C0_CONTROL_CODE = /^[\u0000-\u001F]$/;
module.exports = function (source, i) {
var unterminated = true;
var value = '';
while (i < source.length) {
var chr = at(source, i);
if (chr === '\\') {
var twoChars = slice(source, i, i + 2);
if (hasOwn(codePoints, twoChars)) {
value += codePoints[twoChars];
i += 2;
} else if (twoChars === '\\u') {
i += 2;
var fourHexDigits = slice(source, i, i + 4);
if (!exec(IS_4_HEX_DIGITS, fourHexDigits)) throw new $SyntaxError('Bad Unicode escape at: ' + i);
value += fromCharCode($parseInt(fourHexDigits, 16));
i += 4;
} else throw new $SyntaxError('Unknown escape sequence: "' + twoChars + '"');
} else if (chr === '"') {
unterminated = false;
i++;
break;
} else {
if (exec(IS_C0_CONTROL_CODE, chr)) throw new $SyntaxError('Bad control character in string literal at: ' + i);
value += chr;
i++;
}
}
if (unterminated) throw new $SyntaxError('Unterminated string at: ' + i);
return { value: value, end: i };
};
});
// EXTERNAL MODULE: ./node_modules/core-js/internals/perform.js
var perform_namespaceFn = () => {
return __webpack_require__(103);
};
// MODULE: ./node_modules/core-js/internals/promise-resolve.js
var promise_resolve_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var anObject = (an_object_namespaceFn());
var isObject = (is_object_namespaceFn());
var newPromiseCapability = (new_promise_capability_namespaceFn());
module.exports = function (C, x) {
anObject(C);
if (isObject(x) && x.constructor === C) return x;
var promiseCapability = newPromiseCapability.f(C);
var resolve = promiseCapability.resolve;
resolve(x);
return promiseCapability.promise;
};
});
// MODULE: ./node_modules/core-js/internals/proxy-accessor.js
var proxy_accessor_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var defineProperty = (object_define_property_namespaceFn().f);
module.exports = function (Target, Source, key) {
key in Target || defineProperty(Target, key, {
configurable: true,
get: function () { return Source[key]; },
set: function (it) { Source[key] = it; }
});
};
});
// MODULE: ./node_modules/core-js/internals/regexp-exec-abstract.js
var regexp_exec_abstract_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var call = (function_call_namespaceFn());
var anObject = (an_object_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var classof = (classof_raw_namespaceFn());
var regexpExec = (regexp_exec_namespaceFn());
var $TypeError = TypeError;
// `RegExpExec` abstract operation
// https://tc39.es/ecma262/#sec-regexpexec
module.exports = function (R, S) {
var exec = R.exec;
if (isCallable(exec)) {
var result = call(exec, R, S);
if (result !== null) anObject(result);
return result;
}
if (classof(R) === 'RegExp') return call(regexpExec, R, S);
throw new $TypeError('RegExp#exec called on incompatible receiver');
};
});
// MODULE: ./node_modules/core-js/internals/regexp-exec.js
var regexp_exec_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
/* eslint-disable regexp/no-useless-quantifier -- testing */
var call = (function_call_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var toString = (to_string_namespaceFn());
var regexpFlags = (regexp_flags_namespaceFn());
var stickyHelpers = (regexp_sticky_helpers_namespaceFn());
var shared = (shared_namespaceFn());
var create = (object_create_namespaceFn());
var getInternalState = (internal_state_namespaceFn().get);
var UNSUPPORTED_DOT_ALL = (regexp_unsupported_dot_all_namespaceFn());
var UNSUPPORTED_NCG = (regexp_unsupported_ncg_namespaceFn());
var nativeReplace = shared('native-string-replace', String.prototype.replace);
var nativeExec = RegExp.prototype.exec;
var patchedExec = nativeExec;
var charAt = uncurryThis(''.charAt);
var indexOf = uncurryThis(''.indexOf);
var replace = uncurryThis(''.replace);
var stringSlice = uncurryThis(''.slice);
var UPDATES_LAST_INDEX_WRONG = (function () {
var re1 = /a/;
var re2 = /b*/g;
call(nativeExec, re1, 'a');
call(nativeExec, re2, 'a');
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
})();
var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
// nonparticipating capturing group, copied from es5-shim's String#split patch.
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
var setGroups = function (re, groups) {
var object = re.groups = create(null);
for (var i = 0; i < groups.length; i++) {
var group = groups[i];
object[group[0]] = re[group[1]];
}
};
if (PATCH) {
patchedExec = function exec(string) {
var re = this;
var state = getInternalState(re);
var str = toString(string);
var raw = state.raw;
var result, reCopy, lastIndex;
if (raw) {
raw.lastIndex = re.lastIndex;
result = call(patchedExec, raw, str);
re.lastIndex = raw.lastIndex;
if (result && state.groups) setGroups(result, state.groups);
return result;
}
var groups = state.groups;
var sticky = UNSUPPORTED_Y && re.sticky;
var flags = call(regexpFlags, re);
var source = re.source;
var charsAdded = 0;
var strCopy = str;
if (sticky) {
flags = replace(flags, 'y', '');
if (indexOf(flags, 'g') === -1) {
flags += 'g';
}
strCopy = stringSlice(str, re.lastIndex);
// Support anchored sticky behavior.
var prevChar = re.lastIndex > 0 && charAt(str, re.lastIndex - 1);
if (re.lastIndex > 0 &&
(!re.multiline || re.multiline && prevChar !== '\n' && prevChar !== '\r' && prevChar !== '\u2028' && prevChar !== '\u2029')) {
source = '(?: (?:' + source + '))';
strCopy = ' ' + strCopy;
charsAdded++;
}
// ^(? + rx + ) is needed, in combination with some str slicing, to
// simulate the 'y' flag.
reCopy = new RegExp('^(?:' + source + ')', flags);
}
if (NPCG_INCLUDED) {
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
}
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
var match = call(nativeExec, sticky ? reCopy : re, strCopy);
if (sticky) {
if (match) {
match.input = str;
match[0] = stringSlice(match[0], charsAdded);
match.index = re.lastIndex;
re.lastIndex += match[0].length;
} else re.lastIndex = 0;
} else if (UPDATES_LAST_INDEX_WRONG && match) {
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
}
if (NPCG_INCLUDED && match && match.length > 1) {
// Fix browsers whose `exec` methods don't consistently return `undefined`
// for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
call(nativeReplace, match[0], reCopy, function () {
for (var i = 1; i < arguments.length - 2; i++) {
if (arguments[i] === undefined) match[i] = undefined;
}
});
}
if (match && groups) setGroups(match, groups);
return match;
};
}
module.exports = patchedExec;
});
// MODULE: ./node_modules/core-js/internals/regexp-flags-detection.js
var regexp_flags_detection_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
var fails = (fails_namespaceFn());
// babel-minify and Closure Compiler transpiles RegExp('.', 'd') -> /./d and it causes SyntaxError
var RegExp = globalThis.RegExp;
var FLAGS_GETTER_IS_CORRECT = !fails(function () {
var INDICES_SUPPORT = true;
try {
RegExp('.', 'd');
} catch (error) {
INDICES_SUPPORT = false;
}
var O = {};
// modern V8 bug
var calls = '';
var expected = INDICES_SUPPORT ? 'dgimsy' : 'gimsy';
var addGetter = function (key, chr) {
// eslint-disable-next-line es/no-object-defineproperty -- safe
Object.defineProperty(O, key, { get: function () {
calls += chr;
return true;
} });
};
var pairs = {
dotAll: 's',
global: 'g',
ignoreCase: 'i',
multiline: 'm',
sticky: 'y'
};
if (INDICES_SUPPORT) pairs.hasIndices = 'd';
for (var key in pairs) addGetter(key, pairs[key]);
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var result = Object.getOwnPropertyDescriptor(RegExp.prototype, 'flags').get.call(O);
return result !== expected || calls !== expected;
});
module.exports = { correct: FLAGS_GETTER_IS_CORRECT };
});
// MODULE: ./node_modules/core-js/internals/regexp-flags.js
var regexp_flags_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var anObject = (an_object_namespaceFn());
// `RegExp.prototype.flags` getter implementation
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
module.exports = function () {
var that = anObject(this);
var result = '';
if (that.hasIndices) result += 'd';
if (that.global) result += 'g';
if (that.ignoreCase) result += 'i';
if (that.multiline) result += 'm';
if (that.dotAll) result += 's';
if (that.unicode) result += 'u';
if (that.unicodeSets) result += 'v';
if (that.sticky) result += 'y';
return result;
};
});
// MODULE: ./node_modules/core-js/internals/regexp-get-flags.js
var regexp_get_flags_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var call = (function_call_namespaceFn());
var hasOwn = (has_own_property_namespaceFn());
var isPrototypeOf = (object_is_prototype_of_namespaceFn());
var regExpFlagsDetection = (regexp_flags_detection_namespaceFn());
var regExpFlagsGetterImplementation = (regexp_flags_namespaceFn());
var RegExpPrototype = RegExp.prototype;
module.exports = regExpFlagsDetection.correct ? function (it) {
return it.flags;
} : function (it) {
return (!regExpFlagsDetection.correct && isPrototypeOf(RegExpPrototype, it) && !hasOwn(it, 'flags'))
? call(regExpFlagsGetterImplementation, it)
: it.flags;
};
});
// MODULE: ./node_modules/core-js/internals/regexp-sticky-helpers.js
var regexp_sticky_helpers_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var fails = (fails_namespaceFn());
var globalThis = (global_this_namespaceFn());
// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
var $RegExp = globalThis.RegExp;
var UNSUPPORTED_Y = fails(function () {
var re = $RegExp('a', 'y');
re.lastIndex = 2;
return re.exec('abcd') !== null;
});
// UC Browser bug
// https://github.com/zloirock/core-js/issues/1008
var MISSED_STICKY = UNSUPPORTED_Y || fails(function () {
return !$RegExp('a', 'y').sticky;
});
var BROKEN_CARET = UNSUPPORTED_Y || fails(function () {
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
var re = $RegExp('^r', 'gy');
re.lastIndex = 2;
return re.exec('str') !== null;
});
module.exports = {
BROKEN_CARET: BROKEN_CARET,
MISSED_STICKY: MISSED_STICKY,
UNSUPPORTED_Y: UNSUPPORTED_Y
};
});
// MODULE: ./node_modules/core-js/internals/regexp-unsupported-dot-all.js
var regexp_unsupported_dot_all_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var fails = (fails_namespaceFn());
var globalThis = (global_this_namespaceFn());
// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
var $RegExp = globalThis.RegExp;
module.exports = fails(function () {
var re = $RegExp('.', 's');
return !(re.dotAll && re.test('\n') && re.flags === 's');
});
});
// MODULE: ./node_modules/core-js/internals/regexp-unsupported-ncg.js
var regexp_unsupported_ncg_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var fails = (fails_namespaceFn());
var globalThis = (global_this_namespaceFn());
// babel-minify and Closure Compiler transpiles RegExp('(?<a>b)', 'g') -> /(?<a>b)/g and it causes SyntaxError
var $RegExp = globalThis.RegExp;
module.exports = fails(function () {
var re = $RegExp('(?<a>b)', 'g');
return re.exec('b').groups.a !== 'b' ||
'b'.replace(re, '$<a>c') !== 'bc';
});
});
// MODULE: ./node_modules/core-js/internals/require-object-coercible.js
var require_object_coercible_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var isNullOrUndefined = (is_null_or_undefined_namespaceFn());
var $TypeError = TypeError;
// `RequireObjectCoercible` abstract operation
// https://tc39.es/ecma262/#sec-requireobjectcoercible
module.exports = function (it) {
if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it);
return it;
};
});
// MODULE: ./node_modules/core-js/internals/safe-get-built-in.js
var safe_get_built_in_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
var DESCRIPTORS = (descriptors_namespaceFn());
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
// Avoid NodeJS experimental warning
module.exports = function (name) {
if (!DESCRIPTORS) return globalThis[name];
var descriptor = getOwnPropertyDescriptor(globalThis, name);
return descriptor && descriptor.value;
};
});
// MODULE: ./node_modules/core-js/internals/set-clone.js
var set_clone_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var SetHelpers = (set_helpers_namespaceFn());
var iterate = (set_iterate_namespaceFn());
var Set = SetHelpers.Set;
var add = SetHelpers.add;
module.exports = function (set) {
var result = new Set();
iterate(set, function (it) {
add(result, it);
});
return result;
};
});
// MODULE: ./node_modules/core-js/internals/set-difference.js
var set_difference_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var aSet = (a_set_namespaceFn());
var SetHelpers = (set_helpers_namespaceFn());
var clone = (set_clone_namespaceFn());
var size = (set_size_namespaceFn());
var getSetRecord = (get_set_record_namespaceFn());
var iterateSet = (set_iterate_namespaceFn());
var iterateSimple = (iterate_simple_namespaceFn());
var has = SetHelpers.has;
var remove = SetHelpers.remove;
// `Set.prototype.difference` method
// https://tc39.es/ecma262/#sec-set.prototype.difference
module.exports = function difference(other) {
var O = aSet(this);
var otherRec = getSetRecord(other);
var result = clone(O);
if (size(result) <= otherRec.size) iterateSet(result, function (e) {
if (otherRec.includes(e)) remove(result, e);
});
else iterateSimple(otherRec.getIterator(), function (e) {
if (has(result, e)) remove(result, e);
});
return result;
};
});
// MODULE: ./node_modules/core-js/internals/set-helpers.js
var set_helpers_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
// eslint-disable-next-line es/no-set -- safe
var SetPrototype = Set.prototype;
module.exports = {
// eslint-disable-next-line es/no-set -- safe
Set: Set,
add: uncurryThis(SetPrototype.add),
has: uncurryThis(SetPrototype.has),
remove: uncurryThis(SetPrototype['delete']),
proto: SetPrototype
};
});
// MODULE: ./node_modules/core-js/internals/set-intersection.js
var set_intersection_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var aSet = (a_set_namespaceFn());
var SetHelpers = (set_helpers_namespaceFn());
var size = (set_size_namespaceFn());
var getSetRecord = (get_set_record_namespaceFn());
var iterateSet = (set_iterate_namespaceFn());
var iterateSimple = (iterate_simple_namespaceFn());
var Set = SetHelpers.Set;
var add = SetHelpers.add;
var has = SetHelpers.has;
// `Set.prototype.intersection` method
// https://tc39.es/ecma262/#sec-set.prototype.intersection
module.exports = function intersection(other) {
var O = aSet(this);
var otherRec = getSetRecord(other);
var result = new Set();
if (size(O) > otherRec.size) {
iterateSimple(otherRec.getIterator(), function (e) {
if (has(O, e)) add(result, e);
});
} else {
iterateSet(O, function (e) {
if (otherRec.includes(e)) add(result, e);
});
}
return result;
};
});
// MODULE: ./node_modules/core-js/internals/set-is-disjoint-from.js
var set_is_disjoint_from_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var aSet = (a_set_namespaceFn());
var has = (set_helpers_namespaceFn().has);
var size = (set_size_namespaceFn());
var getSetRecord = (get_set_record_namespaceFn());
var iterateSet = (set_iterate_namespaceFn());
var iterateSimple = (iterate_simple_namespaceFn());
var iteratorClose = (iterator_close_namespaceFn());
// `Set.prototype.isDisjointFrom` method
// https://tc39.es/ecma262/#sec-set.prototype.isdisjointfrom
module.exports = function isDisjointFrom(other) {
var O = aSet(this);
var otherRec = getSetRecord(other);
if (size(O) <= otherRec.size) return iterateSet(O, function (e) {
if (otherRec.includes(e)) return false;
}, true) !== false;
var iterator = otherRec.getIterator();
return iterateSimple(iterator, function (e) {
if (has(O, e)) return iteratorClose(iterator.iterator, 'normal', false);
}) !== false;
};
});
// MODULE: ./node_modules/core-js/internals/set-is-subset-of.js
var set_is_subset_of_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var aSet = (a_set_namespaceFn());
var size = (set_size_namespaceFn());
var iterate = (set_iterate_namespaceFn());
var getSetRecord = (get_set_record_namespaceFn());
// `Set.prototype.isSubsetOf` method
// https://tc39.es/ecma262/#sec-set.prototype.issubsetof
module.exports = function isSubsetOf(other) {
var O = aSet(this);
var otherRec = getSetRecord(other);
if (size(O) > otherRec.size) return false;
return iterate(O, function (e) {
if (!otherRec.includes(e)) return false;
}, true) !== false;
};
});
// MODULE: ./node_modules/core-js/internals/set-is-superset-of.js
var set_is_superset_of_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var aSet = (a_set_namespaceFn());
var has = (set_helpers_namespaceFn().has);
var size = (set_size_namespaceFn());
var getSetRecord = (get_set_record_namespaceFn());
var iterateSimple = (iterate_simple_namespaceFn());
var iteratorClose = (iterator_close_namespaceFn());
// `Set.prototype.isSupersetOf` method
// https://tc39.es/ecma262/#sec-set.prototype.issupersetof
module.exports = function isSupersetOf(other) {
var O = aSet(this);
var otherRec = getSetRecord(other);
if (size(O) < otherRec.size) return false;
var iterator = otherRec.getIterator();
return iterateSimple(iterator, function (e) {
if (!has(O, e)) return iteratorClose(iterator.iterator, 'normal', false);
}) !== false;
};
});
// MODULE: ./node_modules/core-js/internals/set-iterate.js
var set_iterate_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
var iterateSimple = (iterate_simple_namespaceFn());
var SetHelpers = (set_helpers_namespaceFn());
var Set = SetHelpers.Set;
var SetPrototype = SetHelpers.proto;
var forEach = uncurryThis(SetPrototype.forEach);
var keys = uncurryThis(SetPrototype.keys);
var next = keys(new Set()).next;
module.exports = function (set, fn, interruptible) {
return interruptible ? iterateSimple({ iterator: keys(set), next: next }, fn) : forEach(set, fn);
};
});
// MODULE: ./node_modules/core-js/internals/set-method-accept-set-like.js
var set_method_accept_set_like_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var getBuiltIn = (get_built_in_namespaceFn());
var createSetLike = function (size) {
return {
size: size,
has: function () {
return false;
},
keys: function () {
return {
next: function () {
return { done: true };
}
};
}
};
};
var createSetLikeWithInfinitySize = function (size) {
return {
size: size,
has: function () {
return true;
},
keys: function () {
throw new Error('e');
}
};
};
module.exports = function (name, callback) {
var Set = getBuiltIn('Set');
try {
new Set()[name](createSetLike(0));
try {
// late spec change, early WebKit ~ Safari 17 implementation does not pass it
// https://github.com/tc39/proposal-set-methods/pull/88
// also covered engines with
// https://bugs.webkit.org/show_bug.cgi?id=272679
new Set()[name](createSetLike(-1));
return false;
} catch (error2) {
if (!callback) return true;
// early V8 implementation bug
// https://issues.chromium.org/issues/351332634
try {
new Set()[name](createSetLikeWithInfinitySize(-Infinity));
return false;
} catch (error) {
var set = new Set([1, 2]);
return callback(set[name](createSetLikeWithInfinitySize(Infinity)));
}
}
} catch (error) {
return false;
}
};
});
// EXTERNAL MODULE: ./node_modules/core-js/internals/set-method-get-keys-before-cloning-detection.js
var set_method_get_keys_before_cloning_detection_namespaceFn = () => {
return __webpack_require__(835);
};
// MODULE: ./node_modules/core-js/internals/set-size.js
var set_size_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThisAccessor = (function_uncurry_this_accessor_namespaceFn());
var SetHelpers = (set_helpers_namespaceFn());
module.exports = uncurryThisAccessor(SetHelpers.proto, 'size', 'get') || function (set) {
return set.size;
};
});
// MODULE: ./node_modules/core-js/internals/set-species.js
var set_species_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var getBuiltIn = (get_built_in_namespaceFn());
var defineBuiltInAccessor = (define_built_in_accessor_namespaceFn());
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var DESCRIPTORS = (descriptors_namespaceFn());
var SPECIES = wellKnownSymbol('species');
module.exports = function (CONSTRUCTOR_NAME) {
var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
defineBuiltInAccessor(Constructor, SPECIES, {
configurable: true,
get: function () { return this; }
});
}
};
});
// MODULE: ./node_modules/core-js/internals/set-symmetric-difference.js
var set_symmetric_difference_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var aSet = (a_set_namespaceFn());
var SetHelpers = (set_helpers_namespaceFn());
var clone = (set_clone_namespaceFn());
var getSetRecord = (get_set_record_namespaceFn());
var iterateSimple = (iterate_simple_namespaceFn());
var add = SetHelpers.add;
var has = SetHelpers.has;
var remove = SetHelpers.remove;
// `Set.prototype.symmetricDifference` method
// https://tc39.es/ecma262/#sec-set.prototype.symmetricdifference
module.exports = function symmetricDifference(other) {
var O = aSet(this);
var keysIter = getSetRecord(other).getIterator();
var result = clone(O);
iterateSimple(keysIter, function (e) {
if (has(O, e)) remove(result, e);
else add(result, e);
});
return result;
};
});
// MODULE: ./node_modules/core-js/internals/set-to-string-tag.js
var set_to_string_tag_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var defineProperty = (object_define_property_namespaceFn().f);
var hasOwn = (has_own_property_namespaceFn());
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
module.exports = function (target, TAG, STATIC) {
if (target && !STATIC) target = target.prototype;
if (target && !hasOwn(target, TO_STRING_TAG)) {
defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
}
};
});
// MODULE: ./node_modules/core-js/internals/set-union.js
var set_union_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var aSet = (a_set_namespaceFn());
var add = (set_helpers_namespaceFn().add);
var clone = (set_clone_namespaceFn());
var getSetRecord = (get_set_record_namespaceFn());
var iterateSimple = (iterate_simple_namespaceFn());
// `Set.prototype.union` method
// https://tc39.es/ecma262/#sec-set.prototype.union
module.exports = function union(other) {
var O = aSet(this);
var keysIter = getSetRecord(other).getIterator();
var result = clone(O);
iterateSimple(keysIter, function (it) {
add(result, it);
});
return result;
};
});
// MODULE: ./node_modules/core-js/internals/shared-key.js
var shared_key_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var shared = (shared_namespaceFn());
var uid = (uid_namespaceFn());
var keys = shared('keys');
module.exports = function (key) {
return keys[key] || (keys[key] = uid(key));
};
});
// MODULE: ./node_modules/core-js/internals/shared-store.js
var shared_store_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var IS_PURE = (is_pure_namespaceFn());
var globalThis = (global_this_namespaceFn());
var defineGlobalProperty = (define_global_property_namespaceFn());
var SHARED = '__core-js_shared__';
var store = module.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {});
(store.versions || (store.versions = [])).push({
version: '3.51.0',
mode: IS_PURE ? 'pure' : 'global',
copyright: '© 2013–2025 Denis Pushkarev (zloirock.ru), 2025–2026 CoreJS Company (core-js.io). All rights reserved.',
license: 'https://github.com/zloirock/core-js/blob/v3.51.0/LICENSE',
source: 'https://github.com/zloirock/core-js'
});
});
// MODULE: ./node_modules/core-js/internals/shared.js
var shared_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var store = (shared_store_namespaceFn());
// eslint-disable-next-line es/no-object-create -- safe
var create = Object.create || Object;
module.exports = function (key, value) {
return store[key] || (store[key] = value || create(null));
};
});
// MODULE: ./node_modules/core-js/internals/string-multibyte.js
var string_multibyte_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
var toIntegerOrInfinity = (to_integer_or_infinity_namespaceFn());
var toString = (to_string_namespaceFn());
var requireObjectCoercible = (require_object_coercible_namespaceFn());
var charAt = uncurryThis(''.charAt);
var charCodeAt = uncurryThis(''.charCodeAt);
var stringSlice = uncurryThis(''.slice);
var createMethod = function (CONVERT_TO_STRING) {
return function ($this, pos) {
var S = toString(requireObjectCoercible($this));
var position = toIntegerOrInfinity(pos);
var size = S.length;
var first, second;
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
first = charCodeAt(S, position);
return first < 0xD800 || first > 0xDBFF || position + 1 === size
|| (second = charCodeAt(S, position + 1)) < 0xDC00 || second > 0xDFFF
? CONVERT_TO_STRING
? charAt(S, position)
: first
: CONVERT_TO_STRING
? stringSlice(S, position, position + 2)
: (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
};
};
module.exports = {
// `String.prototype.codePointAt` method
// https://tc39.es/ecma262/#sec-string.prototype.codepointat
codeAt: createMethod(false),
// `String.prototype.at` method
// https://github.com/mathiasbynens/String.prototype.at
charAt: createMethod(true)
};
});
// MODULE: ./node_modules/core-js/internals/string-punycode-to-ascii.js
var string_punycode_to_ascii_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
// based on https://github.com/bestiejs/punycode.js/blob/master/punycode.js
var uncurryThis = (function_uncurry_this_namespaceFn());
var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1
var base = 36;
var tMin = 1;
var tMax = 26;
var skew = 38;
var damp = 700;
var initialBias = 72;
var initialN = 128; // 0x80
var delimiter = '-'; // '\x2D'
var regexNonASCII = /[^\0-\u007E]/; // non-ASCII chars
var regexSeparators = /[.\u3002\uFF0E\uFF61]/g; // RFC 3490 separators
var OVERFLOW_ERROR = 'Overflow: input needs wider integers to process';
var baseMinusTMin = base - tMin;
var $RangeError = RangeError;
var exec = uncurryThis(regexSeparators.exec);
var floor = Math.floor;
var fromCharCode = String.fromCharCode;
var charCodeAt = uncurryThis(''.charCodeAt);
var join = uncurryThis([].join);
var push = uncurryThis([].push);
var replace = uncurryThis(''.replace);
var split = uncurryThis(''.split);
var toLowerCase = uncurryThis(''.toLowerCase);
/**
* Creates an array containing the numeric code points of each Unicode
* character in the string. While JavaScript uses UCS-2 internally,
* this function will convert a pair of surrogate halves (each of which
* UCS-2 exposes as separate characters) into a single code point,
* matching UTF-16.
*/
var ucs2decode = function (string) {
var output = [];
var counter = 0;
var length = string.length;
while (counter < length) {
var value = charCodeAt(string, counter++);
if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
// It's a high surrogate, and there is a next character.
var extra = charCodeAt(string, counter++);
if ((extra & 0xFC00) === 0xDC00) { // Low surrogate.
push(output, ((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
} else {
// It's an unmatched surrogate; only append this code unit, in case the
// next code unit is the high surrogate of a surrogate pair.
push(output, value);
counter--;
}
} else {
push(output, value);
}
}
return output;
};
/**
* Converts a digit/integer into a basic code point.
*/
var digitToBasic = function (digit) {
// 0..25 map to ASCII a..z or A..Z
// 26..35 map to ASCII 0..9
return digit + 22 + 75 * (digit < 26);
};
/**
* Bias adaptation function as per section 3.4 of RFC 3492.
* https://tools.ietf.org/html/rfc3492#section-3.4
*/
var adapt = function (delta, numPoints, firstTime) {
var k = 0;
delta = firstTime ? floor(delta / damp) : delta >> 1;
delta += floor(delta / numPoints);
while (delta > baseMinusTMin * tMax >> 1) {
delta = floor(delta / baseMinusTMin);
k += base;
}
return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
};
/**
* Converts a string of Unicode symbols (e.g. a domain name label) to a
* Punycode string of ASCII-only symbols.
*/
var encode = function (input) {
var output = [];
// Convert the input in UCS-2 to an array of Unicode code points.
input = ucs2decode(input);
// Cache the length.
var inputLength = input.length;
// Initialize the state.
var n = initialN;
var delta = 0;
var bias = initialBias;
var i, currentValue;
// Handle the basic code points.
for (i = 0; i < input.length; i++) {
currentValue = input[i];
if (currentValue < 0x80) {
push(output, fromCharCode(currentValue));
}
}
var basicLength = output.length; // number of basic code points.
var handledCPCount = basicLength; // number of code points that have been handled;
// Finish the basic string with a delimiter unless it's empty.
if (basicLength) {
push(output, delimiter);
}
// Main encoding loop:
while (handledCPCount < inputLength) {
// All non-basic code points < n have been handled already. Find the next larger one:
var m = maxInt;
for (i = 0; i < input.length; i++) {
currentValue = input[i];
if (currentValue >= n && currentValue < m) {
m = currentValue;
}
}
// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>, but guard against overflow.
var handledCPCountPlusOne = handledCPCount + 1;
if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
throw new $RangeError(OVERFLOW_ERROR);
}
delta += (m - n) * handledCPCountPlusOne;
n = m;
for (i = 0; i < input.length; i++) {
currentValue = input[i];
if (currentValue < n && ++delta > maxInt) {
throw new $RangeError(OVERFLOW_ERROR);
}
if (currentValue === n) {
// Represent delta as a generalized variable-length integer.
var q = delta;
var k = base;
while (true) {
var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
if (q < t) break;
var qMinusT = q - t;
var baseMinusT = base - t;
push(output, fromCharCode(digitToBasic(t + qMinusT % baseMinusT)));
q = floor(qMinusT / baseMinusT);
k += base;
}
push(output, fromCharCode(digitToBasic(q)));
bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
delta = 0;
handledCPCount++;
}
}
delta++;
n++;
}
return join(output, '');
};
module.exports = function (input) {
var encoded = [];
var labels = split(replace(toLowerCase(input), regexSeparators, '\u002E'), '.');
var i, label;
for (i = 0; i < labels.length; i++) {
label = labels[i];
push(encoded, exec(regexNonASCII, label) ? 'xn--' + encode(label) : label);
}
return join(encoded, '.');
};
});
// MODULE: ./node_modules/core-js/internals/structured-clone-proper-transfer.js
var structured_clone_proper_transfer_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
var fails = (fails_namespaceFn());
var V8 = (environment_v8_version_namespaceFn());
var ENVIRONMENT = (environment_namespaceFn());
var structuredClone = globalThis.structuredClone;
module.exports = !!structuredClone && !fails(function () {
// prevent V8 ArrayBufferDetaching protector cell invalidation and performance degradation
// https://github.com/zloirock/core-js/issues/679
if ((ENVIRONMENT === 'DENO' && V8 > 92) || (ENVIRONMENT === 'NODE' && V8 > 94) || (ENVIRONMENT === 'BROWSER' && V8 > 97)) return false;
var buffer = new ArrayBuffer(8);
var clone = structuredClone(buffer, { transfer: [buffer] });
return buffer.byteLength !== 0 || clone.byteLength !== 8;
});
});
// MODULE: ./node_modules/core-js/internals/symbol-constructor-detection.js
var symbol_constructor_detection_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
/* eslint-disable es/no-symbol -- required for testing */
var V8_VERSION = (environment_v8_version_namespaceFn());
var fails = (fails_namespaceFn());
var globalThis = (global_this_namespaceFn());
var $String = globalThis.String;
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
module.exports = !!Object.getOwnPropertySymbols && !fails(function () {
var symbol = Symbol('symbol detection');
// Chrome 38 Symbol has incorrect toString conversion
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
// nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
// of course, fail.
return !$String(symbol) || !(Object(symbol) instanceof Symbol) ||
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
!Symbol.sham && V8_VERSION && V8_VERSION < 41;
});
});
// MODULE: ./node_modules/core-js/internals/this-number-value.js
var this_number_value_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
// `thisNumberValue` abstract operation
// https://tc39.es/ecma262/#sec-thisnumbervalue
module.exports = uncurryThis(1.1.valueOf);
});
// MODULE: ./node_modules/core-js/internals/to-absolute-index.js
var to_absolute_index_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var toIntegerOrInfinity = (to_integer_or_infinity_namespaceFn());
var max = Math.max;
var min = Math.min;
// Helper for a popular repeating case of the spec:
// Let integer be ? ToInteger(index).
// If integer < 0, let result be max((length + integer), 0); else let result be min(integer, length).
module.exports = function (index, length) {
var integer = toIntegerOrInfinity(index);
return integer < 0 ? max(integer + length, 0) : min(integer, length);
};
});
// MODULE: ./node_modules/core-js/internals/to-big-int.js
var to_big_int_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var toPrimitive = (to_primitive_namespaceFn());
var $TypeError = TypeError;
// `ToBigInt` abstract operation
// https://tc39.es/ecma262/#sec-tobigint
module.exports = function (argument) {
var prim = toPrimitive(argument, 'number');
if (typeof prim == 'number') throw new $TypeError("Can't convert number to bigint");
// eslint-disable-next-line es/no-bigint -- safe
return BigInt(prim);
};
});
// MODULE: ./node_modules/core-js/internals/to-index.js
var to_index_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var toIntegerOrInfinity = (to_integer_or_infinity_namespaceFn());
var toLength = (to_length_namespaceFn());
var $RangeError = RangeError;
// `ToIndex` abstract operation
// https://tc39.es/ecma262/#sec-toindex
module.exports = function (it) {
if (it === undefined) return 0;
var number = toIntegerOrInfinity(it);
var length = toLength(number);
if (number !== length) throw new $RangeError('Wrong length or index');
return length;
};
});
// MODULE: ./node_modules/core-js/internals/to-indexed-object.js
var to_indexed_object_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
// toObject with fallback for non-array-like ES3 strings
var IndexedObject = (indexed_object_namespaceFn());
var requireObjectCoercible = (require_object_coercible_namespaceFn());
module.exports = function (it) {
return IndexedObject(requireObjectCoercible(it));
};
});
// MODULE: ./node_modules/core-js/internals/to-integer-or-infinity.js
var to_integer_or_infinity_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var trunc = (math_trunc_namespaceFn());
// `ToIntegerOrInfinity` abstract operation
// https://tc39.es/ecma262/#sec-tointegerorinfinity
module.exports = function (argument) {
var number = +argument;
// eslint-disable-next-line no-self-compare -- NaN check
return number !== number || number === 0 ? 0 : trunc(number);
};
});
// MODULE: ./node_modules/core-js/internals/to-length.js
var to_length_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var toIntegerOrInfinity = (to_integer_or_infinity_namespaceFn());
var min = Math.min;
// `ToLength` abstract operation
// https://tc39.es/ecma262/#sec-tolength
module.exports = function (argument) {
var len = toIntegerOrInfinity(argument);
return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
};
});
// MODULE: ./node_modules/core-js/internals/to-object.js
var to_object_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var requireObjectCoercible = (require_object_coercible_namespaceFn());
var $Object = Object;
// `ToObject` abstract operation
// https://tc39.es/ecma262/#sec-toobject
module.exports = function (argument) {
return $Object(requireObjectCoercible(argument));
};
});
// MODULE: ./node_modules/core-js/internals/to-offset.js
var to_offset_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var toPositiveInteger = (to_positive_integer_namespaceFn());
var $RangeError = RangeError;
module.exports = function (it, BYTES) {
var offset = toPositiveInteger(it);
if (offset % BYTES) throw new $RangeError('Wrong offset');
return offset;
};
});
// MODULE: ./node_modules/core-js/internals/to-positive-integer.js
var to_positive_integer_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var toIntegerOrInfinity = (to_integer_or_infinity_namespaceFn());
var $RangeError = RangeError;
module.exports = function (it) {
var result = toIntegerOrInfinity(it);
if (result < 0) throw new $RangeError("The argument can't be less than 0");
return result;
};
});
// MODULE: ./node_modules/core-js/internals/to-primitive.js
var to_primitive_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var call = (function_call_namespaceFn());
var isObject = (is_object_namespaceFn());
var isSymbol = (is_symbol_namespaceFn());
var getMethod = (get_method_namespaceFn());
var ordinaryToPrimitive = (ordinary_to_primitive_namespaceFn());
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var $TypeError = TypeError;
var TO_PRIMITIVE = wellKnownSymbol('toPrimitive');
// `ToPrimitive` abstract operation
// https://tc39.es/ecma262/#sec-toprimitive
module.exports = function (input, pref) {
if (!isObject(input) || isSymbol(input)) return input;
var exoticToPrim = getMethod(input, TO_PRIMITIVE);
var result;
if (exoticToPrim) {
if (pref === undefined) pref = 'default';
result = call(exoticToPrim, input, pref);
if (!isObject(result) || isSymbol(result)) return result;
throw new $TypeError("Can't convert object to primitive value");
}
if (pref === undefined) pref = 'number';
return ordinaryToPrimitive(input, pref);
};
});
// MODULE: ./node_modules/core-js/internals/to-property-key.js
var to_property_key_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var toPrimitive = (to_primitive_namespaceFn());
var isSymbol = (is_symbol_namespaceFn());
// `ToPropertyKey` abstract operation
// https://tc39.es/ecma262/#sec-topropertykey
module.exports = function (argument) {
var key = toPrimitive(argument, 'string');
return isSymbol(key) ? key : key + '';
};
});
// MODULE: ./node_modules/core-js/internals/to-string-tag-support.js
var to_string_tag_support_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var test = {};
// eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
test[TO_STRING_TAG] = 'z';
module.exports = String(test) === '[object z]';
});
// MODULE: ./node_modules/core-js/internals/to-string.js
var to_string_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var classof = (classof_namespaceFn());
var $String = String;
module.exports = function (argument) {
if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');
return $String(argument);
};
});
// EXTERNAL MODULE: ./node_modules/core-js/internals/to-uint8-clamped.js
var to_uint8_clamped_namespaceFn = () => {
return __webpack_require__(319);
};
// MODULE: ./node_modules/core-js/internals/try-to-string.js
var try_to_string_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var $String = String;
module.exports = function (argument) {
try {
return $String(argument);
} catch (error) {
return 'Object';
}
};
});
// MODULE: ./node_modules/core-js/internals/typed-array-constructor.js
var typed_array_constructor_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var $ = (export_namespaceFn());
var globalThis = (global_this_namespaceFn());
var call = (function_call_namespaceFn());
var DESCRIPTORS = (descriptors_namespaceFn());
var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = (typed_array_constructors_require_wrappers_namespaceFn());
var ArrayBufferViewCore = (array_buffer_view_core_namespaceFn());
var ArrayBufferModule = (array_buffer_namespaceFn());
var anInstance = (an_instance_namespaceFn());
var createPropertyDescriptor = (create_property_descriptor_namespaceFn());
var createNonEnumerableProperty = (create_non_enumerable_property_namespaceFn());
var isIntegralNumber = (is_integral_number_namespaceFn());
var toIndex = (to_index_namespaceFn());
var toOffset = (to_offset_namespaceFn());
var toUint8Clamped = (to_uint8_clamped_namespaceFn());
var toPropertyKey = (to_property_key_namespaceFn());
var hasOwn = (has_own_property_namespaceFn());
var classof = (classof_namespaceFn());
var isObject = (is_object_namespaceFn());
var isSymbol = (is_symbol_namespaceFn());
var create = (object_create_namespaceFn());
var isPrototypeOf = (object_is_prototype_of_namespaceFn());
var setPrototypeOf = (object_set_prototype_of_namespaceFn());
var getOwnPropertyNames = (object_get_own_property_names_namespaceFn().f);
var typedArrayFrom = (typed_array_from_namespaceFn());
var forEach = (array_iteration_namespaceFn().forEach);
var setSpecies = (set_species_namespaceFn());
var defineBuiltInAccessor = (define_built_in_accessor_namespaceFn());
var definePropertyModule = (object_define_property_namespaceFn());
var getOwnPropertyDescriptorModule = (object_get_own_property_descriptor_namespaceFn());
var arrayFromConstructorAndList = (array_from_constructor_and_list_namespaceFn());
var InternalStateModule = (internal_state_namespaceFn());
var inheritIfRequired = (inherit_if_required_namespaceFn());
var getInternalState = InternalStateModule.get;
var setInternalState = InternalStateModule.set;
var enforceInternalState = InternalStateModule.enforce;
var nativeDefineProperty = definePropertyModule.f;
var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
var RangeError = globalThis.RangeError;
var ArrayBuffer = ArrayBufferModule.ArrayBuffer;
var ArrayBufferPrototype = ArrayBuffer.prototype;
var DataView = ArrayBufferModule.DataView;
var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;
var TypedArray = ArrayBufferViewCore.TypedArray;
var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;
var isTypedArray = ArrayBufferViewCore.isTypedArray;
var BYTES_PER_ELEMENT = 'BYTES_PER_ELEMENT';
var WRONG_LENGTH = 'Wrong length';
var addGetter = function (it, key) {
defineBuiltInAccessor(it, key, {
configurable: true,
get: function () {
return getInternalState(this)[key];
}
});
};
var isArrayBuffer = function (it) {
var klass;
return isPrototypeOf(ArrayBufferPrototype, it) || (klass = classof(it)) === 'ArrayBuffer' || klass === 'SharedArrayBuffer';
};
var isTypedArrayIndex = function (target, key) {
return isTypedArray(target)
&& !isSymbol(key)
&& key in target
&& isIntegralNumber(+key)
&& key >= 0;
};
var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) {
key = toPropertyKey(key);
return isTypedArrayIndex(target, key)
? createPropertyDescriptor(2, target[key])
: nativeGetOwnPropertyDescriptor(target, key);
};
var wrappedDefineProperty = function defineProperty(target, key, descriptor) {
key = toPropertyKey(key);
if (isTypedArrayIndex(target, key)
&& isObject(descriptor)
&& hasOwn(descriptor, 'value')
&& !hasOwn(descriptor, 'get')
&& !hasOwn(descriptor, 'set')
// TODO: add validation descriptor w/o calling accessors
&& !descriptor.configurable
&& (!hasOwn(descriptor, 'writable') || descriptor.writable)
&& (!hasOwn(descriptor, 'enumerable') || descriptor.enumerable)
) {
target[key] = descriptor.value;
return target;
} return nativeDefineProperty(target, key, descriptor);
};
if (DESCRIPTORS) {
if (!NATIVE_ARRAY_BUFFER_VIEWS) {
getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor;
definePropertyModule.f = wrappedDefineProperty;
addGetter(TypedArrayPrototype, 'buffer');
addGetter(TypedArrayPrototype, 'byteOffset');
addGetter(TypedArrayPrototype, 'byteLength');
addGetter(TypedArrayPrototype, 'length');
}
$({ target: 'Object', stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {
getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,
defineProperty: wrappedDefineProperty
});
module.exports = function (TYPE, wrapper, CLAMPED) {
var BYTES = TYPE.match(/\d+/)[0] / 8;
var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? 'Clamped' : '') + 'Array';
var GETTER = 'get' + TYPE;
var SETTER = 'set' + TYPE;
var NativeTypedArrayConstructor = globalThis[CONSTRUCTOR_NAME];
var TypedArrayConstructor = NativeTypedArrayConstructor;
var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype;
var exported = {};
var getter = function (that, index) {
var data = getInternalState(that);
return data.view[GETTER](index * BYTES + data.byteOffset, true);
};
var setter = function (that, index, value) {
var data = getInternalState(that);
data.view[SETTER](index * BYTES + data.byteOffset, CLAMPED ? toUint8Clamped(value) : value, true);
};
var addElement = function (that, index) {
nativeDefineProperty(that, index, {
get: function () {
return getter(this, index);
},
set: function (value) {
return setter(this, index, value);
},
enumerable: true
});
};
if (!NATIVE_ARRAY_BUFFER_VIEWS) {
TypedArrayConstructor = wrapper(function (that, data, offset, $length) {
anInstance(that, TypedArrayConstructorPrototype);
var index = 0;
var byteOffset = 0;
var buffer, byteLength, length;
if (!isObject(data)) {
length = toIndex(data);
byteLength = length * BYTES;
buffer = new ArrayBuffer(byteLength);
} else if (isArrayBuffer(data)) {
buffer = data;
byteOffset = toOffset(offset, BYTES);
var $len = data.byteLength;
if ($length === undefined) {
if ($len % BYTES) throw new RangeError(WRONG_LENGTH);
byteLength = $len - byteOffset;
if (byteLength < 0) throw new RangeError(WRONG_LENGTH);
} else {
byteLength = toIndex($length) * BYTES;
if (byteLength + byteOffset > $len) throw new RangeError(WRONG_LENGTH);
}
length = byteLength / BYTES;
} else if (isTypedArray(data)) {
return arrayFromConstructorAndList(TypedArrayConstructor, data);
} else {
return call(typedArrayFrom, TypedArrayConstructor, data);
}
setInternalState(that, {
buffer: buffer,
byteOffset: byteOffset,
byteLength: byteLength,
length: length,
view: new DataView(buffer)
});
while (index < length) addElement(that, index++);
});
if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);
TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype);
} else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) {
TypedArrayConstructor = wrapper(function (dummy, data, typedArrayOffset, $length) {
anInstance(dummy, TypedArrayConstructorPrototype);
return inheritIfRequired(function () {
if (!isObject(data)) return new NativeTypedArrayConstructor(toIndex(data));
if (isArrayBuffer(data)) return $length !== undefined
? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length)
: typedArrayOffset !== undefined
? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES))
: new NativeTypedArrayConstructor(data);
if (isTypedArray(data)) return arrayFromConstructorAndList(TypedArrayConstructor, data);
return call(typedArrayFrom, TypedArrayConstructor, data);
}(), dummy, TypedArrayConstructor);
});
if (setPrototypeOf) setPrototypeOf(TypedArrayConstructor, TypedArray);
forEach(getOwnPropertyNames(NativeTypedArrayConstructor), function (key) {
if (!(key in TypedArrayConstructor)) {
createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]);
}
});
TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;
}
if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) {
createNonEnumerableProperty(TypedArrayConstructorPrototype, 'constructor', TypedArrayConstructor);
}
enforceInternalState(TypedArrayConstructorPrototype).TypedArrayConstructor = TypedArrayConstructor;
if (TYPED_ARRAY_TAG) {
createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME);
}
var FORCED = TypedArrayConstructor !== NativeTypedArrayConstructor;
exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;
$({ global: true, constructor: true, forced: FORCED, sham: !NATIVE_ARRAY_BUFFER_VIEWS }, exported);
if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {
createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES);
}
if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {
createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES);
}
setSpecies(CONSTRUCTOR_NAME);
};
} else module.exports = function () { /* empty */ };
});
// MODULE: ./node_modules/core-js/internals/typed-array-constructors-require-wrappers.js
var typed_array_constructors_require_wrappers_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
/* eslint-disable no-new, sonarjs/inconsistent-function-call -- required for testing */
var globalThis = (global_this_namespaceFn());
var fails = (fails_namespaceFn());
var checkCorrectnessOfIteration = (check_correctness_of_iteration_namespaceFn());
var NATIVE_ARRAY_BUFFER_VIEWS = (array_buffer_view_core_namespaceFn().NATIVE_ARRAY_BUFFER_VIEWS);
var ArrayBuffer = globalThis.ArrayBuffer;
var Int8Array = globalThis.Int8Array;
module.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function () {
Int8Array(1);
}) || !fails(function () {
new Int8Array(-1);
}) || !checkCorrectnessOfIteration(function (iterable) {
new Int8Array();
new Int8Array(null);
new Int8Array(1.5);
new Int8Array(iterable);
}, true) || fails(function () {
// Safari (11+) bug - a reason why even Safari 13 should load a typed array polyfill
return new Int8Array(new ArrayBuffer(2), 1, undefined).length !== 1;
});
});
// MODULE: ./node_modules/core-js/internals/typed-array-from.js
var typed_array_from_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var bind = (function_bind_context_namespaceFn());
var call = (function_call_namespaceFn());
var aCallable = (a_callable_namespaceFn());
var aConstructor = (a_constructor_namespaceFn());
var toObject = (to_object_namespaceFn());
var lengthOfArrayLike = (length_of_array_like_namespaceFn());
var getIterator = (get_iterator_internal_namespaceFn());
var getIteratorMethod = (get_iterator_method_internal_namespaceFn());
var isArrayIteratorMethod = (is_array_iterator_method_namespaceFn());
var isBigIntArray = (is_big_int_array_namespaceFn());
var aTypedArrayConstructor = (array_buffer_view_core_namespaceFn().aTypedArrayConstructor);
var toBigInt = (to_big_int_namespaceFn());
module.exports = function from(source /* , mapfn, thisArg */) {
var C = aConstructor(this);
var argumentsLength = arguments.length;
var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
if (mapping) aCallable(mapfn);
var O = toObject(source);
var iteratorMethod = getIteratorMethod(O);
var i, length, result, thisIsBigIntArray, value, step, iterator, next;
if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) {
iterator = getIterator(O, iteratorMethod);
next = iterator.next;
O = [];
while (!(step = call(next, iterator)).done) {
O.push(step.value);
}
}
if (mapping && argumentsLength > 2) {
mapfn = bind(mapfn, arguments[2]);
}
length = lengthOfArrayLike(O);
result = new (aTypedArrayConstructor(C))(length);
thisIsBigIntArray = isBigIntArray(result);
for (i = 0; length > i; i++) {
value = mapping ? mapfn(O[i], i) : O[i];
// FF30- typed arrays doesn't properly convert objects to typed array values
result[i] = thisIsBigIntArray ? toBigInt(value) : +value;
}
return result;
};
});
// MODULE: ./node_modules/core-js/internals/uid.js
var uid_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
var id = 0;
var postfix = Math.random();
var toString = uncurryThis(1.1.toString);
module.exports = function (key) {
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36);
};
});
// MODULE: ./node_modules/core-js/internals/uint8-from-base64.js
var uint8_from_base64_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var anObjectOrUndefined = (an_object_or_undefined_namespaceFn());
var aString = (a_string_namespaceFn());
var hasOwn = (has_own_property_namespaceFn());
var base64Map = (base64_map_namespaceFn());
var getAlphabetOption = (get_alphabet_option_namespaceFn());
var notDetached = (array_buffer_not_detached_namespaceFn());
var base64Alphabet = base64Map.c2i;
var base64UrlAlphabet = base64Map.c2iUrl;
var SyntaxError = globalThis.SyntaxError;
var TypeError = globalThis.TypeError;
var $Array = globalThis.Array;
var at = uncurryThis(''.charAt);
var floor = Math.floor;
var skipAsciiWhitespace = function (string, index) {
var length = string.length;
for (;index < length; index++) {
var chr = at(string, index);
if (chr !== ' ' && chr !== '\t' && chr !== '\n' && chr !== '\f' && chr !== '\r') break;
} return index;
};
var decodeBase64Chunk = function (chunk, alphabet, throwOnExtraBits) {
var chunkLength = chunk.length;
if (chunkLength < 4) {
chunk += chunkLength === 2 ? 'AA' : 'A';
}
var triplet = (alphabet[at(chunk, 0)] << 18)
+ (alphabet[at(chunk, 1)] << 12)
+ (alphabet[at(chunk, 2)] << 6)
+ alphabet[at(chunk, 3)];
var chunkBytes = [
(triplet >> 16) & 255,
(triplet >> 8) & 255,
triplet & 255
];
if (chunkLength === 2) {
if (throwOnExtraBits && chunkBytes[1] !== 0) {
throw new SyntaxError('Extra bits');
}
return [chunkBytes[0]];
}
if (chunkLength === 3) {
if (throwOnExtraBits && chunkBytes[2] !== 0) {
throw new SyntaxError('Extra bits');
}
return [chunkBytes[0], chunkBytes[1]];
}
return chunkBytes;
};
var writeBytes = function (bytes, elements, written) {
var elementsLength = elements.length;
for (var index = 0; index < elementsLength; index++) {
bytes[written + index] = elements[index];
}
return written + elementsLength;
};
/* eslint-disable max-statements, max-depth -- TODO */
module.exports = function (string, options, into, maxLength) {
aString(string);
anObjectOrUndefined(options);
var alphabet = getAlphabetOption(options) === 'base64' ? base64Alphabet : base64UrlAlphabet;
var lastChunkHandling = options ? options.lastChunkHandling : undefined;
if (lastChunkHandling === undefined) lastChunkHandling = 'loose';
if (lastChunkHandling !== 'loose' && lastChunkHandling !== 'strict' && lastChunkHandling !== 'stop-before-partial') {
throw new TypeError('Incorrect `lastChunkHandling` option');
}
if (into) notDetached(into.buffer);
var stringLength = string.length;
var bytes = into || $Array(floor(stringLength * 3 / 4));
var written = 0;
var read = 0;
var chunk = '';
var index = 0;
if (maxLength) while (true) {
index = skipAsciiWhitespace(string, index);
if (index === stringLength) {
if (chunk.length > 0) {
if (lastChunkHandling === 'stop-before-partial') {
break;
}
if (lastChunkHandling === 'loose') {
if (chunk.length === 1) {
throw new SyntaxError('Malformed padding: exactly one additional character');
}
written = writeBytes(bytes, decodeBase64Chunk(chunk, alphabet, false), written);
} else {
throw new SyntaxError('Missing padding');
}
}
read = stringLength;
break;
}
var chr = at(string, index);
++index;
if (chr === '=') {
if (chunk.length < 2) {
throw new SyntaxError('Padding is too early');
}
index = skipAsciiWhitespace(string, index);
if (chunk.length === 2) {
if (index === stringLength) {
if (lastChunkHandling === 'stop-before-partial') {
break;
}
throw new SyntaxError('Malformed padding: only one =');
}
if (at(string, index) === '=') {
++index;
index = skipAsciiWhitespace(string, index);
}
}
if (index < stringLength) {
throw new SyntaxError('Unexpected character after padding');
}
written = writeBytes(bytes, decodeBase64Chunk(chunk, alphabet, lastChunkHandling === 'strict'), written);
read = stringLength;
break;
}
if (!hasOwn(alphabet, chr)) {
throw new SyntaxError('Unexpected character');
}
var remainingBytes = maxLength - written;
if (remainingBytes === 1 && chunk.length === 2 || remainingBytes === 2 && chunk.length === 3) {
// special case: we can fit exactly the number of bytes currently represented by chunk, so we were just checking for `=`
break;
}
chunk += chr;
if (chunk.length === 4) {
written = writeBytes(bytes, decodeBase64Chunk(chunk, alphabet, false), written);
chunk = '';
read = index;
if (written === maxLength) {
break;
}
}
}
if (!into) bytes.length = written;
return { bytes: bytes, read: read, written: written };
};
});
// MODULE: ./node_modules/core-js/internals/uint8-from-hex.js
var uint8_from_hex_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var Uint8Array = globalThis.Uint8Array;
var SyntaxError = globalThis.SyntaxError;
var min = Math.min;
var stringMatch = uncurryThis(''.match);
module.exports = function (string, into) {
var stringLength = string.length;
if (stringLength % 2 !== 0) throw new SyntaxError('String should be an even number of characters');
var maxLength = into ? min(into.length, stringLength / 2) : stringLength / 2;
var bytes = into || new Uint8Array(maxLength);
var segments = stringMatch(string, /[\S\s]{2}/g);
var written = 0;
for (; written < maxLength; written++) {
var result = +('0x' + segments[written] + '0');
// eslint-disable-next-line no-self-compare -- NaN check
if (result !== result) {
throw new SyntaxError('String should only contain hex characters');
}
bytes[written] = result >> 4;
}
return { bytes: bytes, read: written << 1 };
};
});
// MODULE: ./node_modules/core-js/internals/url-constructor-detection.js
var url_constructor_detection_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var fails = (fails_namespaceFn());
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var DESCRIPTORS = (descriptors_namespaceFn());
var IS_PURE = (is_pure_namespaceFn());
var ITERATOR = wellKnownSymbol('iterator');
module.exports = !fails(function () {
// eslint-disable-next-line unicorn/relative-url-style -- required for testing
var url = new URL('b?a=1&b=2&c=3', 'https://a');
var params = url.searchParams;
var params2 = new URLSearchParams('a=1&a=2&b=3');
var result = '';
url.pathname = 'c%20d';
params.forEach(function (value, key) {
params['delete']('b');
result += key + value;
});
params2['delete']('a', 2);
// `undefined` case is a Chromium 117 bug
// https://bugs.chromium.org/p/v8/issues/detail?id=14222
params2['delete']('b', undefined);
return (IS_PURE && (!url.toJSON || !params2.has('a', 1) || params2.has('a', 2) || !params2.has('a', undefined) || params2.has('b')))
|| (!params.size && (IS_PURE || !DESCRIPTORS))
|| !params.sort
|| url.href !== 'https://a/c%20d?a=1&c=3'
|| params.get('c') !== '3'
|| String(new URLSearchParams('?a=1')) !== 'a=1'
|| !params[ITERATOR]
// throws in Edge
|| new URL('https://a@b').username !== 'a'
|| new URLSearchParams(new URLSearchParams('a=b')).get('a') !== 'b'
// not punycoded in Edge
|| new URL('https://тест').host !== 'xn--e1aybc'
// not escaped in Chrome 62-
|| new URL('https://a#б').hash !== '#%D0%B1'
// fails in Chrome 66-
|| result !== 'a1c3'
// throws in Safari
|| new URL('https://x', undefined).host !== 'x';
});
});
// MODULE: ./node_modules/core-js/internals/url-percent-coding.js
var url_percent_coding_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
(es_string_from_code_point_namespaceFn());
var getBuiltIn = (get_built_in_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var fromCharCode = String.fromCharCode;
var fromCodePoint = getBuiltIn('String', 'fromCodePoint');
var $encodeURIComponent = encodeURIComponent;
var $parseInt = parseInt;
var charAt = uncurryThis(''.charAt);
var push = uncurryThis([].push);
var replace = uncurryThis(''.replace);
var stringSlice = uncurryThis(''.slice);
var exec = uncurryThis(/./.exec);
var FALLBACK_REPLACER = '\uFFFD';
var VALID_HEX = /^[0-9a-f]+$/i;
// a surrogate pair is matched first, so a one-unit match is always a lone surrogate
var SURROGATE = /[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDFFF]/g;
var parseHexOctet = function (string, start) {
var substr = stringSlice(string, start, start + 2);
if (!exec(VALID_HEX, substr)) return NaN;
return $parseInt(substr, 16);
};
var getLeadingOnes = function (octet) {
var count = 0;
for (var mask = 0x80; mask > 0 && (octet & mask) !== 0; mask >>= 1) {
count++;
}
return count;
};
var utf8Decode = function (octets) {
var codePoint = null;
var length = octets.length;
switch (length) {
case 1:
codePoint = octets[0];
break;
case 2:
codePoint = (octets[0] & 0x1F) << 6 | (octets[1] & 0x3F);
break;
case 3:
codePoint = (octets[0] & 0x0F) << 12 | (octets[1] & 0x3F) << 6 | (octets[2] & 0x3F);
break;
case 4:
codePoint = (octets[0] & 0x07) << 18 | (octets[1] & 0x3F) << 12 | (octets[2] & 0x3F) << 6 | (octets[3] & 0x3F);
break;
}
// reject surrogates, overlong encodings, and out-of-range codepoints
if (codePoint === null
|| codePoint > 0x10FFFF
|| (codePoint >= 0xD800 && codePoint <= 0xDFFF)
|| codePoint < (length > 3 ? 0x10000 : length > 2 ? 0x800 : length > 1 ? 0x80 : 0)
) return null;
return codePoint;
};
var replaceLoneSurrogate = function (chunk) {
return chunk.length === 2 ? chunk : FALLBACK_REPLACER;
};
// https://url.spec.whatwg.org/#percent-decode
/* eslint-disable max-depth -- ok */
var decode = function (input) {
var length = input.length;
var result = '';
var i = 0;
while (i < length) {
var decodedChar = charAt(input, i);
if (decodedChar === '%') {
if (charAt(input, i + 1) === '%' || i + 3 > length) {
result += '%';
i++;
continue;
}
var octet = parseHexOctet(input, i + 1);
// eslint-disable-next-line no-self-compare -- NaN check
if (octet !== octet) {
result += decodedChar;
i++;
continue;
}
i += 2;
var byteSequenceLength = getLeadingOnes(octet);
if (byteSequenceLength === 0) {
decodedChar = fromCharCode(octet);
} else {
if (byteSequenceLength === 1 || byteSequenceLength > 4) {
result += FALLBACK_REPLACER;
i++;
continue;
}
var octets = [octet];
var sequenceIndex = 1;
while (sequenceIndex < byteSequenceLength) {
i++;
if (i + 3 > length || charAt(input, i) !== '%') break;
var nextByte = parseHexOctet(input, i + 1);
// eslint-disable-next-line no-self-compare -- NaN check
if (nextByte !== nextByte || nextByte > 191 || nextByte < 128) break;
// https://encoding.spec.whatwg.org/#utf-8-decoder - position-specific byte ranges
if (sequenceIndex === 1) {
if (octet === 0xE0 && nextByte < 0xA0) break;
if (octet === 0xED && nextByte > 0x9F) break;
if (octet === 0xF0 && nextByte < 0x90) break;
if (octet === 0xF4 && nextByte > 0x8F) break;
}
push(octets, nextByte);
i += 2;
sequenceIndex++;
}
if (octets.length !== byteSequenceLength) {
result += FALLBACK_REPLACER;
continue;
}
var codePoint = utf8Decode(octets);
if (codePoint === null) {
for (var replacement = 0; replacement < byteSequenceLength; replacement++) result += FALLBACK_REPLACER;
i++;
continue;
} else {
decodedChar = fromCodePoint(codePoint);
}
}
}
result += decodedChar;
i++;
}
return result;
};
/* eslint-enable max-depth -- ok */
// https://url.spec.whatwg.org/#string-percent-encode-after-encoding
// a lone surrogate is the only input `encodeURIComponent` throws on, and the UTF-8
// encoder replaces it - so the throw selects the slow path instead of a per-call scan
var encode = function (input) {
try {
return $encodeURIComponent(input);
} catch (error) {
return $encodeURIComponent(replace(input, SURROGATE, replaceLoneSurrogate));
}
};
module.exports = {
decode: decode,
encode: encode
};
});
// MODULE: ./node_modules/core-js/internals/use-symbol-as-uid.js
var use_symbol_as_uid_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
/* eslint-disable es/no-symbol -- required for testing */
var NATIVE_SYMBOL = (symbol_constructor_detection_namespaceFn());
module.exports = NATIVE_SYMBOL &&
!Symbol.sham &&
typeof Symbol.iterator == 'symbol';
});
// MODULE: ./node_modules/core-js/internals/v8-prototype-define-bug.js
var v8_prototype_define_bug_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var DESCRIPTORS = (descriptors_namespaceFn());
var fails = (fails_namespaceFn());
// V8 ~ Chrome 36-
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
module.exports = DESCRIPTORS && fails(function () {
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
value: 42,
writable: false
}).prototype !== 42;
});
});
// MODULE: ./node_modules/core-js/internals/validate-arguments-length.js
var validate_arguments_length_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var $TypeError = TypeError;
module.exports = function (passed, required) {
if (passed < required) throw new $TypeError('Not enough arguments');
return passed;
};
});
// MODULE: ./node_modules/core-js/internals/weak-map-basic-detection.js
var weak_map_basic_detection_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var WeakMap = globalThis.WeakMap;
module.exports = isCallable(WeakMap) && /native code/.test(String(WeakMap));
});
// MODULE: ./node_modules/core-js/internals/weak-map-helpers.js
var weak_map_helpers_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var uncurryThis = (function_uncurry_this_namespaceFn());
// eslint-disable-next-line es/no-weak-map -- safe
var WeakMapPrototype = WeakMap.prototype;
module.exports = {
// eslint-disable-next-line es/no-weak-map -- safe
WeakMap: WeakMap,
set: uncurryThis(WeakMapPrototype.set),
get: uncurryThis(WeakMapPrototype.get),
has: uncurryThis(WeakMapPrototype.has),
remove: uncurryThis(WeakMapPrototype['delete'])
};
});
// MODULE: ./node_modules/core-js/internals/well-known-symbol.js
var well_known_symbol_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var globalThis = (global_this_namespaceFn());
var shared = (shared_namespaceFn());
var hasOwn = (has_own_property_namespaceFn());
var uid = (uid_namespaceFn());
var NATIVE_SYMBOL = (symbol_constructor_detection_namespaceFn());
var USE_SYMBOL_AS_UID = (use_symbol_as_uid_namespaceFn());
var Symbol = globalThis.Symbol;
var WellKnownSymbolsStore = shared('wks');
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid;
module.exports = function (name) {
if (!hasOwn(WellKnownSymbolsStore, name)) {
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name)
? Symbol[name]
: createWellKnownSymbol('Symbol.' + name);
} return WellKnownSymbolsStore[name];
};
});
// MODULE: ./node_modules/core-js/internals/wrap-error-constructor-with-cause.js
var wrap_error_constructor_with_cause_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var getBuiltIn = (get_built_in_namespaceFn());
var hasOwn = (has_own_property_namespaceFn());
var createNonEnumerableProperty = (create_non_enumerable_property_namespaceFn());
var isPrototypeOf = (object_is_prototype_of_namespaceFn());
var setPrototypeOf = (object_set_prototype_of_namespaceFn());
var copyConstructorProperties = (copy_constructor_properties_namespaceFn());
var proxyAccessor = (proxy_accessor_namespaceFn());
var inheritIfRequired = (inherit_if_required_namespaceFn());
var normalizeStringArgument = (normalize_string_argument_namespaceFn());
var installErrorCause = (install_error_cause_namespaceFn());
var installErrorStack = (error_stack_install_namespaceFn());
var DESCRIPTORS = (descriptors_namespaceFn());
var IS_PURE = (is_pure_namespaceFn());
module.exports = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {
var STACK_TRACE_LIMIT = 'stackTraceLimit';
var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;
var path = FULL_NAME.split('.');
var ERROR_NAME = path[path.length - 1];
var OriginalError = getBuiltIn.apply(null, path);
if (!OriginalError) return;
var OriginalErrorPrototype = OriginalError.prototype;
// V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006
if (!IS_PURE && hasOwn(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;
if (!FORCED) return OriginalError;
var BaseError = getBuiltIn('Error');
var WrappedError = wrapper(function (a, b) {
var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);
var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();
if (message !== undefined) createNonEnumerableProperty(result, 'message', message);
installErrorStack(result, WrappedError, result.stack, 2);
if (this && isPrototypeOf(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);
if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);
return result;
});
WrappedError.prototype = OriginalErrorPrototype;
if (ERROR_NAME !== 'Error') {
if (setPrototypeOf) setPrototypeOf(WrappedError, BaseError);
else copyConstructorProperties(WrappedError, BaseError, { name: true });
} else if (DESCRIPTORS && STACK_TRACE_LIMIT in OriginalError) {
proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);
proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');
}
copyConstructorProperties(WrappedError, OriginalError);
if (!IS_PURE) try {
// Safari 13- bug: WebAssembly errors does not have a proper `.name`
if (OriginalErrorPrototype.name !== ERROR_NAME) {
createNonEnumerableProperty(OriginalErrorPrototype, 'name', ERROR_NAME);
}
OriginalErrorPrototype.constructor = WrappedError;
} catch (error) { /* empty */ }
return WrappedError;
};
});
// MODULE: ./node_modules/core-js/modules/es.array-buffer.detached.js
var es_array_buffer_detached_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var DESCRIPTORS = (descriptors_namespaceFn());
var defineBuiltInAccessor = (define_built_in_accessor_namespaceFn());
var isDetached = (array_buffer_is_detached_namespaceFn());
var ArrayBufferPrototype = ArrayBuffer.prototype;
// `ArrayBuffer.prototype.detached` getter
// https://tc39.es/ecma262/#sec-get-arraybuffer.prototype.detached
if (DESCRIPTORS && !('detached' in ArrayBufferPrototype)) {
defineBuiltInAccessor(ArrayBufferPrototype, 'detached', {
configurable: true,
get: function detached() {
return isDetached(this);
}
});
}
});
// MODULE: ./node_modules/core-js/modules/es.array-buffer.transfer-to-fixed-length.js
var es_array_buffer_transfer_to_fixed_length_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var $transfer = (array_buffer_transfer_namespaceFn());
// `ArrayBuffer.prototype.transferToFixedLength` method
// https://tc39.es/ecma262/#sec-arraybuffer.prototype.transfertofixedlength
if ($transfer) $({ target: 'ArrayBuffer', proto: true }, {
transferToFixedLength: function transferToFixedLength() {
return $transfer(this, arguments.length ? arguments[0] : undefined, false);
}
});
});
// MODULE: ./node_modules/core-js/modules/es.array-buffer.transfer.js
var es_array_buffer_transfer_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var $transfer = (array_buffer_transfer_namespaceFn());
// `ArrayBuffer.prototype.transfer` method
// https://tc39.es/ecma262/#sec-arraybuffer.prototype.transfer
if ($transfer) $({ target: 'ArrayBuffer', proto: true }, {
transfer: function transfer() {
return $transfer(this, arguments.length ? arguments[0] : undefined, true);
}
});
});
// MODULE: ./node_modules/core-js/modules/es.array.at.js
var es_array_at_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var toObject = (to_object_namespaceFn());
var lengthOfArrayLike = (length_of_array_like_namespaceFn());
var toIntegerOrInfinity = (to_integer_or_infinity_namespaceFn());
var addToUnscopables = (add_to_unscopables_namespaceFn());
// `Array.prototype.at` method
// https://tc39.es/ecma262/#sec-array.prototype.at
$({ target: 'Array', proto: true }, {
at: function at(index) {
var O = toObject(this);
var len = lengthOfArrayLike(O);
var relativeIndex = toIntegerOrInfinity(index);
var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
return (k < 0 || k >= len) ? undefined : O[k];
}
});
addToUnscopables('at');
});
// MODULE: ./node_modules/core-js/modules/es.array.includes.js
var es_array_includes_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var $includes = (array_includes_namespaceFn().includes);
var fails = (fails_namespaceFn());
var addToUnscopables = (add_to_unscopables_namespaceFn());
// FF99+ bug
var BROKEN_ON_SPARSE = fails(function () {
// eslint-disable-next-line es/no-array-prototype-includes -- detection
return !Array(1).includes();
});
// Safari 26.4- bug
var BROKEN_ON_SPARSE_WITH_FROM_INDEX = fails(function () {
// eslint-disable-next-line no-sparse-arrays, es/no-array-prototype-includes -- detection
return [, 1].includes(undefined, 1);
});
// `Array.prototype.includes` method
// https://tc39.es/ecma262/#sec-array.prototype.includes
$({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE || BROKEN_ON_SPARSE_WITH_FROM_INDEX }, {
includes: function includes(el /* , fromIndex = 0 */) {
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
}
});
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables('includes');
});
// MODULE: ./node_modules/core-js/modules/es.array.iterator.js
var es_array_iterator_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
var toIndexedObject = (to_indexed_object_namespaceFn());
var addToUnscopables = (add_to_unscopables_namespaceFn());
var Iterators = (iterators_namespaceFn());
var InternalStateModule = (internal_state_namespaceFn());
var defineProperty = (object_define_property_namespaceFn().f);
var defineIterator = (iterator_define_namespaceFn());
var createIterResultObject = (create_iter_result_object_namespaceFn());
var IS_PURE = (is_pure_namespaceFn());
var DESCRIPTORS = (descriptors_namespaceFn());
var ARRAY_ITERATOR = 'Array Iterator';
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
// `Array.prototype.entries` method
// https://tc39.es/ecma262/#sec-array.prototype.entries
// `Array.prototype.keys` method
// https://tc39.es/ecma262/#sec-array.prototype.keys
// `Array.prototype.values` method
// https://tc39.es/ecma262/#sec-array.prototype.values
// `Array.prototype[@@iterator]` method
// https://tc39.es/ecma262/#sec-array.prototype-@@iterator
// `CreateArrayIterator` internal method
// https://tc39.es/ecma262/#sec-createarrayiterator
module.exports = defineIterator(Array, 'Array', function (iterated, kind) {
setInternalState(this, {
type: ARRAY_ITERATOR,
target: toIndexedObject(iterated), // target
index: 0, // next index
kind: kind // kind
});
// `%ArrayIteratorPrototype%.next` method
// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
}, function () {
var state = getInternalState(this);
var target = state.target;
var index = state.index++;
if (!target || index >= target.length) {
state.target = null;
return createIterResultObject(undefined, true);
}
switch (state.kind) {
case 'keys': return createIterResultObject(index, false);
case 'values': return createIterResultObject(target[index], false);
} return createIterResultObject([index, target[index]], false);
}, 'values');
// argumentsList[@@iterator] is %ArrayProto_values%
// https://tc39.es/ecma262/#sec-createunmappedargumentsobject
// https://tc39.es/ecma262/#sec-createmappedargumentsobject
var values = Iterators.Arguments = Iterators.Array;
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables('keys');
addToUnscopables('values');
addToUnscopables('entries');
// V8 ~ Chrome 45- bug
if (!IS_PURE && DESCRIPTORS && values.name !== 'values') try {
defineProperty(values, 'name', { value: 'values' });
} catch (error) { /* empty */ }
});
// MODULE: ./node_modules/core-js/modules/es.array.push.js
var es_array_push_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var toObject = (to_object_namespaceFn());
var lengthOfArrayLike = (length_of_array_like_namespaceFn());
var setArrayLength = (array_set_length_namespaceFn());
var doesNotExceedSafeInteger = (does_not_exceed_safe_integer_namespaceFn());
var fails = (fails_namespaceFn());
var INCORRECT_TO_LENGTH = fails(function () {
return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
});
// V8 <= 121 and Safari <= 15.4; FF < 23 throws InternalError
// https://bugs.chromium.org/p/v8/issues/detail?id=12681
var properErrorOnNonWritableLength = function () {
try {
// eslint-disable-next-line es/no-object-defineproperty -- safe
Object.defineProperty([], 'length', { writable: false }).push();
} catch (error) {
return error instanceof TypeError;
}
};
var FORCED = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
// `Array.prototype.push` method
// https://tc39.es/ecma262/#sec-array.prototype.push
$({ target: 'Array', proto: true, arity: 1, forced: FORCED }, {
// eslint-disable-next-line no-unused-vars -- required for `.length`
push: function push(item) {
var O = toObject(this);
var len = lengthOfArrayLike(O);
var argCount = arguments.length;
doesNotExceedSafeInteger(len + argCount);
for (var i = 0; i < argCount; i++) {
O[len] = arguments[i];
len++;
}
setArrayLength(O, len);
return len;
}
});
});
// MODULE: ./node_modules/core-js/modules/es.error.cause.js
var es_error_cause_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
/* eslint-disable no-unused-vars -- required for functions `.length` */
var $ = (export_namespaceFn());
var globalThis = (global_this_namespaceFn());
var apply = (function_apply_namespaceFn());
var wrapErrorConstructorWithCause = (wrap_error_constructor_with_cause_namespaceFn());
var WEB_ASSEMBLY = 'WebAssembly';
var WebAssembly = globalThis[WEB_ASSEMBLY];
// eslint-disable-next-line es/no-error-cause -- feature detection
var FORCED = new Error('e', { cause: 7 }).cause !== 7;
var exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {
var O = {};
// eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED);
$({ global: true, constructor: true, arity: 1, forced: FORCED }, O);
};
var exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {
if (WebAssembly && WebAssembly[ERROR_NAME]) {
var O = {};
// eslint-disable-next-line unicorn/no-immediate-mutation -- ES3 syntax limitation
O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED);
$({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O);
}
};
// https://tc39.es/ecma262/#sec-nativeerror
exportGlobalErrorCauseWrapper('Error', function (init) {
return function Error(message) { return apply(init, this, arguments); };
});
exportGlobalErrorCauseWrapper('EvalError', function (init) {
return function EvalError(message) { return apply(init, this, arguments); };
});
exportGlobalErrorCauseWrapper('RangeError', function (init) {
return function RangeError(message) { return apply(init, this, arguments); };
});
exportGlobalErrorCauseWrapper('ReferenceError', function (init) {
return function ReferenceError(message) { return apply(init, this, arguments); };
});
exportGlobalErrorCauseWrapper('SyntaxError', function (init) {
return function SyntaxError(message) { return apply(init, this, arguments); };
});
exportGlobalErrorCauseWrapper('TypeError', function (init) {
return function TypeError(message) { return apply(init, this, arguments); };
});
exportGlobalErrorCauseWrapper('URIError', function (init) {
return function URIError(message) { return apply(init, this, arguments); };
});
exportWebAssemblyErrorCauseWrapper('CompileError', function (init) {
return function CompileError(message) { return apply(init, this, arguments); };
});
exportWebAssemblyErrorCauseWrapper('LinkError', function (init) {
return function LinkError(message) { return apply(init, this, arguments); };
});
exportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {
return function RuntimeError(message) { return apply(init, this, arguments); };
});
});
// MODULE: ./node_modules/core-js/modules/es.iterator.constructor.js
var es_iterator_constructor_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var globalThis = (global_this_namespaceFn());
var anInstance = (an_instance_namespaceFn());
var anObject = (an_object_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var getPrototypeOf = (object_get_prototype_of_namespaceFn());
var defineBuiltInAccessor = (define_built_in_accessor_namespaceFn());
var createProperty = (create_property_namespaceFn());
var fails = (fails_namespaceFn());
var hasOwn = (has_own_property_namespaceFn());
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var IteratorPrototype = (iterators_core_namespaceFn().IteratorPrototype);
var DESCRIPTORS = (descriptors_namespaceFn());
var IS_PURE = (is_pure_namespaceFn());
var CONSTRUCTOR = 'constructor';
var ITERATOR = 'Iterator';
var TO_STRING_TAG = wellKnownSymbol('toStringTag');
var $TypeError = TypeError;
var NativeIterator = globalThis[ITERATOR];
// FF56- have non-standard global helper `Iterator`
var FORCED = IS_PURE
|| !isCallable(NativeIterator)
|| NativeIterator.prototype !== IteratorPrototype
// FF44- non-standard `Iterator` passes previous tests
|| !fails(function () { NativeIterator({}); });
var IteratorConstructor = function Iterator() {
anInstance(this, IteratorPrototype);
if (getPrototypeOf(this) === IteratorPrototype) throw new $TypeError('Abstract class Iterator not directly constructable');
};
var defineIteratorPrototypeAccessor = function (key, value) {
if (DESCRIPTORS) {
defineBuiltInAccessor(IteratorPrototype, key, {
configurable: true,
get: function () {
return value;
},
set: function (replacement) {
anObject(this);
if (this === IteratorPrototype) throw new $TypeError("You can't redefine this property");
if (hasOwn(this, key)) this[key] = replacement;
else createProperty(this, key, replacement);
}
});
} else IteratorPrototype[key] = value;
};
if (!hasOwn(IteratorPrototype, TO_STRING_TAG)) defineIteratorPrototypeAccessor(TO_STRING_TAG, ITERATOR);
if (FORCED || !hasOwn(IteratorPrototype, CONSTRUCTOR) || IteratorPrototype[CONSTRUCTOR] === Object) {
defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor);
}
IteratorConstructor.prototype = IteratorPrototype;
// `Iterator` constructor
// https://tc39.es/ecma262/#sec-iterator
$({ global: true, constructor: true, forced: FORCED }, {
Iterator: IteratorConstructor
});
});
// MODULE: ./node_modules/core-js/modules/es.iterator.filter.js
var es_iterator_filter_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var call = (function_call_namespaceFn());
var aCallable = (a_callable_namespaceFn());
var anObject = (an_object_namespaceFn());
var getIteratorDirect = (get_iterator_direct_namespaceFn());
var createIteratorProxy = (iterator_create_proxy_namespaceFn());
var callWithSafeIterationClosing = (call_with_safe_iteration_closing_namespaceFn());
var IS_PURE = (is_pure_namespaceFn());
var iteratorClose = (iterator_close_namespaceFn());
var iteratorHelperThrowsOnInvalidIterator = (iterator_helper_throws_on_invalid_iterator_namespaceFn());
var iteratorHelperWithoutClosingOnEarlyError = (iterator_helper_without_closing_on_early_error_namespaceFn());
var FILTER_WITHOUT_THROWING_ON_INVALID_ITERATOR = !IS_PURE && !iteratorHelperThrowsOnInvalidIterator('filter', function () { /* empty */ });
var filterWithoutClosingOnEarlyError = !IS_PURE && !FILTER_WITHOUT_THROWING_ON_INVALID_ITERATOR
&& iteratorHelperWithoutClosingOnEarlyError('filter', TypeError);
var FORCED = IS_PURE || FILTER_WITHOUT_THROWING_ON_INVALID_ITERATOR || filterWithoutClosingOnEarlyError;
var IteratorProxy = createIteratorProxy(function () {
var iterator = this.iterator;
var predicate = this.predicate;
var next = this.next;
var result, done, value;
while (true) {
result = anObject(call(next, iterator));
done = this.done = !!result.done;
if (done) return;
value = result.value;
if (callWithSafeIterationClosing(iterator, predicate, [value, this.counter++], true)) return value;
}
});
// `Iterator.prototype.filter` method
// https://tc39.es/ecma262/#sec-iterator.prototype.filter
$({ target: 'Iterator', proto: true, real: true, forced: FORCED }, {
filter: function filter(predicate) {
anObject(this);
try {
aCallable(predicate);
} catch (error) {
iteratorClose(this, 'throw', error);
}
if (filterWithoutClosingOnEarlyError) return call(filterWithoutClosingOnEarlyError, this, predicate);
return new IteratorProxy(getIteratorDirect(this), {
predicate: predicate
});
}
});
});
// MODULE: ./node_modules/core-js/modules/es.iterator.for-each.js
var es_iterator_for_each_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var call = (function_call_namespaceFn());
var iterate = (iterate_namespaceFn());
var aCallable = (a_callable_namespaceFn());
var anObject = (an_object_namespaceFn());
var getIteratorDirect = (get_iterator_direct_namespaceFn());
var iteratorClose = (iterator_close_namespaceFn());
var iteratorHelperWithoutClosingOnEarlyError = (iterator_helper_without_closing_on_early_error_namespaceFn());
var forEachWithoutClosingOnEarlyError = iteratorHelperWithoutClosingOnEarlyError('forEach', TypeError);
// `Iterator.prototype.forEach` method
// https://tc39.es/ecma262/#sec-iterator.prototype.foreach
$({ target: 'Iterator', proto: true, real: true, forced: forEachWithoutClosingOnEarlyError }, {
forEach: function forEach(fn) {
anObject(this);
try {
aCallable(fn);
} catch (error) {
iteratorClose(this, 'throw', error);
}
if (forEachWithoutClosingOnEarlyError) return call(forEachWithoutClosingOnEarlyError, this, fn);
var record = getIteratorDirect(this);
var counter = 0;
iterate(record, function (value) {
fn(value, counter++);
}, { IS_RECORD: true });
}
});
});
// MODULE: ./node_modules/core-js/modules/es.iterator.map.js
var es_iterator_map_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var call = (function_call_namespaceFn());
var aCallable = (a_callable_namespaceFn());
var anObject = (an_object_namespaceFn());
var getIteratorDirect = (get_iterator_direct_namespaceFn());
var createIteratorProxy = (iterator_create_proxy_namespaceFn());
var callWithSafeIterationClosing = (call_with_safe_iteration_closing_namespaceFn());
var iteratorClose = (iterator_close_namespaceFn());
var iteratorHelperThrowsOnInvalidIterator = (iterator_helper_throws_on_invalid_iterator_namespaceFn());
var iteratorHelperWithoutClosingOnEarlyError = (iterator_helper_without_closing_on_early_error_namespaceFn());
var IS_PURE = (is_pure_namespaceFn());
var MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR = !IS_PURE && !iteratorHelperThrowsOnInvalidIterator('map', function () { /* empty */ });
var mapWithoutClosingOnEarlyError = !IS_PURE && !MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR
&& iteratorHelperWithoutClosingOnEarlyError('map', TypeError);
var FORCED = IS_PURE || MAP_WITHOUT_THROWING_ON_INVALID_ITERATOR || mapWithoutClosingOnEarlyError;
var IteratorProxy = createIteratorProxy(function () {
var iterator = this.iterator;
var result = anObject(call(this.next, iterator));
var done = this.done = !!result.done;
if (!done) return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true);
});
// `Iterator.prototype.map` method
// https://tc39.es/ecma262/#sec-iterator.prototype.map
$({ target: 'Iterator', proto: true, real: true, forced: FORCED }, {
map: function map(mapper) {
anObject(this);
try {
aCallable(mapper);
} catch (error) {
iteratorClose(this, 'throw', error);
}
if (mapWithoutClosingOnEarlyError) return call(mapWithoutClosingOnEarlyError, this, mapper);
return new IteratorProxy(getIteratorDirect(this), {
mapper: mapper
});
}
});
});
// MODULE: ./node_modules/core-js/modules/es.iterator.take.js
var es_iterator_take_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var call = (function_call_namespaceFn());
var anObject = (an_object_namespaceFn());
var getIteratorDirect = (get_iterator_direct_namespaceFn());
var notANaN = (not_a_nan_namespaceFn());
var toPositiveInteger = (to_positive_integer_namespaceFn());
var createIteratorProxy = (iterator_create_proxy_namespaceFn());
var iteratorClose = (iterator_close_namespaceFn());
var iteratorHelperThrowsOnInvalidIterator = (iterator_helper_throws_on_invalid_iterator_namespaceFn());
var iteratorHelperWithoutClosingOnEarlyError = (iterator_helper_without_closing_on_early_error_namespaceFn());
var IS_PURE = (is_pure_namespaceFn());
var $RangeError = RangeError;
var $Infinity = Infinity;
var TAKE_WITHOUT_THROWING_ON_INVALID_ITERATOR = !IS_PURE && !iteratorHelperThrowsOnInvalidIterator('take', 1);
var takeWithoutClosingOnEarlyError = !IS_PURE && !TAKE_WITHOUT_THROWING_ON_INVALID_ITERATOR
&& iteratorHelperWithoutClosingOnEarlyError('take', RangeError);
var FORCED = IS_PURE || TAKE_WITHOUT_THROWING_ON_INVALID_ITERATOR || takeWithoutClosingOnEarlyError || !function () {
try {
// eslint-disable-next-line es/no-iterator, es/no-iterator-prototype-take -- detection
Iterator.prototype.take.call({
next: function () { return { done: true }; }
}, 0x20000000000000);
} catch (error) {
return error instanceof $RangeError;
}
}();
var IteratorProxy = createIteratorProxy(function () {
var iterator = this.iterator;
if (!this.remaining--) {
this.done = true;
return iteratorClose(iterator, 'normal', undefined);
}
var result = anObject(call(this.next, iterator));
var done = this.done = !!result.done;
if (!done) return result.value;
});
// `Iterator.prototype.take` method
// https://tc39.es/ecma262/#sec-iterator.prototype.take
$({ target: 'Iterator', proto: true, real: true, forced: FORCED }, {
take: function take(limit) {
anObject(this);
var remaining;
try {
remaining = toPositiveInteger(notANaN(+limit));
if (remaining > 0x1FFFFFFFFFFFFF && remaining !== $Infinity) {
throw new $RangeError('The argument should be a safe integer');
}
} catch (error) {
iteratorClose(this, 'throw', error);
}
if (takeWithoutClosingOnEarlyError) return call(takeWithoutClosingOnEarlyError, this, remaining);
return new IteratorProxy(getIteratorDirect(this), {
remaining: remaining
});
}
});
});
// MODULE: ./node_modules/core-js/modules/es.json.stringify.js
var es_json_stringify_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var getBuiltIn = (get_built_in_namespaceFn());
var call = (function_call_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var fails = (fails_namespaceFn());
var isArray = (is_array_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var isObject = (is_object_namespaceFn());
var create = (object_create_namespaceFn());
var isRawJSON = (is_raw_json_namespaceFn());
var isSymbol = (is_symbol_namespaceFn());
var classof = (classof_raw_namespaceFn());
var thisNumberValue = (this_number_value_namespaceFn());
var includes = (array_includes_namespaceFn().includes);
var hasOwn = (has_own_property_namespaceFn());
var toString = (to_string_namespaceFn());
var parseJSONString = (parse_json_string_namespaceFn());
var uid = (uid_namespaceFn());
var NATIVE_SYMBOL = (symbol_constructor_detection_namespaceFn());
var NATIVE_RAW_JSON = (native_raw_json_namespaceFn());
var $String = String;
var $TypeError = TypeError;
var $stringify = getBuiltIn('JSON', 'stringify');
var $BigInt = getBuiltIn('BigInt');
var stringValueOf = uncurryThis(''.valueOf);
var booleanValueOf = uncurryThis(true.valueOf);
var bigIntValueOf = $BigInt && uncurryThis($BigInt.prototype.valueOf);
var exec = uncurryThis(/./.exec);
var charAt = uncurryThis(''.charAt);
var charCodeAt = uncurryThis(''.charCodeAt);
var replace = uncurryThis(''.replace);
var slice = uncurryThis(''.slice);
var push = uncurryThis([].push);
var pop = uncurryThis([].pop);
var numberToString = uncurryThis(1.1.toString);
var surrogates = /[\uD800-\uDFFF]/g;
var leadingSurrogates = /^[\uD800-\uDBFF]$/;
var trailingSurrogates = /^[\uDC00-\uDFFF]$/;
var digits = /^\d+$/;
// a placeholder of a raw JSON value
var RAW_MARK = uid();
// a prefix of keys of a reordered object, see `createOrderedObject`
var KEY_MARK = uid();
// the last key of a reordered object, marks the end of its serialization
var END_MARK = uid();
var RAW_MARK_LENGTH = RAW_MARK.length;
var KEY_MARK_LENGTH = KEY_MARK.length;
var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function () {
var symbol = getBuiltIn('Symbol')('stringify detection');
// MS Edge converts symbol values to JSON as {}
return $stringify([symbol]) !== '[null]'
// WebKit converts symbol values to JSON as null
|| $stringify({ a: symbol }) !== '{}'
// V8 throws on boxed symbols
|| $stringify(Object(symbol)) !== '{}';
});
// https://github.com/tc39/proposal-well-formed-stringify
var ILL_FORMED_UNICODE = fails(function () {
return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
|| $stringify('\uDEAD') !== '"\\udead"';
});
var isRawJSONValue = NATIVE_RAW_JSON ? getBuiltIn('JSON', 'isRawJSON') : isRawJSON;
var stringifyWithProperSymbolsConversion = WRONG_SYMBOLS_CONVERSION ? function (it, replacer, space) {
return $stringify(it, function (key, value) {
var replaced = call(replacer, this, key, value);
if (!isSymbol(replaced)) return replaced;
}, space);
} : $stringify;
var fixIllFormedJSON = function (match, offset, string) {
var prev = charAt(string, offset - 1);
var next = charAt(string, offset + 1);
if (
(exec(leadingSurrogates, match) && !exec(trailingSurrogates, next)) ||
(exec(trailingSurrogates, match) && !exec(leadingSurrogates, prev))
) {
return '\\u' + numberToString(charCodeAt(match, 0), 16);
} return match;
};
// `PropertyList` of `JSON.stringify`
// https://tc39.es/ecma262/#sec-json.stringify
var getPropertyList = function (replacer) {
if (!isArray(replacer)) return;
var rawLength = replacer.length;
var propertyList = [];
// a null prototype object is used as a set of already added keys to keep the deduplication linear
var addedKeys = create(null);
for (var i = 0; i < rawLength; i++) {
var element = replacer[i];
var key;
if (typeof element == 'string') key = element;
else if (typeof element == 'number' || classof(element) === 'Number' || classof(element) === 'String') key = toString(element);
else continue;
if (!hasOwn(addedKeys, key)) {
addedKeys[key] = true;
push(propertyList, key);
}
}
return propertyList;
};
// values with such an internal slot are unwrapped by `SerializeJSONProperty` instead of being serialized as objects
var hasInternalSlot = function (valueOf, it) {
try {
valueOf(it);
return true;
} catch (error) {
return false;
}
};
// the slot check is expensive, so it's performed only for the kind reported by the value itself -
// a value lying about its kind via `Symbol.toStringTag` is serialized as an ordinary object
var isBoxedPrimitive = function (it) {
var kind = classof(it);
return (kind === 'Number' && hasInternalSlot(thisNumberValue, it))
|| (kind === 'String' && hasInternalSlot(stringValueOf, it))
|| (kind === 'Boolean' && hasInternalSlot(booleanValueOf, it))
|| (!!bigIntValueOf && kind === 'BigInt' && hasInternalSlot(bigIntValueOf, it));
};
// only objects serialized by `SerializeJSONObject` are affected by the property list
var isSerializedAsObject = function (it) {
if (!isObject(it) || isCallable(it) || isArray(it)) return false;
try {
return !isBoxedPrimitive(it);
// `classof` reads `Symbol.toStringTag`, so a proxy could throw - it has no internal slots anyway
} catch (error) {
return true;
}
};
// the engine unwraps it in the same order as it would read the original property,
// so the property is read lazily and `toJSON` is called once and with the original key
var createElementHolder = function (holder, key) {
return {
toJSON: function () {
var element = holder[key];
if (isObject(element) || typeof element == 'bigint') {
var elementToJSON = element.toJSON;
if (isCallable(elementToJSON)) element = call(elementToJSON, element, key);
} return element;
}
};
};
// own keys of objects are sorted - integer-like keys are moved to the beginning,
// so such keys should be marked and restored in the serialized string
var getKeyPrefix = function (propertyList) {
for (var i = 0, length = propertyList.length; i < length; i++) {
if (exec(digits, propertyList[i])) return KEY_MARK;
} return '';
};
// `SerializeJSONObject` iterates the property list, so the value is replaced with an object with keys in this order
var createOrderedObject = function (value, propertyList, keyPrefix) {
// keys are not marked if the property list has no integer-like keys, so `Object.prototype`
// with a setter, a non-writable property or `__proto__` should not intercept the assignment
var ordered = create(null);
for (var i = 0, length = propertyList.length; i < length; i++) {
var key = propertyList[i];
ordered[keyPrefix + key] = createElementHolder(value, key);
}
ordered[END_MARK] = null;
return ordered;
};
// `JSON.stringify` method
// https://tc39.es/ecma262/#sec-json.stringify
// https://github.com/tc39/proposal-json-parse-with-source
if ($stringify) $({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE || !NATIVE_RAW_JSON }, {
stringify: function stringify(text, replacer, space) {
var replacerFunction = isCallable(replacer) ? replacer : undefined;
var propertyList = replacerFunction ? undefined : getPropertyList(replacer);
var keyPrefix = propertyList && getKeyPrefix(propertyList);
var rawStrings = [];
var openObjects = [];
var parentOrdered = [];
var currentOrdered;
var marked = false;
var root = true;
var json = stringifyWithProperSymbolsConversion(text, function (key, value) {
// some old implementations (like WebKit) could pass numbers as keys
key = $String(key);
if (propertyList) {
if (key === END_MARK) {
pop(openObjects);
currentOrdered = pop(parentOrdered);
return;
}
if (root) root = false;
// the innermost reordered object already contains only keys of the property list and arrays are not
// affected by it, the rest of objects (like objects with a fake `Symbol.toStringTag`) are filtered here
else if (this !== currentOrdered && !isArray(this) && !includes(propertyList, key)) return;
} else if (replacerFunction) value = call(replacerFunction, this, key, value);
if (isRawJSONValue(value)) {
if (NATIVE_RAW_JSON) return value;
marked = true;
return RAW_MARK + (push(rawStrings, value.rawJSON) - 1);
}
if (propertyList && isSerializedAsObject(value)) {
// reordered objects are new each time, so cycles should be detected before the engine does it
if (includes(openObjects, value)) throw new $TypeError('Converting circular structure to JSON');
var ordered = createOrderedObject(value, propertyList, keyPrefix);
push(openObjects, value);
push(parentOrdered, currentOrdered);
currentOrdered = ordered;
if (keyPrefix) marked = true;
return ordered;
}
return value;
}, space);
if (typeof json != 'string') return json;
if (ILL_FORMED_UNICODE) json = replace(json, surrogates, fixIllFormedJSON);
if (!marked) return json;
var result = '';
var length = json.length;
for (var i = 0; i < length; i++) {
var chr = charAt(json, i);
if (chr === '"') {
var end = parseJSONString(json, ++i).end - 1;
var string = slice(json, i, end);
if (slice(string, 0, RAW_MARK_LENGTH) === RAW_MARK) result += rawStrings[slice(string, RAW_MARK_LENGTH)];
else if (slice(string, 0, KEY_MARK_LENGTH) === KEY_MARK) result += '"' + slice(string, KEY_MARK_LENGTH) + '"';
else result += '"' + string + '"';
i = end;
} else result += chr;
}
return result;
}
});
});
// MODULE: ./node_modules/core-js/modules/es.map.get-or-insert-computed.js
var es_map_get_or_insert_computed_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var aCallable = (a_callable_namespaceFn());
var MapHelpers = (map_helpers_namespaceFn());
var IS_PURE = (is_pure_namespaceFn());
var get = MapHelpers.get;
var has = MapHelpers.has;
var set = MapHelpers.set;
// `Map.prototype.getOrInsertComputed` method
// https://tc39.es/ecma262/#sec-map.prototype.getorinsertcomputed
$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {
getOrInsertComputed: function getOrInsertComputed(key, callbackfn) {
var hasKey = has(this, key);
aCallable(callbackfn);
if (hasKey) return get(this, key);
// CanonicalizeKeyedCollectionKey
if (key === 0 && 1 / key === -Infinity) key = 0;
var value = callbackfn(key);
set(this, key, value);
return value;
}
});
});
// MODULE: ./node_modules/core-js/modules/es.map.get-or-insert.js
var es_map_get_or_insert_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var MapHelpers = (map_helpers_namespaceFn());
var IS_PURE = (is_pure_namespaceFn());
var get = MapHelpers.get;
var has = MapHelpers.has;
var set = MapHelpers.set;
// `Map.prototype.getOrInsert` method
// https://tc39.es/ecma262/#sec-map.prototype.getorinsert
$({ target: 'Map', proto: true, real: true, forced: IS_PURE }, {
getOrInsert: function getOrInsert(key, value) {
if (has(this, key)) return get(this, key);
set(this, key, value);
return value;
}
});
});
// MODULE: ./node_modules/core-js/modules/es.promise.try.js
var es_promise_try_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var globalThis = (global_this_namespaceFn());
var apply = (function_apply_namespaceFn());
var slice = (array_slice_namespaceFn());
var promiseResolve = (promise_resolve_namespaceFn());
var newPromiseCapabilityModule = (new_promise_capability_namespaceFn());
var aCallable = (a_callable_namespaceFn());
var perform = (perform_namespaceFn());
var fails = (fails_namespaceFn());
var Promise = globalThis.Promise;
var ACCEPT_ARGUMENTS = false;
var FORCED = !Promise || !Promise['try'] || fails(function () {
var p = Promise.resolve();
return Promise['try'](function (argument) {
// avoiding the use of polyfills of the previous iteration of this proposal
// that does not accept arguments of the callback
ACCEPT_ARGUMENTS = argument === 8;
return p;
// it should use `PromiseResolve`
// https://github.com/tc39/ecma262/pull/3883
}, 8) !== p;
}) || !ACCEPT_ARGUMENTS;
// `Promise.try` method
// https://tc39.es/ecma262/#sec-promise.try
$({ target: 'Promise', stat: true, forced: FORCED }, {
'try': function (callbackfn /* , ...args */) {
var args = arguments.length > 1 ? slice(arguments, 1) : [];
var result = perform(function () {
return apply(aCallable(callbackfn), undefined, args);
});
if (!result.error) return promiseResolve(this, result.value);
var promiseCapability = newPromiseCapabilityModule.f(this);
var reject = promiseCapability.reject;
reject(result.value);
return promiseCapability.promise;
}
});
});
// MODULE: ./node_modules/core-js/modules/es.promise.with-resolvers.js
var es_promise_with_resolvers_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var newPromiseCapabilityModule = (new_promise_capability_namespaceFn());
// `Promise.withResolvers` method
// https://tc39.es/ecma262/#sec-promise.withResolvers
$({ target: 'Promise', stat: true }, {
withResolvers: function withResolvers() {
var promiseCapability = newPromiseCapabilityModule.f(this);
return {
promise: promiseCapability.promise,
resolve: promiseCapability.resolve,
reject: promiseCapability.reject
};
}
});
});
// MODULE: ./node_modules/core-js/modules/es.regexp.exec.js
var es_regexp_exec_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var exec = (regexp_exec_namespaceFn());
// `RegExp.prototype.exec` method
// https://tc39.es/ecma262/#sec-regexp.prototype.exec
$({ target: 'RegExp', proto: true, forced: /./.exec !== exec }, {
exec: exec
});
});
// MODULE: ./node_modules/core-js/modules/es.set.difference.v2.js
var es_set_difference_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var difference = (set_difference_namespaceFn());
var fails = (fails_namespaceFn());
var setMethodAcceptSetLike = (set_method_accept_set_like_namespaceFn());
var SET_LIKE_INCORRECT_BEHAVIOR = !setMethodAcceptSetLike('difference', function (result) {
return result.size === 0;
});
var FORCED = SET_LIKE_INCORRECT_BEHAVIOR || fails(function () {
// https://bugs.webkit.org/show_bug.cgi?id=288595
var setLike = {
size: 1,
has: function () { return true; },
keys: function () {
var index = 0;
return {
next: function () {
var done = index++ > 1;
if (baseSet.has(1)) baseSet.clear();
return { done: done, value: 2 };
}
};
}
};
// eslint-disable-next-line es/no-set -- testing
var baseSet = new Set([1, 2, 3, 4]);
// eslint-disable-next-line es/no-set-prototype-difference -- testing
return baseSet.difference(setLike).size !== 3;
});
// `Set.prototype.difference` method
// https://tc39.es/ecma262/#sec-set.prototype.difference
$({ target: 'Set', proto: true, real: true, forced: FORCED }, {
difference: difference
});
});
// MODULE: ./node_modules/core-js/modules/es.set.intersection.v2.js
var es_set_intersection_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var fails = (fails_namespaceFn());
var intersection = (set_intersection_namespaceFn());
var setMethodAcceptSetLike = (set_method_accept_set_like_namespaceFn());
var INCORRECT = !setMethodAcceptSetLike('intersection', function (result) {
return result.size === 2 && result.has(1) && result.has(2);
}) || fails(function () {
// eslint-disable-next-line es/no-array-from, es/no-set, es/no-set-prototype-intersection -- testing
return String(Array.from(new Set([1, 2, 3]).intersection(new Set([3, 2])))) !== '3,2';
});
// `Set.prototype.intersection` method
// https://tc39.es/ecma262/#sec-set.prototype.intersection
$({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {
intersection: intersection
});
});
// MODULE: ./node_modules/core-js/modules/es.set.is-disjoint-from.v2.js
var es_set_is_disjoint_from_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var isDisjointFrom = (set_is_disjoint_from_namespaceFn());
var setMethodAcceptSetLike = (set_method_accept_set_like_namespaceFn());
var INCORRECT = !setMethodAcceptSetLike('isDisjointFrom', function (result) {
return !result;
});
// `Set.prototype.isDisjointFrom` method
// https://tc39.es/ecma262/#sec-set.prototype.isdisjointfrom
$({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {
isDisjointFrom: isDisjointFrom
});
});
// MODULE: ./node_modules/core-js/modules/es.set.is-subset-of.v2.js
var es_set_is_subset_of_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var isSubsetOf = (set_is_subset_of_namespaceFn());
var setMethodAcceptSetLike = (set_method_accept_set_like_namespaceFn());
var INCORRECT = !setMethodAcceptSetLike('isSubsetOf', function (result) {
return result;
});
// `Set.prototype.isSubsetOf` method
// https://tc39.es/ecma262/#sec-set.prototype.issubsetof
$({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {
isSubsetOf: isSubsetOf
});
});
// MODULE: ./node_modules/core-js/modules/es.set.is-superset-of.v2.js
var es_set_is_superset_of_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var isSupersetOf = (set_is_superset_of_namespaceFn());
var setMethodAcceptSetLike = (set_method_accept_set_like_namespaceFn());
var INCORRECT = !setMethodAcceptSetLike('isSupersetOf', function (result) {
return !result;
});
// `Set.prototype.isSupersetOf` method
// https://tc39.es/ecma262/#sec-set.prototype.issupersetof
$({ target: 'Set', proto: true, real: true, forced: INCORRECT }, {
isSupersetOf: isSupersetOf
});
});
// MODULE: ./node_modules/core-js/modules/es.set.symmetric-difference.v2.js
var es_set_symmetric_difference_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var symmetricDifference = (set_symmetric_difference_namespaceFn());
var setMethodGetKeysBeforeCloning = (set_method_get_keys_before_cloning_detection_namespaceFn());
var setMethodAcceptSetLike = (set_method_accept_set_like_namespaceFn());
var FORCED = !setMethodAcceptSetLike('symmetricDifference') || !setMethodGetKeysBeforeCloning('symmetricDifference');
// `Set.prototype.symmetricDifference` method
// https://tc39.es/ecma262/#sec-set.prototype.symmetricdifference
$({ target: 'Set', proto: true, real: true, forced: FORCED }, {
symmetricDifference: symmetricDifference
});
});
// MODULE: ./node_modules/core-js/modules/es.set.union.v2.js
var es_set_union_v2_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var union = (set_union_namespaceFn());
var setMethodGetKeysBeforeCloning = (set_method_get_keys_before_cloning_detection_namespaceFn());
var setMethodAcceptSetLike = (set_method_accept_set_like_namespaceFn());
var FORCED = !setMethodAcceptSetLike('union') || !setMethodGetKeysBeforeCloning('union');
// `Set.prototype.union` method
// https://tc39.es/ecma262/#sec-set.prototype.union
$({ target: 'Set', proto: true, real: true, forced: FORCED }, {
union: union
});
});
// MODULE: ./node_modules/core-js/modules/es.string.at-alternative.js
var es_string_at_alternative_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var requireObjectCoercible = (require_object_coercible_namespaceFn());
var toIntegerOrInfinity = (to_integer_or_infinity_namespaceFn());
var toString = (to_string_namespaceFn());
var fails = (fails_namespaceFn());
var charAt = uncurryThis(''.charAt);
var FORCED = fails(function () {
// eslint-disable-next-line es/no-string-prototype-at -- safe
return '𠮷'.at(-2) !== '\uD842';
});
// `String.prototype.at` method
// https://tc39.es/ecma262/#sec-string.prototype.at
$({ target: 'String', proto: true, forced: FORCED }, {
at: function at(index) {
var S = toString(requireObjectCoercible(this));
var len = S.length;
var relativeIndex = toIntegerOrInfinity(index);
var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
return (k < 0 || k >= len) ? undefined : charAt(S, k);
}
});
});
// MODULE: ./node_modules/core-js/modules/es.string.from-code-point.js
var es_string_from_code_point_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var toAbsoluteIndex = (to_absolute_index_namespaceFn());
var $RangeError = RangeError;
var fromCharCode = String.fromCharCode;
// eslint-disable-next-line es/no-string-fromcodepoint -- required for testing
var $fromCodePoint = String.fromCodePoint;
var join = uncurryThis([].join);
// length should be 1, old FF problem
var INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length !== 1;
// `String.fromCodePoint` method
// https://tc39.es/ecma262/#sec-string.fromcodepoint
$({ target: 'String', stat: true, arity: 1, forced: INCORRECT_LENGTH }, {
// eslint-disable-next-line no-unused-vars -- required for `.length`
fromCodePoint: function fromCodePoint(x) {
var elements = [];
var length = arguments.length;
var i = 0;
var code;
while (length > i) {
code = +arguments[i];
if (toAbsoluteIndex(code, 0x10FFFF) !== code) throw new $RangeError(code + ' is not a valid code point');
elements[i++] = code < 0x10000
? fromCharCode(code)
: fromCharCode(((code -= 0x10000) >> 10) + 0xD800, code % 0x400 + 0xDC00);
} return join(elements, '');
}
});
});
// MODULE: ./node_modules/core-js/modules/es.string.iterator.js
var es_string_iterator_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var charAt = (string_multibyte_namespaceFn().charAt);
var toString = (to_string_namespaceFn());
var InternalStateModule = (internal_state_namespaceFn());
var defineIterator = (iterator_define_namespaceFn());
var createIterResultObject = (create_iter_result_object_namespaceFn());
var STRING_ITERATOR = 'String Iterator';
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
// `String.prototype[@@iterator]` method
// https://tc39.es/ecma262/#sec-string.prototype-@@iterator
defineIterator(String, 'String', function (iterated) {
setInternalState(this, {
type: STRING_ITERATOR,
string: toString(iterated),
index: 0
});
// `%StringIteratorPrototype%.next` method
// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
}, function next() {
var state = getInternalState(this);
var string = state.string;
var index = state.index;
var point;
if (index >= string.length) return createIterResultObject(undefined, true);
point = charAt(string, index);
state.index += point.length;
return createIterResultObject(point, false);
});
});
// MODULE: ./node_modules/core-js/modules/es.string.replace-all.js
var es_string_replace_all_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var call = (function_call_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var requireObjectCoercible = (require_object_coercible_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var isObject = (is_object_namespaceFn());
var isRegExp = (is_regexp_namespaceFn());
var toString = (to_string_namespaceFn());
var getMethod = (get_method_namespaceFn());
var getRegExpFlags = (regexp_get_flags_namespaceFn());
var getSubstitution = (get_substitution_namespaceFn());
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var IS_PURE = (is_pure_namespaceFn());
var REPLACE = wellKnownSymbol('replace');
var $TypeError = TypeError;
var indexOf = uncurryThis(''.indexOf);
var replace = uncurryThis(''.replace);
var stringSlice = uncurryThis(''.slice);
var max = Math.max;
// `String.prototype.replaceAll` method
// https://tc39.es/ecma262/#sec-string.prototype.replaceall
$({ target: 'String', proto: true }, {
replaceAll: function replaceAll(searchValue, replaceValue) {
var O = requireObjectCoercible(this);
var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, position, replacement;
var endOfLastMatch = 0;
var result = '';
if (isObject(searchValue)) {
IS_REG_EXP = isRegExp(searchValue);
if (IS_REG_EXP) {
flags = toString(requireObjectCoercible(getRegExpFlags(searchValue)));
if (!~indexOf(flags, 'g')) throw new $TypeError('`.replaceAll` does not allow non-global regexes');
}
replacer = getMethod(searchValue, REPLACE);
if (replacer) return call(replacer, searchValue, O, replaceValue);
if (IS_PURE && IS_REG_EXP) return replace(toString(O), searchValue, replaceValue);
}
string = toString(O);
searchString = toString(searchValue);
functionalReplace = isCallable(replaceValue);
if (!functionalReplace) replaceValue = toString(replaceValue);
searchLength = searchString.length;
advanceBy = max(1, searchLength);
position = indexOf(string, searchString);
while (position !== -1) {
replacement = functionalReplace
? toString(replaceValue(searchString, position, string))
: getSubstitution(searchString, string, position, [], undefined, replaceValue);
result += stringSlice(string, endOfLastMatch, position) + replacement;
endOfLastMatch = position + searchLength;
position = position + advanceBy > string.length ? -1 : indexOf(string, searchString, position + advanceBy);
}
if (endOfLastMatch < string.length) {
result += stringSlice(string, endOfLastMatch);
}
return result;
}
});
});
// MODULE: ./node_modules/core-js/modules/es.string.replace.js
var es_string_replace_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var apply = (function_apply_namespaceFn());
var call = (function_call_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var fixRegExpWellKnownSymbolLogic = (fix_regexp_well_known_symbol_logic_namespaceFn());
var fails = (fails_namespaceFn());
var anObject = (an_object_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var isObject = (is_object_namespaceFn());
var toIntegerOrInfinity = (to_integer_or_infinity_namespaceFn());
var toLength = (to_length_namespaceFn());
var toString = (to_string_namespaceFn());
var requireObjectCoercible = (require_object_coercible_namespaceFn());
var advanceStringIndex = (advance_string_index_namespaceFn());
var getMethod = (get_method_namespaceFn());
var getSubstitution = (get_substitution_namespaceFn());
var getRegExpFlags = (regexp_get_flags_namespaceFn());
var regExpExec = (regexp_exec_abstract_namespaceFn());
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var REPLACE = wellKnownSymbol('replace');
var max = Math.max;
var min = Math.min;
var concat = uncurryThis([].concat);
var push = uncurryThis([].push);
var stringIndexOf = uncurryThis(''.indexOf);
var stringSlice = uncurryThis(''.slice);
var maybeToString = function (it) {
return it === undefined ? it : String(it);
};
// IE <= 11 replaces $0 with the whole match, as if it was $&
// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
var REPLACE_KEEPS_$0 = (function () {
// eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
return 'a'.replace(/./, '$0') === '$0';
})();
// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
if (/./[REPLACE]) {
return /./[REPLACE]('a', '$0') === '';
}
return false;
})();
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function () {
var re = /./;
re.exec = function () {
var result = [];
result.groups = { a: '7' };
return result;
};
// eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
return ''.replace(re, '$<a>') !== '7';
});
// @@replace logic
fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
return [
// `String.prototype.replace` method
// https://tc39.es/ecma262/#sec-string.prototype.replace
function replace(searchValue, replaceValue) {
var O = requireObjectCoercible(this);
var replacer = isObject(searchValue) ? getMethod(searchValue, REPLACE) : undefined;
return replacer
? call(replacer, searchValue, O, replaceValue)
: call(nativeReplace, toString(O), searchValue, replaceValue);
},
// `RegExp.prototype[@@replace]` method
// https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
function (string, replaceValue) {
var rx = anObject(this);
var S = toString(string);
var functionalReplace = isCallable(replaceValue);
if (!functionalReplace) replaceValue = toString(replaceValue);
var flags = toString(getRegExpFlags(rx));
if (
typeof replaceValue == 'string' &&
!~stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) &&
!~stringIndexOf(replaceValue, '$<') &&
!~stringIndexOf(flags, 'y')
) {
var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
if (res.done) return res.value;
}
var global = !!~stringIndexOf(flags, 'g');
var fullUnicode;
if (global) {
fullUnicode = !!~stringIndexOf(flags, 'u') || !!~stringIndexOf(flags, 'v');
rx.lastIndex = 0;
}
var results = [];
var result;
while (true) {
result = regExpExec(rx, S);
if (result === null) break;
push(results, result);
if (!global) break;
var matchStr = toString(result[0]);
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength(rx.lastIndex), fullUnicode);
}
var accumulatedResult = '';
var nextSourcePosition = 0;
for (var i = 0; i < results.length; i++) {
result = results[i];
var matched = toString(result[0]);
var position = max(min(toIntegerOrInfinity(result.index), S.length), 0);
var captures = [];
var replacement;
// NOTE: This is equivalent to
// captures = result.slice(1).map(maybeToString)
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
for (var j = 1; j < result.length; j++) push(captures, maybeToString(result[j]));
var namedCaptures = result.groups;
if (functionalReplace) {
var replacerArgs = concat([matched], captures, position, S);
if (namedCaptures !== undefined) push(replacerArgs, namedCaptures);
replacement = toString(apply(replaceValue, undefined, replacerArgs));
} else {
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
}
if (position >= nextSourcePosition) {
accumulatedResult += stringSlice(S, nextSourcePosition, position) + replacement;
nextSourcePosition = position + matched.length;
}
}
return accumulatedResult + stringSlice(S, nextSourcePosition);
}
];
}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
});
// MODULE: ./node_modules/core-js/modules/es.typed-array.at.js
var es_typed_array_at_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var ArrayBufferViewCore = (array_buffer_view_core_namespaceFn());
var lengthOfArrayLike = (length_of_array_like_namespaceFn());
var toIntegerOrInfinity = (to_integer_or_infinity_namespaceFn());
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
// `%TypedArray%.prototype.at` method
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.at
exportTypedArrayMethod('at', function at(index) {
var O = aTypedArray(this);
var len = lengthOfArrayLike(O);
var relativeIndex = toIntegerOrInfinity(index);
var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
return (k < 0 || k >= len) ? undefined : O[k];
});
});
// MODULE: ./node_modules/core-js/modules/es.typed-array.fill.js
var es_typed_array_fill_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var ArrayBufferViewCore = (array_buffer_view_core_namespaceFn());
var $fill = (array_fill_namespaceFn());
var toBigInt = (to_big_int_namespaceFn());
var classof = (classof_namespaceFn());
var call = (function_call_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var fails = (fails_namespaceFn());
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var slice = uncurryThis(''.slice);
// V8 ~ Chrome < 59, Safari < 14.1, FF < 55, Edge <=18
var CONVERSION_BUG = fails(function () {
var count = 0;
// eslint-disable-next-line es/no-typed-arrays -- safe
new Int8Array(2).fill({ valueOf: function () { return count++; } });
return count !== 1;
});
// `%TypedArray%.prototype.fill` method
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.fill
exportTypedArrayMethod('fill', function fill(value /* , start, end */) {
var length = arguments.length;
aTypedArray(this);
var actualValue = slice(classof(this), 0, 3) === 'Big' ? toBigInt(value) : +value;
return call($fill, this, actualValue, length > 1 ? arguments[1] : undefined, length > 2 ? arguments[2] : undefined);
}, CONVERSION_BUG);
});
// MODULE: ./node_modules/core-js/modules/es.typed-array.find-last-index.js
var es_typed_array_find_last_index_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var ArrayBufferViewCore = (array_buffer_view_core_namespaceFn());
var $findLastIndex = (array_iteration_from_last_namespaceFn().findLastIndex);
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
// `%TypedArray%.prototype.findLastIndex` method
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.findlastindex
exportTypedArrayMethod('findLastIndex', function findLastIndex(predicate /* , thisArg */) {
return $findLastIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
});
});
// MODULE: ./node_modules/core-js/modules/es.typed-array.find-last.js
var es_typed_array_find_last_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var ArrayBufferViewCore = (array_buffer_view_core_namespaceFn());
var $findLast = (array_iteration_from_last_namespaceFn().findLast);
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
// `%TypedArray%.prototype.findLast` method
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.findlast
exportTypedArrayMethod('findLast', function findLast(predicate /* , thisArg */) {
return $findLast(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : undefined);
});
});
// MODULE: ./node_modules/core-js/modules/es.typed-array.float32-array.js
var es_typed_array_float32_array_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var createTypedArrayConstructor = (typed_array_constructor_namespaceFn());
// `Float32Array` constructor
// https://tc39.es/ecma262/#sec-typedarray-objects
createTypedArrayConstructor('Float32', function (init) {
return function Float32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
});
// MODULE: ./node_modules/core-js/modules/es.typed-array.float64-array.js
var es_typed_array_float64_array_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var createTypedArrayConstructor = (typed_array_constructor_namespaceFn());
// `Float64Array` constructor
// https://tc39.es/ecma262/#sec-typedarray-objects
createTypedArrayConstructor('Float64', function (init) {
return function Float64Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
});
// MODULE: ./node_modules/core-js/modules/es.typed-array.from.js
var es_typed_array_from_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = (typed_array_constructors_require_wrappers_namespaceFn());
var exportTypedArrayStaticMethod = (array_buffer_view_core_namespaceFn().exportTypedArrayStaticMethod);
var typedArrayFrom = (typed_array_from_namespaceFn());
// `%TypedArray%.from` method
// https://tc39.es/ecma262/#sec-%typedarray%.from
exportTypedArrayStaticMethod('from', typedArrayFrom, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS);
});
// MODULE: ./node_modules/core-js/modules/es.typed-array.set.js
var es_typed_array_set_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var globalThis = (global_this_namespaceFn());
var call = (function_call_namespaceFn());
var ArrayBufferViewCore = (array_buffer_view_core_namespaceFn());
var lengthOfArrayLike = (length_of_array_like_namespaceFn());
var toOffset = (to_offset_namespaceFn());
var toIndexedObject = (to_object_namespaceFn());
var fails = (fails_namespaceFn());
var RangeError = globalThis.RangeError;
var Int8Array = globalThis.Int8Array;
var Int8ArrayPrototype = Int8Array && Int8Array.prototype;
var $set = Int8ArrayPrototype && Int8ArrayPrototype.set;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS = !fails(function () {
// eslint-disable-next-line es/no-typed-arrays -- required for testing
var array = new Uint8ClampedArray(2);
call($set, array, { length: 1, 0: 3 }, 1);
return array[1] !== 3;
});
// https://bugs.chromium.org/p/v8/issues/detail?id=11294 and other
var TO_OBJECT_BUG = WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS && ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS && fails(function () {
var array = new Int8Array(2);
array.set(1);
array.set('2', 1);
return array[0] !== 0 || array[1] !== 2;
});
// `%TypedArray%.prototype.set` method
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.set
exportTypedArrayMethod('set', function set(arrayLike /* , offset */) {
aTypedArray(this);
var offset = toOffset(arguments.length > 1 ? arguments[1] : undefined, 1);
var src = toIndexedObject(arrayLike);
if (WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS) return call($set, this, src, offset);
var length = this.length;
var len = lengthOfArrayLike(src);
var index = 0;
if (len + offset > length) throw new RangeError('Wrong length');
while (index < len) this[offset + index] = src[index++];
}, !WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG);
});
// MODULE: ./node_modules/core-js/modules/es.typed-array.sort.js
var es_typed_array_sort_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var globalThis = (global_this_namespaceFn());
var uncurryThis = (function_uncurry_this_clause_namespaceFn());
var fails = (fails_namespaceFn());
var aCallable = (a_callable_namespaceFn());
var internalSort = (array_sort_namespaceFn());
var ArrayBufferViewCore = (array_buffer_view_core_namespaceFn());
var FF = (environment_ff_version_namespaceFn());
var IE_OR_EDGE = (environment_is_ie_or_edge_namespaceFn());
var V8 = (environment_v8_version_namespaceFn());
var WEBKIT = (environment_webkit_version_namespaceFn());
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var Uint16Array = globalThis.Uint16Array;
var nativeSort = Uint16Array && uncurryThis(Uint16Array.prototype.sort);
// WebKit
var ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !(fails(function () {
nativeSort(new Uint16Array(2), null);
}) && fails(function () {
nativeSort(new Uint16Array(2), {});
}));
var STABLE_SORT = !!nativeSort && !fails(function () {
// feature detection can be too slow, so check engines versions
if (V8) return V8 < 74;
if (FF) return FF < 67;
if (IE_OR_EDGE) return true;
if (WEBKIT) return WEBKIT < 602;
var array = new Uint16Array(516);
var expected = Array(516);
var index, mod;
for (index = 0; index < 516; index++) {
mod = index % 4;
array[index] = 515 - index;
expected[index] = index - 2 * mod + 3;
}
nativeSort(array, function (a, b) {
return (a / 4 | 0) - (b / 4 | 0);
});
for (index = 0; index < 516; index++) {
if (array[index] !== expected[index]) return true;
}
});
var getSortCompare = function (comparefn) {
return function (x, y) {
if (comparefn !== undefined) return +comparefn(x, y) || 0;
// eslint-disable-next-line no-self-compare -- NaN check
if (y !== y) return x !== x ? 0 : -1;
// eslint-disable-next-line no-self-compare -- NaN check
if (x !== x) return 1;
if (x === 0 && y === 0) return 1 / x > 0 ? (1 / y > 0 ? 0 : 1) : (1 / y > 0 ? -1 : 0);
return x > y ? 1 : x < y ? -1 : 0;
};
};
// `%TypedArray%.prototype.sort` method
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.sort
exportTypedArrayMethod('sort', function sort(comparefn) {
if (comparefn !== undefined) aCallable(comparefn);
if (STABLE_SORT) return nativeSort(this, comparefn);
return internalSort(aTypedArray(this), getSortCompare(comparefn));
}, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS);
});
// MODULE: ./node_modules/core-js/modules/es.typed-array.to-reversed.js
var es_typed_array_to_reversed_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var lengthOfArrayLike = (length_of_array_like_namespaceFn());
var ArrayBufferViewCore = (array_buffer_view_core_namespaceFn());
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
// `%TypedArray%.prototype.toReversed` method
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.toreversed
exportTypedArrayMethod('toReversed', function toReversed() {
var O = aTypedArray(this);
var len = lengthOfArrayLike(O);
var A = new (getTypedArrayConstructor(O))(len);
var k = 0;
for (; k < len; k++) A[k] = O[len - k - 1];
return A;
});
});
// MODULE: ./node_modules/core-js/modules/es.typed-array.to-sorted.js
var es_typed_array_to_sorted_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var ArrayBufferViewCore = (array_buffer_view_core_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var aCallable = (a_callable_namespaceFn());
var arrayFromConstructorAndList = (array_from_constructor_and_list_namespaceFn());
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var sort = uncurryThis(ArrayBufferViewCore.TypedArrayPrototype.sort);
// `%TypedArray%.prototype.toSorted` method
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.tosorted
exportTypedArrayMethod('toSorted', function toSorted(compareFn) {
if (compareFn !== undefined) aCallable(compareFn);
var O = aTypedArray(this);
var A = arrayFromConstructorAndList(getTypedArrayConstructor(O), O);
return sort(A, compareFn);
});
});
// MODULE: ./node_modules/core-js/modules/es.typed-array.uint32-array.js
var es_typed_array_uint32_array_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var createTypedArrayConstructor = (typed_array_constructor_namespaceFn());
// `Uint32Array` constructor
// https://tc39.es/ecma262/#sec-typedarray-objects
createTypedArrayConstructor('Uint32', function (init) {
return function Uint32Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
});
// MODULE: ./node_modules/core-js/modules/es.typed-array.uint8-array.js
var es_typed_array_uint8_array_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var createTypedArrayConstructor = (typed_array_constructor_namespaceFn());
// `Uint8Array` constructor
// https://tc39.es/ecma262/#sec-typedarray-objects
createTypedArrayConstructor('Uint8', function (init) {
return function Uint8Array(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
});
});
// MODULE: ./node_modules/core-js/modules/es.typed-array.uint8-clamped-array.js
var es_typed_array_uint8_clamped_array_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var createTypedArrayConstructor = (typed_array_constructor_namespaceFn());
// `Uint8ClampedArray` constructor
// https://tc39.es/ecma262/#sec-typedarray-objects
createTypedArrayConstructor('Uint8', function (init) {
return function Uint8ClampedArray(data, byteOffset, length) {
return init(this, data, byteOffset, length);
};
}, true);
});
// MODULE: ./node_modules/core-js/modules/es.typed-array.with.js
var es_typed_array_with_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var ArrayBufferViewCore = (array_buffer_view_core_namespaceFn());
var isBigIntArray = (is_big_int_array_namespaceFn());
var lengthOfArrayLike = (length_of_array_like_namespaceFn());
var toIntegerOrInfinity = (to_integer_or_infinity_namespaceFn());
var toBigInt = (to_big_int_namespaceFn());
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var $RangeError = RangeError;
var PROPER_ORDER = function () {
try {
// eslint-disable-next-line no-throw-literal, es/no-typed-arrays, es/no-array-prototype-with -- required for testing
new Int8Array(1)['with'](2, { valueOf: function () { throw 8; } });
} catch (error) {
// some early implementations, like WebKit, does not follow the final semantic
// https://github.com/tc39/proposal-change-array-by-copy/pull/86
return error === 8;
}
}();
// Bug in WebKit. It should truncate a negative fractional index to zero, but instead throws an error
var THROW_ON_NEGATIVE_FRACTIONAL_INDEX = PROPER_ORDER && function () {
try {
// eslint-disable-next-line es/no-typed-arrays, es/no-array-prototype-with -- required for testing
new Int8Array(1)['with'](-0.5, 1);
} catch (error) {
return true;
}
}();
// `%TypedArray%.prototype.with` method
// https://tc39.es/ecma262/#sec-%typedarray%.prototype.with
exportTypedArrayMethod('with', { 'with': function (index, value) {
var O = aTypedArray(this);
var len = lengthOfArrayLike(O);
var relativeIndex = toIntegerOrInfinity(index);
var actualIndex = relativeIndex < 0 ? len + relativeIndex : relativeIndex;
var numericValue = isBigIntArray(O) ? toBigInt(value) : +value;
if (actualIndex >= len || actualIndex < 0) throw new $RangeError('Incorrect index');
var A = new (getTypedArrayConstructor(O))(len);
var k = 0;
for (; k < len; k++) A[k] = k === actualIndex ? numericValue : O[k];
return A;
} }['with'], !PROPER_ORDER || THROW_ON_NEGATIVE_FRACTIONAL_INDEX);
});
// MODULE: ./node_modules/core-js/modules/es.uint8-array.set-from-base64.js
var es_uint8_array_set_from_base64_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var globalThis = (global_this_namespaceFn());
var $fromBase64 = (uint8_from_base64_namespaceFn());
var anUint8Array = (an_uint8_array_namespaceFn());
var Uint8Array = globalThis.Uint8Array;
var INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array || !Uint8Array.prototype.setFromBase64 || !function () {
var target = new Uint8Array([255, 255, 255, 255, 255]);
try {
target.setFromBase64('', null);
return;
} catch (error) { /* empty */ }
// Webkit not throw an error on odd length string
try {
target.setFromBase64('a');
return;
} catch (error) { /* empty */ }
try {
target.setFromBase64('MjYyZg===');
} catch (error) {
return target[0] === 50 && target[1] === 54 && target[2] === 50 && target[3] === 255 && target[4] === 255;
}
}();
// `Uint8Array.prototype.setFromBase64` method
// https://tc39.es/ecma262/#sec-uint8array.prototype.setfrombase64
if (Uint8Array) $({ target: 'Uint8Array', proto: true, forced: INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS }, {
setFromBase64: function setFromBase64(string /* , options */) {
anUint8Array(this);
var result = $fromBase64(string, arguments.length > 1 ? arguments[1] : undefined, this, this.length);
return { read: result.read, written: result.written };
}
});
});
// MODULE: ./node_modules/core-js/modules/es.uint8-array.set-from-hex.js
var es_uint8_array_set_from_hex_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var globalThis = (global_this_namespaceFn());
var aString = (a_string_namespaceFn());
var anUint8Array = (an_uint8_array_namespaceFn());
var notDetached = (array_buffer_not_detached_namespaceFn());
var $fromHex = (uint8_from_hex_namespaceFn());
// Should not throw an error on length-tracking views over ResizableArrayBuffer
// https://issues.chromium.org/issues/454630441
function throwsOnLengthTrackingView() {
try {
// eslint-disable-next-line es/no-resizable-and-growable-arraybuffers -- required for testing
var rab = new ArrayBuffer(16, { maxByteLength: 1024 });
// eslint-disable-next-line es/no-uint8array-prototype-setfromhex, es/no-typed-arrays -- required for testing
new Uint8Array(rab).setFromHex('cafed00d');
} catch (error) {
return true;
}
}
// `Uint8Array.prototype.setFromHex` method
// https://tc39.es/ecma262/#sec-uint8array.prototype.setfromhex
if (globalThis.Uint8Array) $({ target: 'Uint8Array', proto: true, forced: throwsOnLengthTrackingView() }, {
setFromHex: function setFromHex(string) {
anUint8Array(this);
aString(string);
notDetached(this.buffer);
var read = $fromHex(string, this).read;
return { read: read, written: read / 2 };
}
});
});
// MODULE: ./node_modules/core-js/modules/es.uint8-array.to-base64.js
var es_uint8_array_to_base64_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
/* eslint-disable no-useless-assignment -- false positive for [index++] syntax */
var $ = (export_namespaceFn());
var globalThis = (global_this_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var anObjectOrUndefined = (an_object_or_undefined_namespaceFn());
var anUint8Array = (an_uint8_array_namespaceFn());
var notDetached = (array_buffer_not_detached_namespaceFn());
var base64Map = (base64_map_namespaceFn());
var getAlphabetOption = (get_alphabet_option_namespaceFn());
var base64Alphabet = base64Map.i2c;
var base64UrlAlphabet = base64Map.i2cUrl;
var $floor = Math.floor;
var $ceil = Math.ceil;
var charAt = uncurryThis(''.charAt);
var Uint8Array = globalThis.Uint8Array;
var $Array = globalThis.Array;
var join = uncurryThis([].join);
var INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array || !Uint8Array.prototype.toBase64 || !function () {
try {
var target = new Uint8Array();
target.toBase64(null);
} catch (error) {
return true;
}
}();
// `Uint8Array.prototype.toBase64` method
// https://tc39.es/ecma262/#sec-uint8array.prototype.tobase64
if (Uint8Array) $({ target: 'Uint8Array', proto: true, forced: INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS }, {
toBase64: function toBase64(/* options */) {
var array = anUint8Array(this);
var options = arguments.length ? anObjectOrUndefined(arguments[0]) : undefined;
var alphabet = getAlphabetOption(options) === 'base64' ? base64Alphabet : base64UrlAlphabet;
var omitPadding = !!options && !!options.omitPadding;
notDetached(this.buffer);
var i = 0;
var length = array.length;
var result = $Array(omitPadding ? $floor(length / 3) * 4 + (length % 3 ? length % 3 + 1 : 0) : $ceil(length / 3) * 4);
var written = 0;
var triplet;
var at = function (shift) {
return charAt(alphabet, (triplet >> (6 * shift)) & 63);
};
for (; i + 2 < length; i += 3) {
triplet = (array[i] << 16) + (array[i + 1] << 8) + array[i + 2];
result[written++] = at(3);
result[written++] = at(2);
result[written++] = at(1);
result[written++] = at(0);
}
if (i + 2 === length) {
triplet = (array[i] << 16) + (array[i + 1] << 8);
result[written++] = at(3);
result[written++] = at(2);
result[written++] = at(1);
if (!omitPadding) result[written++] = '=';
} else if (i + 1 === length) {
triplet = array[i] << 16;
result[written++] = at(3);
result[written++] = at(2);
if (!omitPadding) {
result[written++] = '=';
result[written++] = '=';
}
}
return join(result, '');
}
});
});
// MODULE: ./node_modules/core-js/modules/es.uint8-array.to-hex.js
var es_uint8_array_to_hex_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var globalThis = (global_this_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var anUint8Array = (an_uint8_array_namespaceFn());
var notDetached = (array_buffer_not_detached_namespaceFn());
var numberToString = uncurryThis(1.1.toString);
var join = uncurryThis([].join);
var $Array = Array;
var Uint8Array = globalThis.Uint8Array;
var INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS = !Uint8Array || !Uint8Array.prototype.toHex || !(function () {
try {
var target = new Uint8Array([255, 255, 255, 255, 255, 255, 255, 255]);
return target.toHex() === 'ffffffffffffffff';
} catch (error) {
return false;
}
})();
// `Uint8Array.prototype.toHex` method
// https://tc39.es/ecma262/#sec-uint8array.prototype.tohex
if (Uint8Array) $({ target: 'Uint8Array', proto: true, forced: INCORRECT_BEHAVIOR_OR_DOESNT_EXISTS }, {
toHex: function toHex() {
anUint8Array(this);
notDetached(this.buffer);
var result = $Array(this.length);
for (var i = 0, length = this.length; i < length; i++) {
var hex = numberToString(this[i], 16);
result[i] = hex.length === 1 ? '0' + hex : hex;
}
return join(result, '');
}
});
});
// MODULE: ./node_modules/core-js/modules/es.weak-map.get-or-insert-computed.js
var es_weak_map_get_or_insert_computed_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var aCallable = (a_callable_namespaceFn());
var aWeakMap = (a_weak_map_namespaceFn());
var aWeakKey = (a_weak_key_namespaceFn());
var WeakMapHelpers = (weak_map_helpers_namespaceFn());
var IS_PURE = (is_pure_namespaceFn());
var get = WeakMapHelpers.get;
var has = WeakMapHelpers.has;
var set = WeakMapHelpers.set;
var FORCED = IS_PURE || !function () {
try {
// eslint-disable-next-line es/no-weak-map, no-throw-literal -- testing
if (WeakMap.prototype.getOrInsertComputed) new WeakMap().getOrInsertComputed(1, function () { throw 1; });
} catch (error) {
// FF144 Nightly - Beta 3 bug
// https://bugzilla.mozilla.org/show_bug.cgi?id=1988369
return error instanceof TypeError;
}
}();
// `WeakMap.prototype.getOrInsertComputed` method
// https://tc39.es/ecma262/#sec-weakmap.prototype.getorinsertcomputed
$({ target: 'WeakMap', proto: true, real: true, forced: FORCED }, {
getOrInsertComputed: function getOrInsertComputed(key, callbackfn) {
if (!IS_PURE) aWeakMap(this);
aWeakKey(key);
aCallable(callbackfn);
if (has(this, key)) return get(this, key);
var value = callbackfn(key);
set(this, key, value);
return value;
}
});
});
// MODULE: ./node_modules/core-js/modules/es.weak-map.get-or-insert.js
var es_weak_map_get_or_insert_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var WeakMapHelpers = (weak_map_helpers_namespaceFn());
var IS_PURE = (is_pure_namespaceFn());
var get = WeakMapHelpers.get;
var has = WeakMapHelpers.has;
var set = WeakMapHelpers.set;
// `WeakMap.prototype.getOrInsert` method
// https://tc39.es/ecma262/#sec-weakmap.prototype.getorinsert
$({ target: 'WeakMap', proto: true, real: true, forced: IS_PURE }, {
getOrInsert: function getOrInsert(key, value) {
if (has(this, key)) return get(this, key);
set(this, key, value);
return value;
}
});
});
// MODULE: ./node_modules/core-js/modules/web.dom-exception.stack.js
var web_dom_exception_stack_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var globalThis = (global_this_namespaceFn());
var getBuiltIn = (get_built_in_namespaceFn());
var createPropertyDescriptor = (create_property_descriptor_namespaceFn());
var defineProperty = (object_define_property_namespaceFn().f);
var hasOwn = (has_own_property_namespaceFn());
var anInstance = (an_instance_namespaceFn());
var inheritIfRequired = (inherit_if_required_namespaceFn());
var normalizeStringArgument = (normalize_string_argument_namespaceFn());
var DOMExceptionConstants = (dom_exception_constants_namespaceFn());
var clearErrorStack = (error_stack_clear_namespaceFn());
var DESCRIPTORS = (descriptors_namespaceFn());
var IS_PURE = (is_pure_namespaceFn());
var DOM_EXCEPTION = 'DOMException';
var Error = getBuiltIn('Error');
var NativeDOMException = getBuiltIn(DOM_EXCEPTION);
var $DOMException = function DOMException() {
anInstance(this, DOMExceptionPrototype);
var argumentsLength = arguments.length;
var message = normalizeStringArgument(argumentsLength < 1 ? undefined : arguments[0]);
var name = normalizeStringArgument(argumentsLength < 2 ? undefined : arguments[1], 'Error');
var that = new NativeDOMException(message, name);
var error = new Error(message);
error.name = DOM_EXCEPTION;
defineProperty(that, 'stack', createPropertyDescriptor(1, clearErrorStack(error.stack, 1)));
inheritIfRequired(that, this, $DOMException);
return that;
};
var DOMExceptionPrototype = $DOMException.prototype = NativeDOMException.prototype;
var ERROR_HAS_STACK = 'stack' in new Error(DOM_EXCEPTION);
var DOM_EXCEPTION_HAS_STACK = 'stack' in new NativeDOMException(1, 2);
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var descriptor = NativeDOMException && DESCRIPTORS && Object.getOwnPropertyDescriptor(globalThis, DOM_EXCEPTION);
// Bun ~ 0.1.1 DOMException have incorrect descriptor and we can't redefine it
// https://github.com/Jarred-Sumner/bun/issues/399
var BUGGY_DESCRIPTOR = !!descriptor && !(descriptor.writable && descriptor.configurable);
var FORCED_CONSTRUCTOR = ERROR_HAS_STACK && !BUGGY_DESCRIPTOR && !DOM_EXCEPTION_HAS_STACK;
// `DOMException` constructor patch for `.stack` where it's required
// https://webidl.spec.whatwg.org/#es-DOMException-specialness
$({ global: true, constructor: true, forced: IS_PURE || FORCED_CONSTRUCTOR }, { // TODO: fix export logic
DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException
});
var PolyfilledDOMException = getBuiltIn(DOM_EXCEPTION);
var PolyfilledDOMExceptionPrototype = PolyfilledDOMException.prototype;
if (PolyfilledDOMExceptionPrototype.constructor !== PolyfilledDOMException) {
if (!IS_PURE) {
defineProperty(PolyfilledDOMExceptionPrototype, 'constructor', createPropertyDescriptor(1, PolyfilledDOMException));
}
for (var key in DOMExceptionConstants) if (hasOwn(DOMExceptionConstants, key)) {
var constant = DOMExceptionConstants[key];
var constantName = constant.s;
if (!hasOwn(PolyfilledDOMException, constantName)) {
defineProperty(PolyfilledDOMException, constantName, createPropertyDescriptor(6, constant.c));
}
}
}
});
// MODULE: ./node_modules/core-js/modules/web.self.js
var web_self_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var globalThis = (global_this_namespaceFn());
var defineBuiltInAccessor = (define_built_in_accessor_namespaceFn());
var DESCRIPTORS = (descriptors_namespaceFn());
var $TypeError = TypeError;
// eslint-disable-next-line es/no-object-defineproperty -- safe
var defineProperty = Object.defineProperty;
var INCORRECT_VALUE = globalThis.self !== globalThis;
// `self` getter
// https://html.spec.whatwg.org/multipage/window-object.html#dom-self
try {
if (DESCRIPTORS) {
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var descriptor = Object.getOwnPropertyDescriptor(globalThis, 'self');
// some engines have `self`, but with incorrect descriptor
// https://github.com/denoland/deno/issues/15765
if (INCORRECT_VALUE || !descriptor || !descriptor.get || !descriptor.enumerable) {
defineBuiltInAccessor(globalThis, 'self', {
get: function self() {
return globalThis;
},
set: function self(value) {
if (this !== globalThis) throw new $TypeError('Illegal invocation');
defineProperty(globalThis, 'self', {
value: value,
writable: true,
configurable: true,
enumerable: true
});
},
configurable: true,
enumerable: true
});
}
} else $({ global: true, simple: true, forced: INCORRECT_VALUE }, {
self: globalThis
});
} catch (error) { /* empty */ }
});
// MODULE: ./node_modules/core-js/modules/web.url-search-params.constructor.js
var web_url_search_params_constructor_namespaceFn = /*#__PURE__*/__webpack_require__.cw((module) => {
// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
(es_array_iterator_namespaceFn());
var $ = (export_namespaceFn());
var globalThis = (global_this_namespaceFn());
var safeGetBuiltIn = (safe_get_built_in_namespaceFn());
var call = (function_call_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var DESCRIPTORS = (descriptors_namespaceFn());
var USE_NATIVE_URL = (url_constructor_detection_namespaceFn());
var percentCoding = (url_percent_coding_namespaceFn());
var defineBuiltIn = (define_built_in_namespaceFn());
var defineBuiltInAccessor = (define_built_in_accessor_namespaceFn());
var defineBuiltIns = (define_built_ins_namespaceFn());
var setToStringTag = (set_to_string_tag_namespaceFn());
var createIteratorConstructor = (iterator_create_constructor_namespaceFn());
var InternalStateModule = (internal_state_namespaceFn());
var anInstance = (an_instance_namespaceFn());
var isCallable = (is_callable_namespaceFn());
var hasOwn = (has_own_property_namespaceFn());
var bind = (function_bind_context_namespaceFn());
var classof = (classof_namespaceFn());
var anObject = (an_object_namespaceFn());
var isObject = (is_object_namespaceFn());
var $toString = (to_string_namespaceFn());
var create = (object_create_namespaceFn());
var createPropertyDescriptor = (create_property_descriptor_namespaceFn());
var getIterator = (get_iterator_internal_namespaceFn());
var getIteratorMethod = (get_iterator_method_internal_namespaceFn());
var createIterResultObject = (create_iter_result_object_namespaceFn());
var validateArgumentsLength = (validate_arguments_length_namespaceFn());
var wellKnownSymbol = (well_known_symbol_namespaceFn());
var arraySort = (array_sort_namespaceFn());
var ITERATOR = wellKnownSymbol('iterator');
var URL_SEARCH_PARAMS = 'URLSearchParams';
var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + 'Iterator';
var setInternalState = InternalStateModule.set;
var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
var percentDecode = percentCoding.decode;
var percentEncode = percentCoding.encode;
var nativeFetch = safeGetBuiltIn('fetch');
var NativeRequest = safeGetBuiltIn('Request');
var Headers = safeGetBuiltIn('Headers');
var RequestPrototype = NativeRequest && NativeRequest.prototype;
var HeadersPrototype = Headers && Headers.prototype;
var TypeError = globalThis.TypeError;
var charAt = uncurryThis(''.charAt);
var join = uncurryThis([].join);
var push = uncurryThis([].push);
var replace = uncurryThis(''.replace);
var shift = uncurryThis([].shift);
var splice = uncurryThis([].splice);
var split = uncurryThis(''.split);
var stringSlice = uncurryThis(''.slice);
var plus = /\+/g;
// https://url.spec.whatwg.org/#urlencoded-parsing - `+` decodes to a space
var decodeQueryComponent = function (input) {
return percentDecode(replace(input, plus, ' '));
};
var find = /[!'()~]|%20/g;
var replacements = {
'!': '%21',
"'": '%27',
'(': '%28',
')': '%29',
'~': '%7E',
'%20': '+'
};
var replacer = function (match) {
return replacements[match];
};
var serialize = function (it) {
return replace(percentEncode(it), find, replacer);
};
var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
setInternalState(this, {
type: URL_SEARCH_PARAMS_ITERATOR,
target: getInternalParamsState(params).entries,
index: 0,
kind: kind
});
}, URL_SEARCH_PARAMS, function next() {
var state = getInternalIteratorState(this);
var target = state.target;
var index = state.index++;
if (!target || index >= target.length) {
state.target = null;
return createIterResultObject(undefined, true);
}
var entry = target[index];
switch (state.kind) {
case 'keys': return createIterResultObject(entry.key, false);
case 'values': return createIterResultObject(entry.value, false);
} return createIterResultObject([entry.key, entry.value], false);
}, true);
var URLSearchParamsState = function (init) {
this.entries = [];
this.url = null;
if (init !== undefined) {
if (isObject(init)) this.parseObject(init);
else this.parseQuery(typeof init == 'string' ? charAt(init, 0) === '?' ? stringSlice(init, 1) : init : $toString(init));
}
};
URLSearchParamsState.prototype = {
type: URL_SEARCH_PARAMS,
bindURL: function (url) {
this.url = url;
this.update();
},
parseObject: function (object) {
var entries = this.entries;
var iteratorMethod = getIteratorMethod(object);
var iterator, next, step, entryIterator, entryNext, first, second;
if (iteratorMethod) {
iterator = getIterator(object, iteratorMethod);
next = iterator.next;
while (!(step = call(next, iterator)).done) {
entryIterator = getIterator(anObject(step.value));
entryNext = entryIterator.next;
if (
(first = call(entryNext, entryIterator)).done ||
(second = call(entryNext, entryIterator)).done ||
!call(entryNext, entryIterator).done
) throw new TypeError('Expected sequence with length 2');
push(entries, { key: $toString(first.value), value: $toString(second.value) });
}
} else for (var key in object) if (hasOwn(object, key)) {
push(entries, { key: key, value: $toString(object[key]) });
}
},
parseQuery: function (query) {
if (query) {
var entries = this.entries;
var attributes = split(query, '&');
var index = 0;
var attribute, entry;
while (index < attributes.length) {
attribute = attributes[index++];
if (attribute.length) {
entry = split(attribute, '=');
push(entries, {
key: decodeQueryComponent(shift(entry)),
value: decodeQueryComponent(join(entry, '='))
});
}
}
}
},
serialize: function () {
var entries = this.entries;
var result = [];
var index = 0;
var entry;
while (index < entries.length) {
entry = entries[index++];
push(result, serialize(entry.key) + '=' + serialize(entry.value));
} return join(result, '&');
},
update: function () {
this.entries.length = 0;
this.parseQuery(this.url.query);
},
updateURL: function () {
if (this.url) this.url.update();
}
};
// `URLSearchParams` constructor
// https://url.spec.whatwg.org/#interface-urlsearchparams
var URLSearchParamsConstructor = function URLSearchParams(/* init */) {
anInstance(this, URLSearchParamsPrototype);
var init = arguments.length > 0 ? arguments[0] : undefined;
var state = setInternalState(this, new URLSearchParamsState(init));
if (!DESCRIPTORS) this.size = state.entries.length;
};
var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
defineBuiltIns(URLSearchParamsPrototype, {
// `URLSearchParams.prototype.append` method
// https://url.spec.whatwg.org/#dom-urlsearchparams-append
append: function append(name, value) {
var state = getInternalParamsState(this);
validateArgumentsLength(arguments.length, 2);
push(state.entries, { key: $toString(name), value: $toString(value) });
if (!DESCRIPTORS) this.size++;
state.updateURL();
},
// `URLSearchParams.prototype.delete` method
// https://url.spec.whatwg.org/#dom-urlsearchparams-delete
'delete': function (name /* , value */) {
var state = getInternalParamsState(this);
var length = validateArgumentsLength(arguments.length, 1);
var entries = state.entries;
var key = $toString(name);
var $value = length < 2 ? undefined : arguments[1];
var value = $value === undefined ? $value : $toString($value);
var index = 0;
while (index < entries.length) {
var entry = entries[index];
if (entry.key === key && (value === undefined || entry.value === value)) {
splice(entries, index, 1);
} else index++;
}
if (!DESCRIPTORS) this.size = entries.length;
state.updateURL();
},
// `URLSearchParams.prototype.get` method
// https://url.spec.whatwg.org/#dom-urlsearchparams-get
get: function get(name) {
var entries = getInternalParamsState(this).entries;
validateArgumentsLength(arguments.length, 1);
var key = $toString(name);
var index = 0;
for (; index < entries.length; index++) {
if (entries[index].key === key) return entries[index].value;
}
return null;
},
// `URLSearchParams.prototype.getAll` method
// https://url.spec.whatwg.org/#dom-urlsearchparams-getall
getAll: function getAll(name) {
var entries = getInternalParamsState(this).entries;
validateArgumentsLength(arguments.length, 1);
var key = $toString(name);
var result = [];
var index = 0;
for (; index < entries.length; index++) {
if (entries[index].key === key) push(result, entries[index].value);
}
return result;
},
// `URLSearchParams.prototype.has` method
// https://url.spec.whatwg.org/#dom-urlsearchparams-has
has: function has(name /* , value */) {
var entries = getInternalParamsState(this).entries;
var length = validateArgumentsLength(arguments.length, 1);
var key = $toString(name);
var $value = length < 2 ? undefined : arguments[1];
var value = $value === undefined ? $value : $toString($value);
var index = 0;
while (index < entries.length) {
var entry = entries[index++];
if (entry.key === key && (value === undefined || entry.value === value)) return true;
}
return false;
},
// `URLSearchParams.prototype.set` method
// https://url.spec.whatwg.org/#dom-urlsearchparams-set
set: function set(name, value) {
var state = getInternalParamsState(this);
validateArgumentsLength(arguments.length, 2);
var entries = state.entries;
var found = false;
var key = $toString(name);
var val = $toString(value);
var index = 0;
var entry;
for (; index < entries.length; index++) {
entry = entries[index];
if (entry.key === key) {
if (found) splice(entries, index--, 1);
else {
found = true;
entry.value = val;
}
}
}
if (!found) push(entries, { key: key, value: val });
if (!DESCRIPTORS) this.size = entries.length;
state.updateURL();
},
// `URLSearchParams.prototype.sort` method
// https://url.spec.whatwg.org/#dom-urlsearchparams-sort
sort: function sort() {
var state = getInternalParamsState(this);
arraySort(state.entries, function (a, b) {
return a.key > b.key ? 1 : -1;
});
state.updateURL();
},
// `URLSearchParams.prototype.forEach` method
forEach: function forEach(callback /* , thisArg */) {
var entries = getInternalParamsState(this).entries;
var boundFunction = bind(callback, arguments.length > 1 ? arguments[1] : undefined);
var index = 0;
var entry;
while (index < entries.length) {
entry = entries[index++];
boundFunction(entry.value, entry.key, this);
}
},
// `URLSearchParams.prototype.keys` method
keys: function keys() {
return new URLSearchParamsIterator(this, 'keys');
},
// `URLSearchParams.prototype.values` method
values: function values() {
return new URLSearchParamsIterator(this, 'values');
},
// `URLSearchParams.prototype.entries` method
entries: function entries() {
return new URLSearchParamsIterator(this, 'entries');
}
}, { enumerable: true });
// `URLSearchParams.prototype[@@iterator]` method
defineBuiltIn(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries, { name: 'entries' });
// `URLSearchParams.prototype.toString` method
// https://url.spec.whatwg.org/#urlsearchparams-stringification-behavior
defineBuiltIn(URLSearchParamsPrototype, 'toString', function toString() {
return getInternalParamsState(this).serialize();
}, { enumerable: true });
// `URLSearchParams.prototype.size` getter
// https://url.spec.whatwg.org/#dom-urlsearchparams-size
if (DESCRIPTORS) defineBuiltInAccessor(URLSearchParamsPrototype, 'size', {
get: function size() {
return getInternalParamsState(this).entries.length;
},
configurable: true,
enumerable: true
});
setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
$({ global: true, constructor: true, forced: !USE_NATIVE_URL }, {
URLSearchParams: URLSearchParamsConstructor
});
// Wrap `fetch` and `Request` for correct work with polyfilled `URLSearchParams`
if (!USE_NATIVE_URL && isCallable(Headers)) {
var headersHas = uncurryThis(HeadersPrototype.has);
var headersSet = uncurryThis(HeadersPrototype.set);
var wrapRequestOptions = function (init) {
if (isObject(init)) {
var body = init.body;
var headers;
if (classof(body) === URL_SEARCH_PARAMS) {
headers = init.headers ? new Headers(init.headers) : new Headers();
if (!headersHas(headers, 'content-type')) {
headersSet(headers, 'content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
}
return create(init, {
body: createPropertyDescriptor(0, $toString(body)),
headers: createPropertyDescriptor(0, headers)
});
}
} return init;
};
if (isCallable(nativeFetch)) {
$({ global: true, enumerable: true, dontCallGetSet: true, forced: true }, {
fetch: function fetch(input /* , init */) {
return nativeFetch(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
}
});
}
if (isCallable(NativeRequest)) {
var RequestConstructor = function Request(input /* , init */) {
anInstance(this, RequestPrototype);
return new NativeRequest(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
};
RequestPrototype.constructor = RequestConstructor;
RequestConstructor.prototype = RequestPrototype;
$({ global: true, constructor: true, dontCallGetSet: true, forced: true }, {
Request: RequestConstructor
});
}
}
module.exports = {
URLSearchParams: URLSearchParamsConstructor,
getState: getInternalParamsState
};
});
// MODULE: ./node_modules/core-js/modules/web.url.constructor.js
var web_url_constructor_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
// TODO: in core-js@4, move /modules/ dependencies to public entries for better optimization by tools like `preset-env`
(es_string_iterator_namespaceFn());
var $ = (export_namespaceFn());
var DESCRIPTORS = (descriptors_namespaceFn());
var USE_NATIVE_URL = (url_constructor_detection_namespaceFn());
var globalThis = (global_this_namespaceFn());
var bind = (function_bind_context_namespaceFn());
var uncurryThis = (function_uncurry_this_namespaceFn());
var defineBuiltIn = (define_built_in_namespaceFn());
var defineBuiltInAccessor = (define_built_in_accessor_namespaceFn());
var anInstance = (an_instance_namespaceFn());
var hasOwn = (has_own_property_namespaceFn());
var assign = (object_assign_namespaceFn());
var arrayFrom = (array_from_namespaceFn());
var arraySlice = (array_slice_namespaceFn());
var codeAt = (string_multibyte_namespaceFn().codeAt);
var toASCII = (string_punycode_to_ascii_namespaceFn());
var percentCoding = (url_percent_coding_namespaceFn());
var $toString = (to_string_namespaceFn());
var setToStringTag = (set_to_string_tag_namespaceFn());
var validateArgumentsLength = (validate_arguments_length_namespaceFn());
var URLSearchParamsModule = (web_url_search_params_constructor_namespaceFn());
var InternalStateModule = (internal_state_namespaceFn());
var setInternalState = InternalStateModule.set;
var getInternalURLState = InternalStateModule.getterFor('URL');
var URLSearchParams = URLSearchParamsModule.URLSearchParams;
var getInternalSearchParamsState = URLSearchParamsModule.getState;
var percentDecode = percentCoding.decode;
var percentEncode = percentCoding.encode;
var NativeURL = globalThis.URL;
var TypeError = globalThis.TypeError;
var parseInt = globalThis.parseInt;
var floor = Math.floor;
var pow = Math.pow;
var fromCharCode = String.fromCharCode;
var charAt = uncurryThis(''.charAt);
var exec = uncurryThis(/./.exec);
var join = uncurryThis([].join);
var numberToString = uncurryThis(1.1.toString);
var pop = uncurryThis([].pop);
var push = uncurryThis([].push);
var replace = uncurryThis(''.replace);
var shift = uncurryThis([].shift);
var split = uncurryThis(''.split);
var stringIndexOf = uncurryThis(''.indexOf);
var stringSlice = uncurryThis(''.slice);
var toLowerCase = uncurryThis(''.toLowerCase);
var unshift = uncurryThis([].unshift);
var INVALID_AUTHORITY = 'Invalid authority';
var INVALID_SCHEME = 'Invalid scheme';
var INVALID_HOST = 'Invalid host';
var INVALID_PORT = 'Invalid port';
var ALPHA = /[a-z]/i;
var ALPHANUMERIC_PLUS_MINUS_DOT = /[\d+\-.a-z]/i;
var DIGIT = /\d/;
var HEX_START = /^0x/i;
var OCT = /^[0-7]+$/;
var DEC = /^\d+$/;
var HEX = /^[\da-f]+$/i;
/* eslint-disable regexp/no-control-character -- safe */
// https://url.spec.whatwg.org/#forbidden-domain-code-point
var FORBIDDEN_DOMAIN_CODE_POINT = /[\u0000-\u0020#%/:<>?@[\\\]^|\u007F]/;
// https://url.spec.whatwg.org/#forbidden-host-code-point
var FORBIDDEN_HOST_CODE_POINT = /[\0\t\n\r #/:<>?@[\\\]^|]/;
var LEADING_C0_CONTROL_OR_SPACE = /^[\u0000-\u0020]+/;
var TRAILING_C0_CONTROL_OR_SPACE = /(^|[^\u0000-\u0020])[\u0000-\u0020]+$/;
var TAB_AND_NEW_LINE = /[\t\n\r]/g;
var NON_ASCII = /[^\u0000-\u007F]/;
/* eslint-enable regexp/no-control-character -- safe */
// UTS#46 maps these onto a string containing a forbidden domain code point, so a domain
// holding one is rejected - listing them is far smaller than shipping the mapping table
var MAPPED_ONTO_FORBIDDEN = '\u00A8\u00AF\u00B4\u00B8\u02D8\u02D9\u02DA\u02DB\u02DC\u02DD\u037A\u0384\u0385\u1FBD\u1FBF\u1FC0'
+ '\u1FC1\u1FCD\u1FCE\u1FCF\u1FDD\u1FDE\u1FDF\u1FED\u1FEE\u1FFD\u1FFE\u2017\u203E\u2047\u2048\u2049'
+ '\u2100\u2101\u2105\u2106\u2A74\u309B\u309C\uFC5E\uFC5F\uFC60\uFC61\uFC62\uFC63\uFDFA\uFDFB\uFE13'
+ '\uFE16\uFE47\uFE48\uFE49\uFE4A\uFE4B\uFE4C\uFE55\uFE56\uFE5F\uFE64\uFE65\uFE68\uFE6A\uFE6B\uFE70'
+ '\uFE72\uFE74\uFE76\uFE78\uFE7A\uFE7C\uFE7E\uFFE3';
// eslint-disable-next-line no-unassigned-vars -- expected `undefined` value
var EOF;
// https://www.unicode.org/reports/tr46/#IDNA_Mapping_Table
var isIgnoredCodePoint = function (code) {
return code === 0xAD || code === 0x34F || code === 0x200B || code === 0x3164
|| code === 0xFEFF || code === 0xFFA0
|| (code >= 0x115F && code <= 0x1160)
|| (code >= 0x17B4 && code <= 0x17B5)
|| (code >= 0x180B && code <= 0x180F)
|| (code >= 0x2060 && code <= 0x2064) || (code >= 0x206A && code <= 0x206F)
|| (code >= 0xFE00 && code <= 0xFE0F)
|| (code >= 0xE0100 && code <= 0xE01EF);
};
var isDisallowedCodePoint = function (code) {
return code === 0xFFFD
// lone surrogate - a matched pair is a single code point and never lands here
|| (code >= 0xD800 && code <= 0xDFFF)
// C1 controls
|| (code >= 0x80 && code <= 0x9F)
// line and paragraph separators, bidirectional formatting characters
|| (code >= 0x200E && code <= 0x200F) || (code >= 0x2028 && code <= 0x2029)
|| (code >= 0x202A && code <= 0x202E) || (code >= 0x2065 && code <= 0x2069)
// noncharacters
|| (code >= 0xFDD0 && code <= 0xFDEF) || (code & 0xFFFE) === 0xFFFE
// private use
|| (code >= 0xE000 && code <= 0xF8FF) || (code >= 0xF0000 && code <= 0x10FFFD);
};
var mapCodePoint = function (code) {
// full-width forms
if (code >= 0xFF01 && code <= 0xFF5E) return code - 0xFEE0;
// spaces and the listed code points collapse onto a forbidden domain code point; a space
// stands in for the real mapping since either way the domain is rejected
if (code === 0xA0 || code === 0x1680 || code === 0x202F || code === 0x205F || code === 0x3000) return 0x20;
if (code >= 0x2000 && code <= 0x200A) return 0x20;
// the list holds no supplementary code point, and `fromCharCode` would truncate one
if (code <= 0xFFFF && stringIndexOf(MAPPED_ONTO_FORBIDDEN, fromCharCode(code)) > -1) return 0x20;
return code;
};
// https://url.spec.whatwg.org/#concept-domain-to-ascii
// A subset of UTS#46 processing - the full mapping table is too large to ship. Covered are the
// entries cheap to express: the ignored and disallowed code points, full-width forms, and the
// code points mapping onto a forbidden domain code point. Not covered, so such domains are
// punycoded rather than mapped or rejected: unassigned code points, half-width forms,
// compatibility decompositions, NFC, CheckJoiners, CheckBidi, and labels that already arrive
// punycoded - those are not decoded back for validation.
var domainToASCII = function (domain) {
// every mapped, ignored and disallowed code point is non-ASCII, so an ASCII domain
// needs the punycode step only - this keeps the common case off the slow path
if (!exec(NON_ASCII, domain)) return domain === '' ? null : toASCII(domain);
var codePoints = arrayFrom(domain);
var result = '';
var index, code, mapped;
for (index = 0; index < codePoints.length; index++) {
code = codeAt(codePoints[index], 0);
if (isDisallowedCodePoint(code)) return null;
if (isIgnoredCodePoint(code)) continue;
mapped = mapCodePoint(code);
result += mapped === code ? codePoints[index] : fromCharCode(mapped);
}
return result === '' ? null : toASCII(result);
};
// https://url.spec.whatwg.org/#ends-in-a-number-checker
var endsInNumber = function (input) {
var parts = split(input, '.');
var last, hexPart;
if (parts[parts.length - 1] === '') {
if (parts.length === 1) return false;
parts.length--;
}
last = parts[parts.length - 1];
if (exec(DEC, last)) return true;
if (exec(HEX_START, last)) {
hexPart = stringSlice(last, 2);
return hexPart === '' || !!exec(HEX, hexPart);
}
return false;
};
// https://url.spec.whatwg.org/#concept-ipv4-parser
var parseIPv4 = function (input) {
var parts = split(input, '.');
var partsLength, numbers, index, part, radix, number, ipv4;
if (parts.length && parts[parts.length - 1] === '') {
parts.length--;
}
partsLength = parts.length;
if (partsLength > 4) return null;
numbers = [];
for (index = 0; index < partsLength; index++) {
part = parts[index];
if (part === '') return null;
radix = 10;
if (part.length > 1 && charAt(part, 0) === '0') {
radix = exec(HEX_START, part) ? 16 : 8;
part = stringSlice(part, radix === 8 ? 1 : 2);
}
if (part === '') {
number = 0;
} else {
if (!exec(radix === 10 ? DEC : radix === 8 ? OCT : HEX, part)) return null;
number = parseInt(part, radix);
}
push(numbers, number);
}
for (index = 0; index < partsLength; index++) {
number = numbers[index];
if (index === partsLength - 1) {
if (number >= pow(256, 5 - partsLength)) return null;
} else if (number > 255) return null;
}
ipv4 = pop(numbers);
for (index = 0; index < numbers.length; index++) {
ipv4 += numbers[index] * pow(256, 3 - index);
}
return ipv4;
};
// https://url.spec.whatwg.org/#concept-ipv6-parser
// eslint-disable-next-line max-statements -- TODO
var parseIPv6 = function (input) {
var address = [0, 0, 0, 0, 0, 0, 0, 0];
var pieceIndex = 0;
var compress = null;
var pointer = 0;
var value, length, numbersSeen, ipv4Piece, number, swaps, swap;
var chr = function () {
return charAt(input, pointer);
};
if (chr() === ':') {
if (charAt(input, 1) !== ':') return;
pointer += 2;
pieceIndex++;
compress = pieceIndex;
}
while (chr()) {
if (pieceIndex === 8) return;
if (chr() === ':') {
if (compress !== null) return;
pointer++;
pieceIndex++;
compress = pieceIndex;
continue;
}
value = length = 0;
while (length < 4 && exec(HEX, chr())) {
value = value * 16 + parseInt(chr(), 16);
pointer++;
length++;
}
if (chr() === '.') {
if (length === 0) return;
pointer -= length;
if (pieceIndex > 6) return;
numbersSeen = 0;
while (chr()) {
ipv4Piece = null;
if (numbersSeen > 0) {
if (chr() === '.' && numbersSeen < 4) pointer++;
else return;
}
if (!exec(DIGIT, chr())) return;
while (exec(DIGIT, chr())) {
number = parseInt(chr(), 10);
if (ipv4Piece === null) ipv4Piece = number;
else if (ipv4Piece === 0) return;
else ipv4Piece = ipv4Piece * 10 + number;
if (ipv4Piece > 255) return;
pointer++;
}
address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
numbersSeen++;
if (numbersSeen === 2 || numbersSeen === 4) pieceIndex++;
}
if (numbersSeen !== 4) return;
break;
} else if (chr() === ':') {
pointer++;
if (!chr()) return;
} else if (chr()) return;
address[pieceIndex++] = value;
}
if (compress !== null) {
swaps = pieceIndex - compress;
pieceIndex = 7;
while (pieceIndex !== 0 && swaps > 0) {
swap = address[pieceIndex];
address[pieceIndex--] = address[compress + swaps - 1];
address[compress + --swaps] = swap;
}
} else if (pieceIndex !== 8) return;
return address;
};
var findLongestZeroSequence = function (ipv6) {
var maxIndex = null;
var maxLength = 1;
var currStart = null;
var currLength = 0;
var index = 0;
for (; index < 8; index++) {
if (ipv6[index] !== 0) {
if (currLength > maxLength) {
maxIndex = currStart;
maxLength = currLength;
}
currStart = null;
currLength = 0;
} else {
if (currStart === null) currStart = index;
++currLength;
}
}
return currLength > maxLength ? currStart : maxIndex;
};
// https://url.spec.whatwg.org/#host-serializing
var serializeHost = function (host) {
var result, index, compress, ignore0;
// ipv4
if (typeof host == 'number') {
result = [];
for (index = 0; index < 4; index++) {
unshift(result, host % 256);
host = floor(host / 256);
}
return join(result, '.');
}
// ipv6
if (typeof host == 'object') {
result = '';
compress = findLongestZeroSequence(host);
for (index = 0; index < 8; index++) {
if (ignore0 && host[index] === 0) continue;
if (ignore0) ignore0 = false;
if (compress === index) {
result += index ? ':' : '::';
ignore0 = true;
} else {
result += numberToString(host[index], 16);
if (index < 7) result += ':';
}
}
return '[' + result + ']';
}
return host;
};
// https://url.spec.whatwg.org/#c0-control-percent-encode-set
// empty because the set is the code points outside U+0020..U+007E, which the range
// check below already covers; the sets extending it only add code points inside it
var C0ControlPercentEncodeSet = {};
var queryPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
' ': 1, '"': 1, '#': 1, '<': 1, '>': 1
});
var specialQueryPercentEncodeSet = assign({}, queryPercentEncodeSet, {
"'": 1
});
var fragmentPercentEncodeSet = assign({}, C0ControlPercentEncodeSet, {
' ': 1, '"': 1, '<': 1, '>': 1, '`': 1
});
var pathPercentEncodeSet = assign({}, fragmentPercentEncodeSet, {
'#': 1, '?': 1, '{': 1, '}': 1, '^': 1
});
var userinfoPercentEncodeSet = assign({}, pathPercentEncodeSet, {
'/': 1, ':': 1, ';': 1, '=': 1, '@': 1, '[': 1, '\\': 1, ']': 1, '^': 1, '|': 1
});
// https://url.spec.whatwg.org/#string-utf-8-percent-encode
var utf8PercentEncode = function (chr, set) {
var code = codeAt(chr, 0);
// percent-encoding leaves ' alone, but it belongs to the special-query percent-encode set
return code >= 0x20 && code < 0x7F && !hasOwn(set, chr) ? chr : chr === "'" && hasOwn(set, chr) ? '%27' : percentEncode(chr);
};
// https://url.spec.whatwg.org/#special-scheme
var specialSchemes = {
ftp: 21,
file: null,
http: 80,
https: 443,
ws: 80,
wss: 443
};
// https://url.spec.whatwg.org/#windows-drive-letter
var isWindowsDriveLetter = function (string, normalized) {
var second;
return string.length === 2 && exec(ALPHA, charAt(string, 0))
&& ((second = charAt(string, 1)) === ':' || (!normalized && second === '|'));
};
// https://url.spec.whatwg.org/#start-with-a-windows-drive-letter
var startsWithWindowsDriveLetter = function (string) {
var third;
return string.length > 1 && isWindowsDriveLetter(stringSlice(string, 0, 2)) && (
string.length === 2 ||
((third = charAt(string, 2)) === '/' || third === '\\' || third === '?' || third === '#')
);
};
// https://url.spec.whatwg.org/#single-dot-path-segment
var isSingleDot = function (segment) {
return segment === '.' || toLowerCase(segment) === '%2e';
};
// https://url.spec.whatwg.org/#double-dot-path-segment
var isDoubleDot = function (segment) {
segment = toLowerCase(segment);
return segment === '..' || segment === '%2e.' || segment === '.%2e' || segment === '%2e%2e';
};
// States:
var SCHEME_START = {};
var SCHEME = {};
var NO_SCHEME = {};
var SPECIAL_RELATIVE_OR_AUTHORITY = {};
var PATH_OR_AUTHORITY = {};
var RELATIVE = {};
var RELATIVE_SLASH = {};
var SPECIAL_AUTHORITY_SLASHES = {};
var SPECIAL_AUTHORITY_IGNORE_SLASHES = {};
var AUTHORITY = {};
var HOST = {};
var HOSTNAME = {};
var PORT = {};
var FILE = {};
var FILE_SLASH = {};
var FILE_HOST = {};
var PATH_START = {};
var PATH = {};
var CANNOT_BE_A_BASE_URL_PATH = {};
var QUERY = {};
var FRAGMENT = {};
var URLState = function (url, isBase, base) {
var urlString = $toString(url);
var baseState, failure, searchParams;
if (isBase) {
failure = this.parse(urlString);
if (failure) throw new TypeError(failure);
this.searchParams = null;
} else {
if (base !== undefined) baseState = new URLState(base, true);
failure = this.parse(urlString, null, baseState);
if (failure) throw new TypeError(failure);
searchParams = getInternalSearchParamsState(new URLSearchParams());
searchParams.bindURL(this);
this.searchParams = searchParams;
}
};
URLState.prototype = {
type: 'URL',
// https://url.spec.whatwg.org/#url-parsing
// eslint-disable-next-line max-statements -- TODO
parse: function (input, stateOverride, base) {
var url = this;
var state = stateOverride || SCHEME_START;
var pointer = 0;
var buffer = '';
var seenAt = false;
var seenBracket = false;
var seenPasswordToken = false;
var codePoints, chr, bufferCodePoints, failure;
input = $toString(input);
if (!stateOverride) {
url.scheme = '';
url.username = '';
url.password = '';
url.host = null;
url.port = null;
url.path = [];
url.query = null;
url.fragment = null;
url.cannotBeABaseURL = false;
input = replace(input, LEADING_C0_CONTROL_OR_SPACE, '');
input = replace(input, TRAILING_C0_CONTROL_OR_SPACE, '$1');
}
input = replace(input, TAB_AND_NEW_LINE, '');
codePoints = arrayFrom(input);
while (pointer <= codePoints.length) {
chr = codePoints[pointer];
switch (state) {
case SCHEME_START:
if (chr && exec(ALPHA, chr)) {
buffer += toLowerCase(chr);
state = SCHEME;
} else if (!stateOverride) {
state = NO_SCHEME;
continue;
} else return INVALID_SCHEME;
break;
case SCHEME:
if (chr && exec(ALPHANUMERIC_PLUS_MINUS_DOT, chr)) {
buffer += toLowerCase(chr);
} else if (chr === ':') {
if (stateOverride && (
(url.isSpecial() !== hasOwn(specialSchemes, buffer)) ||
(buffer === 'file' && (url.includesCredentials() || url.port !== null)) ||
(url.scheme === 'file' && url.host === '')
)) return;
url.scheme = buffer;
if (stateOverride) {
if (url.isSpecial() && specialSchemes[url.scheme] === url.port) url.port = null;
return;
}
buffer = '';
if (url.scheme === 'file') {
state = FILE;
} else if (url.isSpecial() && base && base.scheme === url.scheme) {
state = SPECIAL_RELATIVE_OR_AUTHORITY;
} else if (url.isSpecial()) {
state = SPECIAL_AUTHORITY_SLASHES;
} else if (codePoints[pointer + 1] === '/') {
state = PATH_OR_AUTHORITY;
pointer++;
} else {
url.cannotBeABaseURL = true;
push(url.path, '');
state = CANNOT_BE_A_BASE_URL_PATH;
}
} else if (!stateOverride) {
buffer = '';
state = NO_SCHEME;
pointer = 0;
continue;
} else return INVALID_SCHEME;
break;
case NO_SCHEME:
if (!base || (base.cannotBeABaseURL && chr !== '#')) return INVALID_SCHEME;
if (base.cannotBeABaseURL && chr === '#') {
url.scheme = base.scheme;
url.path = arraySlice(base.path);
url.query = base.query;
url.fragment = '';
url.cannotBeABaseURL = true;
state = FRAGMENT;
break;
}
state = base.scheme === 'file' ? FILE : RELATIVE;
continue;
case SPECIAL_RELATIVE_OR_AUTHORITY:
if (chr === '/' && codePoints[pointer + 1] === '/') {
state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
pointer++;
} else {
state = RELATIVE;
continue;
} break;
case PATH_OR_AUTHORITY:
if (chr === '/') {
state = AUTHORITY;
break;
} else {
state = PATH;
continue;
}
case RELATIVE:
url.scheme = base.scheme;
if (chr === EOF) {
url.username = base.username;
url.password = base.password;
url.host = base.host;
url.port = base.port;
url.path = arraySlice(base.path);
url.query = base.query;
} else if (chr === '/' || (chr === '\\' && url.isSpecial())) {
state = RELATIVE_SLASH;
} else if (chr === '?') {
url.username = base.username;
url.password = base.password;
url.host = base.host;
url.port = base.port;
url.path = arraySlice(base.path);
url.query = '';
state = QUERY;
} else if (chr === '#') {
url.username = base.username;
url.password = base.password;
url.host = base.host;
url.port = base.port;
url.path = arraySlice(base.path);
url.query = base.query;
url.fragment = '';
state = FRAGMENT;
} else {
url.username = base.username;
url.password = base.password;
url.host = base.host;
url.port = base.port;
url.path = arraySlice(base.path);
if (url.path.length) url.path.length--;
state = PATH;
continue;
} break;
case RELATIVE_SLASH:
if (url.isSpecial() && (chr === '/' || chr === '\\')) {
state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
} else if (chr === '/') {
state = AUTHORITY;
} else {
url.username = base.username;
url.password = base.password;
url.host = base.host;
url.port = base.port;
state = PATH;
continue;
} break;
case SPECIAL_AUTHORITY_SLASHES:
state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
if (chr !== '/' || codePoints[pointer + 1] !== '/') continue;
pointer++;
break;
case SPECIAL_AUTHORITY_IGNORE_SLASHES:
if (chr !== '/' && chr !== '\\') {
state = AUTHORITY;
continue;
} break;
case AUTHORITY:
if (chr === '@') {
if (seenAt) buffer = '%40' + buffer;
seenAt = true;
bufferCodePoints = arrayFrom(buffer);
for (var i = 0; i < bufferCodePoints.length; i++) {
var codePoint = bufferCodePoints[i];
if (codePoint === ':' && !seenPasswordToken) {
seenPasswordToken = true;
continue;
}
var encodedCodePoints = utf8PercentEncode(codePoint, userinfoPercentEncodeSet);
if (seenPasswordToken) url.password += encodedCodePoints;
else url.username += encodedCodePoints;
}
buffer = '';
} else if (
chr === EOF || chr === '/' || chr === '?' || chr === '#' ||
(chr === '\\' && url.isSpecial())
) {
if (seenAt && buffer === '') return INVALID_AUTHORITY;
pointer -= arrayFrom(buffer).length + 1;
buffer = '';
state = HOST;
} else buffer += chr;
break;
case HOST:
case HOSTNAME:
if (stateOverride && url.scheme === 'file') {
state = FILE_HOST;
continue;
} else if (chr === ':' && !seenBracket) {
if (buffer === '') return INVALID_HOST;
if (stateOverride === HOSTNAME) return;
failure = url.parseHost(buffer);
if (failure) return failure;
buffer = '';
state = PORT;
} else if (
chr === EOF || chr === '/' || chr === '?' || chr === '#' ||
(chr === '\\' && url.isSpecial())
) {
if (url.isSpecial() && buffer === '') return INVALID_HOST;
if (stateOverride && buffer === '' && (url.includesCredentials() || url.port !== null)) return;
failure = url.parseHost(buffer);
if (failure) return failure;
buffer = '';
state = PATH_START;
if (stateOverride) return;
continue;
} else {
if (chr === '[') seenBracket = true;
else if (chr === ']') seenBracket = false;
buffer += chr;
} break;
case PORT:
if (exec(DIGIT, chr)) {
buffer += chr;
} else if (
chr === EOF || chr === '/' || chr === '?' || chr === '#' ||
(chr === '\\' && url.isSpecial()) ||
stateOverride
) {
if (buffer !== '') {
var port = parseInt(buffer, 10);
if (port > 0xFFFF) return INVALID_PORT;
url.port = (url.isSpecial() && port === specialSchemes[url.scheme]) ? null : port;
buffer = '';
}
if (stateOverride) return;
state = PATH_START;
continue;
} else return INVALID_PORT;
break;
case FILE:
url.scheme = 'file';
url.host = '';
if (chr === '/' || chr === '\\') state = FILE_SLASH;
else if (base && base.scheme === 'file') {
switch (chr) {
case EOF:
url.host = base.host;
url.path = arraySlice(base.path);
url.query = base.query;
break;
case '?':
url.host = base.host;
url.path = arraySlice(base.path);
url.query = '';
state = QUERY;
break;
case '#':
url.host = base.host;
url.path = arraySlice(base.path);
url.query = base.query;
url.fragment = '';
state = FRAGMENT;
break;
default:
url.host = base.host;
if (!startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))) {
url.path = arraySlice(base.path);
url.shortenPath();
}
state = PATH;
continue;
}
} else {
state = PATH;
continue;
} break;
case FILE_SLASH:
if (chr === '/' || chr === '\\') {
state = FILE_HOST;
break;
}
if (base && base.scheme === 'file') {
url.host = base.host;
if (!startsWithWindowsDriveLetter(join(arraySlice(codePoints, pointer), ''))
&& isWindowsDriveLetter(base.path[0], true)) push(url.path, base.path[0]);
}
state = PATH;
continue;
case FILE_HOST:
if (chr === EOF || chr === '/' || chr === '\\' || chr === '?' || chr === '#') {
if (!stateOverride && isWindowsDriveLetter(buffer)) {
state = PATH;
} else if (buffer === '') {
url.host = '';
if (stateOverride) return;
state = PATH_START;
} else {
failure = url.parseHost(buffer);
if (failure) return failure;
if (url.host === 'localhost') url.host = '';
if (stateOverride) return;
buffer = '';
state = PATH_START;
} continue;
} else buffer += chr;
break;
case PATH_START:
if (url.isSpecial()) {
state = PATH;
if (chr !== '/' && chr !== '\\') continue;
} else if (!stateOverride && chr === '?') {
url.query = '';
state = QUERY;
} else if (!stateOverride && chr === '#') {
url.fragment = '';
state = FRAGMENT;
} else if (chr !== EOF) {
state = PATH;
if (chr !== '/') continue;
} break;
case PATH:
if (
chr === EOF || chr === '/' ||
(chr === '\\' && url.isSpecial()) ||
(!stateOverride && (chr === '?' || chr === '#'))
) {
if (isDoubleDot(buffer)) {
url.shortenPath();
if (chr !== '/' && !(chr === '\\' && url.isSpecial())) {
push(url.path, '');
}
} else if (isSingleDot(buffer)) {
if (chr !== '/' && !(chr === '\\' && url.isSpecial())) {
push(url.path, '');
}
} else {
if (url.scheme === 'file' && !url.path.length && isWindowsDriveLetter(buffer)) {
// eslint-disable-next-line max-depth -- ok
if (url.host !== null && url.host !== '') url.host = '';
buffer = charAt(buffer, 0) + ':'; // normalize windows drive letter
}
push(url.path, buffer);
}
buffer = '';
if (url.scheme === 'file' && (chr === EOF || chr === '?' || chr === '#')) {
while (url.path.length > 1 && url.path[0] === '') {
shift(url.path);
}
}
if (chr === '?') {
url.query = '';
state = QUERY;
} else if (chr === '#') {
url.fragment = '';
state = FRAGMENT;
}
} else {
buffer += utf8PercentEncode(chr, pathPercentEncodeSet);
} break;
case CANNOT_BE_A_BASE_URL_PATH:
if (chr === '?') {
url.query = '';
state = QUERY;
} else if (chr === '#') {
url.fragment = '';
state = FRAGMENT;
} else if (chr !== EOF) {
if (chr === ' ') {
url.path[0] += codePoints[pointer + 1] === '?' || codePoints[pointer + 1] === '#' ? '%20' : ' ';
} else {
url.path[0] += utf8PercentEncode(chr, C0ControlPercentEncodeSet);
}
} break;
case QUERY:
if (!stateOverride && chr === '#') {
url.fragment = '';
state = FRAGMENT;
} else if (chr !== EOF) {
url.query += utf8PercentEncode(chr, url.isSpecial() ? specialQueryPercentEncodeSet : queryPercentEncodeSet);
} break;
case FRAGMENT:
if (chr !== EOF) url.fragment += utf8PercentEncode(chr, fragmentPercentEncodeSet);
break;
}
pointer++;
}
},
// https://url.spec.whatwg.org/#host-parsing
parseHost: function (input) {
var result, codePoints, index;
if (charAt(input, 0) === '[') {
if (charAt(input, input.length - 1) !== ']') return INVALID_HOST;
result = parseIPv6(stringSlice(input, 1, -1));
if (!result) return INVALID_HOST;
this.host = result;
// opaque host
} else if (!this.isSpecial()) {
if (exec(FORBIDDEN_HOST_CODE_POINT, input)) return INVALID_HOST;
result = '';
codePoints = arrayFrom(input);
for (index = 0; index < codePoints.length; index++) {
result += utf8PercentEncode(codePoints[index], C0ControlPercentEncodeSet);
}
this.host = result;
} else {
input = domainToASCII(percentDecode(input));
if (input === null || exec(FORBIDDEN_DOMAIN_CODE_POINT, input)) return INVALID_HOST;
if (endsInNumber(input)) {
result = parseIPv4(input);
if (result === null) return INVALID_HOST;
this.host = result;
} else {
this.host = input;
}
}
},
// https://url.spec.whatwg.org/#cannot-have-a-username-password-port
cannotHaveUsernamePasswordPort: function () {
return this.host === null || this.host === '' || this.cannotBeABaseURL || this.scheme === 'file';
},
// https://url.spec.whatwg.org/#include-credentials
includesCredentials: function () {
return this.username !== '' || this.password !== '';
},
// https://url.spec.whatwg.org/#is-special
isSpecial: function () {
return hasOwn(specialSchemes, this.scheme);
},
// https://url.spec.whatwg.org/#shorten-a-urls-path
shortenPath: function () {
var path = this.path;
var pathSize = path.length;
if (pathSize && (this.scheme !== 'file' || pathSize !== 1 || !isWindowsDriveLetter(path[0], true))) {
path.length--;
}
},
// https://url.spec.whatwg.org/#concept-url-serializer
serialize: function () {
var url = this;
var scheme = url.scheme;
var username = url.username;
var password = url.password;
var host = url.host;
var port = url.port;
var path = url.path;
var query = url.query;
var fragment = url.fragment;
var output = scheme + ':';
if (host !== null) {
output += '//';
if (url.includesCredentials()) {
output += username + (password ? ':' + password : '') + '@';
}
output += serializeHost(host);
if (port !== null) output += ':' + port;
} else if (scheme === 'file') output += '//';
if (host === null && !url.cannotBeABaseURL && path.length > 1 && path[0] === '') output += '/.';
output += url.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';
if (query !== null) output += '?' + query;
if (fragment !== null) output += '#' + fragment;
return output;
},
// https://url.spec.whatwg.org/#dom-url-href
setHref: function (href) {
var failure = this.parse(href);
if (failure) throw new TypeError(failure);
this.searchParams.update();
},
// https://url.spec.whatwg.org/#dom-url-origin
getOrigin: function () {
var scheme = this.scheme;
var port = this.port;
if (scheme === 'blob') try {
return new URLConstructor(this.path[0]).origin;
} catch (error) {
return 'null';
}
if (scheme === 'file' || !this.isSpecial()) return 'null';
return scheme + '://' + serializeHost(this.host) + (port !== null ? ':' + port : '');
},
// https://url.spec.whatwg.org/#dom-url-protocol
getProtocol: function () {
return this.scheme + ':';
},
setProtocol: function (protocol) {
this.parse($toString(protocol) + ':', SCHEME_START);
},
// https://url.spec.whatwg.org/#dom-url-username
getUsername: function () {
return this.username;
},
setUsername: function (username) {
var codePoints = arrayFrom($toString(username));
if (this.cannotHaveUsernamePasswordPort()) return;
this.username = '';
for (var i = 0; i < codePoints.length; i++) {
this.username += utf8PercentEncode(codePoints[i], userinfoPercentEncodeSet);
}
},
// https://url.spec.whatwg.org/#dom-url-password
getPassword: function () {
return this.password;
},
setPassword: function (password) {
var codePoints = arrayFrom($toString(password));
if (this.cannotHaveUsernamePasswordPort()) return;
this.password = '';
for (var i = 0; i < codePoints.length; i++) {
this.password += utf8PercentEncode(codePoints[i], userinfoPercentEncodeSet);
}
},
// https://url.spec.whatwg.org/#dom-url-host
getHost: function () {
var host = this.host;
var port = this.port;
return host === null ? ''
: port === null ? serializeHost(host)
: serializeHost(host) + ':' + port;
},
setHost: function (host) {
if (this.cannotBeABaseURL) return;
this.parse(host, HOST);
},
// https://url.spec.whatwg.org/#dom-url-hostname
getHostname: function () {
var host = this.host;
return host === null ? '' : serializeHost(host);
},
setHostname: function (hostname) {
if (this.cannotBeABaseURL) return;
this.parse(hostname, HOSTNAME);
},
// https://url.spec.whatwg.org/#dom-url-port
getPort: function () {
var port = this.port;
return port === null ? '' : $toString(port);
},
setPort: function (port) {
if (this.cannotHaveUsernamePasswordPort()) return;
port = $toString(port);
if (port === '') this.port = null;
else this.parse(port, PORT);
},
// https://url.spec.whatwg.org/#dom-url-pathname
getPathname: function () {
var path = this.path;
return this.cannotBeABaseURL ? path[0] : path.length ? '/' + join(path, '/') : '';
},
setPathname: function (pathname) {
if (this.cannotBeABaseURL) return;
this.path = [];
this.parse(pathname, PATH_START);
},
// https://url.spec.whatwg.org/#dom-url-search
getSearch: function () {
var query = this.query;
return query ? '?' + query : '';
},
setSearch: function (search) {
search = $toString(search);
if (search === '') {
this.query = null;
} else {
if (charAt(search, 0) === '?') search = stringSlice(search, 1);
this.query = '';
this.parse(search, QUERY);
}
this.searchParams.update();
},
// https://url.spec.whatwg.org/#dom-url-searchparams
getSearchParams: function () {
return this.searchParams.facade;
},
// https://url.spec.whatwg.org/#dom-url-hash
getHash: function () {
var fragment = this.fragment;
return fragment ? '#' + fragment : '';
},
setHash: function (hash) {
hash = $toString(hash);
if (hash === '') {
this.fragment = null;
return;
}
if (charAt(hash, 0) === '#') hash = stringSlice(hash, 1);
this.fragment = '';
this.parse(hash, FRAGMENT);
},
update: function () {
this.query = this.searchParams.serialize() || null;
}
};
// `URL` constructor
// https://url.spec.whatwg.org/#url-class
var URLConstructor = function URL(url /* , base */) {
var that = anInstance(this, URLPrototype);
var base = validateArgumentsLength(arguments.length, 1) > 1 ? arguments[1] : undefined;
var state = setInternalState(that, new URLState(url, false, base));
if (!DESCRIPTORS) {
that.href = state.serialize();
that.origin = state.getOrigin();
that.protocol = state.getProtocol();
that.username = state.getUsername();
that.password = state.getPassword();
that.host = state.getHost();
that.hostname = state.getHostname();
that.port = state.getPort();
that.pathname = state.getPathname();
that.search = state.getSearch();
that.searchParams = state.getSearchParams();
that.hash = state.getHash();
}
};
var URLPrototype = URLConstructor.prototype;
var accessorDescriptor = function (getter, setter) {
return {
get: function () {
return getInternalURLState(this)[getter]();
},
set: setter && function (value) {
return getInternalURLState(this)[setter](value);
},
configurable: true,
enumerable: true
};
};
if (DESCRIPTORS) {
// `URL.prototype.href` accessors pair
// https://url.spec.whatwg.org/#dom-url-href
defineBuiltInAccessor(URLPrototype, 'href', accessorDescriptor('serialize', 'setHref'));
// `URL.prototype.origin` getter
// https://url.spec.whatwg.org/#dom-url-origin
defineBuiltInAccessor(URLPrototype, 'origin', accessorDescriptor('getOrigin'));
// `URL.prototype.protocol` accessors pair
// https://url.spec.whatwg.org/#dom-url-protocol
defineBuiltInAccessor(URLPrototype, 'protocol', accessorDescriptor('getProtocol', 'setProtocol'));
// `URL.prototype.username` accessors pair
// https://url.spec.whatwg.org/#dom-url-username
defineBuiltInAccessor(URLPrototype, 'username', accessorDescriptor('getUsername', 'setUsername'));
// `URL.prototype.password` accessors pair
// https://url.spec.whatwg.org/#dom-url-password
defineBuiltInAccessor(URLPrototype, 'password', accessorDescriptor('getPassword', 'setPassword'));
// `URL.prototype.host` accessors pair
// https://url.spec.whatwg.org/#dom-url-host
defineBuiltInAccessor(URLPrototype, 'host', accessorDescriptor('getHost', 'setHost'));
// `URL.prototype.hostname` accessors pair
// https://url.spec.whatwg.org/#dom-url-hostname
defineBuiltInAccessor(URLPrototype, 'hostname', accessorDescriptor('getHostname', 'setHostname'));
// `URL.prototype.port` accessors pair
// https://url.spec.whatwg.org/#dom-url-port
defineBuiltInAccessor(URLPrototype, 'port', accessorDescriptor('getPort', 'setPort'));
// `URL.prototype.pathname` accessors pair
// https://url.spec.whatwg.org/#dom-url-pathname
defineBuiltInAccessor(URLPrototype, 'pathname', accessorDescriptor('getPathname', 'setPathname'));
// `URL.prototype.search` accessors pair
// https://url.spec.whatwg.org/#dom-url-search
defineBuiltInAccessor(URLPrototype, 'search', accessorDescriptor('getSearch', 'setSearch'));
// `URL.prototype.searchParams` getter
// https://url.spec.whatwg.org/#dom-url-searchparams
defineBuiltInAccessor(URLPrototype, 'searchParams', accessorDescriptor('getSearchParams'));
// `URL.prototype.hash` accessors pair
// https://url.spec.whatwg.org/#dom-url-hash
defineBuiltInAccessor(URLPrototype, 'hash', accessorDescriptor('getHash', 'setHash'));
}
// `URL.prototype.toJSON` method
// https://url.spec.whatwg.org/#dom-url-tojson
defineBuiltIn(URLPrototype, 'toJSON', function toJSON() {
return getInternalURLState(this).serialize();
}, { enumerable: true });
// `URL.prototype.toString` method
// https://url.spec.whatwg.org/#URL-stringification-behavior
defineBuiltIn(URLPrototype, 'toString', function toString() {
return getInternalURLState(this).serialize();
}, { enumerable: true });
if (NativeURL) {
var nativeCreateObjectURL = NativeURL.createObjectURL;
var nativeRevokeObjectURL = NativeURL.revokeObjectURL;
// `URL.createObjectURL` method
// https://developer.mozilla.org/en-US/docs/Web/API/URL/createObjectURL
if (nativeCreateObjectURL) defineBuiltIn(URLConstructor, 'createObjectURL', bind(nativeCreateObjectURL, NativeURL));
// `URL.revokeObjectURL` method
// https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL
if (nativeRevokeObjectURL) defineBuiltIn(URLConstructor, 'revokeObjectURL', bind(nativeRevokeObjectURL, NativeURL));
}
setToStringTag(URLConstructor, 'URL');
$({ global: true, constructor: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {
URL: URLConstructor
});
});
// MODULE: ./node_modules/core-js/modules/web.url.js
var web_url_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
// TODO: Remove this module from `core-js@4` since it's replaced to module below
(web_url_constructor_namespaceFn());
});
// MODULE: ./node_modules/core-js/modules/web.url.parse.js
var web_url_parse_namespaceFn = /*#__PURE__*/__webpack_require__.cw(() => {
var $ = (export_namespaceFn());
var getBuiltIn = (get_built_in_namespaceFn());
var validateArgumentsLength = (validate_arguments_length_namespaceFn());
var toString = (to_string_namespaceFn());
var USE_NATIVE_URL = (url_constructor_detection_namespaceFn());
var URL = getBuiltIn('URL');
// `URL.parse` method
// https://url.spec.whatwg.org/#dom-url-parse
$({ target: 'URL', stat: true, forced: !USE_NATIVE_URL }, {
parse: function parse(url) {
var length = validateArgumentsLength(arguments.length, 1);
var urlString = toString(url);
var base = length < 2 || arguments[1] === undefined ? undefined : toString(arguments[1]);
try {
return new URL(urlString, base);
} catch (error) {
return null;
}
}
});
});
;// ./node_modules/core-js/modules/es.error.cause.js
es_error_cause_namespaceFn();
;// ./node_modules/core-js/modules/es.array.push.js
es_array_push_namespaceFn();
;// ./node_modules/core-js/modules/es.array-buffer.detached.js
es_array_buffer_detached_namespaceFn();
;// ./node_modules/core-js/modules/es.array-buffer.transfer.js
es_array_buffer_transfer_namespaceFn();
;// ./node_modules/core-js/modules/es.array-buffer.transfer-to-fixed-length.js
es_array_buffer_transfer_to_fixed_length_namespaceFn();
;// ./node_modules/core-js/modules/es.iterator.constructor.js
es_iterator_constructor_namespaceFn();
;// ./node_modules/core-js/modules/es.iterator.take.js
es_iterator_take_namespaceFn();
;// ./node_modules/core-js/modules/es.map.get-or-insert.js
es_map_get_or_insert_namespaceFn();
;// ./node_modules/core-js/modules/es.map.get-or-insert-computed.js
es_map_get_or_insert_computed_namespaceFn();
;// ./node_modules/core-js/modules/es.promise.with-resolvers.js
es_promise_with_resolvers_namespaceFn();
;// ./node_modules/core-js/modules/es.typed-array.uint8-array.js
es_typed_array_uint8_array_namespaceFn();
;// ./node_modules/core-js/modules/es.typed-array.at.js
es_typed_array_at_namespaceFn();
;// ./node_modules/core-js/modules/es.typed-array.fill.js
es_typed_array_fill_namespaceFn();
;// ./node_modules/core-js/modules/es.typed-array.find-last.js
es_typed_array_find_last_namespaceFn();
;// ./node_modules/core-js/modules/es.typed-array.find-last-index.js
es_typed_array_find_last_index_namespaceFn();
;// ./node_modules/core-js/modules/es.typed-array.set.js
es_typed_array_set_namespaceFn();
;// ./node_modules/core-js/modules/es.typed-array.sort.js
es_typed_array_sort_namespaceFn();
;// ./node_modules/core-js/modules/es.typed-array.to-reversed.js
es_typed_array_to_reversed_namespaceFn();
;// ./node_modules/core-js/modules/es.typed-array.to-sorted.js
es_typed_array_to_sorted_namespaceFn();
;// ./node_modules/core-js/modules/es.typed-array.with.js
es_typed_array_with_namespaceFn();
;// ./node_modules/core-js/modules/es.uint8-array.set-from-base64.js
es_uint8_array_set_from_base64_namespaceFn();
;// ./node_modules/core-js/modules/es.uint8-array.set-from-hex.js
es_uint8_array_set_from_hex_namespaceFn();
;// ./node_modules/core-js/modules/es.uint8-array.to-base64.js
es_uint8_array_to_base64_namespaceFn();
;// ./node_modules/core-js/modules/es.uint8-array.to-hex.js
es_uint8_array_to_hex_namespaceFn();
;// ./node_modules/core-js/modules/web.self.js
web_self_namespaceFn();
;// ./node_modules/core-js/modules/es.array.at.js
es_array_at_namespaceFn();
;// ./node_modules/core-js/modules/es.iterator.filter.js
es_iterator_filter_namespaceFn();
;// ./node_modules/core-js/modules/es.iterator.map.js
es_iterator_map_namespaceFn();
;// ./node_modules/core-js/modules/es.json.stringify.js
es_json_stringify_namespaceFn();
;// ./node_modules/core-js/modules/es.string.at-alternative.js
es_string_at_alternative_namespaceFn();
;// ./node_modules/core-js/modules/es.typed-array.float32-array.js
es_typed_array_float32_array_namespaceFn();
;// ./node_modules/core-js/modules/es.typed-array.uint32-array.js
es_typed_array_uint32_array_namespaceFn();
;// ./node_modules/core-js/modules/es.weak-map.get-or-insert.js
es_weak_map_get_or_insert_namespaceFn();
;// ./node_modules/core-js/modules/es.weak-map.get-or-insert-computed.js
es_weak_map_get_or_insert_computed_namespaceFn();
;// ./node_modules/core-js/modules/es.iterator.for-each.js
es_iterator_for_each_namespaceFn();
;// ./node_modules/core-js/modules/es.set.difference.v2.js
es_set_difference_v2_namespaceFn();
;// ./node_modules/core-js/modules/es.set.intersection.v2.js
es_set_intersection_v2_namespaceFn();
;// ./node_modules/core-js/modules/es.set.is-disjoint-from.v2.js
es_set_is_disjoint_from_v2_namespaceFn();
;// ./node_modules/core-js/modules/es.set.is-subset-of.v2.js
es_set_is_subset_of_v2_namespaceFn();
;// ./node_modules/core-js/modules/es.set.is-superset-of.v2.js
es_set_is_superset_of_v2_namespaceFn();
;// ./node_modules/core-js/modules/es.set.symmetric-difference.v2.js
es_set_symmetric_difference_v2_namespaceFn();
;// ./node_modules/core-js/modules/es.set.union.v2.js
es_set_union_v2_namespaceFn();
;// ./node_modules/core-js/modules/es.typed-array.float64-array.js
es_typed_array_float64_array_namespaceFn();
;// ./node_modules/core-js/modules/es.typed-array.uint8-clamped-array.js
es_typed_array_uint8_clamped_array_namespaceFn();
;// ./node_modules/core-js/modules/es.array.includes.js
es_array_includes_namespaceFn();
;// ./node_modules/core-js/modules/es.string.replace.js
es_string_replace_namespaceFn();
;// ./node_modules/core-js/modules/es.string.replace-all.js
es_string_replace_all_namespaceFn();
;// ./node_modules/core-js/modules/es.typed-array.from.js
es_typed_array_from_namespaceFn();
;// ./node_modules/core-js/modules/web.url.js
web_url_namespaceFn();
;// ./node_modules/core-js/modules/web.url.parse.js
web_url_parse_namespaceFn();
;// ./external/ngx-logger/ngx-console.js
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function _toPrimitive(t, e) { if ("object" != typeof t || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); }
class NgxConsole {
static log(message, reason) {
if (NgxConsole.ngxConsoleFilter("log", message)) {
if (reason !== undefined) {
console.log("%s", message, reason);
} else {
console.log(message);
}
}
}
static error(message, reason) {
if (NgxConsole.ngxConsoleFilter("error", message)) {
if (reason !== undefined) {
console.error("%s", message, reason);
} else {
console.error(message);
}
}
}
static warn(message, reason) {
if (NgxConsole.ngxConsoleFilter("warn", message)) {
if (reason !== undefined) {
console.warn("%s", message, reason);
} else {
console.warn(message);
}
}
}
static debug(message, reason) {
if (NgxConsole.ngxConsoleFilter("debug", message)) {
if (reason !== undefined) {
console.warn("%s", message, reason);
} else {
console.warn(message);
}
}
}
get ngxConsoleFilter() {
return NgxConsole.ngxConsoleFilter;
}
set ngxConsoleFilter(filter) {
NgxConsole.ngxConsoleFilter = filter;
}
reset() {
NgxConsole.ngxConsoleFilter = (_level, _message) => true;
}
}
_defineProperty(NgxConsole, "ngxConsoleFilter", (_level, _message) => true);
;// ./src/shared/util.js
var _Util;
function _assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
;
const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser");
const BBOX_INIT = [Infinity, Infinity, -Infinity, -Infinity];
const F32_BBOX_INIT = new Float32Array(BBOX_INIT);
const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
const DEFAULT_VERTICAL_ORIGIN_Y = 880;
const DEFAULT_VERTICAL_ADVANCE = 1000;
const LINE_FACTOR = 1.35;
const LINE_DESCENT_FACTOR = 0.35;
const BASELINE_FACTOR = (/* unused pure expression or super */ null && (LINE_DESCENT_FACTOR / LINE_FACTOR));
const SVG_NS = "http://www.w3.org/2000/svg";
const RenderingIntentFlag = {
ANY: 0x01,
DISPLAY: 0x02,
PRINT: 0x04,
SAVE: 0x08,
ANNOTATIONS_FORMS: 0x10,
ANNOTATIONS_STORAGE: 0x20,
ANNOTATIONS_DISABLE: 0x40,
IS_EDITING: 0x80,
OPLIST: 0x100
};
const AnnotationMode = (/* unused pure expression or super */ null && ({
DISABLE: 0,
ENABLE: 1,
ENABLE_FORMS: 2,
ENABLE_STORAGE: 3
}));
const AnnotationPrefix = "pdfjs_internal_id_";
const AnnotationEditorPrefix = "pdfjs_internal_editor_";
const AnnotationEditorType = (/* unused pure expression or super */ null && ({
DISABLE: -1,
NONE: 0,
FREETEXT: 3,
HIGHLIGHT: 9,
STAMP: 13,
INK: 15,
POPUP: 16,
SIGNATURE: 101,
COMMENT: 102,
ERASER: 103
}));
const AnnotationEditorParamsType = (/* unused pure expression or super */ null && ({
RESIZE: 1,
CREATE: 2,
FREETEXT_SIZE: 11,
FREETEXT_COLOR: 12,
FREETEXT_OPACITY: 13,
INK_COLOR: 21,
INK_THICKNESS: 22,
INK_OPACITY: 23,
INK_COLOR_AND_OPACITY: 24,
ERASER_THICKNESS: 25,
HIGHLIGHT_COLOR: 31,
HIGHLIGHT_THICKNESS: 32,
HIGHLIGHT_FREE: 33,
HIGHLIGHT_SHOW_ALL: 34,
DRAW_STEP: 41,
ERASER_STEP: 42
}));
const PermissionFlag = (/* unused pure expression or super */ null && ({
PRINT: 0x04,
MODIFY_CONTENTS: 0x08,
COPY: 0x10,
MODIFY_ANNOTATIONS: 0x20,
FILL_INTERACTIVE_FORMS: 0x100,
COPY_FOR_ACCESSIBILITY: 0x200,
ASSEMBLE: 0x400,
PRINT_HIGH_QUALITY: 0x800
}));
const MeshFigureType = (/* unused pure expression or super */ null && ({
TRIANGLES: 1,
LATTICE: 2,
PATCH: 3
}));
const TextRenderingMode = {
FILL: 0,
STROKE: 1,
FILL_STROKE: 2,
INVISIBLE: 3,
FILL_ADD_TO_PATH: 4,
STROKE_ADD_TO_PATH: 5,
FILL_STROKE_ADD_TO_PATH: 6,
ADD_TO_PATH: 7,
FILL_STROKE_MASK: 3,
ADD_TO_PATH_FLAG: 4
};
const ImageKind = {
GRAYSCALE_1BPP: 1,
RGB_24BPP: 2,
RGBA_32BPP: 3
};
const AnnotationType = (/* unused pure expression or super */ null && ({
TEXT: 1,
LINK: 2,
FREETEXT: 3,
LINE: 4,
SQUARE: 5,
CIRCLE: 6,
POLYGON: 7,
POLYLINE: 8,
HIGHLIGHT: 9,
UNDERLINE: 10,
SQUIGGLY: 11,
STRIKEOUT: 12,
STAMP: 13,
CARET: 14,
INK: 15,
POPUP: 16,
FILEATTACHMENT: 17,
SOUND: 18,
MOVIE: 19,
WIDGET: 20,
SCREEN: 21,
PRINTERMARK: 22,
TRAPNET: 23,
WATERMARK: 24,
THREED: 25,
REDACT: 26,
RICHMEDIA: 27
}));
const AnnotationReplyType = (/* unused pure expression or super */ null && ({
GROUP: "Group",
REPLY: "R"
}));
const AnnotationRenditionOperation = (/* unused pure expression or super */ null && ({
PLAY_OR_RESUME: 0,
STOP: 1,
PAUSE: 2,
RESUME: 3,
PLAY: 4
}));
const AnnotationFlag = (/* unused pure expression or super */ null && ({
INVISIBLE: 0x01,
HIDDEN: 0x02,
PRINT: 0x04,
NOZOOM: 0x08,
NOROTATE: 0x10,
NOVIEW: 0x20,
READONLY: 0x40,
LOCKED: 0x80,
TOGGLENOVIEW: 0x100,
LOCKEDCONTENTS: 0x200
}));
const AnnotationFieldFlag = (/* unused pure expression or super */ null && ({
READONLY: 0x0000001,
REQUIRED: 0x0000002,
NOEXPORT: 0x0000004,
MULTILINE: 0x0001000,
PASSWORD: 0x0002000,
NOTOGGLETOOFF: 0x0004000,
RADIO: 0x0008000,
PUSHBUTTON: 0x0010000,
COMBO: 0x0020000,
EDIT: 0x0040000,
SORT: 0x0080000,
FILESELECT: 0x0100000,
MULTISELECT: 0x0200000,
DONOTSPELLCHECK: 0x0400000,
DONOTSCROLL: 0x0800000,
COMB: 0x1000000,
RICHTEXT: 0x2000000,
RADIOSINUNISON: 0x2000000,
COMMITONSELCHANGE: 0x4000000
}));
const AnnotationBorderStyleType = (/* unused pure expression or super */ null && ({
SOLID: 1,
DASHED: 2,
BEVELED: 3,
INSET: 4,
UNDERLINE: 5
}));
const AnnotationActionEventType = (/* unused pure expression or super */ null && ({
E: "Mouse Enter",
X: "Mouse Exit",
D: "Mouse Down",
U: "Mouse Up",
Fo: "Focus",
Bl: "Blur",
PO: "PageOpen",
PC: "PageClose",
PV: "PageVisible",
PI: "PageInvisible",
K: "Keystroke",
F: "Format",
V: "Validate",
C: "Calculate"
}));
const DocumentActionEventType = (/* unused pure expression or super */ null && ({
WC: "WillClose",
WS: "WillSave",
DS: "DidSave",
WP: "WillPrint",
DP: "DidPrint"
}));
const PageActionEventType = (/* unused pure expression or super */ null && ({
O: "PageOpen",
C: "PageClose"
}));
const VerbosityLevel = {
ERRORS: 0,
WARNINGS: 1,
INFOS: 5
};
const OPS = {
dependency: 1,
setLineWidth: 2,
setLineCap: 3,
setLineJoin: 4,
setMiterLimit: 5,
setDash: 6,
setRenderingIntent: 7,
setFlatness: 8,
setGState: 9,
save: 10,
restore: 11,
transform: 12,
moveTo: 13,
lineTo: 14,
curveTo: 15,
curveTo2: 16,
curveTo3: 17,
closePath: 18,
rectangle: 19,
stroke: 20,
closeStroke: 21,
fill: 22,
eoFill: 23,
fillStroke: 24,
eoFillStroke: 25,
closeFillStroke: 26,
closeEOFillStroke: 27,
endPath: 28,
clip: 29,
eoClip: 30,
beginText: 31,
endText: 32,
setCharSpacing: 33,
setWordSpacing: 34,
setHScale: 35,
setLeading: 36,
setFont: 37,
setTextRenderingMode: 38,
setTextRise: 39,
moveText: 40,
setLeadingMoveText: 41,
setTextMatrix: 42,
nextLine: 43,
showText: 44,
showSpacedText: 45,
nextLineShowText: 46,
nextLineSetSpacingShowText: 47,
setCharWidth: 48,
setCharWidthAndBounds: 49,
setStrokeColorSpace: 50,
setFillColorSpace: 51,
setStrokeColor: 52,
setStrokeColorN: 53,
setFillColor: 54,
setFillColorN: 55,
setStrokeGray: 56,
setFillGray: 57,
setStrokeRGBColor: 58,
setFillRGBColor: 59,
setStrokeCMYKColor: 60,
setFillCMYKColor: 61,
shadingFill: 62,
beginInlineImage: 63,
beginImageData: 64,
endInlineImage: 65,
paintXObject: 66,
markPoint: 67,
markPointProps: 68,
beginMarkedContent: 69,
beginMarkedContentProps: 70,
endMarkedContent: 71,
beginCompat: 72,
endCompat: 73,
paintFormXObjectBegin: 74,
paintFormXObjectEnd: 75,
beginGroup: 76,
endGroup: 77,
beginAnnotation: 80,
endAnnotation: 81,
paintImageMaskXObject: 83,
paintImageMaskXObjectGroup: 84,
paintImageXObject: 85,
paintInlineImageXObject: 86,
paintInlineImageXObjectGroup: 87,
paintImageXObjectRepeat: 88,
paintImageMaskXObjectRepeat: 89,
paintSolidColorImageMask: 90,
constructPath: 91,
setStrokeTransparent: 92,
setFillTransparent: 93,
rawFillPath: 94
};
const DrawOPS = {
moveTo: 0,
lineTo: 1,
curveTo: 2,
quadraticCurveTo: 3,
closePath: 4
};
const PasswordResponses = (/* unused pure expression or super */ null && ({
NEED_PASSWORD: 1,
INCORRECT_PASSWORD: 2
}));
let verbosity = VerbosityLevel.WARNINGS;
function setVerbosityLevel(level) {
if (Number.isInteger(level)) {
verbosity = level;
}
}
function getVerbosityLevel() {
return verbosity;
}
function info(msg) {
if (verbosity >= VerbosityLevel.INFOS) {
if (typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope) {
NgxConsole.log(`Info: ${msg}`);
} else if (Window && NgxConsole) {
NgxConsole.log(`Info: ${msg}`);
} else {
console.log(`Info: ${msg}`);
}
}
}
function warn(msg) {
if (verbosity >= VerbosityLevel.WARNINGS) {
if (typeof WorkerGlobalScope !== "undefined" && self instanceof WorkerGlobalScope) {
NgxConsole.log(`Warning: ${msg}`);
} else if (Window && NgxConsole) {
NgxConsole.log(`Warning: ${msg}`);
} else {
console.log(`Warning: ${msg}`);
}
}
}
function unreachable(msg) {
throw new Error(msg);
}
function assert(cond, msg) {
if (!cond) {
unreachable(msg);
}
}
function _isValidProtocol(url) {
switch (url?.protocol) {
case "http:":
case "https:":
case "ftp:":
case "mailto:":
case "tel:":
case "capacitor":
return true;
default:
return false;
}
}
function createValidAbsoluteUrl(url, baseUrl = null, options = null) {
if (!url) {
return null;
}
if (options && typeof url === "string") {
if (options.addDefaultProtocol && url.startsWith("www.")) {
const dots = url.match(/\./g);
if (dots?.length >= 2) {
url = `http://${url}`;
}
}
if (options.tryConvertEncoding) {
try {
url = stringToUTF8String(url);
} catch {}
}
}
const absoluteUrl = baseUrl ? URL.parse(url, baseUrl) : URL.parse(url);
return _isValidProtocol(absoluteUrl) ? absoluteUrl : null;
}
function updateUrlHash(url, hash, allowRel = false) {
const res = URL.parse(url);
if (res) {
res.hash = hash;
return res.href;
}
if (allowRel && createValidAbsoluteUrl(url, "http://example.com")) {
return url.split("#", 1)[0] + `${hash ? `#${hash}` : ""}`;
}
return "";
}
function stripPath(str) {
return str.substring(str.lastIndexOf("/") + 1);
}
function util_shadow(obj, prop, value, nonSerializable = false) {
Object.defineProperty(obj, prop, {
value,
enumerable: !nonSerializable,
configurable: true,
writable: false
});
return value;
}
const BaseException = function BaseExceptionClosure() {
function BaseException(message, name) {
this.message = message;
this.name = name;
}
BaseException.prototype = new Error();
BaseException.constructor = BaseException;
return BaseException;
}();
class PasswordException extends BaseException {
constructor(msg, code) {
super(msg, "PasswordException");
this.code = code;
}
}
class UnknownErrorException extends BaseException {
constructor(msg, details) {
super(msg, "UnknownErrorException");
this.details = details;
}
}
class InvalidPDFException extends BaseException {
constructor(msg) {
super(msg, "InvalidPDFException");
}
}
class ResponseException extends BaseException {
constructor(msg, status, missing) {
super(msg, "ResponseException");
this.status = status;
this.missing = missing;
}
}
class FormatError extends BaseException {
constructor(msg) {
super(msg, "FormatError");
}
}
class AbortException extends BaseException {
constructor(msg) {
super(msg, "AbortException");
}
}
function bytesToString(bytes) {
if (typeof bytes !== "object" || bytes?.length === undefined) {
unreachable("Invalid argument for bytesToString");
}
const length = bytes.length;
const MAX_ARGUMENT_COUNT = 8192;
if (length < MAX_ARGUMENT_COUNT) {
return String.fromCharCode.apply(null, bytes);
}
const strBuf = [];
for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) {
const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);
const chunk = bytes.subarray(i, chunkEnd);
strBuf.push(String.fromCharCode.apply(null, chunk));
}
return strBuf.join("");
}
function stringToBytes(str) {
if (typeof str !== "string") {
unreachable("Invalid argument for stringToBytes");
}
const length = str.length;
const bytes = new Uint8Array(length);
for (let i = 0; i < length; ++i) {
bytes[i] = str.charCodeAt(i) & 0xff;
}
return bytes;
}
class FeatureTest {
static get isLittleEndian() {
const buffer8 = new Uint8Array(4);
buffer8[0] = 1;
const view32 = new Uint32Array(buffer8.buffer, 0, 1);
return util_shadow(this, "isLittleEndian", view32[0] === 1);
}
static get isOffscreenCanvasSupported() {
return util_shadow(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas !== "undefined");
}
static get isImageDecoderSupported() {
return util_shadow(this, "isImageDecoderSupported", typeof ImageDecoder !== "undefined");
}
static get isVideoFrameSupported() {
return util_shadow(this, "isVideoFrameSupported", typeof VideoFrame !== "undefined");
}
static get isFloat16ArraySupported() {
return util_shadow(this, "isFloat16ArraySupported", typeof Float16Array !== "undefined");
}
static get isSanitizerSupported() {
return util_shadow(this, "isSanitizerSupported", typeof Sanitizer !== "undefined");
}
static get platform() {
const {
platform,
userAgent
} = navigator;
return util_shadow(this, "platform", {
isAndroid: userAgent.includes("Android"),
isLinux: platform.includes("Linux"),
isMac: platform.includes("Mac"),
isWindows: platform.includes("Win"),
isFirefox: userAgent.includes("Firefox")
});
}
static get isCanvasFilterSupported() {
let ctx;
if (this.isOffscreenCanvasSupported) {
ctx = new OffscreenCanvas(1, 1).getContext("2d");
}
return util_shadow(this, "isCanvasFilterSupported", ctx?.filter !== undefined);
}
static get isAlphaColorInputSupported() {
return util_shadow(this, "isAlphaColorInputSupported", false);
}
static get isBackdropFilterSupported() {
return util_shadow(this, "isBackdropFilterSupported", typeof CSS !== "undefined" && CSS.supports("backdrop-filter", "blur(1px)"));
}
}
class Util {
static get hexNums() {
return util_shadow(this, "hexNums", Array.from({
length: 256
}, (_, n) => n.toString(16).padStart(2, "0")));
}
static makeHexColor(r, g, b) {
return `#${this.hexNums[r]}${this.hexNums[g]}${this.hexNums[b]}`;
}
static get identity0to256Map() {
return util_shadow(this, "identity0to256Map", Uint8Array.from({
length: 256
}, (_, i) => i));
}
static transform(m1, m2) {
return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]];
}
static multiplyByDOMMatrix(m, md) {
return [m[0] * md.a + m[2] * md.b, m[1] * md.a + m[3] * md.b, m[0] * md.c + m[2] * md.d, m[1] * md.c + m[3] * md.d, m[0] * md.e + m[2] * md.f + m[4], m[1] * md.e + m[3] * md.f + m[5]];
}
static applyTransform(p, m, pos = 0) {
const p0 = p[pos];
const p1 = p[pos + 1];
p[pos] = p0 * m[0] + p1 * m[2] + m[4];
p[pos + 1] = p0 * m[1] + p1 * m[3] + m[5];
}
static applyTransformToBezier(p, transform, pos = 0) {
const m0 = transform[0];
const m1 = transform[1];
const m2 = transform[2];
const m3 = transform[3];
const m4 = transform[4];
const m5 = transform[5];
for (let i = 0; i < 6; i += 2) {
const pI = p[pos + i];
const pI1 = p[pos + i + 1];
p[pos + i] = pI * m0 + pI1 * m2 + m4;
p[pos + i + 1] = pI * m1 + pI1 * m3 + m5;
}
}
static applyInverseTransform(p, m) {
const p0 = p[0];
const p1 = p[1];
const d = m[0] * m[3] - m[1] * m[2];
p[0] = (p0 * m[3] - p1 * m[2] + m[2] * m[5] - m[4] * m[3]) / d;
p[1] = (-p0 * m[1] + p1 * m[0] + m[4] * m[1] - m[5] * m[0]) / d;
}
static axialAlignedBoundingBox(rect, transform, output) {
const m0 = transform[0];
const m1 = transform[1];
const m2 = transform[2];
const m3 = transform[3];
const m4 = transform[4];
const m5 = transform[5];
const r0 = rect[0];
const r1 = rect[1];
const r2 = rect[2];
const r3 = rect[3];
let a0 = m0 * r0 + m4;
let a2 = a0;
let a1 = m0 * r2 + m4;
let a3 = a1;
let b0 = m3 * r1 + m5;
let b2 = b0;
let b1 = m3 * r3 + m5;
let b3 = b1;
if (m1 !== 0 || m2 !== 0) {
const m1r0 = m1 * r0;
const m1r2 = m1 * r2;
const m2r1 = m2 * r1;
const m2r3 = m2 * r3;
a0 += m2r1;
a3 += m2r1;
a1 += m2r3;
a2 += m2r3;
b0 += m1r0;
b3 += m1r0;
b1 += m1r2;
b2 += m1r2;
}
output[0] = Math.min(output[0], a0, a1, Math.min(a2, a3));
output[1] = Math.min(output[1], b0, b1, Math.min(b2, b3));
output[2] = Math.max(output[2], a0, a1, Math.max(a2, a3));
output[3] = Math.max(output[3], b0, b1, Math.max(b2, b3));
}
static inverseTransform(m) {
const d = m[0] * m[3] - m[1] * m[2];
return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d];
}
static singularValueDecompose2dScale(matrix, output) {
const m0 = matrix[0];
const m1 = matrix[1];
const m2 = matrix[2];
const m3 = matrix[3];
const a = m0 ** 2 + m1 ** 2;
const b = m0 * m2 + m1 * m3;
const c = m2 ** 2 + m3 ** 2;
const first = (a + c) / 2;
const second = Math.sqrt(first ** 2 - (a * c - b ** 2));
output[0] = Math.sqrt(first + second || 1);
output[1] = Math.sqrt(first - second || 1);
}
static normalizeRect(rect) {
const r = rect.slice(0);
if (rect[0] > rect[2]) {
r[0] = rect[2];
r[2] = rect[0];
}
if (rect[1] > rect[3]) {
r[1] = rect[3];
r[3] = rect[1];
}
return r;
}
static intersect(rect1, rect2) {
const xLow = Math.max(Math.min(rect1[0], rect1[2]), Math.min(rect2[0], rect2[2]));
const xHigh = Math.min(Math.max(rect1[0], rect1[2]), Math.max(rect2[0], rect2[2]));
if (xLow > xHigh) {
return null;
}
const yLow = Math.max(Math.min(rect1[1], rect1[3]), Math.min(rect2[1], rect2[3]));
const yHigh = Math.min(Math.max(rect1[1], rect1[3]), Math.max(rect2[1], rect2[3]));
return yLow > yHigh ? null : [xLow, yLow, xHigh, yHigh];
}
static pointBoundingBox(x, y, minMax) {
minMax[0] = Math.min(minMax[0], x);
minMax[1] = Math.min(minMax[1], y);
minMax[2] = Math.max(minMax[2], x);
minMax[3] = Math.max(minMax[3], y);
}
static rectBoundingBox(x0, y0, x1, y1, minMax) {
minMax[0] = Math.min(minMax[0], x0, x1);
minMax[1] = Math.min(minMax[1], y0, y1);
minMax[2] = Math.max(minMax[2], x0, x1);
minMax[3] = Math.max(minMax[3], y0, y1);
}
static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3, minMax) {
minMax[0] = Math.min(minMax[0], x0, x3);
minMax[1] = Math.min(minMax[1], y0, y3);
minMax[2] = Math.max(minMax[2], x0, x3);
minMax[3] = Math.max(minMax[3], y0, y3);
_assertClassBrand(Util, this, _getExtremum).call(this, x0, x1, x2, x3, y0, y1, y2, y3, 3 * (-x0 + 3 * (x1 - x2) + x3), 6 * (x0 - 2 * x1 + x2), 3 * (x1 - x0), minMax);
_assertClassBrand(Util, this, _getExtremum).call(this, x0, x1, x2, x3, y0, y1, y2, y3, 3 * (-y0 + 3 * (y1 - y2) + y3), 6 * (y0 - 2 * y1 + y2), 3 * (y1 - y0), minMax);
}
}
_Util = Util;
function _getExtremumOnCurve(x0, x1, x2, x3, y0, y1, y2, y3, t, minMax) {
if (t <= 0 || t >= 1) {
return;
}
const mt = 1 - t;
const tt = t * t;
const ttt = tt * t;
const x = mt * (mt * (mt * x0 + 3 * t * x1) + 3 * tt * x2) + ttt * x3;
const y = mt * (mt * (mt * y0 + 3 * t * y1) + 3 * tt * y2) + ttt * y3;
minMax[0] = Math.min(minMax[0], x);
minMax[1] = Math.min(minMax[1], y);
minMax[2] = Math.max(minMax[2], x);
minMax[3] = Math.max(minMax[3], y);
}
function _getExtremum(x0, x1, x2, x3, y0, y1, y2, y3, a, b, c, minMax) {
if (Math.abs(a) < 1e-12) {
if (Math.abs(b) >= 1e-12) {
_assertClassBrand(_Util, this, _getExtremumOnCurve).call(this, x0, x1, x2, x3, y0, y1, y2, y3, -c / b, minMax);
}
return;
}
const delta = b ** 2 - 4 * c * a;
if (delta < 0) {
return;
}
const sqrtDelta = Math.sqrt(delta);
const a2 = 2 * a;
_assertClassBrand(_Util, this, _getExtremumOnCurve).call(this, x0, x1, x2, x3, y0, y1, y2, y3, (-b + sqrtDelta) / a2, minMax);
_assertClassBrand(_Util, this, _getExtremumOnCurve).call(this, x0, x1, x2, x3, y0, y1, y2, y3, (-b - sqrtDelta) / a2, minMax);
}
function stringToUTF8String(str) {
return decodeURIComponent(escape(str));
}
function utf8StringToString(str) {
return unescape(encodeURIComponent(str));
}
function isArrayEqual(arr1, arr2) {
if (arr1.length !== arr2.length) {
return false;
}
for (let i = 0, ii = arr1.length; i < ii; i++) {
if (arr1[i] !== arr2[i]) {
return false;
}
}
return true;
}
let NormalizeRegex = null;
let NormalizationMap = null;
function normalizeUnicode(str) {
if (!NormalizeRegex) {
NormalizeRegex = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu;
NormalizationMap = new Map([["ſt", "ſt"]]);
}
return str.replaceAll(NormalizeRegex, (_, p1, p2) => p1 ? p1.normalize("NFKC") : NormalizationMap.get(p2));
}
function getUuid() {
if (typeof crypto.randomUUID === "function") {
return crypto.randomUUID();
}
const buf = new Uint8Array(32);
crypto.getRandomValues(buf);
return bytesToString(buf);
}
function ngxNextPageWideId(kind) {
const counters = globalThis.ngxPageWideIds ?? (globalThis.ngxPageWideIds = Object.create(null));
counters[kind] = (counters[kind] ?? -1) + 1;
return counters[kind];
}
function _isValidExplicitDest(validRef, validName, dest) {
if (!Array.isArray(dest) || dest.length < 2) {
return false;
}
const [page, zoom, ...args] = dest;
if (!validRef(page) && !Number.isInteger(page)) {
return false;
}
if (!validName(zoom)) {
return false;
}
const argsLen = args.length;
let allowNull = true;
switch (zoom.name) {
case "XYZ":
if (argsLen < 2 || argsLen > 3) {
return false;
}
break;
case "Fit":
case "FitB":
return argsLen === 0;
case "FitH":
case "FitBH":
case "FitV":
case "FitBV":
if (argsLen > 1) {
return false;
}
break;
case "FitR":
if (argsLen !== 4) {
return false;
}
allowNull = false;
break;
default:
return false;
}
for (const arg of args) {
if (typeof arg === "number" || allowNull && arg === null) {
continue;
}
return false;
}
return true;
}
const makeArr = () => [];
const makeMap = () => new Map();
const makeObj = () => Object.create(null);
const makeSet = () => new Set();
if (typeof Blob.prototype.bytes !== "function") {
Blob.prototype.bytes = async function () {
return new Uint8Array(await this.arrayBuffer());
};
}
if (typeof Response.prototype.bytes !== "function") {
Response.prototype.bytes = async function () {
return new Uint8Array(await this.arrayBuffer());
};
}
if (typeof Iterator.prototype.join !== "function") {
Iterator.prototype.join = function (separator) {
return [...this].join(separator);
};
}
;// ./src/display/display_utils.js
/* unused harmony import specifier */ var display_utils_warn;
/* unused harmony import specifier */ var display_utils_Util;
/* unused harmony import specifier */ var MathClamp;
var _PixelsPerInch;
function display_utils_defineProperty(e, r, t) { return (r = display_utils_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function display_utils_toPropertyKey(t) { var i = display_utils_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function display_utils_toPrimitive(t, e) { if ("object" != typeof t || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); }
;
class PixelsPerInch {}
_PixelsPerInch = PixelsPerInch;
display_utils_defineProperty(PixelsPerInch, "CSS", 96.0);
display_utils_defineProperty(PixelsPerInch, "PDF", 72.0);
display_utils_defineProperty(PixelsPerInch, "PDF_TO_CSS_UNITS", _PixelsPerInch.CSS / _PixelsPerInch.PDF);
class RenderingCancelledException extends BaseException {
constructor(msg, extraDelay = 0) {
super(msg, "RenderingCancelledException");
this.extraDelay = extraDelay;
}
}
function getRGBA(color) {
if (color.startsWith("#")) {
const hex = color.slice(1);
return [parseInt(hex.slice(0, 2), 16), parseInt(hex.slice(2, 4), 16), parseInt(hex.slice(4, 6), 16), hex.length >= 8 ? parseInt(hex.slice(6, 8), 16) / 255 : 1];
}
if (color.startsWith("rgb(")) {
const [r, g, b] = color.slice(4, -1).split(",").map(x => parseInt(x, 10));
return [r, g, b, 1];
}
if (color.startsWith("rgba(")) {
const parts = color.slice(5, -1).split(",");
return [parseInt(parts[0], 10), parseInt(parts[1], 10), parseInt(parts[2], 10), parseFloat(parts[3])];
}
const m = color.match(/^color\(srgb\s+([\d.]+)\s+([\d.]+)\s+([\d.]+)(?:\s*\/\s*([\d.]+|none))?\)$/);
if (m) {
return [Math.round(parseFloat(m[1]) * 255), Math.round(parseFloat(m[2]) * 255), Math.round(parseFloat(m[3]) * 255), m[4] !== undefined && m[4] !== "none" ? parseFloat(m[4]) : 1];
}
return null;
}
function getRGB(color) {
const rgba = getRGBA(color);
if (!rgba) {
display_utils_warn(`Not a valid color format: "${color}"`);
return [0, 0, 0];
}
return rgba.slice(0, 3);
}
function getCurrentTransform(ctx) {
const {
a,
b,
c,
d,
e,
f
} = ctx.getTransform();
return [a, b, c, d, e, f];
}
function getCurrentTransformInverse(ctx) {
const {
a,
b,
c,
d,
e,
f
} = ctx.getTransform().invertSelf();
return [a, b, c, d, e, f];
}
class OutputScale {
constructor() {
const {
pixelRatio
} = OutputScale;
this.sx = pixelRatio;
this.sy = pixelRatio;
}
get scaled() {
return this.sx !== 1 || this.sy !== 1;
}
get symmetric() {
return this.sx === this.sy;
}
limitCanvas(width, height, maxPixels, maxDim, capAreaFactor = -1) {
return false;
}
static get pixelRatio() {
return globalThis.devicePixelRatio || 1;
}
static capPixels(maxPixels, capAreaFactor) {
return maxPixels;
}
}
function applyOpacity(color, opacity) {
opacity = MathClamp(opacity ?? 1, 0, 1);
const white = 255 * (1 - opacity);
return color.map(c => Math.round(c * opacity + white));
}
function RGBToHSL(rgb, output) {
const r = rgb[0] / 255;
const g = rgb[1] / 255;
const b = rgb[2] / 255;
const max = Math.max(r, g, b);
const min = Math.min(r, g, b);
const l = (max + min) / 2;
if (max === min) {
output[0] = output[1] = 0;
} else {
const d = max - min;
output[1] = l < 0.5 ? d / (max + min) : d / (2 - max - min);
switch (max) {
case r:
output[0] = ((g - b) / d + (g < b ? 6 : 0)) * 60;
break;
case g:
output[0] = ((b - r) / d + 2) * 60;
break;
case b:
output[0] = ((r - g) / d + 4) * 60;
break;
}
}
output[2] = l;
}
function HSLToRGB(hsl, output) {
const h = hsl[0];
const s = hsl[1];
const l = hsl[2];
const c = (1 - Math.abs(2 * l - 1)) * s;
const x = c * (1 - Math.abs(h / 60 % 2 - 1));
const m = l - c / 2;
switch (Math.floor(h / 60)) {
case 0:
output[0] = c + m;
output[1] = x + m;
output[2] = m;
break;
case 1:
output[0] = x + m;
output[1] = c + m;
output[2] = m;
break;
case 2:
output[0] = m;
output[1] = c + m;
output[2] = x + m;
break;
case 3:
output[0] = m;
output[1] = x + m;
output[2] = c + m;
break;
case 4:
output[0] = x + m;
output[1] = m;
output[2] = c + m;
break;
case 5:
case 6:
output[0] = c + m;
output[1] = m;
output[2] = x + m;
break;
}
}
function computeLuminance(x) {
return x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4;
}
function contrastRatio(hsl1, hsl2, output) {
HSLToRGB(hsl1, output);
output.map(computeLuminance);
const lum1 = 0.2126 * output[0] + 0.7152 * output[1] + 0.0722 * output[2];
HSLToRGB(hsl2, output);
output.map(computeLuminance);
const lum2 = 0.2126 * output[0] + 0.7152 * output[1] + 0.0722 * output[2];
return lum1 > lum2 ? (lum1 + 0.05) / (lum2 + 0.05) : (lum2 + 0.05) / (lum1 + 0.05);
}
const contrastCache = new Map();
function findContrastColor(baseColor, fixedColor) {
const key = baseColor[0] + baseColor[1] * 0x100 + baseColor[2] * 0x10000 + fixedColor[0] * 0x1000000 + fixedColor[1] * 0x100000000 + fixedColor[2] * 0x10000000000;
let cachedValue = contrastCache.get(key);
if (cachedValue) {
return cachedValue;
}
const array = new Float32Array(9);
const output = array.subarray(0, 3);
const baseHSL = array.subarray(3, 6);
RGBToHSL(baseColor, baseHSL);
const fixedHSL = array.subarray(6, 9);
RGBToHSL(fixedColor, fixedHSL);
const isFixedColorDark = fixedHSL[2] < 0.5;
const minContrast = isFixedColorDark ? 12 : 4.5;
baseHSL[2] = isFixedColorDark ? Math.sqrt(baseHSL[2]) : 1 - Math.sqrt(1 - baseHSL[2]);
if (contrastRatio(baseHSL, fixedHSL, output) < minContrast) {
let start, end;
if (isFixedColorDark) {
start = baseHSL[2];
end = 1;
} else {
start = 0;
end = baseHSL[2];
}
const PRECISION = 0.005;
while (end - start > PRECISION) {
const mid = baseHSL[2] = (start + end) / 2;
if (isFixedColorDark === contrastRatio(baseHSL, fixedHSL, output) < minContrast) {
start = mid;
} else {
end = mid;
}
}
baseHSL[2] = isFixedColorDark ? end : start;
}
HSLToRGB(baseHSL, output);
cachedValue = display_utils_Util.makeHexColor(Math.round(output[0] * 255), Math.round(output[1] * 255), Math.round(output[2] * 255));
contrastCache.set(key, cachedValue);
return cachedValue;
}
function makePathFromDrawOPS(data) {
const path = new Path2D();
if (!data) {
return path;
}
for (let i = 0, ii = data.length; i < ii;) {
switch (data[i++]) {
case DrawOPS.moveTo:
path.moveTo(data[i++], data[i++]);
break;
case DrawOPS.lineTo:
path.lineTo(data[i++], data[i++]);
break;
case DrawOPS.curveTo:
path.bezierCurveTo(data[i++], data[i++], data[i++], data[i++], data[i++], data[i++]);
break;
case DrawOPS.quadraticCurveTo:
path.quadraticCurveTo(data[i++], data[i++], data[i++], data[i++]);
break;
case DrawOPS.closePath:
path.closePath();
break;
default:
warn(`Unrecognized drawing path operator: ${data[i - 1]}`);
break;
}
}
return path;
}
;// ./src/shared/math_clamp.js
function math_clamp_MathClamp(v, min, max) {
return Math.min(Math.max(v, min), max);
}
;// ./src/display/canvas_dependency_tracker.js
function _classPrivateMethodInitSpec(e, a) { _checkPrivateRedeclaration(e, a), a.add(e); }
function canvas_dependency_tracker_defineProperty(e, r, t) { return (r = canvas_dependency_tracker_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function canvas_dependency_tracker_toPropertyKey(t) { var i = canvas_dependency_tracker_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function canvas_dependency_tracker_toPrimitive(t, e) { if ("object" != typeof t || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); }
function _classPrivateFieldInitSpec(e, t, a) { _checkPrivateRedeclaration(e, t), t.set(e, a); }
function _checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
function _classPrivateFieldGet(s, a) { return s.get(canvas_dependency_tracker_assertClassBrand(s, a)); }
function _classPrivateFieldSet(s, a, r) { return s.set(canvas_dependency_tracker_assertClassBrand(s, a), r), r; }
function canvas_dependency_tracker_assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
;
const FORCED_DEPENDENCY_LABEL = "__forcedDependency";
const {
floor: canvas_dependency_tracker_floor,
ceil
} = Math;
function expandBBox(array, index, minX, minY, maxX, maxY) {
array[index * 4 + 0] = Math.min(array[index * 4 + 0], minX);
array[index * 4 + 1] = Math.min(array[index * 4 + 1], minY);
array[index * 4 + 2] = Math.max(array[index * 4 + 2], maxX);
array[index * 4 + 3] = Math.max(array[index * 4 + 3], maxY);
}
function scaleCharBBox(scaleX, scaleY, x, y, bbox) {
let temp;
if (scaleX) {
if (scaleX < 0) {
temp = bbox[0];
bbox[0] = bbox[2];
bbox[2] = temp;
}
bbox[0] *= scaleX;
bbox[2] *= scaleX;
if (scaleY < 0) {
temp = bbox[1];
bbox[1] = bbox[3];
bbox[3] = temp;
}
bbox[1] *= scaleY;
bbox[3] *= scaleY;
} else {
bbox.fill(0);
}
bbox[0] += x;
bbox[1] += y;
bbox[2] += x;
bbox[3] += y;
}
const EMPTY_BBOX = new Uint32Array(new Uint8Array([255, 255, 0, 0]).buffer)[0];
var _bboxes = /*#__PURE__*/new WeakMap();
var _coords = /*#__PURE__*/new WeakMap();
class BBoxReader {
constructor(bboxes, coords) {
_classPrivateFieldInitSpec(this, _bboxes, void 0);
_classPrivateFieldInitSpec(this, _coords, void 0);
_classPrivateFieldSet(_bboxes, this, bboxes);
_classPrivateFieldSet(_coords, this, coords);
}
static fromBuffer(buffer) {
return new BBoxReader(new Uint32Array(buffer), new Uint8ClampedArray(buffer));
}
get buffer() {
return _classPrivateFieldGet(_bboxes, this).buffer;
}
get length() {
return _classPrivateFieldGet(_bboxes, this).length;
}
isEmpty(i) {
return _classPrivateFieldGet(_bboxes, this)[i] === EMPTY_BBOX;
}
minX(i) {
return _classPrivateFieldGet(_coords, this)[i * 4 + 0] / 256;
}
minY(i) {
return _classPrivateFieldGet(_coords, this)[i * 4 + 1] / 256;
}
maxX(i) {
return (_classPrivateFieldGet(_coords, this)[i * 4 + 2] + 1) / 256;
}
maxY(i) {
return (_classPrivateFieldGet(_coords, this)[i * 4 + 3] + 1) / 256;
}
}
const ensureDebugMetadata = (map, key) => map?.getOrInsertComputed(key, () => ({
dependencies: new Set(),
isRenderingOperation: false
}));
var _baseTransformStack = /*#__PURE__*/new WeakMap();
var _clipBox = /*#__PURE__*/new WeakMap();
var _pendingBBox = /*#__PURE__*/new WeakMap();
var _canvasWidth = /*#__PURE__*/new WeakMap();
var _canvasHeight = /*#__PURE__*/new WeakMap();
var _bboxesCoords = /*#__PURE__*/new WeakMap();
var _bboxes2 = /*#__PURE__*/new WeakMap();
var _CanvasBBoxTracker_brand = /*#__PURE__*/new WeakSet();
class CanvasBBoxTracker {
constructor(canvas, _operationsCount) {
_classPrivateMethodInitSpec(this, _CanvasBBoxTracker_brand);
_classPrivateFieldInitSpec(this, _baseTransformStack, [[1, 0, 0, 1, 0, 0]]);
_classPrivateFieldInitSpec(this, _clipBox, [-Infinity, -Infinity, Infinity, Infinity]);
_classPrivateFieldInitSpec(this, _pendingBBox, new Float64Array(BBOX_INIT));
canvas_dependency_tracker_defineProperty(this, "_pendingBBoxIdx", -1);
_classPrivateFieldInitSpec(this, _canvasWidth, void 0);
_classPrivateFieldInitSpec(this, _canvasHeight, void 0);
_classPrivateFieldInitSpec(this, _bboxesCoords, void 0);
_classPrivateFieldInitSpec(this, _bboxes2, void 0);
canvas_dependency_tracker_defineProperty(this, "_savesStack", []);
canvas_dependency_tracker_defineProperty(this, "_markedContentStack", []);
_classPrivateFieldSet(_canvasWidth, this, canvas.width);
_classPrivateFieldSet(_canvasHeight, this, canvas.height);
canvas_dependency_tracker_assertClassBrand(_CanvasBBoxTracker_brand, this, _initializeBBoxes).call(this, _operationsCount);
}
growOperationsCount(operationsCount) {
if (operationsCount >= _classPrivateFieldGet(_bboxes2, this).length) {
canvas_dependency_tracker_assertClassBrand(_CanvasBBoxTracker_brand, this, _initializeBBoxes).call(this, operationsCount, _classPrivateFieldGet(_bboxes2, this));
}
}
get clipBox() {
return _classPrivateFieldGet(_clipBox, this);
}
save(opIdx) {
_classPrivateFieldSet(_clipBox, this, {
__proto__: _classPrivateFieldGet(_clipBox, this)
});
this._savesStack.push(opIdx);
return this;
}
restore(opIdx, onSavePopped) {
const previous = Object.getPrototypeOf(_classPrivateFieldGet(_clipBox, this));
if (previous === null) {
return this;
}
_classPrivateFieldSet(_clipBox, this, previous);
const lastSave = this._savesStack.pop();
if (lastSave !== undefined) {
onSavePopped?.(lastSave, opIdx);
_classPrivateFieldGet(_bboxes2, this)[opIdx] = _classPrivateFieldGet(_bboxes2, this)[lastSave];
}
return this;
}
recordOpenMarker(idx) {
this._savesStack.push(idx);
return this;
}
getOpenMarker() {
return this._savesStack.length === 0 ? null : this._savesStack.at(-1);
}
recordCloseMarker(opIdx, onSavePopped) {
const lastSave = this._savesStack.pop();
if (lastSave !== undefined) {
onSavePopped?.(lastSave, opIdx);
_classPrivateFieldGet(_bboxes2, this)[opIdx] = _classPrivateFieldGet(_bboxes2, this)[lastSave];
}
return this;
}
beginMarkedContent(opIdx) {
this._markedContentStack.push(opIdx);
return this;
}
endMarkedContent(opIdx, onSavePopped) {
const lastSave = this._markedContentStack.pop();
if (lastSave !== undefined) {
onSavePopped?.(lastSave, opIdx);
_classPrivateFieldGet(_bboxes2, this)[opIdx] = _classPrivateFieldGet(_bboxes2, this)[lastSave];
}
return this;
}
pushBaseTransform(ctx) {
_classPrivateFieldGet(_baseTransformStack, this).push(Util.multiplyByDOMMatrix(_classPrivateFieldGet(_baseTransformStack, this).at(-1), ctx.getTransform()));
return this;
}
popBaseTransform() {
if (_classPrivateFieldGet(_baseTransformStack, this).length > 1) {
_classPrivateFieldGet(_baseTransformStack, this).pop();
}
return this;
}
resetBBox(idx) {
if (this._pendingBBoxIdx !== idx) {
this._pendingBBoxIdx = idx;
_classPrivateFieldGet(_pendingBBox, this).set(BBOX_INIT, 0);
}
return this;
}
recordClipBox(idx, ctx, minX, maxX, minY, maxY) {
const transform = Util.multiplyByDOMMatrix(_classPrivateFieldGet(_baseTransformStack, this).at(-1), ctx.getTransform());
const clipBox = BBOX_INIT.slice();
Util.axialAlignedBoundingBox([minX, minY, maxX, maxY], transform, clipBox);
const intersection = Util.intersect(_classPrivateFieldGet(_clipBox, this), clipBox);
if (intersection) {
_classPrivateFieldGet(_clipBox, this)[0] = intersection[0];
_classPrivateFieldGet(_clipBox, this)[1] = intersection[1];
_classPrivateFieldGet(_clipBox, this)[2] = intersection[2];
_classPrivateFieldGet(_clipBox, this)[3] = intersection[3];
} else {
_classPrivateFieldGet(_clipBox, this)[0] = _classPrivateFieldGet(_clipBox, this)[1] = Infinity;
_classPrivateFieldGet(_clipBox, this)[2] = _classPrivateFieldGet(_clipBox, this)[3] = -Infinity;
}
return this;
}
recordBBox(idx, ctx, minX, maxX, minY, maxY) {
const clipBox = _classPrivateFieldGet(_clipBox, this);
if (clipBox[0] === Infinity) {
return this;
}
const transform = Util.multiplyByDOMMatrix(_classPrivateFieldGet(_baseTransformStack, this).at(-1), ctx.getTransform());
if (clipBox[0] === -Infinity) {
Util.axialAlignedBoundingBox([minX, minY, maxX, maxY], transform, _classPrivateFieldGet(_pendingBBox, this));
return this;
}
const bbox = BBOX_INIT.slice();
Util.axialAlignedBoundingBox([minX, minY, maxX, maxY], transform, bbox);
_classPrivateFieldGet(_pendingBBox, this)[0] = math_clamp_MathClamp(bbox[0], clipBox[0], _classPrivateFieldGet(_pendingBBox, this)[0]);
_classPrivateFieldGet(_pendingBBox, this)[1] = math_clamp_MathClamp(bbox[1], clipBox[1], _classPrivateFieldGet(_pendingBBox, this)[1]);
_classPrivateFieldGet(_pendingBBox, this)[2] = math_clamp_MathClamp(bbox[2], _classPrivateFieldGet(_pendingBBox, this)[2], clipBox[2]);
_classPrivateFieldGet(_pendingBBox, this)[3] = math_clamp_MathClamp(bbox[3], _classPrivateFieldGet(_pendingBBox, this)[3], clipBox[3]);
return this;
}
recordFullPageBBox(idx) {
_classPrivateFieldGet(_pendingBBox, this)[0] = Math.max(0, _classPrivateFieldGet(_clipBox, this)[0]);
_classPrivateFieldGet(_pendingBBox, this)[1] = Math.max(0, _classPrivateFieldGet(_clipBox, this)[1]);
_classPrivateFieldGet(_pendingBBox, this)[2] = Math.min(_classPrivateFieldGet(_canvasWidth, this), _classPrivateFieldGet(_clipBox, this)[2]);
_classPrivateFieldGet(_pendingBBox, this)[3] = Math.min(_classPrivateFieldGet(_canvasHeight, this), _classPrivateFieldGet(_clipBox, this)[3]);
return this;
}
recordOperation(idx, preserve = false, dependencyLists) {
if (this._pendingBBoxIdx !== idx) {
return this;
}
const minX = canvas_dependency_tracker_floor(_classPrivateFieldGet(_pendingBBox, this)[0] * 256 / _classPrivateFieldGet(_canvasWidth, this));
const minY = canvas_dependency_tracker_floor(_classPrivateFieldGet(_pendingBBox, this)[1] * 256 / _classPrivateFieldGet(_canvasHeight, this));
const maxX = ceil(_classPrivateFieldGet(_pendingBBox, this)[2] * 256 / _classPrivateFieldGet(_canvasWidth, this));
const maxY = ceil(_classPrivateFieldGet(_pendingBBox, this)[3] * 256 / _classPrivateFieldGet(_canvasHeight, this));
expandBBox(_classPrivateFieldGet(_bboxesCoords, this), idx, minX, minY, maxX, maxY);
if (dependencyLists) {
for (const dependencies of dependencyLists) {
for (const depIdx of dependencies) {
if (depIdx !== idx) {
expandBBox(_classPrivateFieldGet(_bboxesCoords, this), depIdx, minX, minY, maxX, maxY);
}
}
}
}
if (!preserve) {
this._pendingBBoxIdx = -1;
}
return this;
}
bboxToClipBoxDropOperation(idx) {
if (this._pendingBBoxIdx === idx) {
this._pendingBBoxIdx = -1;
_classPrivateFieldGet(_clipBox, this)[0] = Math.max(_classPrivateFieldGet(_clipBox, this)[0], _classPrivateFieldGet(_pendingBBox, this)[0]);
_classPrivateFieldGet(_clipBox, this)[1] = Math.max(_classPrivateFieldGet(_clipBox, this)[1], _classPrivateFieldGet(_pendingBBox, this)[1]);
_classPrivateFieldGet(_clipBox, this)[2] = Math.min(_classPrivateFieldGet(_clipBox, this)[2], _classPrivateFieldGet(_pendingBBox, this)[2]);
_classPrivateFieldGet(_clipBox, this)[3] = Math.min(_classPrivateFieldGet(_clipBox, this)[3], _classPrivateFieldGet(_pendingBBox, this)[3]);
}
return this;
}
take() {
return new BBoxReader(_classPrivateFieldGet(_bboxes2, this), _classPrivateFieldGet(_bboxesCoords, this));
}
takeDebugMetadata() {
throw new Error("Unreachable");
}
recordSimpleData(name, idx) {
return this;
}
recordIncrementalData(name, idx) {
return this;
}
resetIncrementalData(name, idx) {
return this;
}
recordNamedData(name, idx) {
return this;
}
recordSimpleDataFromNamed(name, depName, fallbackIdx) {
return this;
}
recordFutureForcedDependency(name, idx) {
return this;
}
inheritSimpleDataAsFutureForcedDependencies(names) {
return this;
}
inheritPendingDependenciesAsFutureForcedDependencies() {
return this;
}
recordCharacterBBox(idx, ctx, font, scale = 1, x = 0, y = 0, getMeasure) {
return this;
}
getSimpleIndex(dependencyName) {
return undefined;
}
recordDependencies(idx, dependencyNames) {
return this;
}
recordNamedDependency(idx, name) {
return this;
}
recordShowTextOperation(idx, preserve = false) {
return this;
}
}
function _initializeBBoxes(operationsCount, oldBBoxes) {
const buffer = new ArrayBuffer(operationsCount * 4);
_classPrivateFieldSet(_bboxesCoords, this, new Uint8ClampedArray(buffer));
_classPrivateFieldSet(_bboxes2, this, new Uint32Array(buffer));
if (oldBBoxes && oldBBoxes.length > 0) {
_classPrivateFieldGet(_bboxes2, this).set(oldBBoxes);
_classPrivateFieldGet(_bboxes2, this).fill(EMPTY_BBOX, oldBBoxes.length);
} else {
_classPrivateFieldGet(_bboxes2, this).fill(EMPTY_BBOX);
}
}
var _simple = /*#__PURE__*/new WeakMap();
var _incremental = /*#__PURE__*/new WeakMap();
var _namedDependencies = /*#__PURE__*/new WeakMap();
var _pendingDependencies = /*#__PURE__*/new WeakMap();
var _fontBBoxTrustworthy = /*#__PURE__*/new WeakMap();
var _debugMetadata = /*#__PURE__*/new WeakMap();
var _recordDebugMetadataDepenencyAfterRestore = /*#__PURE__*/new WeakMap();
var _bboxTracker = /*#__PURE__*/new WeakMap();
class CanvasDependencyTracker {
constructor(bboxTracker, recordDebugMetadata = false) {
_classPrivateFieldInitSpec(this, _simple, {
__proto__: null
});
_classPrivateFieldInitSpec(this, _incremental, {
__proto__: null,
transform: [],
moveText: [],
sameLineText: [],
[FORCED_DEPENDENCY_LABEL]: []
});
_classPrivateFieldInitSpec(this, _namedDependencies, new Map());
_classPrivateFieldInitSpec(this, _pendingDependencies, new Set());
_classPrivateFieldInitSpec(this, _fontBBoxTrustworthy, new Map());
_classPrivateFieldInitSpec(this, _debugMetadata, void 0);
_classPrivateFieldInitSpec(this, _recordDebugMetadataDepenencyAfterRestore, void 0);
_classPrivateFieldInitSpec(this, _bboxTracker, void 0);
_classPrivateFieldSet(_bboxTracker, this, bboxTracker);
if (recordDebugMetadata) {
_classPrivateFieldSet(_debugMetadata, this, new Map());
_classPrivateFieldSet(_recordDebugMetadataDepenencyAfterRestore, this, (lastSave, opIdx) => {
ensureDebugMetadata(_classPrivateFieldGet(_debugMetadata, this), opIdx).dependencies.add(lastSave);
});
}
}
get clipBox() {
return _classPrivateFieldGet(_bboxTracker, this).clipBox;
}
growOperationsCount(operationsCount) {
_classPrivateFieldGet(_bboxTracker, this).growOperationsCount(operationsCount);
}
save(opIdx) {
_classPrivateFieldSet(_simple, this, {
__proto__: _classPrivateFieldGet(_simple, this)
});
_classPrivateFieldSet(_incremental, this, {
__proto__: _classPrivateFieldGet(_incremental, this),
transform: {
__proto__: _classPrivateFieldGet(_incremental, this).transform
},
moveText: {
__proto__: _classPrivateFieldGet(_incremental, this).moveText
},
sameLineText: {
__proto__: _classPrivateFieldGet(_incremental, this).sameLineText
},
[FORCED_DEPENDENCY_LABEL]: {
__proto__: _classPrivateFieldGet(_incremental, this)[FORCED_DEPENDENCY_LABEL]
}
});
_classPrivateFieldGet(_bboxTracker, this).save(opIdx);
return this;
}
restore(opIdx) {
_classPrivateFieldGet(_bboxTracker, this).restore(opIdx, _classPrivateFieldGet(_recordDebugMetadataDepenencyAfterRestore, this));
const previous = Object.getPrototypeOf(_classPrivateFieldGet(_simple, this));
if (previous === null) {
return this;
}
_classPrivateFieldSet(_simple, this, previous);
_classPrivateFieldSet(_incremental, this, Object.getPrototypeOf(_classPrivateFieldGet(_incremental, this)));
return this;
}
recordOpenMarker(opIdx) {
_classPrivateFieldGet(_bboxTracker, this).recordOpenMarker(opIdx, _classPrivateFieldGet(_recordDebugMetadataDepenencyAfterRestore, this));
return this;
}
getOpenMarker() {
return _classPrivateFieldGet(_bboxTracker, this).getOpenMarker();
}
recordCloseMarker(opIdx) {
_classPrivateFieldGet(_bboxTracker, this).recordCloseMarker(opIdx, _classPrivateFieldGet(_recordDebugMetadataDepenencyAfterRestore, this));
return this;
}
beginMarkedContent(opIdx) {
_classPrivateFieldGet(_bboxTracker, this).beginMarkedContent(opIdx);
return this;
}
endMarkedContent(opIdx) {
_classPrivateFieldGet(_bboxTracker, this).endMarkedContent(opIdx, _classPrivateFieldGet(_recordDebugMetadataDepenencyAfterRestore, this));
return this;
}
pushBaseTransform(ctx) {
_classPrivateFieldGet(_bboxTracker, this).pushBaseTransform(ctx);
return this;
}
popBaseTransform() {
_classPrivateFieldGet(_bboxTracker, this).popBaseTransform();
return this;
}
recordSimpleData(name, idx) {
_classPrivateFieldGet(_simple, this)[name] = idx;
return this;
}
recordIncrementalData(name, idx) {
_classPrivateFieldGet(_incremental, this)[name].push(idx);
return this;
}
resetIncrementalData(name, idx) {
_classPrivateFieldGet(_incremental, this)[name].length = 0;
return this;
}
recordNamedData(name, idx) {
_classPrivateFieldGet(_namedDependencies, this).set(name, idx);
return this;
}
recordSimpleDataFromNamed(name, depName, fallbackIdx) {
_classPrivateFieldGet(_simple, this)[name] = _classPrivateFieldGet(_namedDependencies, this).get(depName) ?? fallbackIdx;
}
recordFutureForcedDependency(name, idx) {
this.recordIncrementalData(FORCED_DEPENDENCY_LABEL, idx);
return this;
}
inheritSimpleDataAsFutureForcedDependencies(names) {
for (const name of names) {
if (name in _classPrivateFieldGet(_simple, this)) {
this.recordFutureForcedDependency(name, _classPrivateFieldGet(_simple, this)[name]);
}
}
return this;
}
inheritPendingDependenciesAsFutureForcedDependencies() {
for (const dep of _classPrivateFieldGet(_pendingDependencies, this)) {
this.recordFutureForcedDependency(FORCED_DEPENDENCY_LABEL, dep);
}
return this;
}
resetBBox(idx) {
_classPrivateFieldGet(_bboxTracker, this).resetBBox(idx);
return this;
}
recordClipBox(idx, ctx, minX, maxX, minY, maxY) {
_classPrivateFieldGet(_bboxTracker, this).recordClipBox(idx, ctx, minX, maxX, minY, maxY);
return this;
}
recordBBox(idx, ctx, minX, maxX, minY, maxY) {
_classPrivateFieldGet(_bboxTracker, this).recordBBox(idx, ctx, minX, maxX, minY, maxY);
return this;
}
recordCharacterBBox(idx, ctx, font, scale = 1, x = 0, y = 0, getMeasure) {
const fontBBox = font.bbox;
let isBBoxTrustworthy;
let computedBBox;
if (fontBBox) {
isBBoxTrustworthy = fontBBox[2] !== fontBBox[0] && fontBBox[3] !== fontBBox[1] && _classPrivateFieldGet(_fontBBoxTrustworthy, this).get(font);
if (isBBoxTrustworthy !== false) {
computedBBox = [0, 0, 0, 0];
Util.axialAlignedBoundingBox(fontBBox, font.fontMatrix, computedBBox);
if (scale !== 1 || x !== 0 || y !== 0) {
scaleCharBBox(scale, -scale, x, y, computedBBox);
}
if (isBBoxTrustworthy) {
return this.recordBBox(idx, ctx, computedBBox[0], computedBBox[2], computedBBox[1], computedBBox[3]);
}
}
}
if (!getMeasure) {
return this.recordFullPageBBox(idx);
}
const measure = getMeasure();
if (fontBBox && computedBBox && isBBoxTrustworthy === undefined) {
isBBoxTrustworthy = computedBBox[0] <= x - measure.actualBoundingBoxLeft && computedBBox[2] >= x + measure.actualBoundingBoxRight && computedBBox[1] <= y - measure.actualBoundingBoxAscent && computedBBox[3] >= y + measure.actualBoundingBoxDescent;
_classPrivateFieldGet(_fontBBoxTrustworthy, this).set(font, isBBoxTrustworthy);
if (isBBoxTrustworthy) {
return this.recordBBox(idx, ctx, computedBBox[0], computedBBox[2], computedBBox[1], computedBBox[3]);
}
}
return this.recordBBox(idx, ctx, x - measure.actualBoundingBoxLeft, x + measure.actualBoundingBoxRight, y - measure.actualBoundingBoxAscent, y + measure.actualBoundingBoxDescent);
}
recordFullPageBBox(idx) {
_classPrivateFieldGet(_bboxTracker, this).recordFullPageBBox(idx);
return this;
}
getSimpleIndex(dependencyName) {
return _classPrivateFieldGet(_simple, this)[dependencyName];
}
recordDependencies(idx, dependencyNames) {
const pendingDependencies = _classPrivateFieldGet(_pendingDependencies, this);
const simple = _classPrivateFieldGet(_simple, this);
const incremental = _classPrivateFieldGet(_incremental, this);
for (const name of dependencyNames) {
if (name in _classPrivateFieldGet(_simple, this)) {
pendingDependencies.add(simple[name]);
} else if (name in incremental) {
incremental[name].forEach(pendingDependencies.add, pendingDependencies);
}
}
return this;
}
recordNamedDependency(idx, name) {
if (_classPrivateFieldGet(_namedDependencies, this).has(name)) {
_classPrivateFieldGet(_pendingDependencies, this).add(_classPrivateFieldGet(_namedDependencies, this).get(name));
}
return this;
}
recordOperation(idx, preserve = false) {
this.recordDependencies(idx, [FORCED_DEPENDENCY_LABEL]);
if (_classPrivateFieldGet(_debugMetadata, this)) {
const metadata = ensureDebugMetadata(_classPrivateFieldGet(_debugMetadata, this), idx);
const {
dependencies
} = metadata;
_classPrivateFieldGet(_pendingDependencies, this).forEach(dependencies.add, dependencies);
_classPrivateFieldGet(_bboxTracker, this)._savesStack.forEach(dependencies.add, dependencies);
_classPrivateFieldGet(_bboxTracker, this)._markedContentStack.forEach(dependencies.add, dependencies);
dependencies.delete(idx);
metadata.isRenderingOperation = true;
}
const needsCleanup = !preserve && idx === _classPrivateFieldGet(_bboxTracker, this)._pendingBBoxIdx;
_classPrivateFieldGet(_bboxTracker, this).recordOperation(idx, preserve, [_classPrivateFieldGet(_pendingDependencies, this), _classPrivateFieldGet(_bboxTracker, this)._savesStack, _classPrivateFieldGet(_bboxTracker, this)._markedContentStack]);
if (needsCleanup) {
_classPrivateFieldGet(_pendingDependencies, this).clear();
}
return this;
}
recordShowTextOperation(idx, preserve = false) {
const deps = Array.from(_classPrivateFieldGet(_pendingDependencies, this));
this.recordOperation(idx, preserve);
this.recordIncrementalData("sameLineText", idx);
for (const dep of deps) {
this.recordIncrementalData("sameLineText", dep);
}
return this;
}
bboxToClipBoxDropOperation(idx, preserve = false) {
const needsCleanup = !preserve && idx === _classPrivateFieldGet(_bboxTracker, this)._pendingBBoxIdx;
_classPrivateFieldGet(_bboxTracker, this).bboxToClipBoxDropOperation(idx);
if (needsCleanup) {
_classPrivateFieldGet(_pendingDependencies, this).clear();
}
return this;
}
take() {
_classPrivateFieldGet(_fontBBoxTrustworthy, this).clear();
return _classPrivateFieldGet(_bboxTracker, this).take();
}
takeDebugMetadata() {
return _classPrivateFieldGet(_debugMetadata, this);
}
}
var _dependencyTracker = /*#__PURE__*/new WeakMap();
var _opIdx = /*#__PURE__*/new WeakMap();
var _ignoreBBoxes = /*#__PURE__*/new WeakMap();
var _nestingLevel = /*#__PURE__*/new WeakMap();
var _savesLevel = /*#__PURE__*/new WeakMap();
class CanvasNestedDependencyTracker {
constructor(dependencyTracker, opIdx, ignoreBBoxes) {
_classPrivateFieldInitSpec(this, _dependencyTracker, void 0);
_classPrivateFieldInitSpec(this, _opIdx, void 0);
_classPrivateFieldInitSpec(this, _ignoreBBoxes, void 0);
_classPrivateFieldInitSpec(this, _nestingLevel, 0);
_classPrivateFieldInitSpec(this, _savesLevel, 0);
if (dependencyTracker instanceof CanvasNestedDependencyTracker && _classPrivateFieldGet(_ignoreBBoxes, dependencyTracker) === !!ignoreBBoxes) {
return dependencyTracker;
}
_classPrivateFieldSet(_dependencyTracker, this, dependencyTracker);
_classPrivateFieldSet(_opIdx, this, opIdx);
_classPrivateFieldSet(_ignoreBBoxes, this, !!ignoreBBoxes);
}
get clipBox() {
return _classPrivateFieldGet(_dependencyTracker, this).clipBox;
}
growOperationsCount() {
throw new Error("Unreachable");
}
save(opIdx) {
var _this$savesLevel, _this$savesLevel2;
_classPrivateFieldSet(_savesLevel, this, (_this$savesLevel = _classPrivateFieldGet(_savesLevel, this), _this$savesLevel2 = _this$savesLevel++, _this$savesLevel)), _this$savesLevel2;
_classPrivateFieldGet(_dependencyTracker, this).save(_classPrivateFieldGet(_opIdx, this));
return this;
}
restore(opIdx) {
if (_classPrivateFieldGet(_savesLevel, this) > 0) {
var _this$savesLevel3, _this$savesLevel4;
_classPrivateFieldGet(_dependencyTracker, this).restore(_classPrivateFieldGet(_opIdx, this));
_classPrivateFieldSet(_savesLevel, this, (_this$savesLevel3 = _classPrivateFieldGet(_savesLevel, this), _this$savesLevel4 = _this$savesLevel3--, _this$savesLevel3)), _this$savesLevel4;
}
return this;
}
recordOpenMarker(idx) {
var _this$nestingLevel, _this$nestingLevel2;
_classPrivateFieldSet(_nestingLevel, this, (_this$nestingLevel = _classPrivateFieldGet(_nestingLevel, this), _this$nestingLevel2 = _this$nestingLevel++, _this$nestingLevel)), _this$nestingLevel2;
return this;
}
getOpenMarker() {
return _classPrivateFieldGet(_nestingLevel, this) > 0 ? _classPrivateFieldGet(_opIdx, this) : _classPrivateFieldGet(_dependencyTracker, this).getOpenMarker();
}
recordCloseMarker(idx) {
var _this$nestingLevel3, _this$nestingLevel4;
_classPrivateFieldSet(_nestingLevel, this, (_this$nestingLevel3 = _classPrivateFieldGet(_nestingLevel, this), _this$nestingLevel4 = _this$nestingLevel3--, _this$nestingLevel3)), _this$nestingLevel4;
return this;
}
beginMarkedContent(opIdx) {
return this;
}
endMarkedContent(opIdx) {
return this;
}
pushBaseTransform(ctx) {
_classPrivateFieldGet(_dependencyTracker, this).pushBaseTransform(ctx);
return this;
}
popBaseTransform() {
_classPrivateFieldGet(_dependencyTracker, this).popBaseTransform();
return this;
}
recordSimpleData(name, idx) {
_classPrivateFieldGet(_dependencyTracker, this).recordSimpleData(name, _classPrivateFieldGet(_opIdx, this));
return this;
}
recordIncrementalData(name, idx) {
_classPrivateFieldGet(_dependencyTracker, this).recordIncrementalData(name, _classPrivateFieldGet(_opIdx, this));
return this;
}
resetIncrementalData(name, idx) {
_classPrivateFieldGet(_dependencyTracker, this).resetIncrementalData(name, _classPrivateFieldGet(_opIdx, this));
return this;
}
recordNamedData(name, idx) {
return this;
}
recordSimpleDataFromNamed(name, depName, fallbackIdx) {
_classPrivateFieldGet(_dependencyTracker, this).recordSimpleDataFromNamed(name, depName, _classPrivateFieldGet(_opIdx, this));
return this;
}
recordFutureForcedDependency(name, idx) {
_classPrivateFieldGet(_dependencyTracker, this).recordFutureForcedDependency(name, _classPrivateFieldGet(_opIdx, this));
return this;
}
inheritSimpleDataAsFutureForcedDependencies(names) {
_classPrivateFieldGet(_dependencyTracker, this).inheritSimpleDataAsFutureForcedDependencies(names);
return this;
}
inheritPendingDependenciesAsFutureForcedDependencies() {
_classPrivateFieldGet(_dependencyTracker, this).inheritPendingDependenciesAsFutureForcedDependencies();
return this;
}
resetBBox(idx) {
if (!_classPrivateFieldGet(_ignoreBBoxes, this)) {
_classPrivateFieldGet(_dependencyTracker, this).resetBBox(_classPrivateFieldGet(_opIdx, this));
}
return this;
}
recordClipBox(idx, ctx, minX, maxX, minY, maxY) {
if (!_classPrivateFieldGet(_ignoreBBoxes, this)) {
_classPrivateFieldGet(_dependencyTracker, this).recordClipBox(_classPrivateFieldGet(_opIdx, this), ctx, minX, maxX, minY, maxY);
}
return this;
}
recordBBox(idx, ctx, minX, maxX, minY, maxY) {
if (!_classPrivateFieldGet(_ignoreBBoxes, this)) {
_classPrivateFieldGet(_dependencyTracker, this).recordBBox(_classPrivateFieldGet(_opIdx, this), ctx, minX, maxX, minY, maxY);
}
return this;
}
recordCharacterBBox(idx, ctx, font, scale, x, y, getMeasure) {
if (!_classPrivateFieldGet(_ignoreBBoxes, this)) {
_classPrivateFieldGet(_dependencyTracker, this).recordCharacterBBox(_classPrivateFieldGet(_opIdx, this), ctx, font, scale, x, y, getMeasure);
}
return this;
}
recordFullPageBBox(idx) {
if (!_classPrivateFieldGet(_ignoreBBoxes, this)) {
_classPrivateFieldGet(_dependencyTracker, this).recordFullPageBBox(_classPrivateFieldGet(_opIdx, this));
}
return this;
}
getSimpleIndex(dependencyName) {
return _classPrivateFieldGet(_dependencyTracker, this).getSimpleIndex(dependencyName);
}
recordDependencies(idx, dependencyNames) {
_classPrivateFieldGet(_dependencyTracker, this).recordDependencies(_classPrivateFieldGet(_opIdx, this), dependencyNames);
return this;
}
recordNamedDependency(idx, name) {
_classPrivateFieldGet(_dependencyTracker, this).recordNamedDependency(_classPrivateFieldGet(_opIdx, this), name);
return this;
}
recordOperation(idx) {
_classPrivateFieldGet(_dependencyTracker, this).recordOperation(_classPrivateFieldGet(_opIdx, this), true);
return this;
}
recordShowTextOperation(idx) {
_classPrivateFieldGet(_dependencyTracker, this).recordShowTextOperation(_classPrivateFieldGet(_opIdx, this), true);
return this;
}
bboxToClipBoxDropOperation(idx) {
if (!_classPrivateFieldGet(_ignoreBBoxes, this)) {
_classPrivateFieldGet(_dependencyTracker, this).bboxToClipBoxDropOperation(_classPrivateFieldGet(_opIdx, this), true);
}
return this;
}
take() {
throw new Error("Unreachable");
}
takeDebugMetadata() {
throw new Error("Unreachable");
}
}
const Dependencies = {
stroke: ["path", "transform", "filter", "strokeColor", "strokeAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "dash"],
fill: ["path", "transform", "filter", "fillColor", "fillAlpha", "globalCompositeOperation", "SMask"],
imageXObject: ["transform", "SMask", "filter", "fillAlpha", "strokeAlpha", "globalCompositeOperation"],
rawFillPath: ["filter", "fillColor", "fillAlpha"],
showText: ["transform", "leading", "charSpacing", "wordSpacing", "hScale", "textRise", "moveText", "textMatrix", "font", "fontObj", "filter", "fillColor", "textRenderingMode", "SMask", "fillAlpha", "strokeAlpha", "globalCompositeOperation", "sameLineText"],
transform: ["transform"],
transformAndFill: ["transform", "filter", "fillColor"]
};
var _canvasWidth2 = /*#__PURE__*/new WeakMap();
var _canvasHeight2 = /*#__PURE__*/new WeakMap();
var _capacity = /*#__PURE__*/new WeakMap();
var _count = /*#__PURE__*/new WeakMap();
var _coords2 = /*#__PURE__*/new WeakMap();
class CanvasImagesTracker {
constructor(canvas) {
_classPrivateFieldInitSpec(this, _canvasWidth2, void 0);
_classPrivateFieldInitSpec(this, _canvasHeight2, void 0);
_classPrivateFieldInitSpec(this, _capacity, 4);
_classPrivateFieldInitSpec(this, _count, 0);
_classPrivateFieldInitSpec(this, _coords2, new _CoordsArray._(_classPrivateFieldGet(_capacity, this) * 6));
_classPrivateFieldSet(_canvasWidth2, this, canvas.width);
_classPrivateFieldSet(_canvasHeight2, this, canvas.height);
}
record(ctx, width, height, clipBox) {
var _this$count, _this$count2;
if (_classPrivateFieldGet(_count, this) === _classPrivateFieldGet(_capacity, this)) {
_classPrivateFieldSet(_capacity, this, _classPrivateFieldGet(_capacity, this) * 2);
const newCoords = new _CoordsArray._(_classPrivateFieldGet(_capacity, this) * 6);
newCoords.set(_classPrivateFieldGet(_coords2, this));
_classPrivateFieldSet(_coords2, this, newCoords);
}
const transform = getCurrentTransform(ctx);
let coords;
if (clipBox[0] !== Infinity) {
const bbox = BBOX_INIT.slice();
Util.axialAlignedBoundingBox([0, -height, width, 0], transform, bbox);
const finalBBox = Util.intersect(clipBox, bbox);
if (!finalBBox) {
return;
}
const [minX, minY, maxX, maxY] = finalBBox;
if (minX !== bbox[0] || minY !== bbox[1] || maxX !== bbox[2] || maxY !== bbox[3]) {
const rotationAngle = Math.atan2(transform[1], transform[0]);
const sin = Math.abs(Math.sin(rotationAngle));
const cos = Math.abs(Math.cos(rotationAngle));
if (sin < 1e-6 || cos < 1e-6 || Math.abs(sin - cos) < 1e-6) {
coords = [minX, minY, minX, maxY, maxX, minY];
} else {
const finalBBoxWidth = maxX - minX;
const finalBBoxHeight = maxY - minY;
const sin2 = sin * sin;
const cos2 = cos * cos;
const cosSin = cos * sin;
const denom = cos2 - sin2;
const a = (finalBBoxHeight * cos2 - finalBBoxWidth * cosSin) / denom;
const b = (finalBBoxHeight * cosSin - finalBBoxWidth * sin2) / denom;
coords = [minX + b, minY, minX, minY + a, maxX, maxY - a];
}
}
}
if (!coords) {
coords = [0, -height, 0, 0, width, -height];
Util.applyTransform(coords, transform, 0);
Util.applyTransform(coords, transform, 2);
Util.applyTransform(coords, transform, 4);
}
coords[0] /= _classPrivateFieldGet(_canvasWidth2, this);
coords[1] /= _classPrivateFieldGet(_canvasHeight2, this);
coords[2] /= _classPrivateFieldGet(_canvasWidth2, this);
coords[3] /= _classPrivateFieldGet(_canvasHeight2, this);
coords[4] /= _classPrivateFieldGet(_canvasWidth2, this);
coords[5] /= _classPrivateFieldGet(_canvasHeight2, this);
_classPrivateFieldGet(_coords2, this).set(coords, _classPrivateFieldGet(_count, this) * 6);
_classPrivateFieldSet(_count, this, (_this$count = _classPrivateFieldGet(_count, this), _this$count2 = _this$count++, _this$count)), _this$count2;
}
take() {
return _classPrivateFieldGet(_coords2, this).subarray(0, _classPrivateFieldGet(_count, this) * 6);
}
}
var _CoordsArray = {
_: FeatureTest.isFloat16ArraySupported ? Float16Array : Float32Array
};
function createCanvasTrackers(canvas, operationsCount, {
recordOperations = false,
recordImages = false,
recordDebugMetadata = false
}) {
const bboxTracker = recordOperations || recordImages ? new CanvasBBoxTracker(canvas, operationsCount) : null;
return {
dependencyTracker: recordOperations ? new CanvasDependencyTracker(bboxTracker, recordDebugMetadata) : bboxTracker,
imagesTracker: recordImages ? new CanvasImagesTracker(canvas) : null
};
}
;// ./src/shared/image_utils.js
/* unused harmony import specifier */ var image_utils_ImageKind;
/* unused harmony import specifier */ var image_utils_FeatureTest;
function convertToRGBA(params) {
switch (params.kind) {
case image_utils_ImageKind.GRAYSCALE_1BPP:
return convertBlackAndWhiteToRGBA(params);
case image_utils_ImageKind.RGB_24BPP:
return convertRGBToRGBA(params);
}
return null;
}
function convertBlackAndWhiteToRGBA({
src,
srcPos = 0,
dest,
width,
height,
nonBlackColor = 0xffffffff,
inverseDecode = false
}) {
const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;
const [zeroMapping, oneMapping] = inverseDecode ? [nonBlackColor, black] : [black, nonBlackColor];
const widthInSource = width >> 3;
const widthRemainder = width & 7;
const xorMask = zeroMapping ^ oneMapping;
const srcLength = src.length;
dest = new Uint32Array(dest.buffer);
let destPos = 0;
for (let i = 0; i < height; ++i) {
for (const max = srcPos + widthInSource; srcPos < max; ++srcPos, destPos += 8) {
const elem = src[srcPos];
dest[destPos] = zeroMapping ^ -(elem >> 7 & 1) & xorMask;
dest[destPos + 1] = zeroMapping ^ -(elem >> 6 & 1) & xorMask;
dest[destPos + 2] = zeroMapping ^ -(elem >> 5 & 1) & xorMask;
dest[destPos + 3] = zeroMapping ^ -(elem >> 4 & 1) & xorMask;
dest[destPos + 4] = zeroMapping ^ -(elem >> 3 & 1) & xorMask;
dest[destPos + 5] = zeroMapping ^ -(elem >> 2 & 1) & xorMask;
dest[destPos + 6] = zeroMapping ^ -(elem >> 1 & 1) & xorMask;
dest[destPos + 7] = zeroMapping ^ -(elem & 1) & xorMask;
}
if (widthRemainder === 0) {
continue;
}
const elem = srcPos < srcLength ? src[srcPos++] : 255;
for (let j = 0; j < widthRemainder; ++j, ++destPos) {
dest[destPos] = zeroMapping ^ -(elem >> 7 - j & 1) & xorMask;
}
}
return {
srcPos,
destPos
};
}
function convertRGBToRGBA({
src,
srcPos = 0,
dest,
destPos = 0,
width,
height
}) {
let i = 0;
const len = width * height * 3;
const byteOffset = src.byteOffset + srcPos;
const len32 = byteOffset % 4 === 0 ? Math.floor(math_clamp_MathClamp(src.length - srcPos, 0, len) / 4) : 0;
const src32 = len32 > 0 ? new Uint32Array(src.buffer, byteOffset, len32) : null;
const alphaMask = FeatureTest.isLittleEndian ? 0xff000000 : 0xff;
if (FeatureTest.isLittleEndian) {
for (; i < len32 - 2; i += 3, destPos += 4) {
const s1 = src32[i],
s2 = src32[i + 1],
s3 = src32[i + 2];
dest[destPos] = s1 | alphaMask;
dest[destPos + 1] = s1 >>> 24 | s2 << 8 | alphaMask;
dest[destPos + 2] = s2 >>> 16 | s3 << 16 | alphaMask;
dest[destPos + 3] = s3 >>> 8 | alphaMask;
}
for (let j = srcPos + i * 4, jj = srcPos + len; j < jj; j += 3) {
dest[destPos++] = src[j] | src[j + 1] << 8 | src[j + 2] << 16 | alphaMask;
}
} else {
for (; i < len32 - 2; i += 3, destPos += 4) {
const s1 = src32[i],
s2 = src32[i + 1],
s3 = src32[i + 2];
dest[destPos] = s1 | alphaMask;
dest[destPos + 1] = s1 << 24 | s2 >>> 8 | alphaMask;
dest[destPos + 2] = s2 << 16 | s3 >>> 16 | alphaMask;
dest[destPos + 3] = s3 << 8 | alphaMask;
}
for (let j = srcPos + i * 4, jj = srcPos + len; j < jj; j += 3) {
dest[destPos++] = src[j] << 24 | src[j + 1] << 16 | src[j + 2] << 8 | alphaMask;
}
}
return {
srcPos: srcPos + len,
destPos
};
}
function grayToRGBA(src, dest) {
if (image_utils_FeatureTest.isLittleEndian) {
for (let i = 0, ii = src.length; i < ii; i++) {
dest[i] = src[i] * 0x10101 | 0xff000000;
}
} else {
for (let i = 0, ii = src.length; i < ii; i++) {
dest[i] = src[i] * 0x1010100 | 0x000000ff;
}
}
}
;// ./src/display/webgpu.js
function webgpu_classPrivateMethodInitSpec(e, a) { webgpu_checkPrivateRedeclaration(e, a), a.add(e); }
function webgpu_classPrivateFieldInitSpec(e, t, a) { webgpu_checkPrivateRedeclaration(e, t), t.set(e, a); }
function webgpu_checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
function webgpu_classPrivateFieldGet(s, a) { return s.get(webgpu_assertClassBrand(s, a)); }
function webgpu_classPrivateFieldSet(s, a, r) { return s.set(webgpu_assertClassBrand(s, a), r), r; }
function webgpu_assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
const MESH_WGSL = `
struct Uniforms {
offsetX : f32,
offsetY : f32,
scaleX : f32,
scaleY : f32,
paddedWidth : f32,
paddedHeight : f32,
borderSize : f32,
_pad : f32,
};
@group(0) @binding(0) var<uniform> u : Uniforms;
struct VertexInput {
@location(0) position : vec2<f32>,
@location(1) color : vec4<f32>,
};
struct VertexOutput {
@builtin(position) position : vec4<f32>,
@location(0) color : vec3<f32>,
};
@vertex
fn vs_main(in : VertexInput) -> VertexOutput {
var out : VertexOutput;
let cx = (in.position.x + u.offsetX) * u.scaleX;
let cy = (in.position.y + u.offsetY) * u.scaleY;
out.position = vec4<f32>(
((cx + u.borderSize) / u.paddedWidth) * 2.0 - 1.0,
1.0 - ((cy + u.borderSize) / u.paddedHeight) * 2.0,
0.0,
1.0
);
out.color = in.color.rgb;
return out;
}
@fragment
fn fs_main(in : VertexOutput) -> @location(0) vec4<f32> {
return vec4<f32>(in.color, 1.0);
}
`;
var _initPromise = /*#__PURE__*/new WeakMap();
var _device = /*#__PURE__*/new WeakMap();
var _meshPipeline = /*#__PURE__*/new WeakMap();
var _preferredFormat = /*#__PURE__*/new WeakMap();
var _WebGPU_brand = /*#__PURE__*/new WeakSet();
class WebGPU {
constructor() {
webgpu_classPrivateMethodInitSpec(this, _WebGPU_brand);
webgpu_classPrivateFieldInitSpec(this, _initPromise, null);
webgpu_classPrivateFieldInitSpec(this, _device, null);
webgpu_classPrivateFieldInitSpec(this, _meshPipeline, null);
webgpu_classPrivateFieldInitSpec(this, _preferredFormat, null);
}
init() {
return webgpu_classPrivateFieldGet(_initPromise, this) || webgpu_classPrivateFieldSet(_initPromise, this, webgpu_assertClassBrand(_WebGPU_brand, this, _initGPU).call(this));
}
get isReady() {
return webgpu_classPrivateFieldGet(_device, this) !== null;
}
loadMeshShader() {
if (!webgpu_classPrivateFieldGet(_device, this) || webgpu_classPrivateFieldGet(_meshPipeline, this)) {
return;
}
const shaderModule = webgpu_classPrivateFieldGet(_device, this).createShaderModule({
code: MESH_WGSL
});
webgpu_classPrivateFieldSet(_meshPipeline, this, webgpu_classPrivateFieldGet(_device, this).createRenderPipeline({
layout: "auto",
vertex: {
module: shaderModule,
entryPoint: "vs_main",
buffers: [{
arrayStride: 2 * 4,
attributes: [{
shaderLocation: 0,
offset: 0,
format: "float32x2"
}]
}, {
arrayStride: 4,
attributes: [{
shaderLocation: 1,
offset: 0,
format: "unorm8x4"
}]
}]
},
fragment: {
module: shaderModule,
entryPoint: "fs_main",
targets: [{
format: webgpu_classPrivateFieldGet(_preferredFormat, this)
}]
},
primitive: {
topology: "triangle-list"
}
}));
}
draw(posData, colData, vertexCount, context, backgroundColor, paddedWidth, paddedHeight, borderSize) {
this.loadMeshShader();
const device = webgpu_classPrivateFieldGet(_device, this);
const {
offsetX,
offsetY,
scaleX,
scaleY
} = context;
const posBuffer = device.createBuffer({
size: Math.max(posData.byteLength, 4),
usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST
});
if (posData.byteLength > 0) {
device.queue.writeBuffer(posBuffer, 0, posData);
}
const colBuffer = device.createBuffer({
size: Math.max(colData.byteLength, 4),
usage: GPUBufferUsage.VERTEX | GPUBufferUsage.COPY_DST
});
if (colData.byteLength > 0) {
device.queue.writeBuffer(colBuffer, 0, colData);
}
const uniformBuffer = device.createBuffer({
size: 8 * 4,
usage: GPUBufferUsage.UNIFORM | GPUBufferUsage.COPY_DST
});
device.queue.writeBuffer(uniformBuffer, 0, new Float32Array([offsetX, offsetY, scaleX, scaleY, paddedWidth, paddedHeight, borderSize, 0]));
const bindGroup = device.createBindGroup({
layout: webgpu_classPrivateFieldGet(_meshPipeline, this).getBindGroupLayout(0),
entries: [{
binding: 0,
resource: {
buffer: uniformBuffer
}
}]
});
const offscreen = new OffscreenCanvas(paddedWidth, paddedHeight);
const gpuCtx = offscreen.getContext("webgpu");
gpuCtx.configure({
device,
format: webgpu_classPrivateFieldGet(_preferredFormat, this),
alphaMode: backgroundColor ? "opaque" : "premultiplied"
});
const clearValue = backgroundColor ? {
r: backgroundColor[0] / 255,
g: backgroundColor[1] / 255,
b: backgroundColor[2] / 255,
a: 1
} : {
r: 0,
g: 0,
b: 0,
a: 0
};
const commandEncoder = device.createCommandEncoder();
const renderPass = commandEncoder.beginRenderPass({
colorAttachments: [{
view: gpuCtx.getCurrentTexture().createView(),
clearValue,
loadOp: "clear",
storeOp: "store"
}]
});
if (vertexCount > 0) {
renderPass.setPipeline(webgpu_classPrivateFieldGet(_meshPipeline, this));
renderPass.setBindGroup(0, bindGroup);
renderPass.setVertexBuffer(0, posBuffer);
renderPass.setVertexBuffer(1, colBuffer);
renderPass.draw(vertexCount);
}
renderPass.end();
device.queue.submit([commandEncoder.finish()]);
posBuffer.destroy();
colBuffer.destroy();
uniformBuffer.destroy();
return offscreen.transferToImageBitmap();
}
}
async function _initGPU() {
if (!globalThis.navigator?.gpu) {
return false;
}
try {
const adapter = await navigator.gpu.requestAdapter();
if (!adapter) {
return false;
}
webgpu_classPrivateFieldSet(_preferredFormat, this, navigator.gpu.getPreferredCanvasFormat());
webgpu_classPrivateFieldSet(_device, this, await adapter.requestDevice());
return true;
} catch {
return false;
}
}
const _webGPU = new WebGPU();
function initGPU() {
return _webGPU.init();
}
function isGPUReady() {
return _webGPU.isReady;
}
function loadMeshShader() {
_webGPU.loadMeshShader();
}
function drawMeshWithGPU(posData, colData, vertexCount, context, backgroundColor, paddedWidth, paddedHeight, borderSize) {
return _webGPU.draw(posData, colData, vertexCount, context, backgroundColor, paddedWidth, paddedHeight, borderSize);
}
;// ./src/display/pattern_helper.js
function pattern_helper_defineProperty(e, r, t) { return (r = pattern_helper_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function pattern_helper_toPropertyKey(t) { var i = pattern_helper_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function pattern_helper_toPrimitive(t, e) { if ("object" != typeof t || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); }
;
const PathType = {
FILL: "Fill",
STROKE: "Stroke",
SHADING: "Shading"
};
function applyBoundingBox(ctx, bbox) {
if (!bbox) {
return;
}
const width = bbox[2] - bbox[0];
const height = bbox[3] - bbox[1];
const region = new Path2D();
region.rect(bbox[0], bbox[1], width, height);
ctx.clip(region);
}
class BaseShadingPattern {
constructor() {
pattern_helper_defineProperty(this, "matrix", null);
}
isModifyingCurrentTransform() {
return false;
}
getPattern() {
unreachable("Abstract method `getPattern` called.");
}
}
class RadialAxialShadingPattern extends BaseShadingPattern {
constructor(IR) {
super();
this._type = IR[1];
this._bbox = IR[2];
this._colorStops = IR[3];
this._p0 = IR[4];
this._p1 = IR[5];
this._r0 = IR[6];
this._r1 = IR[7];
}
isOriginBased() {
return this._p0[0] === 0 && this._p0[1] === 0 && (!this.isRadial() || this._p1[0] === 0 && this._p1[1] === 0);
}
isRadial() {
return this._type === "radial";
}
areConic() {
if (!this.isRadial()) {
return false;
}
const dist = Math.hypot(this._p0[0] - this._p1[0], this._p0[1] - this._p1[1]);
return dist + this._r1 > this._r0 && dist + this._r0 > this._r1;
}
_createGradient(ctx, transform = null) {
let grad;
let firstPoint = this._p0;
let secondPoint = this._p1;
if (transform) {
firstPoint = firstPoint.slice();
secondPoint = secondPoint.slice();
Util.applyTransform(firstPoint, transform);
Util.applyTransform(secondPoint, transform);
}
if (this._type === "axial") {
grad = ctx.createLinearGradient(firstPoint[0], firstPoint[1], secondPoint[0], secondPoint[1]);
} else if (this._type === "radial") {
let r0 = this._r0;
let r1 = this._r1;
if (transform) {
const scale = new Float32Array(2);
Util.singularValueDecompose2dScale(transform, scale);
r0 *= scale[0];
r1 *= scale[0];
}
grad = ctx.createRadialGradient(firstPoint[0], firstPoint[1], r0, secondPoint[0], secondPoint[1], r1);
}
for (const colorStop of this._colorStops) {
grad.addColorStop(colorStop[0], colorStop[1]);
}
return grad;
}
_createReversedGradient(ctx, transform = null) {
let firstPoint = this._p1;
let secondPoint = this._p0;
if (transform) {
firstPoint = firstPoint.slice();
secondPoint = secondPoint.slice();
Util.applyTransform(firstPoint, transform);
Util.applyTransform(secondPoint, transform);
}
let r0 = this._r1;
let r1 = this._r0;
if (transform) {
const scale = new Float32Array(2);
Util.singularValueDecompose2dScale(transform, scale);
r0 *= scale[0];
r1 *= scale[0];
}
const grad = ctx.createRadialGradient(firstPoint[0], firstPoint[1], r0, secondPoint[0], secondPoint[1], r1);
const reversedStops = this._colorStops.map(([t, c]) => [1 - t, c]).reverse();
for (const [t, c] of reversedStops) {
grad.addColorStop(t, c);
}
return grad;
}
_createRasterPattern(ctx, owner, inverse, bbox, transform, transferMaps) {
const width = Math.ceil(bbox[2] - bbox[0]) || 1;
const height = Math.ceil(bbox[3] - bbox[1]) || 1;
const tmpCanvas = owner.canvasFactory.create(width, height);
const tmpCtx = tmpCanvas.context;
tmpCtx.clearRect(0, 0, width, height);
tmpCtx.beginPath();
tmpCtx.rect(0, 0, width, height);
tmpCtx.translate(-bbox[0], -bbox[1]);
inverse = Util.transform(inverse, [1, 0, 0, 1, bbox[0], bbox[1]]);
tmpCtx.transform(...transform);
applyBoundingBox(tmpCtx, this._bbox);
if (this.areConic()) {
tmpCtx.fillStyle = this._createReversedGradient(tmpCtx);
tmpCtx.fill();
}
tmpCtx.fillStyle = this._createGradient(tmpCtx);
tmpCtx.fill();
transferMaps?.applyToCanvas(tmpCtx);
const pattern = ctx.createPattern(tmpCanvas.canvas, "no-repeat");
owner.canvasFactory.destroy(tmpCanvas);
pattern.setTransform(new DOMMatrix(inverse));
return pattern;
}
getPattern(ctx, owner, inverse, pathType) {
const transferMaps = owner.current.transferMapsFallback;
if (pathType === PathType.STROKE || pathType === PathType.FILL) {
if (this.isOriginBased() && !transferMaps) {
let transf = Util.transform(inverse, owner.baseTransform);
if (this.matrix) {
transf = Util.transform(transf, this.matrix);
}
const precision = 1e-3;
const n1 = Math.hypot(transf[0], transf[1]);
const n2 = Math.hypot(transf[2], transf[3]);
const ps = (transf[0] * transf[2] + transf[1] * transf[3]) / (n1 * n2);
if (Math.abs(ps) < precision) {
if (this.isRadial()) {
if (Math.abs(n1 - n2) < precision) {
return this._createGradient(ctx, transf);
}
} else {
return this._createGradient(ctx, transf);
}
}
}
const ownerBBox = owner.current.getClippedPathBoundingBox(pathType, getCurrentTransform(ctx)) || [0, 0, 0, 0];
const transform = this.matrix ? Util.transform(owner.baseTransform, this.matrix) : owner.baseTransform;
return this._createRasterPattern(ctx, owner, inverse, ownerBBox, transform, transferMaps);
}
if (transferMaps && inverse) {
return this._createRasterPattern(ctx, owner, inverse, owner.current.clipBox, getCurrentTransform(ctx), transferMaps);
}
if (this.areConic()) {
ctx.save();
applyBoundingBox(ctx, this._bbox);
ctx.fillStyle = this._createReversedGradient(ctx);
ctx.fillRect(-1e10, -1e10, 2e10, 2e10);
ctx.restore();
}
applyBoundingBox(ctx, this._bbox);
return this._createGradient(ctx);
}
}
function drawTriangle(data, context, p1, p2, p3, c1, c2, c3) {
const coords = context.coords,
colors = context.colors;
const bytes = data.data,
rowSize = data.width * 4;
let tmp;
if (coords[p1 * 2 + 1] > coords[p2 * 2 + 1]) {
tmp = p1;
p1 = p2;
p2 = tmp;
tmp = c1;
c1 = c2;
c2 = tmp;
}
if (coords[p2 * 2 + 1] > coords[p3 * 2 + 1]) {
tmp = p2;
p2 = p3;
p3 = tmp;
tmp = c2;
c2 = c3;
c3 = tmp;
}
if (coords[p1 * 2 + 1] > coords[p2 * 2 + 1]) {
tmp = p1;
p1 = p2;
p2 = tmp;
tmp = c1;
c1 = c2;
c2 = tmp;
}
const x1 = (coords[p1 * 2] + context.offsetX) * context.scaleX;
const y1 = (coords[p1 * 2 + 1] + context.offsetY) * context.scaleY;
const x2 = (coords[p2 * 2] + context.offsetX) * context.scaleX;
const y2 = (coords[p2 * 2 + 1] + context.offsetY) * context.scaleY;
const x3 = (coords[p3 * 2] + context.offsetX) * context.scaleX;
const y3 = (coords[p3 * 2 + 1] + context.offsetY) * context.scaleY;
if (y1 >= y3) {
return;
}
const c1r = colors[c1 * 4],
c1g = colors[c1 * 4 + 1],
c1b = colors[c1 * 4 + 2];
const c2r = colors[c2 * 4],
c2g = colors[c2 * 4 + 1],
c2b = colors[c2 * 4 + 2];
const c3r = colors[c3 * 4],
c3g = colors[c3 * 4 + 1],
c3b = colors[c3 * 4 + 2];
const minY = Math.round(y1),
maxY = Math.round(y3);
let xa, car, cag, cab;
let xb, cbr, cbg, cbb;
for (let y = minY; y <= maxY; y++) {
if (y < y2) {
const k = y < y1 ? 0 : (y1 - y) / (y1 - y2);
xa = x1 - (x1 - x2) * k;
car = c1r - (c1r - c2r) * k;
cag = c1g - (c1g - c2g) * k;
cab = c1b - (c1b - c2b) * k;
} else {
let k;
if (y > y3) {
k = 1;
} else if (y2 === y3) {
k = 0;
} else {
k = (y2 - y) / (y2 - y3);
}
xa = x2 - (x2 - x3) * k;
car = c2r - (c2r - c3r) * k;
cag = c2g - (c2g - c3g) * k;
cab = c2b - (c2b - c3b) * k;
}
let k;
if (y < y1) {
k = 0;
} else if (y > y3) {
k = 1;
} else {
k = (y1 - y) / (y1 - y3);
}
xb = x1 - (x1 - x3) * k;
cbr = c1r - (c1r - c3r) * k;
cbg = c1g - (c1g - c3g) * k;
cbb = c1b - (c1b - c3b) * k;
const x1_ = Math.round(Math.min(xa, xb));
const x2_ = Math.round(Math.max(xa, xb));
let j = rowSize * y + x1_ * 4;
for (let x = x1_; x <= x2_; x++) {
k = (xa - x) / (xa - xb);
if (k < 0) {
k = 0;
} else if (k > 1) {
k = 1;
}
bytes[j++] = car - (car - cbr) * k | 0;
bytes[j++] = cag - (cag - cbg) * k | 0;
bytes[j++] = cab - (cab - cbb) * k | 0;
bytes[j++] = 255;
}
}
}
class MeshShadingPattern extends BaseShadingPattern {
constructor(IR) {
super();
this._posData = IR[2];
this._colData = IR[3];
this._vertexCount = IR[4];
this._bounds = IR[5];
this._bbox = IR[6];
this._background = IR[7];
loadMeshShader();
}
_createMeshCanvas(combinedScale, backgroundColor, canvasFactory, transferMaps = null) {
const EXPECTED_SCALE = 1.1;
const MAX_PATTERN_SIZE = 3000;
const BORDER_SIZE = 2;
const offsetX = Math.floor(this._bounds[0]);
const offsetY = Math.floor(this._bounds[1]);
const boundsWidth = Math.ceil(this._bounds[2]) - offsetX;
const boundsHeight = Math.ceil(this._bounds[3]) - offsetY;
const width = Math.min(Math.ceil(Math.abs(boundsWidth * combinedScale[0] * EXPECTED_SCALE)), MAX_PATTERN_SIZE) || 1;
const height = Math.min(Math.ceil(Math.abs(boundsHeight * combinedScale[1] * EXPECTED_SCALE)), MAX_PATTERN_SIZE) || 1;
const scaleX = boundsWidth ? boundsWidth / width : 1;
const scaleY = boundsHeight ? boundsHeight / height : 1;
const context = {
coords: this._posData,
colors: this._colData,
offsetX: -offsetX,
offsetY: -offsetY,
scaleX: 1 / scaleX,
scaleY: 1 / scaleY
};
const paddedWidth = width + BORDER_SIZE * 2;
const paddedHeight = height + BORDER_SIZE * 2;
const tmpCanvas = canvasFactory.create(paddedWidth, paddedHeight);
if (isGPUReady() && this._vertexCount > 48) {
tmpCanvas.context.drawImage(drawMeshWithGPU(this._posData, this._colData, this._vertexCount, context, backgroundColor, paddedWidth, paddedHeight, BORDER_SIZE), 0, 0);
} else {
const data = tmpCanvas.context.createImageData(width, height);
if (backgroundColor) {
const bytes = data.data;
for (let i = 0, ii = bytes.length; i < ii; i += 4) {
bytes[i] = backgroundColor[0];
bytes[i + 1] = backgroundColor[1];
bytes[i + 2] = backgroundColor[2];
bytes[i + 3] = 255;
}
}
for (let i = 0, ii = this._vertexCount; i < ii; i += 3) {
drawTriangle(data, context, i, i + 1, i + 2, i, i + 1, i + 2);
}
tmpCanvas.context.putImageData(data, BORDER_SIZE, BORDER_SIZE);
}
transferMaps?.applyToCanvas(tmpCanvas.context);
return {
canvas: tmpCanvas.canvas,
offsetX: offsetX - BORDER_SIZE * scaleX,
offsetY: offsetY - BORDER_SIZE * scaleY,
scaleX,
scaleY
};
}
isModifyingCurrentTransform() {
return true;
}
getPattern(ctx, owner, inverse, pathType) {
applyBoundingBox(ctx, this._bbox);
const scale = new Float32Array(2);
if (pathType === PathType.SHADING) {
Util.singularValueDecompose2dScale(getCurrentTransform(ctx), scale);
} else if (this.matrix) {
Util.singularValueDecompose2dScale(this.matrix, scale);
const [matrixScaleX, matrixScaleY] = scale;
Util.singularValueDecompose2dScale(owner.baseTransform, scale);
scale[0] *= matrixScaleX;
scale[1] *= matrixScaleY;
} else {
Util.singularValueDecompose2dScale(owner.baseTransform, scale);
}
const temporaryPatternCanvas = this._createMeshCanvas(scale, pathType === PathType.SHADING ? null : this._background, owner.canvasFactory, owner.current.transferMapsFallback);
if (pathType !== PathType.SHADING) {
ctx.setTransform(...owner.baseTransform);
if (this.matrix) {
ctx.transform(...this.matrix);
}
}
ctx.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY);
ctx.scale(temporaryPatternCanvas.scaleX, temporaryPatternCanvas.scaleY);
const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, "no-repeat");
owner.canvasFactory.destroy(temporaryPatternCanvas);
return pattern;
}
}
class DummyShadingPattern extends BaseShadingPattern {
getPattern() {
return "hotpink";
}
}
function getShadingPattern(IR) {
switch (IR[0]) {
case "RadialAxial":
return new RadialAxialShadingPattern(IR);
case "Mesh":
return new MeshShadingPattern(IR);
case "Dummy":
return new DummyShadingPattern();
}
throw new Error(`Unknown IR type: ${IR[0]}`);
}
const PaintType = {
COLORED: 1,
UNCOLORED: 2
};
class TilingPattern {
constructor(IR, ctx, canvasGraphicsFactory, baseTransform) {
this.color = IR[1];
this.operatorList = IR[2];
this.matrix = IR[3];
this.bbox = IR[4];
this.xstep = IR[5];
this.ystep = IR[6];
this.paintType = IR[7];
this.tilingType = IR[8];
this.needsIsolation = IR[9] ?? true;
this.ctx = ctx;
this.canvasGraphicsFactory = canvasGraphicsFactory;
this.baseTransform = baseTransform;
this.patternBaseMatrix = this.matrix ? Util.transform(baseTransform, this.matrix) : baseTransform;
}
canSkipPatternCanvas([width, height, offsetX, offsetY]) {
const [x0, y0, x1, y1] = this.bbox;
const absXStep = Math.abs(this.xstep);
const absYStep = Math.abs(this.ystep);
if (width > absXStep + 1e-6 || height > absYStep + 1e-6) {
return null;
}
const nXFirst = Math.floor((offsetX - x1) / absXStep) + 1;
const nXLast = Math.ceil((offsetX + width - x0) / absXStep) - 1;
const nYFirst = Math.floor((offsetY - y1) / absYStep) + 1;
const nYLast = Math.ceil((offsetY + height - y0) / absYStep) - 1;
return nXLast <= nXFirst && nYLast <= nYFirst ? [nXFirst, nYFirst] : null;
}
updatePatternDims(clippedBBox, dims) {
const bbox = BBOX_INIT.slice();
Util.axialAlignedBoundingBox(clippedBBox, Util.inverseTransform(this.patternBaseMatrix), bbox);
dims[0] = bbox[2] - bbox[0];
dims[1] = bbox[3] - bbox[1];
dims[2] = bbox[0];
dims[3] = bbox[1];
}
_renderTileCanvas(owner, opIdx, dimx, dimy) {
const [x0, y0, x1, y1] = this.bbox;
const tmpCanvas = owner.canvasFactory.create(dimx.size, dimy.size);
const tmpCtx = tmpCanvas.context;
const graphics = this.canvasGraphicsFactory.createCanvasGraphics(tmpCtx, opIdx);
graphics.groupLevel = owner.groupLevel;
graphics.current.transferMapsFallback = owner.current.transferMapsFallback;
this.setFillAndStrokeStyleToContext(graphics, this.paintType, this.color);
tmpCtx.translate(-dimx.scale * x0, -dimy.scale * y0);
graphics.transform(0, dimx.scale, 0, 0, dimy.scale, 0, 0);
tmpCtx.save();
graphics.dependencyTracker?.save();
this.clipBbox(graphics, x0, y0, x1, y1);
graphics.baseTransform = getCurrentTransform(graphics.ctx);
graphics.executeOperatorList(this.operatorList);
graphics.endDrawing();
graphics.dependencyTracker?.restore();
tmpCtx.restore();
return tmpCanvas;
}
_getCombinedScales() {
const scale = new Float32Array(2);
Util.singularValueDecompose2dScale(this.matrix, scale);
const [matrixScaleX, matrixScaleY] = scale;
Util.singularValueDecompose2dScale(this.baseTransform, scale);
return [matrixScaleX * scale[0], matrixScaleY * scale[1]];
}
drawPattern(owner, path, useEOFill = false, [n, m], opIdx) {
const [x0, y0, x1, y1] = this.bbox;
const dependencyTracker = owner.dependencyTracker;
if (dependencyTracker) {
owner.dependencyTracker = new CanvasNestedDependencyTracker(dependencyTracker, opIdx);
}
try {
owner.save();
if (useEOFill) {
owner.ctx.clip(path, "evenodd");
} else {
owner.ctx.clip(path);
}
owner.ctx.setTransform(...this.patternBaseMatrix);
owner.ctx.translate(n * this.xstep, m * this.ystep);
if (this.needsIsolation || owner.ctx.globalAlpha !== 1 || owner.ctx.globalCompositeOperation !== "source-over" || owner.inSMaskMode) {
const bboxWidth = x1 - x0;
const bboxHeight = y1 - y0;
const [combinedScaleX, combinedScaleY] = this._getCombinedScales();
const dimx = this.getSizeAndScale(bboxWidth, this.ctx.canvas.width, combinedScaleX);
const dimy = this.getSizeAndScale(bboxHeight, this.ctx.canvas.height, combinedScaleY);
const tmpCanvas = this._renderTileCanvas(owner, opIdx, dimx, dimy);
owner.ctx.drawImage(tmpCanvas.canvas, x0, y0, bboxWidth, bboxHeight);
owner.canvasFactory.destroy(tmpCanvas);
} else {
owner.resetGraphicsState();
this.setFillAndStrokeStyleToContext(owner, this.paintType, this.color);
this.clipBbox(owner, x0, y0, x1, y1);
owner.baseTransformStack.push(owner.baseTransform);
owner.baseTransform = getCurrentTransform(owner.ctx);
owner.executeOperatorList(this.operatorList);
owner.baseTransform = owner.baseTransformStack.pop();
}
owner.restore();
} finally {
if (dependencyTracker) {
owner.dependencyTracker = dependencyTracker;
}
}
}
createPatternCanvas(owner, opIdx) {
const [x0, y0, x1, y1] = this.bbox;
const width = x1 - x0;
const height = y1 - y0;
let {
xstep,
ystep
} = this;
xstep = Math.abs(xstep);
ystep = Math.abs(ystep);
info("TilingType: " + this.tilingType);
const [combinedScaleX, combinedScaleY] = this._getCombinedScales();
let canvasWidth = width,
canvasHeight = height,
redrawHorizontally = false,
redrawVertically = false;
if (Math.ceil(xstep * combinedScaleX) >= Math.ceil(width * combinedScaleX)) {
canvasWidth = xstep;
} else {
redrawHorizontally = true;
}
if (Math.ceil(ystep * combinedScaleY) >= Math.ceil(height * combinedScaleY)) {
canvasHeight = ystep;
} else {
redrawVertically = true;
}
const dimx = this.getSizeAndScale(canvasWidth, this.ctx.canvas.width, combinedScaleX);
const dimy = this.getSizeAndScale(canvasHeight, this.ctx.canvas.height, combinedScaleY);
const tmpCanvas = this._renderTileCanvas(owner, opIdx, dimx, dimy);
if (redrawHorizontally || redrawVertically) {
const image = tmpCanvas.canvas;
if (redrawHorizontally) {
canvasWidth = xstep;
}
if (redrawVertically) {
canvasHeight = ystep;
}
const dimx2 = this.getSizeAndScale(canvasWidth, this.ctx.canvas.width, combinedScaleX);
const dimy2 = this.getSizeAndScale(canvasHeight, this.ctx.canvas.height, combinedScaleY);
const xSize = dimx2.size;
const ySize = dimy2.size;
const tmpCanvas2 = owner.canvasFactory.create(xSize, ySize);
const tmpCtx2 = tmpCanvas2.context;
const ii = redrawHorizontally ? Math.min(Math.floor(width / xstep), Math.ceil(image.width / xSize)) : 0;
const jj = redrawVertically ? Math.min(Math.floor(height / ystep), Math.ceil(image.height / ySize)) : 0;
let rowSource = image;
let bandCanvas = null;
if (redrawVertically) {
bandCanvas = owner.canvasFactory.create(image.width, ySize);
const bandCtx = bandCanvas.context;
for (let j = jj; j >= 0; j--) {
bandCtx.drawImage(image, 0, ySize * j, image.width, ySize, 0, 0, image.width, ySize);
}
rowSource = bandCanvas.canvas;
}
for (let i = ii; i >= 0; i--) {
tmpCtx2.drawImage(rowSource, xSize * i, 0, xSize, ySize, 0, 0, xSize, ySize);
}
if (bandCanvas) {
owner.canvasFactory.destroy(bandCanvas);
}
owner.canvasFactory.destroy(tmpCanvas);
return {
canvas: tmpCanvas2.canvas,
canvasEntry: tmpCanvas2,
scaleX: dimx2.scale,
scaleY: dimy2.scale,
offsetX: x0,
offsetY: y0
};
}
return {
canvas: tmpCanvas.canvas,
canvasEntry: tmpCanvas,
scaleX: dimx.scale,
scaleY: dimy.scale,
offsetX: x0,
offsetY: y0
};
}
getSizeAndScale(step, realOutputSize, scale) {
const maxSize = Math.max(TilingPattern.MAX_PATTERN_SIZE, realOutputSize);
let size = Math.ceil(step * scale);
if (size >= maxSize) {
size = maxSize;
} else {
scale = size / step;
}
return {
scale,
size
};
}
clipBbox(graphics, x0, y0, x1, y1) {
const bboxWidth = x1 - x0;
const bboxHeight = y1 - y0;
const clip = new Path2D();
clip.rect(x0, y0, bboxWidth, bboxHeight);
Util.axialAlignedBoundingBox([x0, y0, x1, y1], getCurrentTransform(graphics.ctx), graphics.current.minMax);
graphics.ctx.clip(clip);
graphics.current.updateClipFromPath();
}
setFillAndStrokeStyleToContext(graphics, paintType, color) {
switch (paintType) {
case PaintType.COLORED:
color = "#000000";
break;
case PaintType.UNCOLORED:
break;
default:
throw new FormatError(`Unsupported paint type: ${paintType}`);
}
const {
ctx,
current
} = graphics;
current.patternFill = current.patternStroke = false;
ctx.fillStyle = ctx.strokeStyle = current.transferMapsFallback?.applyToColor(color) ?? color;
current.fillColor = current.strokeColor = color;
}
isModifyingCurrentTransform() {
return false;
}
getPattern(ctx, owner, inverse, pathType, opIdx) {
const matrix = pathType !== PathType.SHADING ? Util.transform(inverse, this.patternBaseMatrix) : inverse;
const temporaryPatternCanvas = this.createPatternCanvas(owner, opIdx);
let domMatrix = new DOMMatrix(matrix);
domMatrix = domMatrix.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY);
domMatrix = domMatrix.scale(1 / temporaryPatternCanvas.scaleX, 1 / temporaryPatternCanvas.scaleY);
const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, "repeat");
owner.canvasFactory.destroy(temporaryPatternCanvas.canvasEntry);
pattern.setTransform(domMatrix);
return pattern;
}
}
pattern_helper_defineProperty(TilingPattern, "MAX_PATTERN_SIZE", 3000);
;// ./src/display/canvas.js
function canvas_classPrivateMethodInitSpec(e, a) { canvas_checkPrivateRedeclaration(e, a), a.add(e); }
function canvas_classPrivateFieldInitSpec(e, t, a) { canvas_checkPrivateRedeclaration(e, t), t.set(e, a); }
function canvas_checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
function canvas_classPrivateFieldGet(s, a) { return s.get(canvas_assertClassBrand(s, a)); }
function canvas_classPrivateFieldSet(s, a, r) { return s.set(canvas_assertClassBrand(s, a), r), r; }
function canvas_assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
function canvas_defineProperty(e, r, t) { return (r = canvas_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function canvas_toPropertyKey(t) { var i = canvas_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function canvas_toPrimitive(t, e) { if ("object" != typeof t || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); }
;
const MIN_FONT_SIZE = 16;
const MAX_FONT_SIZE = 100;
const EXECUTION_TIME = 15;
const EXECUTION_STEPS = 10;
const FULL_CHUNK_HEIGHT = 16;
const XY = new Float32Array(2);
function mirrorContextOperations(ctx, destCtx) {
if (ctx._removeMirroring) {
throw new Error("Context is already forwarding operations.");
}
const originalMethods = new Map();
for (const name of ["save", "restore", "rotate", "scale", "translate", "transform", "setTransform", "resetTransform", "clip", "moveTo", "lineTo", "bezierCurveTo", "quadraticCurveTo", "arc", "arcTo", "ellipse", "rect", "roundRect", "closePath", "beginPath"]) {
const original = ctx[name];
if (typeof original !== "function" || typeof destCtx[name] !== "function") {
continue;
}
originalMethods.set(name, original);
ctx[name] = function (...args) {
destCtx[name](...args);
return original.apply(this, args);
};
}
ctx._removeMirroring = () => {
for (const [name, original] of originalMethods) {
ctx[name] = original;
}
delete ctx._removeMirroring;
};
}
function drawImageAtIntegerCoords(ctx, srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH) {
const [a, b, c, d, tx, ty] = getCurrentTransform(ctx);
if (b === 0 && c === 0) {
const tlX = destX * a + tx;
const rTlX = Math.round(tlX);
const tlY = destY * d + ty;
const rTlY = Math.round(tlY);
const brX = (destX + destW) * a + tx;
const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;
const brY = (destY + destH) * d + ty;
const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;
ctx.setTransform(Math.sign(a), 0, 0, Math.sign(d), rTlX, rTlY);
ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rWidth, rHeight);
ctx.setTransform(a, b, c, d, tx, ty);
return [rWidth, rHeight];
}
if (a === 0 && d === 0) {
const tlX = destY * c + tx;
const rTlX = Math.round(tlX);
const tlY = destX * b + ty;
const rTlY = Math.round(tlY);
const brX = (destY + destH) * c + tx;
const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;
const brY = (destX + destW) * b + ty;
const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;
ctx.setTransform(0, Math.sign(b), Math.sign(c), 0, rTlX, rTlY);
ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rHeight, rWidth);
ctx.setTransform(a, b, c, d, tx, ty);
return [rHeight, rWidth];
}
ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH);
const scaleX = Math.hypot(a, b);
const scaleY = Math.hypot(c, d);
return [scaleX * destW, scaleY * destH];
}
class CanvasExtraState {
constructor(width, height) {
canvas_defineProperty(this, "alphaIsShape", false);
canvas_defineProperty(this, "fontSize", 0);
canvas_defineProperty(this, "fontSizeScale", 1);
canvas_defineProperty(this, "textMatrix", null);
canvas_defineProperty(this, "textMatrixScale", 1);
canvas_defineProperty(this, "fontMatrix", FONT_IDENTITY_MATRIX);
canvas_defineProperty(this, "leading", 0);
canvas_defineProperty(this, "x", 0);
canvas_defineProperty(this, "y", 0);
canvas_defineProperty(this, "lineX", 0);
canvas_defineProperty(this, "lineY", 0);
canvas_defineProperty(this, "charSpacing", 0);
canvas_defineProperty(this, "wordSpacing", 0);
canvas_defineProperty(this, "textHScale", 1);
canvas_defineProperty(this, "textRenderingMode", TextRenderingMode.FILL);
canvas_defineProperty(this, "textRise", 0);
canvas_defineProperty(this, "fillColor", "#000000");
canvas_defineProperty(this, "strokeColor", "#000000");
canvas_defineProperty(this, "tilingPatternDims", null);
canvas_defineProperty(this, "patternFill", false);
canvas_defineProperty(this, "patternStroke", false);
canvas_defineProperty(this, "fillAlpha", 1);
canvas_defineProperty(this, "strokeAlpha", 1);
canvas_defineProperty(this, "lineWidth", 1);
canvas_defineProperty(this, "activeSMask", null);
canvas_defineProperty(this, "transferMaps", "none");
canvas_defineProperty(this, "transferMapsFallback", null);
canvas_defineProperty(this, "minMax", F32_BBOX_INIT.slice());
this.clipBox = new Float32Array([0, 0, width, height]);
}
clone() {
const clone = Object.create(this);
clone.clipBox = this.clipBox.slice();
clone.minMax = this.minMax.slice();
clone.tilingPatternDims = this.tilingPatternDims?.slice();
return clone;
}
getPathBoundingBox(pathType = PathType.FILL, transform = null) {
const box = this.minMax.slice();
if (pathType === PathType.STROKE) {
if (!transform) {
unreachable("Stroke bounding box must include transform.");
}
Util.singularValueDecompose2dScale(transform, XY);
const xStrokePad = XY[0] * this.lineWidth / 2;
const yStrokePad = XY[1] * this.lineWidth / 2;
box[0] -= xStrokePad;
box[1] -= yStrokePad;
box[2] += xStrokePad;
box[3] += yStrokePad;
}
return box;
}
updateClipFromPath() {
const intersect = Util.intersect(this.clipBox, this.getPathBoundingBox());
this.startNewPathAndClipBox(intersect || [0, 0, 0, 0]);
}
isEmptyClip() {
return this.minMax[0] === Infinity;
}
startNewPathAndClipBox(box) {
this.clipBox.set(box, 0);
this.minMax.set(F32_BBOX_INIT, 0);
}
getClippedPathBoundingBox(pathType = PathType.FILL, transform = null) {
return Util.intersect(this.clipBox, this.getPathBoundingBox(pathType, transform));
}
}
function putBinaryImageData(ctx, imgData) {
const {
width,
height,
kind
} = imgData;
const partialChunkHeight = height % FULL_CHUNK_HEIGHT;
const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;
const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;
const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);
let srcPos = 0;
const src = imgData.data;
const dest = chunkImgData.data;
let i;
if (kind === ImageKind.GRAYSCALE_1BPP) {
for (i = 0; i < totalChunks; i++) {
({
srcPos
} = convertBlackAndWhiteToRGBA({
src,
srcPos,
dest,
width,
height: i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight
}));
ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);
}
} else if (kind === ImageKind.RGBA_32BPP) {
let j = 0;
let elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4;
for (i = 0; i < fullChunks; i++) {
dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));
srcPos += elemsInThisChunk;
ctx.putImageData(chunkImgData, 0, j);
j += FULL_CHUNK_HEIGHT;
}
if (i < totalChunks) {
elemsInThisChunk = width * partialChunkHeight * 4;
dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));
ctx.putImageData(chunkImgData, 0, j);
}
} else if (kind === ImageKind.RGB_24BPP) {
for (i = 0; i < totalChunks; i++) {
({
srcPos
} = convertRGBToRGBA({
src,
srcPos,
dest: new Uint32Array(dest.buffer),
width,
height: i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight
}));
ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);
}
} else {
throw new Error(`bad image kind: ${kind}`);
}
}
function putBinaryImageMask(ctx, imgData) {
if (imgData.bitmap) {
ctx.drawImage(imgData.bitmap, 0, 0);
return;
}
const {
width,
height
} = imgData;
const partialChunkHeight = height % FULL_CHUNK_HEIGHT;
const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;
const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;
const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);
let srcPos = 0;
const src = imgData.data;
const dest = chunkImgData.data;
for (let i = 0; i < totalChunks; i++) {
({
srcPos
} = convertBlackAndWhiteToRGBA({
src,
srcPos,
dest,
width,
height: i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight,
nonBlackColor: 0
}));
ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);
}
}
function copyCtxState(sourceCtx, destCtx) {
const properties = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font", "filter"];
for (const property of properties) {
if (sourceCtx[property] !== undefined) {
destCtx[property] = sourceCtx[property];
}
}
if (sourceCtx.setLineDash !== undefined) {
destCtx.setLineDash(sourceCtx.getLineDash());
destCtx.lineDashOffset = sourceCtx.lineDashOffset;
}
}
function setAnnotationCanvasName(canvas, canvasName) {
canvas.setAttribute?.("data-canvas-name", canvasName);
canvas._pdfjsCanvasName = canvasName;
}
function getAnnotationCanvasName(canvas) {
return canvas._pdfjsCanvasName ?? null;
}
function resetCtxToDefault(ctx) {
ctx.strokeStyle = ctx.fillStyle = "#000000";
ctx.fillRule = "nonzero";
ctx.globalAlpha = 1;
ctx.lineWidth = 1;
ctx.lineCap = "butt";
ctx.lineJoin = "miter";
ctx.miterLimit = 10;
ctx.globalCompositeOperation = "source-over";
ctx.font = "10px sans-serif";
if (ctx.setLineDash !== undefined) {
ctx.setLineDash([]);
ctx.lineDashOffset = 0;
}
const {
filter
} = ctx;
if (filter !== "none" && filter !== "") {
ctx.filter = "none";
}
}
var _maps = /*#__PURE__*/new WeakMap();
class TransferMapsFallback {
constructor(maps) {
canvas_classPrivateFieldInitSpec(this, _maps, void 0);
const [mapR, mapG = mapR, mapB = mapR] = maps;
const identityMap = Util.identity0to256Map.slice();
canvas_classPrivateFieldSet(_maps, this, [mapR || identityMap, mapG || identityMap, mapB || identityMap]);
}
applyToColor(color) {
if (typeof color !== "string" || !color.startsWith("#")) {
return color;
}
const [r, g, b] = getRGBA(color);
const [mapR, mapG, mapB] = canvas_classPrivateFieldGet(_maps, this);
return Util.makeHexColor(mapR[r], mapG[g], mapB[b]);
}
applyToImageData({
data
}) {
const [mapR, mapG, mapB] = canvas_classPrivateFieldGet(_maps, this);
for (let i = 0, ii = data.length; i < ii; i += 4) {
data[i] = mapR[data[i]];
data[i + 1] = mapG[data[i + 1]];
data[i + 2] = mapB[data[i + 2]];
}
}
applyToCanvas(ctx) {
const {
width,
height
} = ctx.canvas;
const imgData = ctx.getImageData(0, 0, width, height);
this.applyToImageData(imgData);
ctx.putImageData(imgData, 0, 0);
}
}
function getImageSmoothingEnabled(transform, interpolate, pixelRatio) {
if (interpolate) {
return true;
}
Util.singularValueDecompose2dScale(transform, XY);
const actualScale = Math.fround(pixelRatio * PixelsPerInch.PDF_TO_CSS_UNITS);
return XY[0] <= actualScale && XY[1] <= actualScale;
}
const LINE_CAP_STYLES = ["butt", "round", "square"];
const LINE_JOIN_STYLES = ["miter", "round", "bevel"];
const NORMAL_CLIP = {};
const EO_CLIP = {};
var _knockoutGroupLevel = /*#__PURE__*/new WeakMap();
var _knockoutElementDepth = /*#__PURE__*/new WeakMap();
var _knockoutTempCanvasEntry = /*#__PURE__*/new WeakMap();
var _knockoutSavedCtx = /*#__PURE__*/new WeakMap();
var _knockoutSavedSMaskCtx = /*#__PURE__*/new WeakMap();
var _knockoutSavedGCO = /*#__PURE__*/new WeakMap();
var _knockoutElementAlpha = /*#__PURE__*/new WeakMap();
var _knockoutFilterCache = /*#__PURE__*/new WeakMap();
var _knockoutElementGroupMeta = /*#__PURE__*/new WeakMap();
var _groupStackMeta = /*#__PURE__*/new WeakMap();
var _CanvasGraphics_brand = /*#__PURE__*/new WeakSet();
class CanvasGraphics {
constructor(canvasCtx, commonObjs, objs, canvasFactory, filterFactory, {
optionalContentConfig,
markedContentStack = null,
pixelRatio = OutputScale.pixelRatio
}, annotationCanvasMap, pageColors, dependencyTracker, imagesTracker) {
canvas_classPrivateMethodInitSpec(this, _CanvasGraphics_brand);
canvas_classPrivateFieldInitSpec(this, _knockoutGroupLevel, 0);
canvas_classPrivateFieldInitSpec(this, _knockoutElementDepth, 0);
canvas_classPrivateFieldInitSpec(this, _knockoutTempCanvasEntry, null);
canvas_classPrivateFieldInitSpec(this, _knockoutSavedCtx, null);
canvas_classPrivateFieldInitSpec(this, _knockoutSavedSMaskCtx, null);
canvas_classPrivateFieldInitSpec(this, _knockoutSavedGCO, null);
canvas_classPrivateFieldInitSpec(this, _knockoutElementAlpha, 1);
canvas_classPrivateFieldInitSpec(this, _knockoutFilterCache, void 0);
canvas_classPrivateFieldInitSpec(this, _knockoutElementGroupMeta, null);
canvas_classPrivateFieldInitSpec(this, _groupStackMeta, []);
this.ctx = canvasCtx;
this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height);
this.stateStack = [];
this.pendingClip = null;
this.pendingEOFill = false;
this.commonObjs = commonObjs;
this.objs = objs;
this.canvasFactory = canvasFactory;
this.filterFactory = filterFactory;
this.groupStack = [];
this.baseTransform = null;
this.baseTransformStack = [];
this.groupLevel = 0;
this.smaskStack = [];
this.tempSMask = null;
this.smaskGroupCanvases = [];
this.smaskPreparedEntry = null;
this.smaskPreparedFor = null;
this.smaskPreparedOffsetX = 0;
this.smaskPreparedOffsetY = 0;
this.smaskPreparedOOBAlpha = null;
this.suspendedCtx = null;
this.contentVisible = true;
this.markedContentStack = markedContentStack || [];
this.optionalContentConfig = optionalContentConfig;
this.pixelRatio = pixelRatio;
this.cachedPatterns = new Map();
this.annotationCanvasMap = annotationCanvasMap;
this.viewportScale = 1;
this.outputScaleX = 1;
this.outputScaleY = 1;
this.pageColors = pageColors;
this._cachedScaleForStroking = [-1, 0];
this._cachedBitmapsMap = new Map();
this.dependencyTracker = dependencyTracker ?? null;
this.imagesTracker = imagesTracker ?? null;
}
getObject(opIdx, data, fallback = null) {
if (typeof data === "string") {
this.dependencyTracker?.recordNamedDependency(opIdx, data);
return data.startsWith("g_") ? this.commonObjs.get(data) : this.objs.get(data);
}
return fallback;
}
beginDrawing({
transform,
viewport,
transparency = false,
background = null
}) {
const width = this.ctx.canvas.width;
const height = this.ctx.canvas.height;
const savedFillStyle = this.ctx.fillStyle;
this.ctx.fillStyle = background || "#ffffff";
this.ctx.fillRect(0, 0, width, height);
this.ctx.fillStyle = savedFillStyle;
if (transparency) {
const transparentCanvas = this.transparentCanvasEntry = this.canvasFactory.create(width, height);
this.compositeCtx = this.ctx;
({
canvas: this.transparentCanvas,
context: this.ctx
} = transparentCanvas);
this.ctx.save();
this.ctx.transform(...getCurrentTransform(this.compositeCtx));
}
this.ctx.save();
resetCtxToDefault(this.ctx);
if (transform) {
this.ctx.transform(...transform);
this.outputScaleX = transform[0];
this.outputScaleY = transform[3];
}
this.ctx.transform(...viewport.transform);
this.viewportScale = viewport.scale;
this.baseTransform = getCurrentTransform(this.ctx);
}
executeOperatorList(operatorList, executionStartIdx, continueCallback, errorCallback, stepper, operationsFilter) {
const argsArray = operatorList.argsArray;
const fnArray = operatorList.fnArray;
const prevPathCache = this._pathCache;
this._pathCache = operatorList.pathCache ?? _pathCaches._.getOrInsertComputed(operatorList, makeMap);
try {
let i = executionStartIdx || 0;
const argsArrayLen = argsArray.length;
if (argsArrayLen === i) {
return i;
}
const chunkOperations = argsArrayLen - i > EXECUTION_STEPS && typeof continueCallback === "function";
const endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0;
let steps = 0;
const commonObjs = this.commonObjs;
const objs = this.objs;
let fnId, fnArgs;
while (true) {
if (stepper !== undefined) {
if (i === stepper.nextBreakPoint) {
stepper.breakIt(i, continueCallback);
return i;
}
if (stepper.shouldSkip(i)) {
if (++i === argsArrayLen) {
return i;
}
continue;
}
}
if (!operationsFilter || operationsFilter(i, operatorList)) {
fnId = fnArray[i];
fnArgs = argsArray[i] ?? null;
if (fnId !== OPS.dependency) {
if (fnArgs === null) {
this[fnId](i);
} else {
this[fnId](i, ...fnArgs);
}
} else {
for (const depObjId of fnArgs) {
this.dependencyTracker?.recordNamedData(depObjId, i);
const objsPool = depObjId.startsWith("g_") ? commonObjs : objs;
if (!objsPool.has(depObjId)) {
objsPool.get(depObjId, continueCallback, errorCallback);
return i;
}
}
}
}
i++;
if (i === argsArrayLen) {
return i;
}
if (chunkOperations && ++steps > EXECUTION_STEPS) {
if (Date.now() > endTime) {
continueCallback();
return i;
}
steps = 0;
}
}
} finally {
this._pathCache = prevPathCache;
}
}
endDrawing() {
canvas_assertClassBrand(_CanvasGraphics_brand, this, _restoreInitialState).call(this);
for (const canvas of this.smaskGroupCanvases) {
this.canvasFactory.destroy(canvas);
}
this.smaskGroupCanvases.length = 0;
this._clearPreparedSMask();
this.tempSMask = null;
this.smaskStack.length = 0;
for (const meta of canvas_classPrivateFieldGet(_groupStackMeta, this)) {
canvas_assertClassBrand(_CanvasGraphics_brand, this, _destroyKnockoutPools).call(this, meta);
}
canvas_classPrivateFieldGet(_groupStackMeta, this).length = 0;
canvas_classPrivateFieldSet(_knockoutTempCanvasEntry, this, null);
canvas_classPrivateFieldSet(_knockoutSavedCtx, this, null);
canvas_classPrivateFieldSet(_knockoutSavedSMaskCtx, this, null);
canvas_classPrivateFieldSet(_knockoutSavedGCO, this, null);
canvas_classPrivateFieldSet(_knockoutElementAlpha, this, 1);
canvas_classPrivateFieldSet(_knockoutElementGroupMeta, this, null);
canvas_classPrivateFieldSet(_knockoutElementDepth, this, 0);
canvas_classPrivateFieldSet(_knockoutGroupLevel, this, 0);
this.cachedPatterns.clear();
for (const cache of this._cachedBitmapsMap.values()) {
for (const canvas of cache.values()) {
if (typeof HTMLCanvasElement !== "undefined" && canvas instanceof HTMLCanvasElement) {
canvas.width = canvas.height = 0;
}
}
cache.clear();
}
this._cachedBitmapsMap.clear();
canvas_assertClassBrand(_CanvasGraphics_brand, this, _drawFilter).call(this);
}
_scaleImage(img, inverseTransform) {
const width = img.width ?? img.displayWidth;
const height = img.height ?? img.displayHeight;
const widthScale = Math.max(Math.hypot(inverseTransform[0], inverseTransform[1]), 1);
const heightScale = Math.max(Math.hypot(inverseTransform[2], inverseTransform[3]), 1);
const scaleSteps = [];
let ws = widthScale,
hs = heightScale,
pw = width,
ph = height;
while (ws > 2 && pw > 1 || hs > 2 && ph > 1) {
let nw = pw,
nh = ph;
if (ws > 2 && pw > 1) {
nw = Math.ceil(pw / 2);
ws /= pw / nw;
}
if (hs > 2 && ph > 1) {
nh = Math.ceil(ph / 2);
hs /= ph / nh;
}
scaleSteps.push({
newWidth: nw,
newHeight: nh
});
pw = nw;
ph = nh;
}
if (scaleSteps.length === 0) {
return {
img,
paintWidth: width,
paintHeight: height,
tmpCanvas: null
};
}
if (scaleSteps.length === 1) {
const {
newWidth,
newHeight
} = scaleSteps[0];
const tmpCanvas = this.canvasFactory.create(newWidth, newHeight);
tmpCanvas.context.drawImage(img, 0, 0, width, height, 0, 0, newWidth, newHeight);
return {
img: tmpCanvas.canvas,
paintWidth: newWidth,
paintHeight: newHeight,
tmpCanvas
};
}
let readEntry = this.canvasFactory.create(1, 1);
let writeEntry = this.canvasFactory.create(1, 1);
let paintWidth = width,
paintHeight = height;
let source = img;
for (const {
newWidth,
newHeight
} of scaleSteps) {
this.canvasFactory.reset(writeEntry, newWidth, newHeight);
writeEntry.context.drawImage(source, 0, 0, paintWidth, paintHeight, 0, 0, newWidth, newHeight);
[readEntry, writeEntry] = [writeEntry, readEntry];
source = readEntry.canvas;
paintWidth = newWidth;
paintHeight = newHeight;
}
this.canvasFactory.destroy(writeEntry);
return {
img: readEntry.canvas,
paintWidth,
paintHeight,
tmpCanvas: readEntry
};
}
_createMaskCanvas(opIdx, img) {
const ctx = this.ctx;
const {
width,
height
} = img;
const isPatternFill = this.current.patternFill;
const fillColor = isPatternFill ? this.current.fillColor : ctx.fillStyle;
const currentTransform = getCurrentTransform(ctx);
let cache, cacheKey, scaled, maskCanvas;
if ((img.bitmap || img.data) && img.count > 1) {
const mainKey = img.bitmap || img.data.buffer;
cacheKey = JSON.stringify(isPatternFill ? currentTransform : [currentTransform.slice(0, 4), fillColor]);
cache = this._cachedBitmapsMap.getOrInsertComputed(mainKey, makeMap);
const cachedImage = cache.get(cacheKey);
if (cachedImage && !isPatternFill) {
const offsetX = Math.round(Math.min(currentTransform[0], currentTransform[2]) + currentTransform[4]);
const offsetY = Math.round(Math.min(currentTransform[1], currentTransform[3]) + currentTransform[5]);
this.dependencyTracker?.recordDependencies(opIdx, Dependencies.transformAndFill);
return {
canvas: cachedImage,
offsetX,
offsetY
};
}
scaled = cachedImage;
}
if (!scaled) {
maskCanvas = this.canvasFactory.create(width, height);
putBinaryImageMask(maskCanvas.context, img);
}
let maskToCanvas = Util.transform(currentTransform, [1 / width, 0, 0, -1 / height, 0, 0]);
maskToCanvas = Util.transform(maskToCanvas, [1, 0, 0, 1, 0, -height]);
const minMax = F32_BBOX_INIT.slice();
Util.axialAlignedBoundingBox([0, 0, width, height], maskToCanvas, minMax);
const [minX, minY, maxX, maxY] = minMax;
const drawnWidth = Math.round(maxX - minX) || 1;
const drawnHeight = Math.round(maxY - minY) || 1;
const fillCanvas = this.canvasFactory.create(drawnWidth, drawnHeight);
const fillCtx = fillCanvas.context;
const offsetX = minX;
const offsetY = minY;
fillCtx.translate(-offsetX, -offsetY);
fillCtx.transform(...maskToCanvas);
let scaledEntry = null;
if (!scaled) {
const scaleResult = this._scaleImage(maskCanvas.canvas, getCurrentTransformInverse(fillCtx));
scaled = scaleResult.img;
scaledEntry = scaleResult.tmpCanvas;
if (scaled !== maskCanvas.canvas) {
this.canvasFactory.destroy(maskCanvas);
maskCanvas = null;
}
if (cache && isPatternFill) {
cache.set(cacheKey, scaled);
scaledEntry = null;
maskCanvas = null;
}
}
fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled(getCurrentTransform(fillCtx), img.interpolate, this.pixelRatio);
drawImageAtIntegerCoords(fillCtx, scaled, 0, 0, scaled.width, scaled.height, 0, 0, width, height);
if (scaledEntry) {
this.canvasFactory.destroy(scaledEntry);
}
if (maskCanvas) {
this.canvasFactory.destroy(maskCanvas);
}
fillCtx.globalCompositeOperation = "source-in";
const inverse = Util.transform(getCurrentTransformInverse(fillCtx), [1, 0, 0, 1, -offsetX, -offsetY]);
fillCtx.fillStyle = isPatternFill ? fillColor.getPattern(ctx, this, inverse, PathType.FILL, opIdx) : fillColor;
fillCtx.fillRect(0, 0, width, height);
if (cache && !isPatternFill) {
cache.set(cacheKey, fillCanvas.canvas);
}
this.dependencyTracker?.recordDependencies(opIdx, Dependencies.transformAndFill);
return {
canvas: fillCanvas.canvas,
canvasEntry: cache && !isPatternFill ? null : fillCanvas,
offsetX: Math.round(offsetX),
offsetY: Math.round(offsetY)
};
}
setLineWidth(opIdx, width) {
this.dependencyTracker?.recordSimpleData("lineWidth", opIdx);
if (width !== this.current.lineWidth) {
this._cachedScaleForStroking[0] = -1;
}
this.current.lineWidth = width;
this.ctx.lineWidth = width;
}
setLineCap(opIdx, style) {
this.dependencyTracker?.recordSimpleData("lineCap", opIdx);
this.ctx.lineCap = LINE_CAP_STYLES[style];
}
setLineJoin(opIdx, style) {
this.dependencyTracker?.recordSimpleData("lineJoin", opIdx);
this.ctx.lineJoin = LINE_JOIN_STYLES[style];
}
setMiterLimit(opIdx, limit) {
this.dependencyTracker?.recordSimpleData("miterLimit", opIdx);
this.ctx.miterLimit = limit;
}
setDash(opIdx, dashArray, dashPhase) {
this.dependencyTracker?.recordSimpleData("dash", opIdx);
const ctx = this.ctx;
if (ctx.setLineDash !== undefined) {
ctx.setLineDash(dashArray);
ctx.lineDashOffset = dashPhase;
}
}
setRenderingIntent(opIdx, intent) {}
setFlatness(opIdx, flatness) {}
setGState(opIdx, states) {
for (const [key, value] of states) {
switch (key) {
case "LW":
this.setLineWidth(opIdx, value);
break;
case "LC":
this.setLineCap(opIdx, value);
break;
case "LJ":
this.setLineJoin(opIdx, value);
break;
case "ML":
this.setMiterLimit(opIdx, value);
break;
case "D":
this.setDash(opIdx, value[0], value[1]);
break;
case "RI":
this.setRenderingIntent(opIdx, value);
break;
case "FL":
this.setFlatness(opIdx, value);
break;
case "Font":
this.setFont(opIdx, value[0], value[1]);
break;
case "CA":
this.dependencyTracker?.recordSimpleData("strokeAlpha", opIdx);
this.current.strokeAlpha = value;
break;
case "ca":
this.dependencyTracker?.recordSimpleData("fillAlpha", opIdx);
this.ctx.globalAlpha = this.current.fillAlpha = value;
break;
case "BM":
this.dependencyTracker?.recordSimpleData("globalCompositeOperation", opIdx);
this.ctx.globalCompositeOperation = value;
break;
case "SMask":
this.dependencyTracker?.recordSimpleData("SMask", opIdx);
this.current.activeSMask = value ? this.tempSMask : null;
if (this.current.activeSMask) {
this.current.activeSMask.blendMode = this.ctx.globalCompositeOperation;
}
this.tempSMask = null;
this.checkSMaskState(opIdx);
break;
case "TR":
{
this.dependencyTracker?.recordSimpleData("filter", opIdx);
let filter = this.filterFactory.addFilter(value);
this.ctx.filter = filter;
let fallback = null;
if (value && (filter === "none" || !FeatureTest.isCanvasFilterSupported || this.ctx.filter === "none" || this.ctx.filter === "")) {
this.ctx.filter = filter = "none";
fallback = new TransferMapsFallback(value);
}
this.current.transferMaps = filter;
if (fallback || this.current.transferMapsFallback) {
this.current.transferMapsFallback = fallback;
if (!this.current.patternFill) {
this.ctx.fillStyle = canvas_assertClassBrand(_CanvasGraphics_brand, this, _transferColor).call(this, this.current.fillColor);
}
if (!this.current.patternStroke) {
this.ctx.strokeStyle = canvas_assertClassBrand(_CanvasGraphics_brand, this, _transferColor).call(this, this.current.strokeColor);
}
}
break;
}
}
}
}
get inSMaskMode() {
return !!this.suspendedCtx;
}
_clearPreparedSMask() {
if (this.smaskPreparedEntry) {
this.canvasFactory.destroy(this.smaskPreparedEntry);
this.smaskPreparedEntry = null;
}
this.smaskPreparedFor = null;
this.smaskPreparedOffsetX = 0;
this.smaskPreparedOffsetY = 0;
this.smaskPreparedOOBAlpha = null;
}
_ensurePreparedSMask(smask) {
if (smask === this.smaskPreparedFor) {
return;
}
this._clearPreparedSMask();
this._prepareSMaskCanvas(smask);
}
checkSMaskState(opIdx) {
const inSMaskMode = this.inSMaskMode;
if (this.current.activeSMask && !inSMaskMode) {
this.beginSMaskMode(opIdx);
} else if (!this.current.activeSMask && inSMaskMode) {
this.endSMaskMode();
} else if (this.current.activeSMask && inSMaskMode) {
this._ensurePreparedSMask(this.current.activeSMask);
}
}
_prepareSMaskCanvas(smask) {
const {
canvas: maskCanvas,
subtype,
backdrop,
transferMap
} = smask;
const hasFilter = subtype === "Luminosity" || subtype === "Alpha" && transferMap;
if (!hasFilter && !(subtype === "Luminosity" && backdrop)) {
this.smaskPreparedFor = smask;
return;
}
let filteredOOBAlpha;
if (subtype === "Luminosity" && backdrop) {
const [r, g, b] = getRGBA(backdrop);
const inputAlpha = Math.round(0.3 * r + 0.59 * g + 0.11 * b);
filteredOOBAlpha = transferMap?.[inputAlpha] ?? inputAlpha;
} else {
filteredOOBAlpha = transferMap?.[0] ?? 0;
}
const SMASK_LAYER_TO_MASK_AREA_RATIO = 4;
const {
width: layerW,
height: layerH
} = this.ctx.canvas;
const maskArea = maskCanvas.width * maskCanvas.height;
const useLayerSize = layerW * layerH < SMASK_LAYER_TO_MASK_AREA_RATIO * maskArea;
const filterSpec = hasFilter ? {
url: subtype === "Alpha" ? this.filterFactory.addAlphaFilter(transferMap) : this.filterFactory.addLuminosityFilter(transferMap),
subtype,
transferMap
} : null;
const bakedBackdrop = subtype === "Luminosity" ? backdrop : null;
let preparedEntry, offsetX, offsetY;
if (useLayerSize) {
preparedEntry = this._bakeSMaskCanvas(maskCanvas, smask.offsetX, smask.offsetY, layerW, layerH, bakedBackdrop, filterSpec);
offsetX = 0;
offsetY = 0;
} else {
preparedEntry = this._bakeSMaskCanvas(maskCanvas, 0, 0, maskCanvas.width, maskCanvas.height, bakedBackdrop, filterSpec);
offsetX = smask.offsetX;
offsetY = smask.offsetY;
}
this.smaskPreparedEntry = preparedEntry;
this.smaskPreparedFor = smask;
this.smaskPreparedOffsetX = offsetX;
this.smaskPreparedOffsetY = offsetY;
this.smaskPreparedOOBAlpha = !useLayerSize && filteredOOBAlpha !== 0 ? filteredOOBAlpha : null;
}
_bakeSMaskCanvas(maskCanvas, drawX, drawY, w, h, backdrop, filterSpec) {
if (!backdrop && !filterSpec) {
unreachable("_bakeSMaskCanvas with neither backdrop nor filter");
}
const srcEntry = this.canvasFactory.create(w, h);
const sCtx = srcEntry.context;
sCtx.drawImage(maskCanvas, drawX, drawY);
if (backdrop) {
sCtx.globalCompositeOperation = "destination-atop";
sCtx.fillStyle = backdrop;
sCtx.fillRect(0, 0, w, h);
}
if (!filterSpec) {
return srcEntry;
}
const preparedEntry = this.canvasFactory.create(w, h);
const pCtx = preparedEntry.context;
pCtx.filter = filterSpec.url;
const filterApplied = FeatureTest.isCanvasFilterSupported && pCtx.filter !== "none" && pCtx.filter !== "";
pCtx.drawImage(srcEntry.canvas, 0, 0);
if (FeatureTest.isCanvasFilterSupported) {
pCtx.filter = "none";
}
if (!filterApplied) {
const img = pCtx.getImageData(0, 0, w, h);
const {
data
} = img;
const {
transferMap
} = filterSpec;
if (filterSpec.subtype === "Luminosity") {
for (let i = 0, ii = data.length; i < ii; i += 4) {
const a = 0.3 * data[i] + 0.59 * data[i + 1] + 0.11 * data[i + 2] + 0.5 | 0;
data[i] = data[i + 1] = data[i + 2] = 0;
data[i + 3] = transferMap?.[a] ?? a;
}
} else {
for (let i = 3, ii = data.length; i < ii; i += 4) {
data[i] = transferMap[data[i]];
}
}
pCtx.putImageData(img, 0, 0);
}
this.canvasFactory.destroy(srcEntry);
return preparedEntry;
}
beginSMaskMode(opIdx) {
if (this.inSMaskMode) {
throw new Error("beginSMaskMode called while already in smask mode");
}
const {
width: drawnWidth,
height: drawnHeight
} = this.ctx.canvas;
const scratchCanvas = this.canvasFactory.create(drawnWidth, drawnHeight);
this.smaskScratchCanvas = scratchCanvas;
this.suspendedCtx = this.ctx;
const ctx = this.ctx = scratchCanvas.context;
ctx.setTransform(this.suspendedCtx.getTransform());
copyCtxState(this.suspendedCtx, ctx);
mirrorContextOperations(ctx, this.suspendedCtx);
this._ensurePreparedSMask(this.current.activeSMask);
this.setGState(opIdx, [["BM", "source-over"]]);
}
endSMaskMode() {
if (!this.inSMaskMode) {
throw new Error("endSMaskMode called while not in smask mode");
}
this.ctx._removeMirroring();
copyCtxState(this.ctx, this.suspendedCtx);
this.ctx = this.suspendedCtx;
this.suspendedCtx = null;
this.canvasFactory.destroy(this.smaskScratchCanvas);
this.smaskScratchCanvas = null;
this._clearPreparedSMask();
}
compose(dirtyBox) {
if (!this.current.activeSMask) {
return;
}
dirtyBox = dirtyBox ? [Math.floor(dirtyBox[0]), Math.floor(dirtyBox[1]), Math.ceil(dirtyBox[2]), Math.ceil(dirtyBox[3])] : [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];
const smask = this.current.activeSMask;
const suspendedCtx = this.suspendedCtx;
const applySMaskInPlace = canvas_classPrivateFieldGet(_knockoutElementDepth, this) > 0 && suspendedCtx === this.ctx;
this.composeSMask(applySMaskInPlace ? null : suspendedCtx, smask, this.ctx, dirtyBox);
if (applySMaskInPlace) {
return;
}
this.ctx.save();
this.ctx.setTransform(1, 0, 0, 1, 0, 0);
this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);
this.ctx.restore();
}
composeSMask(ctx, smask, layerCtx, layerBox) {
const layerOffsetX = layerBox[0];
const layerOffsetY = layerBox[1];
const layerWidth = layerBox[2] - layerOffsetX;
const layerHeight = layerBox[3] - layerOffsetY;
if (layerWidth === 0 || layerHeight === 0) {
return;
}
const preparedEntry = this.smaskPreparedEntry;
if (preparedEntry) {
let clipX = layerOffsetX;
let clipY = layerOffsetY;
let clipW = layerWidth;
let clipH = layerHeight;
const oobAlpha = this.smaskPreparedOOBAlpha;
const hasOOBAlpha = oobAlpha !== null;
if (hasOOBAlpha) {
clipX = Math.max(layerOffsetX, smask.offsetX);
clipY = Math.max(layerOffsetY, smask.offsetY);
const x1 = Math.min(layerOffsetX + layerWidth, smask.offsetX + smask.canvas.width);
const y1 = Math.min(layerOffsetY + layerHeight, smask.offsetY + smask.canvas.height);
clipW = x1 - clipX;
clipH = y1 - clipY;
}
if (clipW > 0 && clipH > 0) {
const srcX = clipX - this.smaskPreparedOffsetX;
const srcY = clipY - this.smaskPreparedOffsetY;
layerCtx.save();
layerCtx.globalAlpha = 1;
layerCtx.setTransform(1, 0, 0, 1, 0, 0);
const clip = new Path2D();
clip.rect(clipX, clipY, clipW, clipH);
layerCtx.clip(clip);
layerCtx.globalCompositeOperation = "destination-in";
layerCtx.drawImage(preparedEntry.canvas, srcX, srcY, clipW, clipH, clipX, clipY, clipW, clipH);
layerCtx.restore();
}
if (hasOOBAlpha && oobAlpha < 255) {
this._applySMaskOOBAlpha(layerCtx, layerOffsetX, layerOffsetY, layerWidth, layerHeight, clipX, clipY, clipX + clipW, clipY + clipH, oobAlpha);
}
} else {
this.genericComposeSMask(smask, layerCtx, layerWidth, layerHeight, layerOffsetX, layerOffsetY);
}
if (!ctx) {
return;
}
ctx.save();
ctx.globalAlpha = 1;
ctx.globalCompositeOperation = smask.blendMode || "source-over";
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.drawImage(layerCtx.canvas, layerOffsetX, layerOffsetY, layerWidth, layerHeight, layerOffsetX, layerOffsetY, layerWidth, layerHeight);
ctx.restore();
}
_applySMaskOOBAlpha(layerCtx, layerOffsetX, layerOffsetY, layerWidth, layerHeight, maskX0, maskY0, maskX1, maskY1, alpha) {
const hasInnerCutout = maskX0 < maskX1 && maskY0 < maskY1;
if (hasInnerCutout && maskX0 === layerOffsetX && maskY0 === layerOffsetY && maskX1 === layerOffsetX + layerWidth && maskY1 === layerOffsetY + layerHeight) {
return;
}
const path = new Path2D();
path.rect(layerOffsetX, layerOffsetY, layerWidth, layerHeight);
if (hasInnerCutout) {
path.rect(maskX0, maskY0, maskX1 - maskX0, maskY1 - maskY0);
}
layerCtx.save();
layerCtx.globalAlpha = alpha / 255;
layerCtx.setTransform(1, 0, 0, 1, 0, 0);
layerCtx.clip(path, "evenodd");
layerCtx.globalCompositeOperation = "destination-in";
layerCtx.fillStyle = "#000000";
layerCtx.fillRect(layerOffsetX, layerOffsetY, layerWidth, layerHeight);
layerCtx.restore();
}
genericComposeSMask(smask, layerCtx, width, height, layerOffsetX, layerOffsetY) {
const {
context: maskCtx,
offsetX: maskOffsetX,
offsetY: maskOffsetY
} = smask;
layerCtx.save();
layerCtx.globalAlpha = 1;
layerCtx.setTransform(1, 0, 0, 1, 0, 0);
const clip = new Path2D();
clip.rect(layerOffsetX, layerOffsetY, width, height);
layerCtx.clip(clip);
layerCtx.globalCompositeOperation = "destination-in";
layerCtx.drawImage(maskCtx.canvas, layerOffsetX - maskOffsetX, layerOffsetY - maskOffsetY, width, height, layerOffsetX, layerOffsetY, width, height);
layerCtx.restore();
}
save(opIdx) {
if (this.inSMaskMode) {
copyCtxState(this.ctx, this.suspendedCtx);
}
this.ctx.save();
const old = this.current;
this.stateStack.push(old);
this.current = old.clone();
this.dependencyTracker?.save(opIdx);
}
restore(opIdx) {
this.dependencyTracker?.restore(opIdx);
if (this.stateStack.length === 0) {
if (this.inSMaskMode) {
this.endSMaskMode();
}
return;
}
this.current = this.stateStack.pop();
this.ctx.restore();
if (this.inSMaskMode) {
copyCtxState(this.suspendedCtx, this.ctx);
this.ctx.setTransform(this.suspendedCtx.getTransform());
}
this.checkSMaskState(opIdx);
this.pendingClip = null;
this._cachedScaleForStroking[0] = -1;
}
resetGraphicsState() {
const {
clipBox,
transferMaps,
transferMapsFallback
} = this.current;
const current = this.current = new CanvasExtraState(0, 0);
current.clipBox = clipBox;
current.transferMaps = transferMaps;
current.transferMapsFallback = transferMapsFallback;
const ctx = this.ctx;
ctx.lineWidth = 1;
ctx.lineCap = "butt";
ctx.lineJoin = "miter";
ctx.miterLimit = 10;
if (ctx.setLineDash !== undefined) {
ctx.setLineDash([]);
ctx.lineDashOffset = 0;
}
this._cachedScaleForStroking[0] = -1;
}
transform(opIdx, a, b, c, d, e, f) {
this.dependencyTracker?.recordIncrementalData("transform", opIdx);
this.ctx.transform(a, b, c, d, e, f);
this._cachedScaleForStroking[0] = -1;
}
constructPath(opIdx, op, data, minMax) {
let path = this._pathCache.get(opIdx);
if (!minMax) {
if (!path) {
path = new Path2D();
this._pathCache.set(opIdx, path);
}
if (op !== OPS.stroke && op !== OPS.closeStroke) {
this.current.tilingPatternDims = null;
}
this[op](opIdx, path);
return;
}
if (this.dependencyTracker !== null) {
const outerExtraSize = op === OPS.stroke ? this.current.lineWidth / 2 : 0;
this.dependencyTracker.resetBBox(opIdx).recordBBox(opIdx, this.ctx, minMax[0] - outerExtraSize, minMax[2] + outerExtraSize, minMax[1] - outerExtraSize, minMax[3] + outerExtraSize).recordDependencies(opIdx, ["transform"]);
}
if (!path) {
path = makePathFromDrawOPS(data[0]);
this._pathCache.set(opIdx, path);
}
Util.axialAlignedBoundingBox(minMax, getCurrentTransform(this.ctx), this.current.minMax);
const tilingDims = this.current.tilingPatternDims;
if (tilingDims && op !== OPS.stroke && op !== OPS.closeStroke && this.current.fillColor instanceof TilingPattern) {
const clippedBBox = Util.intersect(this.current.clipBox, this.current.minMax);
if (!clippedBBox) {
this.current.tilingPatternDims = null;
} else {
this.current.fillColor.updatePatternDims(clippedBBox, tilingDims);
}
}
this[op](opIdx, path);
this._pathStartIdx = opIdx;
}
closePath(opIdx) {
this.ctx.closePath();
}
stroke(opIdx, path, consumePath = true) {
const started = consumePath && canvas_assertClassBrand(_CanvasGraphics_brand, this, _beginKnockoutElement).call(this, this.current.strokeAlpha);
const ctx = this.ctx;
const strokeColor = this.current.strokeColor;
ctx.globalAlpha = this.current.strokeAlpha;
if (this.contentVisible) {
if (typeof strokeColor === "object" && strokeColor?.getPattern) {
const baseTransform = strokeColor.isModifyingCurrentTransform() ? ctx.getTransform() : null;
ctx.save();
ctx.strokeStyle = strokeColor.getPattern(ctx, this, getCurrentTransformInverse(ctx), PathType.STROKE, opIdx);
if (baseTransform) {
const newPath = new Path2D();
newPath.addPath(path, ctx.getTransform().invertSelf().multiplySelf(baseTransform));
path = newPath;
}
this.rescaleAndStroke(path, false);
ctx.restore();
} else {
this.rescaleAndStroke(path, true);
}
}
this.dependencyTracker?.recordDependencies(opIdx, Dependencies.stroke);
if (consumePath) {
this.consumePath(opIdx, path, this.current.getClippedPathBoundingBox(PathType.STROKE, getCurrentTransform(this.ctx)));
}
ctx.globalAlpha = this.current.fillAlpha;
canvas_assertClassBrand(_CanvasGraphics_brand, this, _endKnockoutElement).call(this, started);
}
closeStroke(opIdx, path) {
this.stroke(opIdx, path);
}
fill(opIdx, path, consumePath = true) {
const started = consumePath && canvas_assertClassBrand(_CanvasGraphics_brand, this, _beginKnockoutElement).call(this, this.current.fillAlpha);
const ctx = this.ctx;
const fillColor = this.current.fillColor;
const isPatternFill = this.current.patternFill;
let needRestore = false;
const intersect = this.current.getClippedPathBoundingBox();
this.dependencyTracker?.recordDependencies(opIdx, Dependencies.fill);
if (isPatternFill) {
const dims = this.current.tilingPatternDims;
const tileIdx = dims && fillColor.canSkipPatternCanvas(dims);
if (tileIdx) {
const {
pendingClip,
pendingEOFill
} = this;
this.pendingClip = null;
this.pendingEOFill = false;
fillColor.drawPattern(this, path, pendingEOFill, tileIdx, opIdx);
this.pendingClip = pendingClip;
if (consumePath) {
this.consumePath(opIdx, path, intersect);
}
this.current.tilingPatternDims = null;
canvas_assertClassBrand(_CanvasGraphics_brand, this, _endKnockoutElement).call(this, started);
return;
}
const baseTransform = fillColor.isModifyingCurrentTransform() ? ctx.getTransform() : null;
this.dependencyTracker?.save(opIdx);
ctx.save();
ctx.fillStyle = fillColor.getPattern(ctx, this, getCurrentTransformInverse(ctx), PathType.FILL, opIdx);
if (baseTransform) {
const newPath = new Path2D();
newPath.addPath(path, ctx.getTransform().invertSelf().multiplySelf(baseTransform));
path = newPath;
}
needRestore = true;
}
if (this.contentVisible && intersect !== null) {
if (this.pendingEOFill) {
ctx.fill(path, "evenodd");
this.pendingEOFill = false;
} else {
ctx.fill(path);
}
}
if (needRestore) {
ctx.restore();
this.dependencyTracker?.restore(opIdx);
}
if (consumePath) {
this.consumePath(opIdx, path, intersect);
}
canvas_assertClassBrand(_CanvasGraphics_brand, this, _endKnockoutElement).call(this, started);
}
eoFill(opIdx, path) {
this.pendingEOFill = true;
this.fill(opIdx, path);
}
fillStroke(opIdx, path) {
const started = canvas_assertClassBrand(_CanvasGraphics_brand, this, _beginKnockoutElement).call(this, Math.min(this.current.fillAlpha, this.current.strokeAlpha));
this.fill(opIdx, path, false);
this.stroke(opIdx, path, false);
this.consumePath(opIdx, path);
canvas_assertClassBrand(_CanvasGraphics_brand, this, _endKnockoutElement).call(this, started);
}
eoFillStroke(opIdx, path) {
this.pendingEOFill = true;
this.fillStroke(opIdx, path);
}
closeFillStroke(opIdx, path) {
this.fillStroke(opIdx, path);
}
closeEOFillStroke(opIdx, path) {
this.pendingEOFill = true;
this.fillStroke(opIdx, path);
}
endPath(opIdx, path) {
this.consumePath(opIdx, path);
}
rawFillPath(opIdx, path) {
const started = canvas_assertClassBrand(_CanvasGraphics_brand, this, _beginKnockoutElement).call(this, this.current.fillAlpha);
this.ctx.fill(path);
this.dependencyTracker?.recordDependencies(opIdx, Dependencies.rawFillPath).recordOperation(opIdx);
canvas_assertClassBrand(_CanvasGraphics_brand, this, _endKnockoutElement).call(this, started);
}
clip(opIdx) {
this.dependencyTracker?.recordFutureForcedDependency("clipMode", opIdx);
this.pendingClip = NORMAL_CLIP;
}
eoClip(opIdx) {
this.dependencyTracker?.recordFutureForcedDependency("clipMode", opIdx);
this.pendingClip = EO_CLIP;
}
beginText(opIdx) {
this.current.textMatrix = null;
this.current.textMatrixScale = 1;
this.current.x = this.current.lineX = 0;
this.current.y = this.current.lineY = 0;
this.dependencyTracker?.recordOpenMarker(opIdx).resetIncrementalData("sameLineText").resetIncrementalData("moveText", opIdx);
}
endText(opIdx) {
const paths = this.pendingTextPaths;
const ctx = this.ctx;
if (this.dependencyTracker) {
const {
dependencyTracker
} = this;
if (paths !== undefined) {
dependencyTracker.recordFutureForcedDependency("textClip", dependencyTracker.getOpenMarker()).recordFutureForcedDependency("textClip", opIdx);
}
dependencyTracker.recordCloseMarker(opIdx);
}
if (paths !== undefined) {
const newPath = new Path2D();
const invTransf = ctx.getTransform().invertSelf();
for (const {
transform,
x,
y,
fontSize,
path
} of paths) {
if (!path) {
continue;
}
newPath.addPath(path, new DOMMatrix(transform).preMultiplySelf(invTransf).translate(x, y).scale(fontSize, -fontSize));
}
ctx.clip(newPath);
}
delete this.pendingTextPaths;
}
setCharSpacing(opIdx, spacing) {
this.dependencyTracker?.recordSimpleData("charSpacing", opIdx);
this.current.charSpacing = spacing;
}
setWordSpacing(opIdx, spacing) {
this.dependencyTracker?.recordSimpleData("wordSpacing", opIdx);
this.current.wordSpacing = spacing;
}
setHScale(opIdx, scale) {
this.dependencyTracker?.recordSimpleData("hScale", opIdx);
this.current.textHScale = scale / 100;
}
setLeading(opIdx, leading) {
this.dependencyTracker?.recordSimpleData("leading", opIdx);
this.current.leading = -leading;
}
setFont(opIdx, fontRefName, size) {
this.dependencyTracker?.recordSimpleData("font", opIdx).recordSimpleDataFromNamed("fontObj", fontRefName, opIdx);
const fontObj = this.commonObjs.get(fontRefName);
const current = this.current;
if (!fontObj) {
throw new Error(`Can't find font for ${fontRefName}`);
}
current.fontMatrix = fontObj.fontMatrix || FONT_IDENTITY_MATRIX;
if (current.fontMatrix[0] === 0 || current.fontMatrix[3] === 0) {
warn("Invalid font matrix for font " + fontRefName);
}
if (size < 0) {
size = -size;
current.fontDirection = -1;
} else {
current.fontDirection = 1;
}
this.current.font = fontObj;
this.current.fontSize = size;
if (fontObj.isType3Font) {
return;
}
const name = fontObj.loadedName || "sans-serif";
const typeface = fontObj.systemFontInfo?.css || `"${name}", ${fontObj.fallbackName}`;
let bold = "normal";
if (fontObj.black) {
bold = "900";
} else if (fontObj.bold) {
bold = "bold";
}
const italic = fontObj.italic ? "italic" : "normal";
const browserFontSize = math_clamp_MathClamp(size, MIN_FONT_SIZE, MAX_FONT_SIZE);
this.current.fontSizeScale = size / browserFontSize;
this.ctx.font = `${italic} ${bold} ${browserFontSize}px ${typeface}`;
}
setTextRenderingMode(opIdx, mode) {
this.dependencyTracker?.recordSimpleData("textRenderingMode", opIdx);
this.current.textRenderingMode = mode;
}
setTextRise(opIdx, rise) {
this.dependencyTracker?.recordSimpleData("textRise", opIdx);
this.current.textRise = rise;
}
moveText(opIdx, x, y) {
this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText", opIdx);
this.current.x = this.current.lineX += x;
this.current.y = this.current.lineY += y;
}
setLeadingMoveText(opIdx, x, y) {
this.setLeading(opIdx, -y);
this.moveText(opIdx, x, y);
}
setTextMatrix(opIdx, matrix) {
this.dependencyTracker?.resetIncrementalData("sameLineText").recordSimpleData("textMatrix", opIdx);
const {
current
} = this;
current.textMatrix = matrix;
current.textMatrixScale = Math.hypot(matrix[0], matrix[1]);
current.x = current.lineX = 0;
current.y = current.lineY = 0;
}
nextLine(opIdx) {
this.moveText(opIdx, 0, this.current.leading);
this.dependencyTracker?.recordIncrementalData("moveText", this.dependencyTracker.getSimpleIndex("leading") ?? opIdx);
}
paintChar(opIdx, character, x, y, patternFillTransform, patternStrokeTransform) {
const ctx = this.ctx;
const current = this.current;
const font = current.font;
const textRenderingMode = current.textRenderingMode;
const fontSize = current.fontSize / current.fontSizeScale;
const fillStrokeMode = textRenderingMode & TextRenderingMode.FILL_STROKE_MASK;
const isAddToPathSet = !!(textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG);
const patternFill = current.patternFill && !font.missingFile;
const patternStroke = current.patternStroke && !font.missingFile;
let path;
if ((font.disableFontFace || isAddToPathSet || patternFill || patternStroke) && !font.missingFile) {
path = font.getPathGenerator(this.commonObjs, character);
}
if (path && (font.disableFontFace || patternFill || patternStroke)) {
ctx.save();
ctx.translate(x, y);
ctx.scale(fontSize, -fontSize);
this.dependencyTracker?.recordCharacterBBox(opIdx, ctx, font);
let currentTransform;
if (fillStrokeMode === TextRenderingMode.FILL || fillStrokeMode === TextRenderingMode.FILL_STROKE) {
if (patternFillTransform) {
currentTransform = ctx.getTransform();
ctx.setTransform(...patternFillTransform);
const scaledPath = canvas_assertClassBrand(_CanvasGraphics_brand, this, _getScaledPath).call(this, path, currentTransform, patternFillTransform);
ctx.fill(scaledPath);
} else {
ctx.fill(path);
}
}
if (fillStrokeMode === TextRenderingMode.STROKE || fillStrokeMode === TextRenderingMode.FILL_STROKE) {
if (patternStrokeTransform) {
currentTransform || (currentTransform = ctx.getTransform());
ctx.setTransform(...patternStrokeTransform);
const {
a,
b,
c,
d
} = currentTransform;
const invPatternTransform = Util.inverseTransform(patternStrokeTransform);
const transf = Util.transform([a, b, c, d, 0, 0], invPatternTransform);
Util.singularValueDecompose2dScale(transf, XY);
ctx.lineWidth *= Math.max(XY[0], XY[1]) / fontSize;
ctx.stroke(canvas_assertClassBrand(_CanvasGraphics_brand, this, _getScaledPath).call(this, path, currentTransform, patternStrokeTransform));
} else {
ctx.lineWidth /= fontSize;
ctx.stroke(path);
}
}
ctx.restore();
} else {
if (fillStrokeMode === TextRenderingMode.FILL || fillStrokeMode === TextRenderingMode.FILL_STROKE) {
ctx.fillText(character, x, y);
this.dependencyTracker?.recordCharacterBBox(opIdx, ctx, font, fontSize, x, y, () => ctx.measureText(character));
}
if (fillStrokeMode === TextRenderingMode.STROKE || fillStrokeMode === TextRenderingMode.FILL_STROKE) {
if (this.dependencyTracker) {
this.dependencyTracker?.recordCharacterBBox(opIdx, ctx, font, fontSize, x, y, () => ctx.measureText(character)).recordDependencies(opIdx, Dependencies.stroke);
}
ctx.strokeText(character, x, y);
}
}
if (isAddToPathSet) {
const paths = this.pendingTextPaths || (this.pendingTextPaths = []);
paths.push({
transform: getCurrentTransform(ctx),
x,
y,
fontSize,
path
});
this.dependencyTracker?.recordCharacterBBox(opIdx, ctx, font, fontSize, x, y);
}
}
get isFontSubpixelAAEnabled() {
const tmpCanvas = this.canvasFactory.create(10, 10);
const ctx = tmpCanvas.context;
ctx.scale(1.5, 1);
ctx.fillText("I", 0, 10);
const data = ctx.getImageData(0, 0, 10, 10).data;
this.canvasFactory.destroy(tmpCanvas);
let enabled = false;
for (let i = 3; i < data.length; i += 4) {
if (data[i] > 0 && data[i] < 255) {
enabled = true;
break;
}
}
return util_shadow(this, "isFontSubpixelAAEnabled", enabled);
}
showText(opIdx, glyphs) {
if (this.dependencyTracker) {
this.dependencyTracker.recordDependencies(opIdx, Dependencies.showText).resetBBox(opIdx);
if (this.current.textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG) {
this.dependencyTracker.recordFutureForcedDependency("textClip", opIdx).inheritPendingDependenciesAsFutureForcedDependencies();
}
}
const current = this.current;
const font = current.font;
if (font.isType3Font) {
const started = canvas_assertClassBrand(_CanvasGraphics_brand, this, _beginKnockoutElement).call(this, current.fillAlpha);
this.showType3Text(opIdx, glyphs);
this.dependencyTracker?.recordShowTextOperation(opIdx);
canvas_assertClassBrand(_CanvasGraphics_brand, this, _endKnockoutElement).call(this, started);
return;
}
const fontSize = current.fontSize;
if (fontSize === 0) {
this.dependencyTracker?.recordOperation(opIdx);
return;
}
const started = canvas_assertClassBrand(_CanvasGraphics_brand, this, _beginKnockoutElement).call(this, current.fillAlpha);
const ctx = this.ctx;
const fontSizeScale = current.fontSizeScale;
const charSpacing = current.charSpacing;
const wordSpacing = current.wordSpacing;
const fontDirection = current.fontDirection;
const textHScale = current.textHScale * fontDirection;
const glyphsLength = glyphs.length;
const vertical = font.vertical;
const spacingDir = vertical ? 1 : -1;
const widthAdvanceScale = fontSize * current.fontMatrix[0];
const simpleFillText = current.textRenderingMode === TextRenderingMode.FILL && !font.disableFontFace && !current.patternFill;
ctx.save();
if (current.textMatrix) {
ctx.transform(...current.textMatrix);
}
ctx.translate(current.x, current.y + current.textRise);
if (fontDirection > 0) {
ctx.scale(textHScale, -1);
} else {
ctx.scale(textHScale, 1);
}
let patternFillTransform, patternStrokeTransform;
const fillStrokeMode = current.textRenderingMode & TextRenderingMode.FILL_STROKE_MASK;
const needsFill = fillStrokeMode === TextRenderingMode.FILL || fillStrokeMode === TextRenderingMode.FILL_STROKE;
const needsStroke = fillStrokeMode === TextRenderingMode.STROKE || fillStrokeMode === TextRenderingMode.FILL_STROKE;
let lineWidth = current.lineWidth;
const scale = current.textMatrixScale;
if (scale === 0 || lineWidth === 0) {
if (needsStroke) {
lineWidth = this.getSinglePixelWidth();
}
} else {
lineWidth /= scale;
}
if (fontSizeScale !== 1.0) {
ctx.scale(fontSizeScale, fontSizeScale);
lineWidth /= fontSizeScale;
}
ctx.lineWidth = lineWidth;
if (needsFill && current.patternFill) {
[ctx.fillStyle, patternFillTransform] = canvas_assertClassBrand(_CanvasGraphics_brand, this, _getTextPattern).call(this, current.fillColor, PathType.FILL, opIdx);
}
if (needsStroke && current.patternStroke) {
[ctx.strokeStyle, patternStrokeTransform] = canvas_assertClassBrand(_CanvasGraphics_brand, this, _getTextPattern).call(this, current.strokeColor, PathType.STROKE, opIdx);
}
if (font.isInvalidPDFjsFont) {
const chars = [];
let width = 0;
for (const glyph of glyphs) {
chars.push(glyph.unicode);
width += glyph.width;
}
const joinedChars = chars.join("");
ctx.fillText(joinedChars, 0, 0);
if (this.dependencyTracker !== null) {
const measure = ctx.measureText(joinedChars);
this.dependencyTracker.recordBBox(opIdx, this.ctx, -measure.actualBoundingBoxLeft, measure.actualBoundingBoxRight, -measure.actualBoundingBoxAscent, measure.actualBoundingBoxDescent).recordShowTextOperation(opIdx);
}
current.x += width * widthAdvanceScale * textHScale;
ctx.restore();
this.compose();
canvas_assertClassBrand(_CanvasGraphics_brand, this, _endKnockoutElement).call(this, started);
return;
}
let x = 0,
i,
glyphPatterns = null;
for (i = 0; i < glyphsLength; ++i) {
const glyph = glyphs[i];
if (typeof glyph === "number") {
x += spacingDir * glyph * fontSize / 1000;
continue;
}
let restoreNeeded = false;
const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;
const character = glyph.fontChar;
const accent = glyph.accent;
let scaledX, scaledY, measure;
let width = glyph.width;
if (vertical) {
const vmetric = glyph.vmetric;
const vx = -vmetric[1] * widthAdvanceScale;
const vy = vmetric[2] * widthAdvanceScale;
width = -vmetric[0];
scaledX = vx / fontSizeScale;
scaledY = (x + vy) / fontSizeScale;
if (glyph.isRotated) {
measure = ctx.measureText(character);
const glyphScale = widthAdvanceScale / fontSizeScale;
const halfWidth = glyph.width / 2 * glyphScale;
const centerX = scaledX + halfWidth;
scaledX = scaledY - ((/* inlined export .DEFAULT_VERTICAL_ORIGIN_Y */880) - (/* inlined export .DEFAULT_VERTICAL_ADVANCE */1000) / 2) * glyphScale - halfWidth;
scaledY = (measure.actualBoundingBoxAscent - measure.actualBoundingBoxDescent) / 2 - centerX;
restoreNeeded = true;
ctx.save();
ctx.rotate(Math.PI / 2);
}
} else {
scaledX = x / fontSizeScale;
scaledY = 0;
}
const glyphWidth = glyph.isRotated ? glyph.width : width;
let characterScaleX = 1;
if ((font.remeasure || glyph.isRotated) && glyphWidth > 0) {
measure ?? (measure = ctx.measureText(character));
const measuredWidth = measure.width * 1000 / fontSize * fontSizeScale;
if (glyphWidth < measuredWidth && this.isFontSubpixelAAEnabled) {
characterScaleX = glyphWidth / measuredWidth;
if (!restoreNeeded) {
restoreNeeded = true;
ctx.save();
}
ctx.scale(characterScaleX, 1);
scaledX /= characterScaleX;
} else if (glyphWidth !== measuredWidth) {
scaledX += (glyphWidth - measuredWidth) / 2000 * fontSize / fontSizeScale;
}
}
if (restoreNeeded && font.missingFile && (patternFillTransform || patternStrokeTransform)) {
glyphPatterns || (glyphPatterns = new Map());
[ctx.fillStyle, ctx.strokeStyle] = glyphPatterns.getOrInsertComputed(glyph.isRotated ? -characterScaleX : characterScaleX, () => [patternFillTransform ? canvas_assertClassBrand(_CanvasGraphics_brand, this, _getTextPattern).call(this, current.fillColor, PathType.FILL, opIdx)[0] : ctx.fillStyle, patternStrokeTransform ? canvas_assertClassBrand(_CanvasGraphics_brand, this, _getTextPattern).call(this, current.strokeColor, PathType.STROKE, opIdx)[0] : ctx.strokeStyle]);
}
if (this.contentVisible && (glyph.isInFont || font.missingFile)) {
if (simpleFillText && !accent) {
ctx.fillText(character, scaledX, scaledY);
this.dependencyTracker?.recordCharacterBBox(opIdx, ctx, measure ? {
bbox: null
} : font, fontSize / fontSizeScale, scaledX, scaledY, () => measure ?? ctx.measureText(character));
} else {
this.paintChar(opIdx, character, scaledX, scaledY, patternFillTransform, patternStrokeTransform);
if (accent) {
const scaledAccentX = scaledX + fontSize * accent.offset.x / fontSizeScale;
const scaledAccentY = scaledY - fontSize * accent.offset.y / fontSizeScale;
this.paintChar(opIdx, accent.fontChar, scaledAccentX, scaledAccentY, patternFillTransform, patternStrokeTransform);
}
}
}
const charWidth = vertical ? width * widthAdvanceScale - spacing * fontDirection : width * widthAdvanceScale + spacing * fontDirection;
x += charWidth;
if (restoreNeeded) {
ctx.restore();
}
}
if (vertical) {
current.y -= x;
} else {
current.x += x * textHScale;
}
ctx.restore();
this.compose();
this.dependencyTracker?.recordShowTextOperation(opIdx);
canvas_assertClassBrand(_CanvasGraphics_brand, this, _endKnockoutElement).call(this, started);
}
showType3Text(opIdx, glyphs) {
const ctx = this.ctx;
const current = this.current;
const font = current.font;
const fontSize = current.fontSize;
const fontDirection = current.fontDirection;
const spacingDir = font.vertical ? 1 : -1;
const charSpacing = current.charSpacing;
const wordSpacing = current.wordSpacing;
const textHScale = current.textHScale * fontDirection;
const fontMatrix = current.fontMatrix || FONT_IDENTITY_MATRIX;
const glyphsLength = glyphs.length;
const isTextVisible = current.textRenderingMode !== TextRenderingMode.INVISIBLE;
let i, glyph, width, spacingLength;
if (fontSize === 0) {
return;
}
this._cachedScaleForStroking[0] = -1;
ctx.save();
if (current.textMatrix) {
ctx.transform(...current.textMatrix);
}
ctx.translate(current.x, current.y + current.textRise);
ctx.scale(textHScale, fontDirection);
const dependencyTracker = this.dependencyTracker;
this.dependencyTracker = dependencyTracker ? new CanvasNestedDependencyTracker(dependencyTracker, opIdx) : null;
try {
for (i = 0; i < glyphsLength; ++i) {
glyph = glyphs[i];
if (typeof glyph === "number") {
spacingLength = spacingDir * glyph * fontSize / 1000;
this.ctx.translate(spacingLength, 0);
current.x += spacingLength * textHScale;
continue;
}
const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;
const operatorList = font.charProcOperatorList.get(glyph.operatorListId);
if (!operatorList) {
warn(`Type3 character "${glyph.operatorListId}" is not available.`);
} else if (this.contentVisible && isTextVisible) {
this.save();
ctx.scale(fontSize, fontSize);
ctx.transform(...fontMatrix);
this.executeOperatorList(operatorList);
this.restore();
}
width = glyph.width * fontMatrix[0] * fontSize + spacing * fontDirection;
ctx.translate(width, 0);
current.x += width * textHScale;
}
} finally {
if (dependencyTracker) {
this.dependencyTracker = dependencyTracker;
}
}
ctx.restore();
}
setCharWidth(opIdx, xWidth, yWidth) {}
setCharWidthAndBounds(opIdx, xWidth, yWidth, llx, lly, urx, ury) {
const clip = new Path2D();
clip.rect(llx, lly, urx - llx, ury - lly);
this.ctx.clip(clip);
this.dependencyTracker?.recordBBox(opIdx, this.ctx, llx, urx, lly, ury).recordClipBox(opIdx, this.ctx, llx, urx, lly, ury);
this.endPath(opIdx);
}
getColorN_Pattern(opIdx, IR) {
let pattern;
if (IR[0] === "TilingPattern") {
const baseTransform = this.baseTransform || getCurrentTransform(this.ctx);
const canvasGraphicsFactory = {
createCanvasGraphics: (ctx, renderingOpIdx) => new CanvasGraphics(ctx, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
optionalContentConfig: this.optionalContentConfig,
markedContentStack: this.markedContentStack,
pixelRatio: this.pixelRatio
}, undefined, undefined, this.dependencyTracker ? new CanvasNestedDependencyTracker(this.dependencyTracker, renderingOpIdx, true) : null)
};
pattern = new TilingPattern(IR, this.ctx, canvasGraphicsFactory, baseTransform);
} else {
pattern = this._getPattern(opIdx, IR[1], IR[2]);
}
return pattern;
}
setStrokeColorN(opIdx, ...args) {
this.dependencyTracker?.recordSimpleData("strokeColor", opIdx);
this.current.strokeColor = this.getColorN_Pattern(opIdx, args);
this.current.patternStroke = true;
}
setFillColorN(opIdx, ...args) {
this.dependencyTracker?.recordSimpleData("fillColor", opIdx);
const pattern = this.current.fillColor = this.getColorN_Pattern(opIdx, args);
this.current.patternFill = true;
this.current.tilingPatternDims = pattern instanceof TilingPattern ? [0, 0, 0, 0] : null;
}
setStrokeRGBColor(opIdx, color) {
this.dependencyTracker?.recordSimpleData("strokeColor", opIdx);
this.current.strokeColor = color;
this.ctx.strokeStyle = canvas_assertClassBrand(_CanvasGraphics_brand, this, _transferColor).call(this, color);
this.current.patternStroke = false;
}
setStrokeTransparent(opIdx) {
this.dependencyTracker?.recordSimpleData("strokeColor", opIdx);
this.ctx.strokeStyle = this.current.strokeColor = "transparent";
this.current.patternStroke = false;
}
setFillRGBColor(opIdx, color) {
this.dependencyTracker?.recordSimpleData("fillColor", opIdx);
this.current.fillColor = color;
this.ctx.fillStyle = canvas_assertClassBrand(_CanvasGraphics_brand, this, _transferColor).call(this, color);
this.current.patternFill = false;
this.current.tilingPatternDims = null;
}
setFillTransparent(opIdx) {
this.dependencyTracker?.recordSimpleData("fillColor", opIdx);
this.ctx.fillStyle = this.current.fillColor = "transparent";
this.current.patternFill = false;
this.current.tilingPatternDims = null;
}
_getPattern(opIdx, objId, matrix = null) {
const pattern = this.cachedPatterns.getOrInsertComputed(objId, () => getShadingPattern(this.getObject(opIdx, objId)));
if (matrix) {
pattern.matrix = matrix;
}
return pattern;
}
shadingFill(opIdx, objId) {
if (!this.contentVisible) {
return;
}
const started = canvas_assertClassBrand(_CanvasGraphics_brand, this, _beginKnockoutElement).call(this, this.current.fillAlpha);
const ctx = this.ctx;
this.save(opIdx);
const pattern = this._getPattern(opIdx, objId);
ctx.fillStyle = pattern.getPattern(ctx, this, getCurrentTransformInverse(ctx), PathType.SHADING, opIdx);
const inv = getCurrentTransformInverse(ctx);
if (inv) {
const {
width,
height
} = ctx.canvas;
const minMax = F32_BBOX_INIT.slice();
Util.axialAlignedBoundingBox([0, 0, width, height], inv, minMax);
const [x0, y0, x1, y1] = minMax;
this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0);
} else {
this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);
}
this.dependencyTracker?.resetBBox(opIdx).recordFullPageBBox(opIdx).recordDependencies(opIdx, Dependencies.transform).recordDependencies(opIdx, Dependencies.fill).recordOperation(opIdx);
this.compose(this.current.getClippedPathBoundingBox());
this.restore(opIdx);
canvas_assertClassBrand(_CanvasGraphics_brand, this, _endKnockoutElement).call(this, started);
}
beginInlineImage() {
unreachable("Should not call beginInlineImage");
}
beginImageData() {
unreachable("Should not call beginImageData");
}
paintFormXObjectBegin(opIdx, matrix, bbox) {
if (!this.contentVisible) {
return;
}
this.save(opIdx);
this.baseTransformStack.push(this.baseTransform);
if (matrix) {
this.transform(opIdx, ...matrix);
}
this.baseTransform = getCurrentTransform(this.ctx);
if (bbox) {
Util.axialAlignedBoundingBox(bbox, this.baseTransform, this.current.minMax);
const [x0, y0, x1, y1] = bbox;
const clip = new Path2D();
clip.rect(x0, y0, x1 - x0, y1 - y0);
this.ctx.clip(clip);
this.dependencyTracker?.recordClipBox(opIdx, this.ctx, x0, x1, y0, y1);
this.endPath(opIdx);
}
}
paintFormXObjectEnd(opIdx) {
if (!this.contentVisible) {
return;
}
this.restore(opIdx);
this.baseTransform = this.baseTransformStack.pop();
}
beginGroup(opIdx, group) {
if (!this.contentVisible) {
return;
}
this.save(opIdx);
const {
inSMaskMode
} = this;
if (inSMaskMode) {
this.endSMaskMode();
this.current.activeSMask = null;
}
const currentCtx = this.ctx;
if ((!group.needsIsolation || !group.isolated && !group.hasSoftMask) && !group.knockout && !group.isGray && canvas_classPrivateFieldGet(_knockoutGroupLevel, this) === 0 && currentCtx.globalAlpha === 1 && currentCtx.globalCompositeOperation === "source-over" && !inSMaskMode) {
if (group.bbox) {
let clip = new Path2D();
const [x0, y0, x1, y1] = group.bbox;
clip.rect(x0, y0, x1 - x0, y1 - y0);
if (group.matrix) {
const path = new Path2D();
path.addPath(clip, new DOMMatrix(group.matrix));
clip = path;
}
currentCtx.clip(clip);
}
this.groupStack.push(null);
canvas_classPrivateFieldGet(_groupStackMeta, this).push(null);
this.groupLevel++;
return;
}
if (!group.isolated && !group.knockout && canvas_classPrivateFieldGet(_knockoutGroupLevel, this) === 0) {
info("TODO: Fully support non-isolated non-knockout groups.");
}
const currentTransform = getCurrentTransform(currentCtx);
if (group.matrix) {
currentCtx.transform(...group.matrix);
}
const canvasBounds = [0, 0, currentCtx.canvas.width, currentCtx.canvas.height];
let bounds;
if (group.bbox) {
bounds = F32_BBOX_INIT.slice();
Util.axialAlignedBoundingBox(group.bbox, getCurrentTransform(currentCtx), bounds);
bounds = Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0];
} else {
bounds = canvasBounds;
}
const offsetX = Math.floor(bounds[0]);
const offsetY = Math.floor(bounds[1]);
const drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1);
const drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1);
this.current.startNewPathAndClipBox([0, 0, drawnWidth, drawnHeight]);
const scratchCanvas = this.canvasFactory.create(drawnWidth, drawnHeight);
if (group.smask) {
this.smaskGroupCanvases.push(scratchCanvas);
}
const groupCtx = scratchCanvas.context;
const backdropCtx = group.knockout && !group.isolated ? currentCtx : null;
const hasInnerBackdrop = !group.isolated && !group.knockout && !group.smask && group.needsIsolation && canvas_classPrivateFieldGet(_knockoutGroupLevel, this) > 0;
const knockoutMaskEntry = group.knockout ? this.canvasFactory.create(drawnWidth, drawnHeight) : null;
const savedKnockoutLevel = canvas_classPrivateFieldGet(_knockoutGroupLevel, this);
if (group.knockout) {
var _this$knockoutGroupLe, _this$knockoutGroupLe2;
canvas_classPrivateFieldSet(_knockoutGroupLevel, this, (_this$knockoutGroupLe = canvas_classPrivateFieldGet(_knockoutGroupLevel, this), _this$knockoutGroupLe2 = _this$knockoutGroupLe++, _this$knockoutGroupLe)), _this$knockoutGroupLe2;
} else {
canvas_classPrivateFieldSet(_knockoutGroupLevel, this, 0);
}
groupCtx.translate(-offsetX, -offsetY);
groupCtx.transform(...currentTransform);
const needsBackdropCopy = !group.isolated && !group.smask && group.needsIsolation;
const replaceBackdrop = needsBackdropCopy && !inSMaskMode && savedKnockoutLevel === 0 && !group.knockout && !group.isGray && group.hasSoftMask && currentCtx.globalAlpha === 1 && currentCtx.globalCompositeOperation === "source-over" && this.current.transferMaps === "none" && !this.current.transferMapsFallback;
if (needsBackdropCopy && (inSMaskMode || replaceBackdrop)) {
groupCtx.save();
groupCtx.setTransform(1, 0, 0, 1, 0, 0);
groupCtx.drawImage(currentCtx.canvas, -offsetX, -offsetY);
groupCtx.restore();
}
if (group.bbox) {
let clip = new Path2D();
const [x0, y0, x1, y1] = group.bbox;
clip.rect(x0, y0, x1 - x0, y1 - y0);
if (group.matrix) {
const path = new Path2D();
path.addPath(clip, new DOMMatrix(group.matrix));
clip = path;
}
groupCtx.clip(clip);
}
if (group.smask) {
this.smaskStack.push({
canvas: scratchCanvas.canvas,
context: groupCtx,
offsetX,
offsetY,
subtype: group.smask.subtype,
backdrop: group.smask.backdrop,
transferMap: group.smask.transferMap || null
});
}
if (!group.smask || this.dependencyTracker) {
currentCtx.setTransform(1, 0, 0, 1, 0, 0);
currentCtx.translate(offsetX, offsetY);
currentCtx.save();
}
copyCtxState(currentCtx, groupCtx);
this.ctx = groupCtx;
this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha", "strokeAlpha", "globalCompositeOperation"]).pushBaseTransform(currentCtx);
this.setGState(opIdx, [["BM", "source-over"], ["ca", 1], ["CA", 1], ["TR", null]]);
this.groupStack.push(currentCtx);
canvas_classPrivateFieldGet(_groupStackMeta, this).push({
backdropCtx,
savedKnockoutLevel,
offsetX,
offsetY,
hasInnerBackdrop,
replaceBackdrop,
knockoutMaskEntry,
knockoutTempEntry: null,
knockoutBackdropEntry: null
});
this.groupLevel++;
}
endGroup(opIdx, group) {
if (!this.contentVisible) {
return;
}
this.groupLevel--;
const groupCtx = this.ctx;
const ctx = this.groupStack.pop();
const groupMeta = canvas_classPrivateFieldGet(_groupStackMeta, this).pop();
if (groupMeta) {
canvas_classPrivateFieldSet(_knockoutGroupLevel, this, groupMeta.savedKnockoutLevel);
}
if (ctx === null) {
this.restore(opIdx);
return;
}
if (group.isGray) {
canvas_assertClassBrand(_CanvasGraphics_brand, this, _convertGroupToGray).call(this, groupCtx);
}
this.ctx = ctx;
this.ctx.imageSmoothingEnabled = false;
this.dependencyTracker?.popBaseTransform();
if (group.smask) {
this.tempSMask = this.smaskStack.pop();
this.restore(opIdx);
if (this.dependencyTracker) {
this.ctx.restore();
if (this.inSMaskMode) {
this.ctx.setTransform(this.suspendedCtx.getTransform());
}
}
canvas_assertClassBrand(_CanvasGraphics_brand, this, _destroyKnockoutPools).call(this, groupMeta);
} else {
this.ctx.restore();
const currentMtx = getCurrentTransform(this.ctx);
this.restore(opIdx);
this.current.transferMapsFallback?.applyToCanvas(groupCtx);
this.ctx.save();
this.ctx.setTransform(...currentMtx);
const dirtyBox = F32_BBOX_INIT.slice();
Util.axialAlignedBoundingBox([0, 0, groupCtx.canvas.width, groupCtx.canvas.height], currentMtx, dirtyBox);
const parentGroupMeta = canvas_classPrivateFieldGet(_groupStackMeta, this).at(-1);
if (canvas_classPrivateFieldGet(_knockoutGroupLevel, this) > 0) {
if (groupMeta.hasInnerBackdrop) {
const {
width,
height
} = groupCtx.canvas;
const colorEntry = this.canvasFactory.create(width, height);
const colorCtx = colorEntry.context;
colorCtx.drawImage(ctx.canvas, groupMeta.offsetX, groupMeta.offsetY, width, height, 0, 0, width, height);
colorCtx.globalCompositeOperation = "source-over";
colorCtx.drawImage(groupCtx.canvas, 0, 0);
const shapeMaskEntry = canvas_assertClassBrand(_CanvasGraphics_brand, this, _createKnockoutMaskCanvas).call(this, groupCtx.canvas);
colorCtx.globalCompositeOperation = "destination-in";
colorCtx.drawImage(shapeMaskEntry.canvas, 0, 0);
const sourceCompositeOperation = this.ctx.globalCompositeOperation;
const sourceAlpha = this.ctx.globalAlpha;
const sourceFilter = this.ctx.filter;
this.ctx.save();
this.ctx.setTransform(...currentMtx);
this.ctx.globalAlpha = 1;
if (FeatureTest.isCanvasFilterSupported) {
this.ctx.filter = "none";
}
this.ctx.globalCompositeOperation = "destination-out";
this.ctx.drawImage(shapeMaskEntry.canvas, 0, 0);
this.ctx.globalCompositeOperation = sourceCompositeOperation;
this.ctx.globalAlpha = sourceAlpha;
if (FeatureTest.isCanvasFilterSupported) {
this.ctx.filter = sourceFilter ?? "none";
}
this.ctx.drawImage(colorEntry.canvas, 0, 0);
this.ctx.restore();
this.canvasFactory.destroy(shapeMaskEntry);
this.canvasFactory.destroy(colorEntry);
} else {
const backdropCtx = parentGroupMeta?.backdropCtx ?? null;
canvas_assertClassBrand(_CanvasGraphics_brand, this, _compositeKnockoutSurface).call(this, this.ctx, groupCtx.canvas, {
backdropCanvas: backdropCtx?.canvas ?? null,
destTransform: currentMtx,
backdropOffset: backdropCtx ? [parentGroupMeta.offsetX + groupMeta.offsetX, parentGroupMeta.offsetY + groupMeta.offsetY] : [0, 0],
sourceAlpha: this.ctx.globalAlpha,
sourceFilter: this.ctx.filter
});
}
} else {
if (groupMeta.replaceBackdrop) {
const clip = new Path2D();
clip.rect(0, 0, groupCtx.canvas.width, groupCtx.canvas.height);
this.ctx.clip(clip);
this.ctx.globalCompositeOperation = "copy";
}
this.ctx.drawImage(groupCtx.canvas, 0, 0);
}
this.ctx.restore();
this.canvasFactory.destroy({
canvas: groupCtx.canvas,
context: groupCtx
});
canvas_assertClassBrand(_CanvasGraphics_brand, this, _destroyKnockoutPools).call(this, groupMeta);
this.compose(dirtyBox);
}
}
beginAnnotation(opIdx, id, rect, transform, matrix, hasOwnCanvas, canvasName) {
canvas_assertClassBrand(_CanvasGraphics_brand, this, _restoreInitialState).call(this);
resetCtxToDefault(this.ctx);
this.ctx.save();
this.save(opIdx);
if (this.baseTransform) {
this.ctx.setTransform(...this.baseTransform);
}
if (rect) {
const width = rect[2] - rect[0];
const height = rect[3] - rect[1];
if (hasOwnCanvas && this.annotationCanvasMap) {
transform = transform.slice();
transform[4] -= rect[0];
transform[5] -= rect[1];
Util.singularValueDecompose2dScale(getCurrentTransform(this.ctx), XY);
const {
viewportScale
} = this;
const canvasWidth = Math.ceil(width * this.outputScaleX * viewportScale);
const canvasHeight = Math.ceil(height * this.outputScaleY * viewportScale);
this.annotationCanvas = this.canvasFactory.create(canvasWidth, canvasHeight);
const {
canvas,
context
} = this.annotationCanvas;
if (canvasName) {
const canvases = this.annotationCanvasMap.getOrInsertComputed(id, makeArr);
setAnnotationCanvasName(canvas, canvasName);
const index = canvases.findIndex(c => getAnnotationCanvasName(c) === canvasName);
if (index === -1) {
canvases.push(canvas);
} else {
canvases[index] = canvas;
}
} else {
this.annotationCanvasMap.set(id, canvas);
}
this.annotationCanvas.savedCtx = this.ctx;
this.ctx = context;
this.ctx.save();
this.ctx.setTransform(XY[0], 0, 0, -XY[1], 0, height * XY[1]);
resetCtxToDefault(this.ctx);
} else {
resetCtxToDefault(this.ctx);
this.endPath(opIdx);
const clip = new Path2D();
clip.rect(rect[0], rect[1], width, height);
this.ctx.clip(clip);
}
}
this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height);
this.baseTransformStack.push(this.baseTransform);
this.transform(opIdx, ...transform);
this.transform(opIdx, ...matrix);
this.baseTransform = getCurrentTransform(this.ctx);
}
endAnnotation(opIdx) {
if (this.annotationCanvas) {
this.ctx.restore();
canvas_assertClassBrand(_CanvasGraphics_brand, this, _drawFilter).call(this);
this.ctx = this.annotationCanvas.savedCtx;
delete this.annotationCanvas.savedCtx;
delete this.annotationCanvas;
}
this.baseTransform = this.baseTransformStack.pop();
}
paintImageMaskXObject(opIdx, img) {
if (!this.contentVisible) {
return;
}
const count = img.count;
img = this.getObject(opIdx, img.data, img);
img.count = count;
const started = canvas_assertClassBrand(_CanvasGraphics_brand, this, _beginKnockoutElement).call(this, this.current.fillAlpha);
const ctx = this.ctx;
const mask = this._createMaskCanvas(opIdx, img);
const maskCanvas = mask.canvas;
ctx.save();
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.drawImage(maskCanvas, mask.offsetX, mask.offsetY);
this.dependencyTracker?.resetBBox(opIdx).recordBBox(opIdx, this.ctx, mask.offsetX, mask.offsetX + maskCanvas.width, mask.offsetY, mask.offsetY + maskCanvas.height).recordOperation(opIdx);
ctx.restore();
if (mask.canvasEntry) {
this.canvasFactory.destroy(mask.canvasEntry);
}
this.compose();
canvas_assertClassBrand(_CanvasGraphics_brand, this, _endKnockoutElement).call(this, started);
}
paintImageMaskXObjectRepeat(opIdx, img, scaleX, skewX = 0, skewY = 0, scaleY, positions) {
if (!this.contentVisible) {
return;
}
img = this.getObject(opIdx, img.data, img);
const started = canvas_assertClassBrand(_CanvasGraphics_brand, this, _beginKnockoutElement).call(this, this.current.fillAlpha);
const ctx = this.ctx;
ctx.save();
const currentTransform = getCurrentTransform(ctx);
ctx.transform(scaleX, skewX, skewY, scaleY, 0, 0);
const mask = this._createMaskCanvas(opIdx, img);
ctx.setTransform(1, 0, 0, 1, mask.offsetX - currentTransform[4], mask.offsetY - currentTransform[5]);
this.dependencyTracker?.resetBBox(opIdx);
for (let i = 0, ii = positions.length; i < ii; i += 2) {
const trans = Util.transform(currentTransform, [scaleX, skewX, skewY, scaleY, positions[i], positions[i + 1]]);
ctx.drawImage(mask.canvas, trans[4], trans[5]);
this.dependencyTracker?.recordBBox(opIdx, this.ctx, trans[4], trans[4] + mask.canvas.width, trans[5], trans[5] + mask.canvas.height);
}
ctx.restore();
if (mask.canvasEntry) {
this.canvasFactory.destroy(mask.canvasEntry);
}
this.compose();
this.dependencyTracker?.recordOperation(opIdx);
canvas_assertClassBrand(_CanvasGraphics_brand, this, _endKnockoutElement).call(this, started);
}
paintImageMaskXObjectGroup(opIdx, images) {
if (!this.contentVisible) {
return;
}
const started = canvas_assertClassBrand(_CanvasGraphics_brand, this, _beginKnockoutElement).call(this, this.current.fillAlpha);
const ctx = this.ctx;
const isPatternFill = this.current.patternFill;
const fillColor = isPatternFill ? this.current.fillColor : ctx.fillStyle;
this.dependencyTracker?.resetBBox(opIdx).recordDependencies(opIdx, Dependencies.transformAndFill);
for (const image of images) {
const {
data,
width,
height,
transform
} = image;
const maskCanvas = this.canvasFactory.create(width, height);
const maskCtx = maskCanvas.context;
maskCtx.save();
const img = this.getObject(opIdx, data, image);
putBinaryImageMask(maskCtx, img);
maskCtx.globalCompositeOperation = "source-in";
maskCtx.fillStyle = isPatternFill ? fillColor.getPattern(maskCtx, this, getCurrentTransformInverse(ctx), PathType.FILL, opIdx) : fillColor;
maskCtx.fillRect(0, 0, width, height);
maskCtx.restore();
ctx.save();
ctx.transform(...transform);
ctx.scale(1, -1);
drawImageAtIntegerCoords(ctx, maskCanvas.canvas, 0, 0, width, height, 0, -1, 1, 1);
this.canvasFactory.destroy(maskCanvas);
this.dependencyTracker?.recordBBox(opIdx, ctx, 0, width, 0, height);
ctx.restore();
}
this.compose();
this.dependencyTracker?.recordOperation(opIdx);
canvas_assertClassBrand(_CanvasGraphics_brand, this, _endKnockoutElement).call(this, started);
}
paintImageXObject(opIdx, objId) {
if (!this.contentVisible) {
return;
}
const imgData = this.getObject(opIdx, objId);
if (!imgData) {
warn("Dependent image isn't ready yet");
return;
}
this.paintInlineImageXObject(opIdx, imgData);
}
paintImageXObjectRepeat(opIdx, objId, scaleX, scaleY, positions) {
if (!this.contentVisible) {
return;
}
const imgData = this.getObject(opIdx, objId);
if (!imgData) {
warn("Dependent image isn't ready yet");
return;
}
const width = imgData.width;
const height = imgData.height;
const map = [];
for (let i = 0, ii = positions.length; i < ii; i += 2) {
map.push({
transform: [scaleX, 0, 0, scaleY, positions[i], positions[i + 1]],
x: 0,
y: 0,
w: width,
h: height
});
}
this.paintInlineImageXObjectGroup(opIdx, imgData, map);
}
applyTransferMapsToCanvas(ctx) {
if (this.current.transferMaps !== "none") {
ctx.filter = this.current.transferMaps;
ctx.drawImage(ctx.canvas, 0, 0);
ctx.filter = "none";
} else {
this.current.transferMapsFallback?.applyToCanvas(ctx);
}
return ctx.canvas;
}
applyTransferMapsToBitmap(imgData) {
const {
transferMaps,
transferMapsFallback
} = this.current;
if (transferMaps === "none" && !transferMapsFallback) {
return {
img: imgData.bitmap,
canvasEntry: null
};
}
const {
bitmap,
width,
height
} = imgData;
const tmpCanvas = this.canvasFactory.create(width, height);
const tmpCtx = tmpCanvas.context;
tmpCtx.filter = transferMaps;
tmpCtx.drawImage(bitmap, 0, 0);
tmpCtx.filter = "none";
transferMapsFallback?.applyToCanvas(tmpCtx);
return {
img: tmpCanvas.canvas,
canvasEntry: tmpCanvas
};
}
paintInlineImageXObject(opIdx, imgData) {
if (!this.contentVisible) {
return;
}
const width = imgData.width;
const height = imgData.height;
const started = canvas_assertClassBrand(_CanvasGraphics_brand, this, _beginKnockoutElement).call(this, this.current.fillAlpha);
const ctx = this.ctx;
this.save(opIdx);
const {
filter
} = ctx;
if (filter !== "none" && filter !== "") {
ctx.filter = "none";
}
ctx.scale(1 / width, -1 / height);
let imgToPaint;
let inlineImgCanvas = null;
if (imgData.bitmap) {
const result = this.applyTransferMapsToBitmap(imgData);
imgToPaint = result.img;
inlineImgCanvas = result.canvasEntry;
} else {
const tmpCanvas = this.canvasFactory.create(width, height);
putBinaryImageData(tmpCanvas.context, imgData);
imgToPaint = this.applyTransferMapsToCanvas(tmpCanvas.context);
inlineImgCanvas = tmpCanvas;
}
const scaled = this._scaleImage(imgToPaint, getCurrentTransformInverse(ctx));
ctx.imageSmoothingEnabled = getImageSmoothingEnabled(getCurrentTransform(ctx), imgData.interpolate, this.pixelRatio);
if (this.dependencyTracker) {
this.dependencyTracker.resetBBox(opIdx).recordBBox(opIdx, ctx, 0, width, -height, 0).recordDependencies(opIdx, Dependencies.imageXObject).recordOperation(opIdx);
this.imagesTracker?.record(ctx, width, height, this.dependencyTracker.clipBox);
}
drawImageAtIntegerCoords(ctx, scaled.img, 0, 0, scaled.paintWidth, scaled.paintHeight, 0, -height, width, height);
if (scaled.tmpCanvas) {
this.canvasFactory.destroy(scaled.tmpCanvas);
}
if (inlineImgCanvas) {
this.canvasFactory.destroy(inlineImgCanvas);
}
this.compose();
this.restore(opIdx);
canvas_assertClassBrand(_CanvasGraphics_brand, this, _endKnockoutElement).call(this, started);
}
paintInlineImageXObjectGroup(opIdx, imgData, map) {
if (!this.contentVisible) {
return;
}
const started = canvas_assertClassBrand(_CanvasGraphics_brand, this, _beginKnockoutElement).call(this, this.current.fillAlpha);
const ctx = this.ctx;
let imgToPaint;
let inlineImgCanvas = null;
if (imgData.bitmap && !this.current.transferMapsFallback) {
imgToPaint = imgData.bitmap;
} else if (imgData.bitmap) {
({
img: imgToPaint,
canvasEntry: inlineImgCanvas
} = this.applyTransferMapsToBitmap(imgData));
} else {
const w = imgData.width;
const h = imgData.height;
const tmpCanvas = this.canvasFactory.create(w, h);
putBinaryImageData(tmpCanvas.context, imgData);
imgToPaint = this.applyTransferMapsToCanvas(tmpCanvas.context);
inlineImgCanvas = tmpCanvas;
}
this.dependencyTracker?.resetBBox(opIdx);
for (const entry of map) {
ctx.save();
ctx.transform(...entry.transform);
ctx.scale(1, -1);
drawImageAtIntegerCoords(ctx, imgToPaint, entry.x, entry.y, entry.w, entry.h, 0, -1, 1, 1);
this.dependencyTracker?.recordBBox(opIdx, ctx, 0, 1, -1, 0);
ctx.restore();
}
if (inlineImgCanvas) {
this.canvasFactory.destroy(inlineImgCanvas);
}
this.dependencyTracker?.recordOperation(opIdx);
this.compose();
canvas_assertClassBrand(_CanvasGraphics_brand, this, _endKnockoutElement).call(this, started);
}
paintSolidColorImageMask(opIdx) {
if (!this.contentVisible) {
return;
}
const started = canvas_assertClassBrand(_CanvasGraphics_brand, this, _beginKnockoutElement).call(this, this.current.fillAlpha);
this.dependencyTracker?.resetBBox(opIdx).recordBBox(opIdx, this.ctx, 0, 1, 0, 1).recordDependencies(opIdx, Dependencies.fill).recordOperation(opIdx);
this.ctx.fillRect(0, 0, 1, 1);
this.compose();
canvas_assertClassBrand(_CanvasGraphics_brand, this, _endKnockoutElement).call(this, started);
}
markPoint(opIdx, tag) {}
markPointProps(opIdx, tag, properties) {}
beginMarkedContent(opIdx, tag) {
this.dependencyTracker?.beginMarkedContent(opIdx);
this.markedContentStack.push({
visible: true
});
}
beginMarkedContentProps(opIdx, tag, properties) {
this.dependencyTracker?.beginMarkedContent(opIdx);
if (tag === "OC") {
this.markedContentStack.push({
visible: this.optionalContentConfig.isVisible(properties)
});
} else {
this.markedContentStack.push({
visible: true
});
}
this.contentVisible = this.isContentVisible();
}
endMarkedContent(opIdx) {
this.dependencyTracker?.endMarkedContent(opIdx);
this.markedContentStack.pop();
this.contentVisible = this.isContentVisible();
}
beginCompat(opIdx) {}
endCompat(opIdx) {}
consumePath(opIdx, path, clipBox) {
const isEmpty = this.current.isEmptyClip();
if (this.pendingClip) {
this.current.updateClipFromPath();
}
if (!this.pendingClip) {
this.compose(clipBox);
}
const ctx = this.ctx;
if (this.pendingClip) {
if (!isEmpty) {
if (this.pendingClip === EO_CLIP) {
ctx.clip(path, "evenodd");
} else {
ctx.clip(path);
}
}
this.pendingClip = null;
this.dependencyTracker?.bboxToClipBoxDropOperation(opIdx).recordFutureForcedDependency("clipPath", opIdx);
} else {
this.dependencyTracker?.recordOperation(opIdx);
}
this.current.startNewPathAndClipBox(this.current.clipBox);
}
getSinglePixelWidth() {
const m = getCurrentTransform(this.ctx);
if (m[1] === 0 && m[2] === 0) {
return 1 / Math.min(Math.abs(m[0]), Math.abs(m[3]));
}
const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]);
const normX = Math.hypot(m[0], m[2]);
const normY = Math.hypot(m[1], m[3]);
return Math.max(normX, normY) / absDet;
}
getScaleForStroking() {
if (this._cachedScaleForStroking[0] === -1) {
const {
lineWidth
} = this.current;
const {
a,
b,
c,
d
} = this.ctx.getTransform();
let scaleX, scaleY;
if (b === 0 && c === 0) {
const normX = Math.abs(a);
const normY = Math.abs(d);
if (normX === normY) {
if (lineWidth === 0) {
scaleX = scaleY = 1 / normX;
} else {
const scaledLineWidth = normX * lineWidth;
scaleX = scaleY = scaledLineWidth < 1 ? 1 / scaledLineWidth : 1;
}
} else if (lineWidth === 0) {
scaleX = 1 / normX;
scaleY = 1 / normY;
} else {
const scaledXLineWidth = normX * lineWidth;
const scaledYLineWidth = normY * lineWidth;
scaleX = scaledXLineWidth < 1 ? 1 / scaledXLineWidth : 1;
scaleY = scaledYLineWidth < 1 ? 1 / scaledYLineWidth : 1;
}
} else {
const absDet = Math.abs(a * d - b * c);
const normX = Math.hypot(a, b);
const normY = Math.hypot(c, d);
if (lineWidth === 0) {
scaleX = normY / absDet;
scaleY = normX / absDet;
} else {
const baseArea = lineWidth * absDet;
scaleX = normY > baseArea ? normY / baseArea : 1;
scaleY = normX > baseArea ? normX / baseArea : 1;
}
}
this._cachedScaleForStroking[0] = scaleX;
this._cachedScaleForStroking[1] = scaleY;
}
return this._cachedScaleForStroking;
}
rescaleAndStroke(path, saveRestore) {
const {
ctx,
current: {
lineWidth
}
} = this;
const [scaleX, scaleY] = this.getScaleForStroking();
if (scaleX === scaleY) {
ctx.lineWidth = (lineWidth || 1) * scaleX;
ctx.stroke(path);
return;
}
const SCALE_MATRIX = _SCALE_MATRIX._ ?? (_SCALE_MATRIX._ = new DOMMatrix());
const dashes = ctx.getLineDash();
if (saveRestore) {
ctx.save();
}
ctx.scale(scaleX, scaleY);
SCALE_MATRIX.a = 1 / scaleX;
SCALE_MATRIX.d = 1 / scaleY;
const newPath = new Path2D();
newPath.addPath(path, SCALE_MATRIX);
if (dashes.length > 0) {
const scale = Math.max(scaleX, scaleY);
ctx.setLineDash(dashes.map(x => x / scale));
ctx.lineDashOffset /= scale;
}
ctx.lineWidth = lineWidth || 1;
ctx.stroke(newPath);
if (saveRestore) {
ctx.restore();
}
}
isContentVisible() {
for (let i = this.markedContentStack.length - 1; i >= 0; i--) {
if (!this.markedContentStack[i].visible) {
return false;
}
}
return true;
}
}
function _restoreInitialState() {
while (this.stateStack.length || this.inSMaskMode) {
this.restore();
}
this.current.activeSMask = null;
this.ctx.restore();
if (this.transparentCanvas) {
this.ctx = this.compositeCtx;
this.ctx.save();
this.ctx.setTransform(1, 0, 0, 1, 0, 0);
this.ctx.drawImage(this.transparentCanvas, 0, 0);
this.ctx.restore();
this.canvasFactory.destroy(this.transparentCanvasEntry);
this.transparentCanvas = null;
this.transparentCanvasEntry = null;
}
}
function _drawFilter() {
if (this.pageColors) {
const hcmFilterId = this.filterFactory.addHCMFilter(this.pageColors.foreground, this.pageColors.background);
if (hcmFilterId !== "none") {
const savedFilter = this.ctx.filter;
this.ctx.filter = hcmFilterId;
this.ctx.drawImage(this.ctx.canvas, 0, 0);
this.ctx.filter = savedFilter;
}
}
}
function _createKnockoutMaskCanvas(sourceCanvas, reuseEntry = null, alpha = 1) {
const {
width,
height
} = sourceCanvas;
const maskEntry = reuseEntry ?? this.canvasFactory.create(width, height);
const maskCtx = maskEntry.context;
alpha = Math.round(alpha * 255) / 255;
const needsAlphaScaling = alpha < 1;
if (needsAlphaScaling && canvas_classPrivateFieldGet(_knockoutFilterCache, this) === undefined) {
canvas_classPrivateFieldSet(_knockoutFilterCache, this, FeatureTest.isCanvasFilterSupported ? new Map() : "none");
}
let knockoutFilter = "none";
if (needsAlphaScaling && canvas_classPrivateFieldGet(_knockoutFilterCache, this) instanceof Map) {
knockoutFilter = canvas_classPrivateFieldGet(_knockoutFilterCache, this).getOrInsertComputed(alpha, () => this.filterFactory.addKnockoutFilter(alpha));
}
if (!needsAlphaScaling || knockoutFilter !== "none") {
if (reuseEntry) {
maskCtx.save();
maskCtx.setTransform(1, 0, 0, 1, 0, 0);
maskCtx.clearRect(0, 0, width, height);
maskCtx.restore();
}
maskCtx.filter = knockoutFilter;
maskCtx.drawImage(sourceCanvas, 0, 0);
maskCtx.filter = "none";
return maskEntry;
}
const sourceData = sourceCanvas.getContext("2d", {
willReadFrequently: true
}).getImageData(0, 0, width, height);
const maskData = maskCtx.createImageData(width, height);
const sourcePixels = sourceData.data,
maskPixels = maskData.data;
const alphaScale = alpha > 0 ? 1 / alpha : 1e6;
for (let i = 3, ii = sourcePixels.length; i < ii; i += 4) {
maskPixels[i] = Math.min(Math.round(sourcePixels[i] * alphaScale), 255);
}
maskCtx.putImageData(maskData, 0, 0);
return maskEntry;
}
function _getOrCreatePooledEntry(meta, key, width, height) {
let entry = meta?.[key] ?? null;
if (entry && (entry.canvas.width !== width || entry.canvas.height !== height)) {
this.canvasFactory.destroy(entry);
entry = null;
}
if (!entry) {
entry = this.canvasFactory.create(width, height);
if (meta) {
meta[key] = entry;
}
return entry;
}
const ctx = entry.context;
ctx.save();
ctx.setTransform(1, 0, 0, 1, 0, 0);
ctx.clearRect(0, 0, width, height);
ctx.restore();
return entry;
}
function _compositeKnockoutSurface(destCtx, surfaceCanvas, options = {}) {
const {
backdropCanvas = null,
destTransform = [1, 0, 0, 1, 0, 0],
backdropOffset = [0, 0],
reuseMaskEntry = null,
poolMeta = null,
sourceAlpha = 1,
sourceFilter = "none",
knockoutAlpha = 1
} = options;
const {
width,
height
} = surfaceCanvas;
const knockoutMaskEntry = canvas_assertClassBrand(_CanvasGraphics_brand, this, _createKnockoutMaskCanvas).call(this, surfaceCanvas, reuseMaskEntry, knockoutAlpha);
const sourceCompositeOperation = destCtx.globalCompositeOperation;
destCtx.save();
destCtx.setTransform(...destTransform);
destCtx.globalAlpha = 1;
if (FeatureTest.isCanvasFilterSupported) {
destCtx.filter = "none";
}
destCtx.globalCompositeOperation = "destination-out";
destCtx.drawImage(knockoutMaskEntry.canvas, 0, 0);
if (backdropCanvas) {
const [bx, by] = backdropOffset;
const backdropEntry = canvas_assertClassBrand(_CanvasGraphics_brand, this, _getOrCreatePooledEntry).call(this, poolMeta, "knockoutBackdropEntry", width, height);
const backdropCtx = backdropEntry.context;
backdropCtx.drawImage(backdropCanvas, bx, by, width, height, 0, 0, width, height);
backdropCtx.globalCompositeOperation = "destination-in";
backdropCtx.drawImage(knockoutMaskEntry.canvas, 0, 0);
backdropCtx.globalCompositeOperation = "source-over";
destCtx.globalCompositeOperation = "destination-over";
destCtx.drawImage(backdropEntry.canvas, 0, 0);
if (!poolMeta) {
this.canvasFactory.destroy(backdropEntry);
}
}
destCtx.globalCompositeOperation = sourceCompositeOperation;
destCtx.globalAlpha = sourceAlpha;
if (FeatureTest.isCanvasFilterSupported) {
destCtx.filter = sourceFilter ?? "none";
}
destCtx.drawImage(surfaceCanvas, 0, 0);
destCtx.restore();
if (!reuseMaskEntry) {
this.canvasFactory.destroy(knockoutMaskEntry);
}
}
function _beginKnockoutElement(alpha = 1) {
var _this$knockoutElement, _this$knockoutElement2;
if (canvas_classPrivateFieldGet(_knockoutGroupLevel, this) === 0 || canvas_classPrivateFieldGet(_knockoutElementDepth, this) > 0 || !this.contentVisible) {
return false;
}
canvas_classPrivateFieldSet(_knockoutElementDepth, this, (_this$knockoutElement = canvas_classPrivateFieldGet(_knockoutElementDepth, this), _this$knockoutElement2 = _this$knockoutElement++, _this$knockoutElement)), _this$knockoutElement2;
canvas_classPrivateFieldSet(_knockoutElementAlpha, this, alpha);
const groupMeta = canvas_classPrivateFieldGet(_groupStackMeta, this).at(-1);
const {
canvas
} = this.ctx;
const tempEntry = canvas_assertClassBrand(_CanvasGraphics_brand, this, _getOrCreatePooledEntry).call(this, groupMeta, "knockoutTempEntry", canvas.width, canvas.height);
canvas_classPrivateFieldSet(_knockoutTempCanvasEntry, this, tempEntry);
const tempCtx = tempEntry.context;
tempCtx.save();
tempCtx.setTransform(this.ctx.getTransform());
copyCtxState(this.ctx, tempCtx);
canvas_classPrivateFieldSet(_knockoutSavedGCO, this, tempCtx.globalCompositeOperation);
tempCtx.globalCompositeOperation = "source-over";
mirrorContextOperations(tempCtx, this.ctx);
canvas_classPrivateFieldSet(_knockoutElementGroupMeta, this, groupMeta);
canvas_classPrivateFieldSet(_knockoutSavedCtx, this, this.ctx);
canvas_classPrivateFieldSet(_knockoutSavedSMaskCtx, this, this.suspendedCtx);
this.ctx = tempCtx;
if (this.inSMaskMode) {
this.suspendedCtx = tempCtx;
}
return true;
}
function _endKnockoutElement(started) {
if (!started) {
return;
}
const tempEntry = canvas_classPrivateFieldGet(_knockoutTempCanvasEntry, this);
const savedCtx = canvas_classPrivateFieldGet(_knockoutSavedCtx, this);
const savedSMaskCtx = canvas_classPrivateFieldGet(_knockoutSavedSMaskCtx, this);
const tempCtx = tempEntry.context;
canvas_classPrivateFieldSet(_knockoutTempCanvasEntry, this, null);
canvas_classPrivateFieldSet(_knockoutSavedCtx, this, null);
canvas_classPrivateFieldSet(_knockoutSavedSMaskCtx, this, null);
if (this.inSMaskMode && this.suspendedCtx === tempCtx && this.ctx !== tempCtx) {
this.endSMaskMode();
}
if (this.inSMaskMode) {
this.suspendedCtx = savedSMaskCtx;
}
this.ctx._removeMirroring();
this.ctx.globalCompositeOperation = canvas_classPrivateFieldGet(_knockoutSavedGCO, this);
canvas_classPrivateFieldSet(_knockoutSavedGCO, this, null);
copyCtxState(this.ctx, savedCtx);
this.ctx = savedCtx;
const groupMeta = canvas_classPrivateFieldGet(_knockoutElementGroupMeta, this);
canvas_classPrivateFieldSet(_knockoutElementGroupMeta, this, null);
const knockoutAlpha = canvas_classPrivateFieldGet(_knockoutElementAlpha, this);
canvas_classPrivateFieldSet(_knockoutElementAlpha, this, 1);
try {
canvas_assertClassBrand(_CanvasGraphics_brand, this, _compositeKnockoutSurface).call(this, savedSMaskCtx ?? savedCtx, tempEntry.canvas, {
backdropCanvas: groupMeta?.backdropCtx?.canvas ?? null,
backdropOffset: groupMeta?.backdropCtx ? [groupMeta.offsetX, groupMeta.offsetY] : [0, 0],
reuseMaskEntry: groupMeta?.knockoutMaskEntry ?? null,
poolMeta: groupMeta,
knockoutAlpha
});
} finally {
var _this$knockoutElement3, _this$knockoutElement4;
tempCtx.restore();
canvas_classPrivateFieldSet(_knockoutElementDepth, this, (_this$knockoutElement3 = canvas_classPrivateFieldGet(_knockoutElementDepth, this), _this$knockoutElement4 = _this$knockoutElement3--, _this$knockoutElement3)), _this$knockoutElement4;
if (!groupMeta) {
this.canvasFactory.destroy(tempEntry);
}
}
}
function _getScaledPath(path, currentTransform, transform) {
const newPath = new Path2D();
newPath.addPath(path, new DOMMatrix(transform).invertSelf().multiplySelf(currentTransform));
return newPath;
}
function _getTextPattern(color, pathType, opIdx) {
const ctx = this.ctx;
ctx.save();
const pattern = color.getPattern(ctx, this, getCurrentTransformInverse(ctx), pathType, opIdx);
const transform = getCurrentTransform(ctx);
ctx.restore();
return [pattern, transform];
}
function _transferColor(color) {
return this.current.transferMapsFallback?.applyToColor(color) ?? color;
}
function _convertGroupToGray(groupCtx) {
const {
canvas
} = groupCtx;
const {
width,
height
} = canvas;
if (FeatureTest.isCanvasFilterSupported) {
groupCtx.save();
groupCtx.setTransform(1, 0, 0, 1, 0, 0);
groupCtx.filter = "grayscale(1)";
groupCtx.globalAlpha = 1;
groupCtx.globalCompositeOperation = "copy";
groupCtx.drawImage(canvas, 0, 0);
groupCtx.restore();
return;
}
const imageData = groupCtx.getImageData(0, 0, width, height);
const {
data
} = imageData;
for (let i = 0, ii = data.length; i < ii; i += 4) {
const gray = data[i] * 0.2126 + data[i + 1] * 0.7152 + data[i + 2] * 0.0722 + 0.5 | 0;
data[i] = data[i + 1] = data[i + 2] = gray;
}
groupCtx.putImageData(imageData, 0, 0);
}
function _destroyKnockoutPools(groupMeta) {
if (!groupMeta) {
return;
}
if (groupMeta.knockoutMaskEntry) {
this.canvasFactory.destroy(groupMeta.knockoutMaskEntry);
groupMeta.knockoutMaskEntry = null;
}
if (groupMeta.knockoutTempEntry) {
this.canvasFactory.destroy(groupMeta.knockoutTempEntry);
groupMeta.knockoutTempEntry = null;
}
if (groupMeta.knockoutBackdropEntry) {
this.canvasFactory.destroy(groupMeta.knockoutBackdropEntry);
groupMeta.knockoutBackdropEntry = null;
}
}
var _SCALE_MATRIX = {
_: null
};
var _pathCaches = {
_: new WeakMap()
};
for (const op in OPS) {
if (CanvasGraphics.prototype[op] !== undefined) {
CanvasGraphics.prototype[OPS[op]] = CanvasGraphics.prototype[op];
}
}
;// ./node_modules/core-js/modules/web.dom-exception.stack.js
web_dom_exception_stack_namespaceFn();
;// ./src/shared/css_utils.js
const CONTROL_CHAR_REGEXP = /\p{Cc}/u;
function isCSSString(str) {
const quote = str[0];
if (str.length < 2 || quote !== `"` && quote !== `'` || str.at(-1) !== quote) {
return false;
}
const end = str.length - 1;
for (let i = 1; i < end; i++) {
const char = str[i];
if (char === quote || CONTROL_CHAR_REGEXP.test(char)) {
return false;
}
if (char === "\\") {
if (++i >= end || CONTROL_CHAR_REGEXP.test(str[i])) {
return false;
}
}
}
return true;
}
function serializeFontFamily(fontFamily) {
if (isCSSString(fontFamily)) {
return fontFamily;
}
const escaped = fontFamily.replaceAll(/["\\\p{Cc}]/gu, char => char === `"` || char === "\\" ? `\\${char}` : `\\${char.codePointAt(0).toString(16)} `);
return `"${escaped}"`;
}
;// ./src/display/font_loader.js
function font_loader_classPrivateMethodInitSpec(e, a) { font_loader_checkPrivateRedeclaration(e, a), a.add(e); }
function font_loader_classPrivateFieldInitSpec(e, t, a) { font_loader_checkPrivateRedeclaration(e, t), t.set(e, a); }
function font_loader_checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
function font_loader_classPrivateFieldSet(s, a, r) { return s.set(font_loader_assertClassBrand(s, a), r), r; }
function font_loader_classPrivateFieldGet(s, a) { return s.get(font_loader_assertClassBrand(s, a)); }
function font_loader_assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
;
var _nativeFontFaces = /*#__PURE__*/new WeakMap();
var _systemFonts = /*#__PURE__*/new WeakMap();
var _styleSheet = /*#__PURE__*/new WeakMap();
var _FontLoader_brand = /*#__PURE__*/new WeakSet();
class FontLoader {
constructor({
ownerDocument = globalThis.document,
styleElement = null
}) {
font_loader_classPrivateMethodInitSpec(this, _FontLoader_brand);
font_loader_classPrivateFieldInitSpec(this, _nativeFontFaces, new Set());
font_loader_classPrivateFieldInitSpec(this, _systemFonts, new Set());
font_loader_classPrivateFieldInitSpec(this, _styleSheet, null);
this._document = ownerDocument;
this.styleElement = null;
}
addNativeFontFace(nativeFontFace) {
font_loader_classPrivateFieldGet(_nativeFontFaces, this).add(nativeFontFace);
this._document.fonts.add(nativeFontFace);
}
removeNativeFontFace(nativeFontFace) {
font_loader_classPrivateFieldGet(_nativeFontFaces, this).delete(nativeFontFace);
this._document.fonts.delete(nativeFontFace);
}
insertRule(rule) {
throw new Error("Not implemented: insertRule");
}
clear() {
for (const nativeFontFace of font_loader_classPrivateFieldGet(_nativeFontFaces, this)) {
this._document.fonts.delete(nativeFontFace);
}
font_loader_classPrivateFieldGet(_nativeFontFaces, this).clear();
font_loader_classPrivateFieldGet(_systemFonts, this).clear();
}
async loadSystemFont({
systemFontInfo: info,
disableFontFace,
_inspectFont
}) {
if (!info || font_loader_classPrivateFieldGet(_systemFonts, this).has(info.loadedName)) {
return;
}
assert(!disableFontFace, "loadSystemFont shouldn't be called when `disableFontFace` is set.");
if (this.isFontLoadingAPISupported) {
const {
loadedName,
src,
style
} = info;
const fontFace = new FontFace(loadedName, src, style);
this.addNativeFontFace(fontFace);
try {
await fontFace.load();
font_loader_classPrivateFieldGet(_systemFonts, this).add(loadedName);
_inspectFont?.(info);
} catch {
warn(`Cannot load system font: ${info.baseFontName}, installing it could help to improve PDF rendering.`);
this.removeNativeFontFace(fontFace);
}
return;
}
unreachable("Not implemented: loadSystemFont without the Font Loading API.");
}
async bind(font) {
if (font.attached || font.missingFile && !font.systemFontInfo) {
return;
}
font.attached = true;
if (font.systemFontInfo) {
await this.loadSystemFont(font);
return;
}
if (this.isFontLoadingAPISupported) {
const nativeFontFace = font.createNativeFontFace();
if (nativeFontFace) {
this.addNativeFontFace(nativeFontFace);
try {
await nativeFontFace.loaded;
} catch (ex) {
warn(`Failed to load font '${nativeFontFace.family}': '${ex}'.`);
font.disableFontFace = true;
throw ex;
}
}
return;
}
throw new Error("Not implemented: DOM font loading");
}
get isFontLoadingAPISupported() {
return util_shadow(this, "isFontLoadingAPISupported", !!this._document?.fonts);
}
get isSyncFontLoadingSupported() {
return util_shadow(this, "isSyncFontLoadingSupported", isNodeJS || FeatureTest.platform.isFirefox);
}
}
var _compiledPaths = /*#__PURE__*/new WeakMap();
var _fontData = /*#__PURE__*/new WeakMap();
class FontFaceObject {
constructor(translatedData, inspectFont = null, charProcOperatorList, extra) {
font_loader_classPrivateFieldInitSpec(this, _compiledPaths, new Map());
font_loader_classPrivateFieldInitSpec(this, _fontData, void 0);
font_loader_classPrivateFieldSet(_fontData, this, translatedData);
this._inspectFont = inspectFont;
if (charProcOperatorList) {
this.charProcOperatorList = charProcOperatorList;
}
if (extra) {
Object.assign(this, extra);
}
}
createNativeFontFace() {
const {
data
} = this;
if (!data || this.disableFontFace) {
return null;
}
let nativeFontFace;
if (!this.cssFontInfo) {
nativeFontFace = new FontFace(this.loadedName, data, {});
} else {
const css = {
weight: this.cssFontInfo.fontWeight
};
if (this.cssFontInfo.italicAngle) {
css.style = `oblique ${this.cssFontInfo.italicAngle}deg`;
}
nativeFontFace = new FontFace(serializeFontFamily(this.cssFontInfo.fontFamily), data, css);
}
this._inspectFont?.(this);
return nativeFontFace;
}
createFontFaceRule() {
throw new Error("Not implemented: createFontFaceRule");
}
getPathGenerator(objs, character) {
let path = font_loader_classPrivateFieldGet(_compiledPaths, this).get(character);
if (path) {
return path;
}
const objId = `${this.loadedName}_path_${character}`;
let cmds;
try {
cmds = objs.get(objId);
} catch (ex) {
warn(`getPathGenerator - ignoring character: "${ex}".`);
}
path = makePathFromDrawOPS(cmds?.path);
if (!this.fontExtraProperties) {
objs.delete(objId);
}
font_loader_classPrivateFieldGet(_compiledPaths, this).set(character, path);
return path;
}
get black() {
return font_loader_classPrivateFieldGet(_fontData, this).black;
}
get bold() {
return font_loader_classPrivateFieldGet(_fontData, this).bold;
}
get disableFontFace() {
return font_loader_classPrivateFieldGet(_fontData, this).disableFontFace;
}
set disableFontFace(value) {
util_shadow(this, "disableFontFace", !!value);
}
get fontExtraProperties() {
return font_loader_classPrivateFieldGet(_fontData, this).fontExtraProperties;
}
get isInvalidPDFjsFont() {
return font_loader_classPrivateFieldGet(_fontData, this).isInvalidPDFjsFont;
}
get isType3Font() {
return font_loader_classPrivateFieldGet(_fontData, this).isType3Font;
}
get italic() {
return font_loader_classPrivateFieldGet(_fontData, this).italic;
}
get missingFile() {
return font_loader_classPrivateFieldGet(_fontData, this).missingFile;
}
get remeasure() {
return font_loader_classPrivateFieldGet(_fontData, this).remeasure;
}
get vertical() {
return font_loader_classPrivateFieldGet(_fontData, this).vertical;
}
get bbox() {
return font_loader_classPrivateFieldGet(_fontData, this).bbox;
}
get fontMatrix() {
return font_loader_classPrivateFieldGet(_fontData, this).fontMatrix;
}
get fallbackName() {
return font_loader_classPrivateFieldGet(_fontData, this).fallbackName;
}
get loadedName() {
return font_loader_classPrivateFieldGet(_fontData, this).loadedName;
}
get mimetype() {
return this.missingFile ? null : "font/opentype";
}
get data() {
return font_loader_classPrivateFieldGet(_fontData, this).data;
}
clearData() {
font_loader_classPrivateFieldGet(_fontData, this).clearData();
}
get cssFontInfo() {
return font_loader_classPrivateFieldGet(_fontData, this).cssFontInfo;
}
get systemFontInfo() {
return font_loader_classPrivateFieldGet(_fontData, this).systemFontInfo;
}
}
;// ./node_modules/core-js/modules/es.promise.try.js
es_promise_try_namespaceFn();
;// ./src/shared/message_handler.js
function message_handler_classPrivateMethodInitSpec(e, a) { message_handler_checkPrivateRedeclaration(e, a), a.add(e); }
function message_handler_classPrivateFieldInitSpec(e, t, a) { message_handler_checkPrivateRedeclaration(e, t), t.set(e, a); }
function message_handler_checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
function message_handler_classPrivateFieldGet(s, a) { return s.get(message_handler_assertClassBrand(s, a)); }
function message_handler_classPrivateFieldSet(s, a, r) { return s.set(message_handler_assertClassBrand(s, a), r), r; }
function message_handler_assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
;
const CallbackKind = {
DATA: 1,
ERROR: 2
};
const StreamKind = {
CANCEL: 1,
CANCEL_COMPLETE: 2,
CLOSE: 3,
ENQUEUE: 4,
ERROR: 5,
PULL: 6,
PULL_COMPLETE: 7,
START_COMPLETE: 8
};
function onFn() {}
function wrapReason(ex) {
if (ex instanceof AbortException || ex instanceof InvalidPDFException || ex instanceof PasswordException || ex instanceof ResponseException || ex instanceof UnknownErrorException) {
return ex;
}
if (typeof ex !== "object" || ex === null) {
return new UnknownErrorException(String(ex), String(ex));
}
switch (ex.name) {
case "AbortException":
return new AbortException(ex.message);
case "InvalidPDFException":
return new InvalidPDFException(ex.message);
case "PasswordException":
return new PasswordException(ex.message, ex.code);
case "ResponseException":
return new ResponseException(ex.message, ex.status, ex.missing);
case "UnknownErrorException":
return new UnknownErrorException(ex.message, ex.details);
}
return new UnknownErrorException(ex.message, ex.toString());
}
var _actions = /*#__PURE__*/new WeakMap();
var _callbackCapabilities = /*#__PURE__*/new WeakMap();
var _callbackId = /*#__PURE__*/new WeakMap();
var _comObj = /*#__PURE__*/new WeakMap();
var _messageAC = /*#__PURE__*/new WeakMap();
var _sourceName = /*#__PURE__*/new WeakMap();
var _streamControllers = /*#__PURE__*/new WeakMap();
var _streamId = /*#__PURE__*/new WeakMap();
var _streamSinks = /*#__PURE__*/new WeakMap();
var _targetName = /*#__PURE__*/new WeakMap();
var _MessageHandler_brand = /*#__PURE__*/new WeakSet();
class MessageHandler {
constructor(_sourceName2, _targetName2, _comObj2) {
message_handler_classPrivateMethodInitSpec(this, _MessageHandler_brand);
message_handler_classPrivateFieldInitSpec(this, _actions, new Map());
message_handler_classPrivateFieldInitSpec(this, _callbackCapabilities, new Map());
message_handler_classPrivateFieldInitSpec(this, _callbackId, 1);
message_handler_classPrivateFieldInitSpec(this, _comObj, void 0);
message_handler_classPrivateFieldInitSpec(this, _messageAC, new AbortController());
message_handler_classPrivateFieldInitSpec(this, _sourceName, void 0);
message_handler_classPrivateFieldInitSpec(this, _streamControllers, new Map());
message_handler_classPrivateFieldInitSpec(this, _streamId, 1);
message_handler_classPrivateFieldInitSpec(this, _streamSinks, new Map());
message_handler_classPrivateFieldInitSpec(this, _targetName, void 0);
message_handler_classPrivateFieldSet(_sourceName, this, _sourceName2);
message_handler_classPrivateFieldSet(_targetName, this, _targetName2);
message_handler_classPrivateFieldSet(_comObj, this, _comObj2);
_comObj2.addEventListener("message", message_handler_assertClassBrand(_MessageHandler_brand, this, _onMessage).bind(this), {
signal: message_handler_classPrivateFieldGet(_messageAC, this).signal
});
}
on(actionName, handler) {
const ah = message_handler_classPrivateFieldGet(_actions, this);
if (ah.has(actionName)) {
throw new Error(`There is already a "${actionName}" handler.`);
}
ah.set(actionName, handler);
}
send(actionName, data, transfers) {
message_handler_classPrivateFieldGet(_comObj, this).postMessage({
sourceName: message_handler_classPrivateFieldGet(_sourceName, this),
targetName: message_handler_classPrivateFieldGet(_targetName, this),
action: actionName,
data
}, transfers);
}
sendWithPromise(actionName, data, transfers) {
var _this$callbackId, _this$callbackId2;
const callbackId = (message_handler_classPrivateFieldSet(_callbackId, this, (_this$callbackId = message_handler_classPrivateFieldGet(_callbackId, this), _this$callbackId2 = _this$callbackId++, _this$callbackId)), _this$callbackId2),
capability = Promise.withResolvers();
message_handler_classPrivateFieldGet(_callbackCapabilities, this).set(callbackId, capability);
try {
message_handler_classPrivateFieldGet(_comObj, this).postMessage({
sourceName: message_handler_classPrivateFieldGet(_sourceName, this),
targetName: message_handler_classPrivateFieldGet(_targetName, this),
action: actionName,
callbackId,
data
}, transfers);
} catch (ex) {
capability.reject(ex);
}
return capability.promise;
}
sendWithStream(actionName, data, queueingStrategy, transfers) {
var _this$streamId, _this$streamId2;
const streamId = (message_handler_classPrivateFieldSet(_streamId, this, (_this$streamId = message_handler_classPrivateFieldGet(_streamId, this), _this$streamId2 = _this$streamId++, _this$streamId)), _this$streamId2),
sourceName = message_handler_classPrivateFieldGet(_sourceName, this),
targetName = message_handler_classPrivateFieldGet(_targetName, this),
comObj = message_handler_classPrivateFieldGet(_comObj, this);
return new ReadableStream({
start: controller => {
const startCapability = Promise.withResolvers();
message_handler_classPrivateFieldGet(_streamControllers, this).set(streamId, {
controller,
startCall: startCapability,
pullCall: null,
cancelCall: null,
isClosed: false
});
comObj.postMessage({
sourceName,
targetName,
action: actionName,
streamId,
data,
desiredSize: controller.desiredSize
}, transfers);
return startCapability.promise;
},
pull: controller => {
const pullCapability = Promise.withResolvers();
message_handler_classPrivateFieldGet(_streamControllers, this).get(streamId).pullCall = pullCapability;
comObj.postMessage({
sourceName,
targetName,
stream: StreamKind.PULL,
streamId,
desiredSize: controller.desiredSize
});
return pullCapability.promise;
},
cancel: reason => {
assert(reason instanceof Error, "cancel must have a valid reason");
const cancelCapability = Promise.withResolvers();
message_handler_classPrivateFieldGet(_streamControllers, this).get(streamId).cancelCall = cancelCapability;
message_handler_classPrivateFieldGet(_streamControllers, this).get(streamId).isClosed = true;
comObj.postMessage({
sourceName,
targetName,
stream: StreamKind.CANCEL,
streamId,
reason: wrapReason(reason)
});
return cancelCapability.promise;
}
}, queueingStrategy);
}
destroy() {
message_handler_classPrivateFieldGet(_messageAC, this)?.abort();
message_handler_classPrivateFieldSet(_messageAC, this, null);
}
get destroyed() {
return !message_handler_classPrivateFieldGet(_messageAC, this);
}
}
function _onMessage({
data
}) {
if (data.targetName !== message_handler_classPrivateFieldGet(_sourceName, this)) {
return;
}
if (data.stream) {
message_handler_assertClassBrand(_MessageHandler_brand, this, _processStreamMessage).call(this, data);
return;
}
if (data.callback) {
const {
callbackId,
callback
} = data;
const capability = message_handler_classPrivateFieldGet(_callbackCapabilities, this).get(callbackId);
if (!capability) {
throw new Error(`Cannot resolve callback ${callbackId}`);
}
message_handler_classPrivateFieldGet(_callbackCapabilities, this).delete(callbackId);
if (callback === CallbackKind.DATA) {
capability.resolve(data.data);
} else if (callback === CallbackKind.ERROR) {
capability.reject(wrapReason(data.reason));
} else {
throw new Error("Unexpected callback case");
}
return;
}
const action = message_handler_classPrivateFieldGet(_actions, this).get(data.action);
if (!action) {
throw new Error(`Unknown action from worker: ${data.action}`);
}
if (data.callbackId) {
const sourceName = message_handler_classPrivateFieldGet(_sourceName, this),
targetName = data.sourceName,
comObj = message_handler_classPrivateFieldGet(_comObj, this);
Promise.try(action, data.data).then(result => {
comObj.postMessage({
sourceName,
targetName,
callback: CallbackKind.DATA,
callbackId: data.callbackId,
data: result
});
}).catch(reason => {
comObj.postMessage({
sourceName,
targetName,
callback: CallbackKind.ERROR,
callbackId: data.callbackId,
reason: wrapReason(reason)
});
});
return;
}
if (data.streamId) {
message_handler_assertClassBrand(_MessageHandler_brand, this, _createStreamSink).call(this, data);
return;
}
action(data.data);
}
function _createStreamSink(data) {
const streamId = data.streamId,
sourceName = message_handler_classPrivateFieldGet(_sourceName, this),
targetName = data.sourceName,
comObj = message_handler_classPrivateFieldGet(_comObj, this);
const streamSinks = message_handler_classPrivateFieldGet(_streamSinks, this),
action = message_handler_classPrivateFieldGet(_actions, this).get(data.action);
const streamSink = {
enqueue(chunk, size = 1, transfers) {
if (this.isCancelled) {
return;
}
const lastDesiredSize = this.desiredSize;
this.desiredSize -= size;
if (lastDesiredSize > 0 && this.desiredSize <= 0) {
this.sinkCapability = Promise.withResolvers();
this.ready = this.sinkCapability.promise;
}
comObj.postMessage({
sourceName,
targetName,
stream: StreamKind.ENQUEUE,
streamId,
chunk
}, transfers);
},
close() {
if (this.isCancelled) {
return;
}
this.isCancelled = true;
comObj.postMessage({
sourceName,
targetName,
stream: StreamKind.CLOSE,
streamId
});
streamSinks.delete(streamId);
},
error(reason) {
if (this.isCancelled) {
return;
}
this.isCancelled = true;
comObj.postMessage({
sourceName,
targetName,
stream: StreamKind.ERROR,
streamId,
reason: wrapReason(reason)
});
},
sinkCapability: Promise.withResolvers(),
onPull: null,
onCancel: null,
isCancelled: false,
desiredSize: data.desiredSize,
ready: null
};
streamSink.sinkCapability.resolve();
streamSink.ready = streamSink.sinkCapability.promise;
streamSinks.set(streamId, streamSink);
Promise.try(action, data.data, streamSink).then(() => {
comObj.postMessage({
sourceName,
targetName,
stream: StreamKind.START_COMPLETE,
streamId,
success: true
});
}, reason => {
comObj.postMessage({
sourceName,
targetName,
stream: StreamKind.START_COMPLETE,
streamId,
reason: wrapReason(reason)
});
});
}
function _processStreamMessage(data) {
const streamId = data.streamId,
sourceName = message_handler_classPrivateFieldGet(_sourceName, this),
targetName = data.sourceName,
comObj = message_handler_classPrivateFieldGet(_comObj, this);
const streamController = message_handler_classPrivateFieldGet(_streamControllers, this).get(streamId),
streamSink = message_handler_classPrivateFieldGet(_streamSinks, this).get(streamId);
switch (data.stream) {
case StreamKind.START_COMPLETE:
if (data.success) {
streamController.startCall.resolve();
} else {
streamController.startCall.reject(wrapReason(data.reason));
}
break;
case StreamKind.PULL_COMPLETE:
if (data.success) {
streamController.pullCall.resolve();
} else {
streamController.pullCall.reject(wrapReason(data.reason));
}
break;
case StreamKind.PULL:
if (!streamSink) {
comObj.postMessage({
sourceName,
targetName,
stream: StreamKind.PULL_COMPLETE,
streamId,
success: true
});
break;
}
if (streamSink.desiredSize <= 0 && data.desiredSize > 0) {
streamSink.sinkCapability.resolve();
}
streamSink.desiredSize = data.desiredSize;
Promise.try(streamSink.onPull || onFn).then(() => {
comObj.postMessage({
sourceName,
targetName,
stream: StreamKind.PULL_COMPLETE,
streamId,
success: true
});
}, reason => {
comObj.postMessage({
sourceName,
targetName,
stream: StreamKind.PULL_COMPLETE,
streamId,
reason: wrapReason(reason)
});
});
break;
case StreamKind.ENQUEUE:
assert(streamController, "enqueue should have stream controller");
if (streamController.isClosed) {
break;
}
streamController.controller.enqueue(data.chunk);
break;
case StreamKind.CLOSE:
assert(streamController, "close should have stream controller");
if (streamController.isClosed) {
break;
}
streamController.isClosed = true;
streamController.controller.close();
message_handler_assertClassBrand(_MessageHandler_brand, this, _deleteStreamController).call(this, streamController, streamId);
break;
case StreamKind.ERROR:
assert(streamController, "error should have stream controller");
streamController.controller.error(wrapReason(data.reason));
message_handler_assertClassBrand(_MessageHandler_brand, this, _deleteStreamController).call(this, streamController, streamId);
break;
case StreamKind.CANCEL_COMPLETE:
if (data.success) {
streamController.cancelCall.resolve();
} else {
streamController.cancelCall.reject(wrapReason(data.reason));
}
message_handler_assertClassBrand(_MessageHandler_brand, this, _deleteStreamController).call(this, streamController, streamId);
break;
case StreamKind.CANCEL:
if (!streamSink) {
break;
}
const dataReason = wrapReason(data.reason);
Promise.try(streamSink.onCancel || onFn, dataReason).then(() => {
comObj.postMessage({
sourceName,
targetName,
stream: StreamKind.CANCEL_COMPLETE,
streamId,
success: true
});
}, reason => {
comObj.postMessage({
sourceName,
targetName,
stream: StreamKind.CANCEL_COMPLETE,
streamId,
reason: wrapReason(reason)
});
});
streamSink.sinkCapability.reject(dataReason);
streamSink.isCancelled = true;
message_handler_classPrivateFieldGet(_streamSinks, this).delete(streamId);
break;
default:
throw new Error("Unexpected stream case");
}
}
async function _deleteStreamController(streamController, streamId) {
await Promise.allSettled([streamController.startCall?.promise, streamController.pullCall?.promise, streamController.cancelCall?.promise]);
message_handler_classPrivateFieldGet(_streamControllers, this).delete(streamId);
}
;// ./src/shared/obj_bin_transform_utils.js
var _FONT_INFO;
function obj_bin_transform_utils_defineProperty(e, r, t) { return (r = obj_bin_transform_utils_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function obj_bin_transform_utils_toPropertyKey(t) { var i = obj_bin_transform_utils_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function obj_bin_transform_utils_toPrimitive(t, e) { if ("object" != typeof t || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); }
;
class CSS_FONT_INFO {}
obj_bin_transform_utils_defineProperty(CSS_FONT_INFO, "strings", ["fontFamily", "fontWeight", "italicAngle"]);
class SYSTEM_FONT_INFO {}
obj_bin_transform_utils_defineProperty(SYSTEM_FONT_INFO, "strings", ["css", "loadedName", "baseFontName", "src"]);
class FONT_INFO {}
_FONT_INFO = FONT_INFO;
obj_bin_transform_utils_defineProperty(FONT_INFO, "bools", ["black", "bold", "disableFontFace", "fontExtraProperties", "isInvalidPDFjsFont", "isType3Font", "italic", "missingFile", "remeasure", "vertical"]);
obj_bin_transform_utils_defineProperty(FONT_INFO, "strings", ["fallbackName", "loadedName"]);
obj_bin_transform_utils_defineProperty(FONT_INFO, "OFFSET_BBOX", Math.ceil(_FONT_INFO.bools.length * 2 / 8));
obj_bin_transform_utils_defineProperty(FONT_INFO, "OFFSET_FONT_MATRIX", _FONT_INFO.OFFSET_BBOX + 1 + 2 * 4);
obj_bin_transform_utils_defineProperty(FONT_INFO, "OFFSET_STRINGS", _FONT_INFO.OFFSET_FONT_MATRIX + 1 + 8 * 6);
class PATTERN_INFO {}
obj_bin_transform_utils_defineProperty(PATTERN_INFO, "KIND", 0);
obj_bin_transform_utils_defineProperty(PATTERN_INFO, "HAS_BBOX", 1);
obj_bin_transform_utils_defineProperty(PATTERN_INFO, "HAS_BACKGROUND", 2);
obj_bin_transform_utils_defineProperty(PATTERN_INFO, "SHADING_TYPE", 3);
obj_bin_transform_utils_defineProperty(PATTERN_INFO, "N_COORD", 4);
obj_bin_transform_utils_defineProperty(PATTERN_INFO, "N_COLOR", 8);
obj_bin_transform_utils_defineProperty(PATTERN_INFO, "N_STOP", 12);
obj_bin_transform_utils_defineProperty(PATTERN_INFO, "N_FIGURES", 16);
class InfoUtils {
static get decoder() {
return util_shadow(this, "decoder", new TextDecoder());
}
static get encoder() {
return util_shadow(this, "encoder", new TextEncoder());
}
}
;// ./src/display/obj_bin_transform_display.js
function obj_bin_transform_display_classPrivateMethodInitSpec(e, a) { obj_bin_transform_display_checkPrivateRedeclaration(e, a), a.add(e); }
function obj_bin_transform_display_classPrivateFieldInitSpec(e, t, a) { obj_bin_transform_display_checkPrivateRedeclaration(e, t), t.set(e, a); }
function obj_bin_transform_display_checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
function obj_bin_transform_display_classPrivateFieldGet(s, a) { return s.get(obj_bin_transform_display_assertClassBrand(s, a)); }
function obj_bin_transform_display_classPrivateFieldSet(s, a, r) { return s.set(obj_bin_transform_display_assertClassBrand(s, a), r), r; }
function obj_bin_transform_display_assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
;
function readString(buffer, view, index, offset = 0) {
const {
decoder
} = InfoUtils;
for (let i = 0; i < index; i++) {
offset += view.getUint32(offset) + 4;
}
const length = view.getUint32(offset);
return decoder.decode(new Uint8Array(buffer, offset + 4, length));
}
var _buffer = /*#__PURE__*/new WeakMap();
var _view = /*#__PURE__*/new WeakMap();
var _CssFontInfo_brand = /*#__PURE__*/new WeakSet();
class CssFontInfo {
constructor(buffer) {
obj_bin_transform_display_classPrivateMethodInitSpec(this, _CssFontInfo_brand);
obj_bin_transform_display_classPrivateFieldInitSpec(this, _buffer, void 0);
obj_bin_transform_display_classPrivateFieldInitSpec(this, _view, void 0);
obj_bin_transform_display_classPrivateFieldSet(_buffer, this, buffer);
obj_bin_transform_display_classPrivateFieldSet(_view, this, new DataView(buffer));
}
get fontFamily() {
return util_shadow(this, "fontFamily", obj_bin_transform_display_assertClassBrand(_CssFontInfo_brand, this, _readString).call(this, 0));
}
get fontWeight() {
return util_shadow(this, "fontWeight", obj_bin_transform_display_assertClassBrand(_CssFontInfo_brand, this, _readString).call(this, 1));
}
get italicAngle() {
return util_shadow(this, "italicAngle", obj_bin_transform_display_assertClassBrand(_CssFontInfo_brand, this, _readString).call(this, 2));
}
}
function _readString(index) {
assert(index < CSS_FONT_INFO.strings.length, "Invalid string index");
return readString(obj_bin_transform_display_classPrivateFieldGet(_buffer, this), obj_bin_transform_display_classPrivateFieldGet(_view, this), index);
}
var _buffer2 = /*#__PURE__*/new WeakMap();
var _view2 = /*#__PURE__*/new WeakMap();
var _SystemFontInfo_brand = /*#__PURE__*/new WeakSet();
class SystemFontInfo {
constructor(buffer) {
obj_bin_transform_display_classPrivateMethodInitSpec(this, _SystemFontInfo_brand);
obj_bin_transform_display_classPrivateFieldInitSpec(this, _buffer2, void 0);
obj_bin_transform_display_classPrivateFieldInitSpec(this, _view2, void 0);
obj_bin_transform_display_classPrivateFieldSet(_buffer2, this, buffer);
obj_bin_transform_display_classPrivateFieldSet(_view2, this, new DataView(buffer));
}
get css() {
return util_shadow(this, "css", obj_bin_transform_display_assertClassBrand(_SystemFontInfo_brand, this, _readString2).call(this, 0));
}
get loadedName() {
return util_shadow(this, "loadedName", obj_bin_transform_display_assertClassBrand(_SystemFontInfo_brand, this, _readString2).call(this, 1));
}
get baseFontName() {
return util_shadow(this, "baseFontName", obj_bin_transform_display_assertClassBrand(_SystemFontInfo_brand, this, _readString2).call(this, 2));
}
get src() {
return util_shadow(this, "src", obj_bin_transform_display_assertClassBrand(_SystemFontInfo_brand, this, _readString2).call(this, 3));
}
get style() {
let offset = 0;
offset += 4 + obj_bin_transform_display_classPrivateFieldGet(_view2, this).getUint32(offset);
const style = readString(obj_bin_transform_display_classPrivateFieldGet(_buffer2, this), obj_bin_transform_display_classPrivateFieldGet(_view2, this), 0, offset),
weight = readString(obj_bin_transform_display_classPrivateFieldGet(_buffer2, this), obj_bin_transform_display_classPrivateFieldGet(_view2, this), 1, offset);
return util_shadow(this, "style", {
style,
weight
});
}
}
function _readString2(index) {
assert(index < SYSTEM_FONT_INFO.strings.length, "Invalid string index");
return readString(obj_bin_transform_display_classPrivateFieldGet(_buffer2, this), obj_bin_transform_display_classPrivateFieldGet(_view2, this), index, 4);
}
var _buffer3 = /*#__PURE__*/new WeakMap();
var _view3 = /*#__PURE__*/new WeakMap();
var _FontInfo_brand = /*#__PURE__*/new WeakSet();
class FontInfo {
constructor(buffer) {
obj_bin_transform_display_classPrivateMethodInitSpec(this, _FontInfo_brand);
obj_bin_transform_display_classPrivateFieldInitSpec(this, _buffer3, void 0);
obj_bin_transform_display_classPrivateFieldInitSpec(this, _view3, void 0);
obj_bin_transform_display_classPrivateFieldSet(_buffer3, this, buffer);
obj_bin_transform_display_classPrivateFieldSet(_view3, this, new DataView(buffer));
}
get black() {
return util_shadow(this, "black", obj_bin_transform_display_assertClassBrand(_FontInfo_brand, this, _readBoolean).call(this, 0));
}
get bold() {
return util_shadow(this, "bold", obj_bin_transform_display_assertClassBrand(_FontInfo_brand, this, _readBoolean).call(this, 1));
}
get disableFontFace() {
return util_shadow(this, "disableFontFace", obj_bin_transform_display_assertClassBrand(_FontInfo_brand, this, _readBoolean).call(this, 2));
}
get fontExtraProperties() {
return util_shadow(this, "fontExtraProperties", obj_bin_transform_display_assertClassBrand(_FontInfo_brand, this, _readBoolean).call(this, 3));
}
get isInvalidPDFjsFont() {
return util_shadow(this, "isInvalidPDFjsFont", obj_bin_transform_display_assertClassBrand(_FontInfo_brand, this, _readBoolean).call(this, 4));
}
get isType3Font() {
return util_shadow(this, "isType3Font", obj_bin_transform_display_assertClassBrand(_FontInfo_brand, this, _readBoolean).call(this, 5));
}
get italic() {
return util_shadow(this, "italic", obj_bin_transform_display_assertClassBrand(_FontInfo_brand, this, _readBoolean).call(this, 6));
}
get missingFile() {
return util_shadow(this, "missingFile", obj_bin_transform_display_assertClassBrand(_FontInfo_brand, this, _readBoolean).call(this, 7));
}
get remeasure() {
return util_shadow(this, "remeasure", obj_bin_transform_display_assertClassBrand(_FontInfo_brand, this, _readBoolean).call(this, 8));
}
get vertical() {
return util_shadow(this, "vertical", obj_bin_transform_display_assertClassBrand(_FontInfo_brand, this, _readBoolean).call(this, 9));
}
get bbox() {
return util_shadow(this, "bbox", obj_bin_transform_display_assertClassBrand(_FontInfo_brand, this, _readArray).call(this, FONT_INFO.OFFSET_BBOX, 4, "getInt16", 2));
}
get fontMatrix() {
return util_shadow(this, "fontMatrix", obj_bin_transform_display_assertClassBrand(_FontInfo_brand, this, _readArray).call(this, FONT_INFO.OFFSET_FONT_MATRIX, 6, "getFloat64", 8));
}
get fallbackName() {
return util_shadow(this, "fallbackName", obj_bin_transform_display_assertClassBrand(_FontInfo_brand, this, _readString3).call(this, 0));
}
get loadedName() {
return util_shadow(this, "loadedName", obj_bin_transform_display_assertClassBrand(_FontInfo_brand, this, _readString3).call(this, 1));
}
get data() {
const {
offset,
length
} = obj_bin_transform_display_assertClassBrand(_FontInfo_brand, this, _getBufferOffset).call(this, 2);
return !length ? undefined : new Uint8Array(obj_bin_transform_display_classPrivateFieldGet(_buffer3, this), offset + 4, length);
}
clearData() {
const {
offset,
length
} = obj_bin_transform_display_assertClassBrand(_FontInfo_brand, this, _getBufferOffset).call(this, 2);
if (!length) {
return;
}
obj_bin_transform_display_classPrivateFieldGet(_view3, this).setUint32(offset, 0);
obj_bin_transform_display_classPrivateFieldSet(_buffer3, this, new Uint8Array(obj_bin_transform_display_classPrivateFieldGet(_buffer3, this), 0, offset + 4).slice().buffer);
obj_bin_transform_display_classPrivateFieldSet(_view3, this, new DataView(obj_bin_transform_display_classPrivateFieldGet(_buffer3, this)));
}
get cssFontInfo() {
const {
offset,
length
} = obj_bin_transform_display_assertClassBrand(_FontInfo_brand, this, _getBufferOffset).call(this, 1);
let info = null;
if (length) {
const data = new Uint8Array(obj_bin_transform_display_classPrivateFieldGet(_buffer3, this), offset + 4, length).slice();
info = new CssFontInfo(data.buffer);
}
return util_shadow(this, "cssFontInfo", info);
}
get systemFontInfo() {
const {
offset,
length
} = obj_bin_transform_display_assertClassBrand(_FontInfo_brand, this, _getBufferOffset).call(this, 0);
let info = null;
if (length) {
const data = new Uint8Array(obj_bin_transform_display_classPrivateFieldGet(_buffer3, this), offset + 4, length).slice();
info = new SystemFontInfo(data.buffer);
}
return util_shadow(this, "systemFontInfo", info);
}
}
function _readBoolean(index) {
assert(index < FONT_INFO.bools.length, "Invalid boolean index");
const byteOffset = Math.floor(index / 4);
const bitOffset = index * 2 % 8;
const value = obj_bin_transform_display_classPrivateFieldGet(_view3, this).getUint8(byteOffset) >> bitOffset & 0x03;
return value === 0x00 ? undefined : value === 0x02;
}
function _readArray(offset, arrLen, lookupName, increment) {
const len = obj_bin_transform_display_classPrivateFieldGet(_view3, this).getUint8(offset++);
if (len === 0) {
return undefined;
}
assert(len === arrLen, "Invalid array length.");
const arr = new Array(len);
for (let i = 0; i < len; i++) {
arr[i] = obj_bin_transform_display_classPrivateFieldGet(_view3, this)[lookupName](offset, true);
offset += increment;
}
return arr;
}
function _readString3(index) {
assert(index < FONT_INFO.strings.length, "Invalid string index");
return readString(obj_bin_transform_display_classPrivateFieldGet(_buffer3, this), obj_bin_transform_display_classPrivateFieldGet(_view3, this), index, FONT_INFO.OFFSET_STRINGS + 4);
}
function _getBufferOffset(index) {
let offset = FONT_INFO.OFFSET_STRINGS;
for (let i = 0; i <= index; i++) {
offset += 4 + obj_bin_transform_display_classPrivateFieldGet(_view3, this).getUint32(offset);
}
const length = obj_bin_transform_display_classPrivateFieldGet(_view3, this).getUint32(offset);
return {
offset,
length
};
}
class PatternInfo {
constructor(buffer) {
this.buffer = buffer;
this.view = new DataView(buffer);
this.data = new Uint8Array(buffer);
}
getIR() {
const dataView = this.view;
const kind = this.data[PATTERN_INFO.KIND];
const hasBBox = !!this.data[PATTERN_INFO.HAS_BBOX];
const hasBackground = !!this.data[PATTERN_INFO.HAS_BACKGROUND];
const nCoord = dataView.getUint32(PATTERN_INFO.N_COORD, true);
const nColor = dataView.getUint32(PATTERN_INFO.N_COLOR, true);
const nStop = dataView.getUint32(PATTERN_INFO.N_STOP, true);
let offset = 20;
const coords = new Float32Array(this.buffer, offset, nCoord * 2);
offset += nCoord * 8;
const colors = new Uint8Array(this.buffer, offset, nColor * 4);
offset += nColor * 4;
const stops = [];
for (let i = 0; i < nStop; ++i) {
const p = dataView.getFloat32(offset, true);
offset += 4;
const rgb = dataView.getUint32(offset, true);
offset += 4;
stops.push([p, `#${rgb.toString(16).padStart(6, "0")}`]);
}
let bbox = null;
if (hasBBox) {
bbox = [];
for (let i = 0; i < 4; ++i) {
bbox.push(dataView.getFloat32(offset, true));
offset += 4;
}
}
let background = null;
if (hasBackground) {
background = new Uint8Array(this.buffer, offset, 3);
offset += 3;
}
if (kind === 1) {
return ["RadialAxial", "axial", bbox, stops, [coords[0], coords[1]], [coords[2], coords[3]], null, null];
}
if (kind === 2) {
return ["RadialAxial", "radial", bbox, stops, [coords[0], coords[1]], [coords[3], coords[4]], coords[2], coords[5]];
}
if (kind === 3) {
const shadingType = this.data[PATTERN_INFO.SHADING_TYPE];
let bounds = null;
if (coords.length > 0) {
bounds = BBOX_INIT.slice();
for (let i = 0, ii = coords.length; i < ii; i += 2) {
Util.pointBoundingBox(coords[i], coords[i + 1], bounds);
}
}
return ["Mesh", shadingType, coords, colors, nCoord, bounds, bbox, background];
}
throw new Error(`Unsupported pattern kind: ${kind}`);
}
}
var _buffer4 = /*#__PURE__*/new WeakMap();
class FontPathInfo {
constructor(buffer) {
obj_bin_transform_display_classPrivateFieldInitSpec(this, _buffer4, void 0);
obj_bin_transform_display_classPrivateFieldSet(_buffer4, this, buffer);
}
get path() {
if (FeatureTest.isFloat16ArraySupported) {
return new Float16Array(obj_bin_transform_display_classPrivateFieldGet(_buffer4, this));
}
return new Float32Array(obj_bin_transform_display_classPrivateFieldGet(_buffer4, this));
}
}
;// ./src/display/pdf_objects.js
function pdf_objects_classPrivateFieldInitSpec(e, t, a) { pdf_objects_checkPrivateRedeclaration(e, t), t.set(e, a); }
function pdf_objects_checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
function pdf_objects_classPrivateFieldGet(s, a) { return s.get(pdf_objects_assertClassBrand(s, a)); }
function pdf_objects_assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
;
const INITIAL_DATA = Symbol("INITIAL_DATA");
const dataObj = () => ({
...Promise.withResolvers(),
data: INITIAL_DATA
});
var _objs = /*#__PURE__*/new WeakMap();
class PDFObjects {
constructor() {
pdf_objects_classPrivateFieldInitSpec(this, _objs, new Map());
}
get(objId, callback = null, errorCallback = null) {
if (callback) {
const obj = pdf_objects_classPrivateFieldGet(_objs, this).getOrInsertComputed(objId, dataObj);
obj.promise.then(() => callback(obj.data), errorCallback);
return null;
}
const obj = pdf_objects_classPrivateFieldGet(_objs, this).get(objId);
if (!obj || obj.data === INITIAL_DATA) {
throw new Error(`Requesting object that isn't resolved yet ${objId}.`);
}
return obj.data;
}
has(objId) {
const obj = pdf_objects_classPrivateFieldGet(_objs, this).get(objId);
return !!obj && obj.data !== INITIAL_DATA;
}
delete(objId) {
const obj = pdf_objects_classPrivateFieldGet(_objs, this).get(objId);
if (!obj || obj.data === INITIAL_DATA) {
return false;
}
pdf_objects_classPrivateFieldGet(_objs, this).delete(objId);
return true;
}
resolve(objId, data = null) {
const obj = pdf_objects_classPrivateFieldGet(_objs, this).getOrInsertComputed(objId, dataObj);
if (obj.data !== INITIAL_DATA) {
throw new Error(`Object already resolved ${objId}.`);
}
obj.data = data;
obj.resolve();
}
reject(objId, reason) {
const obj = pdf_objects_classPrivateFieldGet(_objs, this).getOrInsertComputed(objId, dataObj);
if (obj.data !== INITIAL_DATA) {
return;
}
obj.promise.catch(() => {});
obj.reject(reason);
}
clear() {
for (const {
data
} of pdf_objects_classPrivateFieldGet(_objs, this).values()) {
data?.bitmap?.close();
}
pdf_objects_classPrivateFieldGet(_objs, this).clear();
}
*[Symbol.iterator]() {
for (const [objId, {
data
}] of pdf_objects_classPrivateFieldGet(_objs, this)) {
if (data !== INITIAL_DATA) {
yield [objId, data];
}
}
}
}
;// ./src/display/object_handler.js
class ObjectHandler {
constructor({
messageHandler,
commonObjs,
fontLoader,
pageCache,
pdfBug = false,
shouldCreatePageObjs = false
}) {
this.messageHandler = messageHandler;
this.commonObjs = commonObjs;
this.fontLoader = fontLoader;
this.pageCache = pageCache;
this.pdfBug = pdfBug;
this.shouldCreatePageObjs = shouldCreatePageObjs;
}
resolveCommonObject(id, type, exportedData) {
if (type === "CopyLocalImage") {
const {
imageRef
} = exportedData;
assert(imageRef, "The imageRef must be defined.");
for (const pageOrObjs of this.pageCache.values()) {
const objs = pageOrObjs.objs || pageOrObjs;
for (const [, data] of objs) {
if (data?.ref !== imageRef) {
continue;
}
if (!data.dataLen) {
return null;
}
const copy = structuredClone(data);
this.commonObjs.resolve(id, copy);
return data.dataLen;
}
}
return null;
}
switch (type) {
case "Font":
if ("error" in exportedData) {
const exportedError = exportedData.error;
warn(`Error during font loading: ${exportedError}`);
this.commonObjs.resolve(id, exportedError);
break;
}
const fontData = new FontInfo(exportedData.buffer);
const inspectFont = null;
const font = new FontFaceObject(fontData, inspectFont, exportedData.charProcOperatorList, exportedData.extra);
this.fontLoader.bind(font).catch(() => this.messageHandler.sendWithPromise("FontFallback", {
id
}).catch(reason => {
warn(`FontFallback failed for "${id}": ${reason}`);
})).finally(() => {
if (!font.fontExtraProperties) {
font.clearData();
}
this.commonObjs.resolve(id, font);
});
break;
case "FontPath":
this.commonObjs.resolve(id, new FontPathInfo(exportedData));
break;
case "Image":
this.commonObjs.resolve(id, exportedData);
break;
case "Pattern":
const pattern = new PatternInfo(exportedData);
this.commonObjs.resolve(id, pattern.getIR());
break;
default:
throw new Error(`Got unknown common object type ${type}`);
}
return null;
}
resolveObject(id, pageProxyId, type, exportedData) {
let pageOrObjs = this.pageCache.get(pageProxyId);
if (!pageOrObjs) {
if (!this.shouldCreatePageObjs) {
return false;
}
pageOrObjs = new PDFObjects();
this.pageCache.set(pageProxyId, pageOrObjs);
}
const objs = pageOrObjs.objs || pageOrObjs;
if (objs.has(id)) {
return false;
}
if (pageOrObjs._intentStates?.size === 0) {
exportedData?.bitmap?.close();
return false;
}
switch (type) {
case "Image":
case "Pattern":
objs.resolve(id, exportedData);
return true;
default:
throw new Error(`Got unknown object type ${type}`);
}
}
}
;// ./src/display/canvas_factory.js
function canvas_factory_classPrivateFieldInitSpec(e, t, a) { canvas_factory_checkPrivateRedeclaration(e, t), t.set(e, a); }
function canvas_factory_checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
function canvas_factory_classPrivateFieldGet(s, a) { return s.get(canvas_factory_assertClassBrand(s, a)); }
function canvas_factory_classPrivateFieldSet(s, a, r) { return s.set(canvas_factory_assertClassBrand(s, a), r), r; }
function canvas_factory_assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
;
var _enableHWA = /*#__PURE__*/new WeakMap();
class BaseCanvasFactory {
constructor({
enableHWA = false
}) {
canvas_factory_classPrivateFieldInitSpec(this, _enableHWA, false);
canvas_factory_classPrivateFieldSet(_enableHWA, this, enableHWA);
}
create(width, height) {
if (width <= 0 || height <= 0) {
throw new Error("Invalid canvas size");
}
const canvas = this._createCanvas(width, height);
return {
canvas,
context: canvas.getContext("2d", {
willReadFrequently: !canvas_factory_classPrivateFieldGet(_enableHWA, this)
})
};
}
reset({
canvas
}, width, height) {
if (!canvas) {
throw new Error("Canvas is not specified");
}
if (width <= 0 || height <= 0) {
throw new Error("Invalid canvas size");
}
canvas.width = width;
canvas.height = height;
}
destroy(canvasAndContext) {
const {
canvas
} = canvasAndContext;
if (!canvas) {
throw new Error("Canvas is not specified");
}
canvas.width = canvas.height = 0;
canvasAndContext.canvas = null;
canvasAndContext.context = null;
}
getNoAlphaContext(canvas) {
return canvas.getContext("2d", {
alpha: false,
willReadFrequently: !canvas_factory_classPrivateFieldGet(_enableHWA, this)
});
}
_createCanvas(width, height) {
unreachable("Abstract method `_createCanvas` called.");
}
}
;// ./src/display/offscreen_canvas_factory.js
class OffscreenCanvasFactory extends BaseCanvasFactory {
_createCanvas(width, height) {
return new OffscreenCanvas(width, height);
}
}
;// ./src/shared/murmurhash3.js
const SEED = 0xc3d2e1f0;
const MASK_HIGH = 0xffff0000;
const MASK_LOW = 0xffff;
class MurmurHash3_64 {
constructor(seed) {
this.h1 = seed ? seed & 0xffffffff : SEED;
this.h2 = seed ? seed & 0xffffffff : SEED;
}
update(input) {
let data, length;
if (typeof input === "string") {
data = new Uint8Array(input.length * 2);
length = 0;
for (let i = 0, ii = input.length; i < ii; i++) {
const code = input.charCodeAt(i);
if (code <= 0xff) {
data[length++] = code;
} else {
data[length++] = code >>> 8;
data[length++] = code & 0xff;
}
}
} else if (ArrayBuffer.isView(input)) {
data = input.slice();
length = data.byteLength;
} else {
throw new Error("Invalid data format, must be a string or TypedArray.");
}
const blockCounts = length >> 2;
const tailLength = length - blockCounts * 4;
const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts);
let k1 = 0,
k2 = 0;
let h1 = this.h1,
h2 = this.h2;
const C1 = 0xcc9e2d51,
C2 = 0x1b873593;
const C1_LOW = C1 & MASK_LOW,
C2_LOW = C2 & MASK_LOW;
for (let i = 0; i < blockCounts; i++) {
if (i & 1) {
k1 = dataUint32[i];
k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW;
k1 = k1 << 15 | k1 >>> 17;
k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW;
h1 ^= k1;
h1 = h1 << 13 | h1 >>> 19;
h1 = h1 * 5 + 0xe6546b64;
} else {
k2 = dataUint32[i];
k2 = k2 * C1 & MASK_HIGH | k2 * C1_LOW & MASK_LOW;
k2 = k2 << 15 | k2 >>> 17;
k2 = k2 * C2 & MASK_HIGH | k2 * C2_LOW & MASK_LOW;
h2 ^= k2;
h2 = h2 << 13 | h2 >>> 19;
h2 = h2 * 5 + 0xe6546b64;
}
}
k1 = 0;
switch (tailLength) {
case 3:
k1 ^= data[blockCounts * 4 + 2] << 16;
case 2:
k1 ^= data[blockCounts * 4 + 1] << 8;
case 1:
k1 ^= data[blockCounts * 4];
k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW;
k1 = k1 << 15 | k1 >>> 17;
k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW;
if (blockCounts & 1) {
h1 ^= k1;
} else {
h2 ^= k1;
}
}
this.h1 = h1;
this.h2 = h2;
}
hexdigest() {
let h1 = this.h1,
h2 = this.h2;
h1 ^= h2 >>> 1;
h1 = h1 * 0xed558ccd & MASK_HIGH | h1 * 0x8ccd & MASK_LOW;
h2 = h2 * 0xff51afd7 & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16;
h1 ^= h2 >>> 1;
h1 = h1 * 0x1a85ec53 & MASK_HIGH | h1 * 0xec53 & MASK_LOW;
h2 = h2 * 0xc4ceb9fe & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16;
h1 ^= h2 >>> 1;
return (h1 >>> 0).toString(16).padStart(8, "0") + (h2 >>> 0).toString(16).padStart(8, "0");
}
}
;// ./src/display/optional_content_config.js
function optional_content_config_classPrivateMethodInitSpec(e, a) { optional_content_config_checkPrivateRedeclaration(e, a), a.add(e); }
function optional_content_config_defineProperty(e, r, t) { return (r = optional_content_config_toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
function optional_content_config_toPropertyKey(t) { var i = optional_content_config_toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
function optional_content_config_toPrimitive(t, e) { if ("object" != typeof t || !t) return t; var r; if ("undefined" != typeof Symbol && void 0 !== (r = t[Symbol.toPrimitive])) { var i = r.call(t, e || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === e ? String : Number)(t); }
function optional_content_config_classPrivateFieldInitSpec(e, t, a) { optional_content_config_checkPrivateRedeclaration(e, t), t.set(e, a); }
function optional_content_config_checkPrivateRedeclaration(e, t) { if (t.has(e)) throw new TypeError("Cannot initialize the same private elements twice on an object"); }
function optional_content_config_classPrivateFieldGet(s, a) { return s.get(optional_content_config_assertClassBrand(s, a)); }
function optional_content_config_classPrivateFieldSet(s, a, r) { return s.set(optional_content_config_assertClassBrand(s, a), r), r; }
function optional_content_config_assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
;
const INTERNAL = Symbol("INTERNAL");
var _isDisplay = /*#__PURE__*/new WeakMap();
var _isPrint = /*#__PURE__*/new WeakMap();
var _userSet = /*#__PURE__*/new WeakMap();
var _visible = /*#__PURE__*/new WeakMap();
class OptionalContentGroup {
constructor(renderingIntent, {
name,
intent,
usage,
rbGroups
}) {
optional_content_config_classPrivateFieldInitSpec(this, _isDisplay, false);
optional_content_config_classPrivateFieldInitSpec(this, _isPrint, false);
optional_content_config_classPrivateFieldInitSpec(this, _userSet, false);
optional_content_config_classPrivateFieldInitSpec(this, _visible, true);
optional_content_config_classPrivateFieldSet(_isDisplay, this, !!(renderingIntent & RenderingIntentFlag.DISPLAY));
optional_content_config_classPrivateFieldSet(_isPrint, this, !!(renderingIntent & RenderingIntentFlag.PRINT));
this.name = name;
this.intent = intent;
this.usage = usage;
this.rbGroups = rbGroups;
}
get visible() {
if (optional_content_config_classPrivateFieldGet(_userSet, this)) {
return optional_content_config_classPrivateFieldGet(_visible, this);
}
if (!optional_content_config_classPrivateFieldGet(_visible, this)) {
return false;
}
const {
print,
view
} = this.usage;
if (optional_content_config_classPrivateFieldGet(_isDisplay, this)) {
return view?.viewState !== "OFF";
} else if (optional_content_config_classPrivateFieldGet(_isPrint, this)) {
return print?.printState !== "OFF";
}
return true;
}
_setVisible(internal, visible, userSet = false) {
if (internal !== INTERNAL) {
unreachable("Internal method `_setVisible` called.");
}
optional_content_config_classPrivateFieldSet(_userSet, this, userSet);
optional_content_config_classPrivateFieldSet(_visible, this, visible);
}
get serializable() {
return {
userSet: optional_content_config_classPrivateFieldGet(_userSet, this),
visible: optional_content_config_classPrivateFieldGet(_visible, this)
};
}
}
var _cachedGetHash = /*#__PURE__*/new WeakMap();
var _groups = /*#__PURE__*/new WeakMap();
var _initialHash = /*#__PURE__*/new WeakMap();
var _order = /*#__PURE__*/new WeakMap();
var _rawData = /*#__PURE__*/new WeakMap();
var _OptionalContentConfig_brand = /*#__PURE__*/new WeakSet();
class OptionalContentConfig {
constructor(data, renderingIntent = RenderingIntentFlag.DISPLAY, groupState = null) {
optional_content_config_classPrivateMethodInitSpec(this, _OptionalContentConfig_brand);
optional_content_config_classPrivateFieldInitSpec(this, _cachedGetHash, null);
optional_content_config_classPrivateFieldInitSpec(this, _groups, new Map());
optional_content_config_classPrivateFieldInitSpec(this, _initialHash, null);
optional_content_config_classPrivateFieldInitSpec(this, _order, null);
optional_content_config_classPrivateFieldInitSpec(this, _rawData, void 0);
optional_content_config_defineProperty(this, "creator", null);
optional_content_config_defineProperty(this, "name", null);
optional_content_config_classPrivateFieldSet(_rawData, this, data);
this.renderingIntent = renderingIntent;
if (data === null) {
return;
}
this.name = data.name;
this.creator = data.creator;
optional_content_config_classPrivateFieldSet(_order, this, data.order);
for (const group of data.groups) {
optional_content_config_classPrivateFieldGet(_groups, this).set(group.id, new OptionalContentGroup(renderingIntent, group));
}
if (groupState) {
if (groupState.size !== optional_content_config_classPrivateFieldGet(_groups, this).size) {
unreachable("Incorrect serialized groupState.");
}
for (const [id, group] of groupState) {
optional_content_config_classPrivateFieldGet(_groups, this).get(id)._setVisible(INTERNAL, group.visible, group.userSet);
}
} else {
if (data.baseState === "OFF") {
for (const group of optional_content_config_classPrivateFieldGet(_groups, this).values()) {
group._setVisible(INTERNAL, false);
}
}
for (const on of data.on) {
optional_content_config_classPrivateFieldGet(_groups, this).get(on)._setVisible(INTERNAL, true);
}
for (const off of data.off) {
optional_content_config_classPrivateFieldGet(_groups, this).get(off)._setVisible(INTERNAL, false);
}
}
optional_content_config_classPrivateFieldSet(_initialHash, this, this.getHash());
}
isVisible(group) {
if (optional_content_config_classPrivateFieldGet(_groups, this).size === 0) {
return true;
}
if (!group) {
info("Optional content group not defined.");
return true;
}
if (group.type === "OCG") {
if (!optional_content_config_classPrivateFieldGet(_groups, this).has(group.id)) {
warn(`Optional content group not found: ${group.id}`);
return true;
}
return optional_content_config_classPrivateFieldGet(_groups, this).get(group.id).visible;
} else if (group.type === "OCMD") {
if (group.expression) {
return optional_content_config_assertClassBrand(_OptionalContentConfig_brand, this, _evaluateVisibilityExpression).call(this, group.expression);
}
if (!group.policy || group.policy === "AnyOn") {
for (const id of group.ids) {
if (!optional_content_config_classPrivateFieldGet(_groups, this).has(id)) {
warn(`Optional content group not found: ${id}`);
return true;
}
if (optional_content_config_classPrivateFieldGet(_groups, this).get(id).visible) {
return true;
}
}
return false;
} else if (group.policy === "AllOn") {
for (const id of group.ids) {
if (!optional_content_config_classPrivateFieldGet(_groups, this).has(id)) {
warn(`Optional content group not found: ${id}`);
return true;
}
if (!optional_content_config_classPrivateFieldGet(_groups, this).get(id).visible) {
return false;
}
}
return true;
} else if (group.policy === "AnyOff") {
for (const id of group.ids) {
if (!optional_content_config_classPrivateFieldGet(_groups, this).has(id)) {
warn(`Optional content group not found: ${id}`);
return true;
}
if (!optional_content_config_classPrivateFieldGet(_groups, this).get(id).visible) {
return true;
}
}
return false;
} else if (group.policy === "AllOff") {
for (const id of group.ids) {
if (!optional_content_config_classPrivateFieldGet(_groups, this).has(id)) {
warn(`Optional content group not found: ${id}`);
return true;
}
if (optional_content_config_classPrivateFieldGet(_groups, this).get(id).visible) {
return false;
}
}
return true;
}
warn(`Unknown optional content policy ${group.policy}.`);
return true;
}
warn(`Unknown group type ${group.type}.`);
return true;
}
setVisibility(id, visible = true, preserveRB = true) {
throw new Error("Not implemented: setVisibility");
}
setOCGState({
state,
preserveRB
}) {
throw new Error("Not implemented: setOCGState");
}
get hasInitialVisibility() {
return optional_content_config_classPrivateFieldGet(_initialHash, this) === null || this.getHash() === optional_content_config_classPrivateFieldGet(_initialHash, this);
}
getOrder() {
throw new Error("Not implemented: getOrder");
}
getGroup(id) {
return optional_content_config_classPrivateFieldGet(_groups, this).get(id) || null;
}
getHash() {
if (optional_content_config_classPrivateFieldGet(_cachedGetHash, this) !== null) {
return optional_content_config_classPrivateFieldGet(_cachedGetHash, this);
}
const hash = new MurmurHash3_64();
for (const [id, group] of optional_content_config_classPrivateFieldGet(_groups, this)) {
hash.update(`${id}:${group.visible}`);
}
return optional_content_config_classPrivateFieldSet(_cachedGetHash, this, hash.hexdigest());
}
[Symbol.iterator]() {
return optional_content_config_classPrivateFieldGet(_groups, this).entries();
}
get serializable() {
const groupState = new Map();
for (const [id, group] of optional_content_config_classPrivateFieldGet(_groups, this)) {
groupState.set(id, group.serializable);
}
return {
data: optional_content_config_classPrivateFieldGet(_rawData, this),
renderingIntent: this.renderingIntent,
groupState
};
}
static fromSerializable({
data,
renderingIntent,
groupState
}) {
return new OptionalContentConfig(data, renderingIntent, groupState);
}
}
function _evaluateVisibilityExpression(array) {
const length = array.length;
if (length < 2) {
return true;
}
const operator = array[0];
for (let i = 1; i < length; i++) {
const element = array[i];
let state;
if (Array.isArray(element)) {
state = optional_content_config_assertClassBrand(_OptionalContentConfig_brand, this, _evaluateVisibilityExpression).call(this, element);
} else if (optional_content_config_classPrivateFieldGet(_groups, this).has(element)) {
state = optional_content_config_classPrivateFieldGet(_groups, this).get(element).visible;
} else {
warn(`Optional content group not found: ${element}`);
return true;
}
switch (operator) {
case "And":
if (!state) {
return false;
}
break;
case "Or":
if (state) {
return true;
}
break;
case "Not":
return !state;
default:
return true;
}
}
return operator === "And";
}
;// ./src/display/filter_factory.js
class BaseFilterFactory {
addFilter(maps) {
return "none";
}
addHCMFilter(fgColor, bgColor) {
return "none";
}
addAlphaFilter(map) {
return "none";
}
addLuminosityFilter(map) {
return "none";
}
addKnockoutFilter(alpha = 0) {
return "none";
}
addHighlightHCMFilter(filterName, fgColor, bgColor, newFgColor, newBgColor) {
return "none";
}
addSelectionHCMFilter(fgColor, bgColor) {
return "none";
}
addSelectionFilter() {
return "none";
}
createSelectionStyle(pageColors = null) {
return null;
}
destroy(keepHCM = false) {}
}
;// ./src/display/worker_filter_factory.js
class WorkerFilterFactory extends BaseFilterFactory {}
;// ./src/display/renderer_worker.js
var _RendererMessageHandler;
function renderer_worker_assertClassBrand(e, t, n) { if ("function" == typeof e ? e === t : e.has(t)) return arguments.length < 3 ? t : n; throw new TypeError("Private element is not present on this object"); }
;
const PARTIAL_FRAME_TIME = 500;
class RendererMessageHandler {}
_RendererMessageHandler = RendererMessageHandler;
function _getPageObjs(pageProxyId) {
return renderer_worker_assertClassBrand(_RendererMessageHandler, this, _objsMap)._.getOrInsertComputed(pageProxyId, () => new PDFObjects());
}
function _getOperatorList(pageProxyId, operatorListId) {
return renderer_worker_assertClassBrand(_RendererMessageHandler, this, _operatorLists)._.getOrInsertComputed(pageProxyId, makeMap).getOrInsertComputed(operatorListId, () => ({
fnArray: [],
argsArray: [],
pathCache: new Map()
}));
}
function _collectAnnotationBitmaps(renderTaskState, transfers) {
const map = renderTaskState.gfx?.annotationCanvasMap;
if (!map?.size) {
return null;
}
const tuples = [];
for (const [id, value] of map) {
for (const canvas of Array.isArray(value) ? value : [value]) {
const bitmap = canvas.transferToImageBitmap();
tuples.push([id, getAnnotationCanvasName(canvas), bitmap]);
transfers.push(bitmap);
}
}
return tuples;
}
async function _sendFrame(handler, renderTaskState, isFinal) {
const {
canvas,
renderTaskId
} = renderTaskState;
let bitmap = null;
if (canvas.width === 0 || canvas.height === 0) {
if (!isFinal) {
return;
}
} else if (isFinal) {
bitmap = canvas.transferToImageBitmap();
} else {
const {
transparentCanvas
} = renderTaskState.gfx;
if (transparentCanvas) {
const composite = new OffscreenCanvas(canvas.width, canvas.height);
const ctx = composite.getContext("2d");
ctx.drawImage(canvas, 0, 0);
ctx.drawImage(transparentCanvas, 0, 0);
bitmap = composite.transferToImageBitmap();
composite.width = composite.height = 0;
} else {
bitmap = await createImageBitmap(canvas);
if (renderTaskState.aborted) {
bitmap.close();
return;
}
}
}
const transfers = bitmap ? [bitmap] : [];
const annotationBitmaps = isFinal ? renderer_worker_assertClassBrand(_RendererMessageHandler, this, _collectAnnotationBitmaps).call(this, renderTaskState, transfers) : null;
handler.send("RenderFrame", {
renderTaskId,
bitmap,
annotationBitmaps
}, transfers);
}
async function _maybeSendInterimFrame(handler, renderTaskState) {
if (!renderTaskState.partialFrames || renderTaskState.aborted || Date.now() - renderTaskState.lastFrameTime < PARTIAL_FRAME_TIME || renderTaskState.operatorListIdx === renderTaskState.lastFrameIdx) {
return;
}
try {
await renderer_worker_assertClassBrand(_RendererMessageHandler, this, _sendFrame).call(this, handler, renderTaskState, false);
} catch (ex) {
warn(`Failed to send an interim frame: ${ex.message}`);
}
renderTaskState.lastFrameTime = Date.now();
renderTaskState.lastFrameIdx = renderTaskState.operatorListIdx;
}
function _cleanupPage(pageProxyId) {
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _objsMap)._.get(pageProxyId)?.clear();
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _objsMap)._.delete(pageProxyId);
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _operatorLists)._.delete(pageProxyId);
for (const [renderTaskId, renderTaskState] of renderer_worker_assertClassBrand(_RendererMessageHandler, this, _renderTaskStates)._) {
if (renderTaskState.pageProxyId === pageProxyId) {
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _cleanupRenderTask).call(this, renderTaskId);
}
}
}
function _cleanupRenderTask(renderTaskId, keepCanvas = false) {
const renderTaskState = renderer_worker_assertClassBrand(_RendererMessageHandler, this, _renderTaskStates)._.get(renderTaskId);
if (!renderTaskState) {
return;
}
renderTaskState.aborted = true;
renderTaskState.continueResolve?.();
renderTaskState.gfx?.endDrawing();
if (!keepCanvas) {
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _releaseCanvases).call(this, renderTaskState);
}
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _renderTaskStates)._.delete(renderTaskId);
}
function _releaseCanvases({
canvas,
gfx
}) {
canvas.width = canvas.height = 0;
const map = gfx?.annotationCanvasMap;
if (!map) {
return;
}
for (const value of map.values()) {
for (const annotationCanvas of Array.isArray(value) ? value : [value]) {
annotationCanvas.width = annotationCanvas.height = 0;
}
}
map.clear();
}
function _appendFromSharedOperatorList(renderTaskState, length, operationsFilterMask, lastChunk) {
const {
operatorList,
sharedOperatorList
} = renderTaskState;
const {
fnArray,
argsArray
} = sharedOperatorList;
for (let i = operatorList.fnArray.length; i < length; i++) {
operatorList.fnArray.push(fnArray[i]);
operatorList.argsArray.push(argsArray[i]);
}
if (operationsFilterMask) {
const mask = renderTaskState.operationsFilterMask || (renderTaskState.operationsFilterMask = []);
for (let i = 0, ii = operationsFilterMask.length; i < ii; i++) {
mask.push(operationsFilterMask[i]);
}
}
operatorList.lastChunk = lastChunk;
renderTaskState.dependencyTracker?.growOperationsCount(operatorList.fnArray.length);
}
async function _executeOperatorList(handler, renderTaskState) {
const {
operatorList,
gfx,
operationsFilterMask
} = renderTaskState;
const operationsFilter = operationsFilterMask ? i => operationsFilterMask[i] : null;
while (!renderTaskState.aborted) {
const {
promise,
resolve,
reject
} = Promise.withResolvers();
renderTaskState.continueResolve = resolve;
renderTaskState.operatorListIdx = gfx.executeOperatorList(operatorList, renderTaskState.operatorListIdx, resolve, reject, undefined, operationsFilter);
if (renderTaskState.operatorListIdx === operatorList.argsArray.length) {
return renderTaskState.operatorListIdx;
}
await renderer_worker_assertClassBrand(_RendererMessageHandler, this, _maybeSendInterimFrame).call(this, handler, renderTaskState);
await promise;
if (renderTaskState.aborted) {
break;
}
await renderer_worker_assertClassBrand(_RendererMessageHandler, this, _yield).call(this);
}
return renderTaskState.operatorListIdx;
}
function _yield() {
if (!renderer_worker_assertClassBrand(_RendererMessageHandler, this, _yieldChannel)._) {
_yieldChannel._ = renderer_worker_assertClassBrand(_RendererMessageHandler, this, new MessageChannel());
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _yieldChannel)._.port1.onmessage = () => {
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _yieldResolvers)._.shift()();
};
}
const {
promise,
resolve
} = Promise.withResolvers();
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _yieldResolvers)._.push(resolve);
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _yieldChannel)._.port2.postMessage(null);
return promise;
}
function _setupObjectHandler(handler) {
const objectHandler = new ObjectHandler({
messageHandler: handler,
commonObjs: renderer_worker_assertClassBrand(_RendererMessageHandler, this, _commonObjs)._,
fontLoader: renderer_worker_assertClassBrand(_RendererMessageHandler, this, _fontLoader)._,
pageCache: renderer_worker_assertClassBrand(_RendererMessageHandler, this, _objsMap)._,
shouldCreatePageObjs: true
});
handler.on("commonobj", ([id, type, exportedData]) => {
if (renderer_worker_assertClassBrand(_RendererMessageHandler, this, _commonObjs)._.has(id)) {
return;
}
objectHandler.resolveCommonObject(id, type, exportedData);
if (type === "Pattern" && renderer_worker_assertClassBrand(_RendererMessageHandler, this, _commonObjs)._.get(id)[0] === "Mesh") {
_hasMeshPattern._ = renderer_worker_assertClassBrand(_RendererMessageHandler, this, true);
}
});
handler.on("obj", ([id, pageProxyId, type, imageData]) => {
if (type === "Pattern" && imageData[0] === "Mesh") {
_hasMeshPattern._ = renderer_worker_assertClassBrand(_RendererMessageHandler, this, true);
}
objectHandler.resolveObject(id, pageProxyId, type, imageData);
});
handler.on("objFailed", ({
id,
pageProxyId,
reason
}) => {
const error = new Error(reason);
if (pageProxyId === null) {
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _commonObjs)._.reject(id, error);
return;
}
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _getPageObjs).call(this, pageProxyId).reject(id, error);
});
}
function _setup(handler) {
handler.on("configure", data => {
setVerbosityLevel(data.verbosity);
renderer_worker_enableHWA._ = renderer_worker_assertClassBrand(_RendererMessageHandler, this, data.enableHWA);
_enableWebGPU._ = renderer_worker_assertClassBrand(_RendererMessageHandler, this, data.enableWebGPU);
if (renderer_worker_assertClassBrand(_RendererMessageHandler, this, _enableWebGPU)._) {
initGPU();
}
});
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _setupObjectHandler).call(this, handler);
handler.on("cleanupPage", ({
pageProxyId
}) => {
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _cleanupPage).call(this, pageProxyId);
});
handler.on("Cleanup", ({
keepLoadedFonts
}) => {
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _commonObjs)._.clear();
if (!keepLoadedFonts) {
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _fontLoader)._.clear();
}
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _filterFactory)._?.destroy(true);
});
handler.on("CleanupRenderTask", ({
renderTaskId
}) => {
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _cleanupRenderTask).call(this, renderTaskId);
});
handler.on("AppendOperatorList", ({
pageProxyId,
operatorListId,
fnArray,
argsArray
}) => {
const operatorList = renderer_worker_assertClassBrand(_RendererMessageHandler, this, _getOperatorList).call(this, pageProxyId, operatorListId);
for (let i = 0, ii = fnArray.length; i < ii; i++) {
operatorList.fnArray.push(fnArray[i]);
operatorList.argsArray.push(argsArray[i]);
}
});
handler.on("InitializeGraphics", async data => {
const {
width,
height,
pageProxyId,
operatorListId,
renderTaskId,
hasAnnotationCanvasMap = false,
transform,
viewport,
transparency,
background,
pixelRatio,
recordOperations = false,
recordImages = false,
partialFrames = false
} = data;
const canvas = new OffscreenCanvas(width, height);
const sharedOperatorList = renderer_worker_assertClassBrand(_RendererMessageHandler, this, _getOperatorList).call(this, pageProxyId, operatorListId);
const renderTaskState = {
pageProxyId,
renderTaskId,
canvas,
partialFrames,
lastFrameTime: Date.now(),
gfx: null,
sharedOperatorList,
dependencyTracker: null,
imagesTracker: null,
operatorList: {
fnArray: [],
argsArray: [],
lastChunk: false,
pathCache: sharedOperatorList.pathCache
},
operatorListIdx: 0,
lastFrameIdx: 0,
operationsFilterMask: null,
continueResolve: null,
aborted: false
};
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _renderTaskStates)._.set(renderTaskId, renderTaskState);
try {
const objs = renderer_worker_assertClassBrand(_RendererMessageHandler, this, _getPageObjs).call(this, pageProxyId);
const optionalContentConfig = OptionalContentConfig.fromSerializable(data.optionalContentConfig);
const canvasFactory = renderer_worker_assertClassBrand(_RendererMessageHandler, this, _canvasFactory)._ ?? (_canvasFactory._ = renderer_worker_assertClassBrand(_RendererMessageHandler, this, new OffscreenCanvasFactory({
enableHWA: renderer_worker_assertClassBrand(_RendererMessageHandler, this, renderer_worker_enableHWA)._
})));
const filterFactory = renderer_worker_assertClassBrand(_RendererMessageHandler, this, _filterFactory)._ ?? (_filterFactory._ = renderer_worker_assertClassBrand(_RendererMessageHandler, this, new WorkerFilterFactory()));
const annotationCanvases = hasAnnotationCanvasMap ? new Map() : null;
const {
dependencyTracker,
imagesTracker
} = createCanvasTrackers(canvas, 0, {
recordOperations,
recordImages
});
const gfx = new CanvasGraphics(canvasFactory.getNoAlphaContext(canvas), renderer_worker_assertClassBrand(_RendererMessageHandler, this, _commonObjs)._, objs, canvasFactory, filterFactory, {
optionalContentConfig,
pixelRatio
}, annotationCanvases, null, dependencyTracker, imagesTracker);
gfx.beginDrawing({
transform,
viewport,
transparency,
background
});
renderTaskState.gfx = gfx;
renderTaskState.dependencyTracker = dependencyTracker;
renderTaskState.imagesTracker = imagesTracker;
} catch (ex) {
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _cleanupRenderTask).call(this, renderTaskId);
throw ex;
}
});
handler.on("ExecuteOperatorList", async data => {
const {
renderTaskId,
operatorListIdx,
operatorListLength,
operationsFilterMask,
lastChunk
} = data;
const renderTaskState = renderer_worker_assertClassBrand(_RendererMessageHandler, this, _renderTaskStates)._.get(renderTaskId);
if (!renderTaskState) {
return {
operatorListIdx,
aborted: true
};
}
if (renderer_worker_assertClassBrand(_RendererMessageHandler, this, _hasMeshPattern)._ && renderer_worker_assertClassBrand(_RendererMessageHandler, this, _enableWebGPU)._ && !isGPUReady()) {
await initGPU();
if (renderTaskState.aborted) {
return {
operatorListIdx,
aborted: true
};
}
}
renderTaskState.operatorListIdx = operatorListIdx;
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _appendFromSharedOperatorList).call(this, renderTaskState, operatorListLength, operationsFilterMask, lastChunk);
const currentOperatorListIdx = await renderer_worker_assertClassBrand(_RendererMessageHandler, this, _executeOperatorList).call(this, handler, renderTaskState);
let recordedBBoxesBuffer = null;
let imageCoordinates = null;
if (renderTaskState.operatorList.lastChunk && currentOperatorListIdx === renderTaskState.operatorList.argsArray.length) {
recordedBBoxesBuffer = renderTaskState.dependencyTracker?.take().buffer ?? null;
imageCoordinates = renderTaskState.imagesTracker?.take() ?? null;
const aborted = renderTaskState.aborted;
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _cleanupRenderTask).call(this, renderTaskId, !aborted);
if (!aborted) {
try {
await renderer_worker_assertClassBrand(_RendererMessageHandler, this, _sendFrame).call(this, handler, renderTaskState, true);
} finally {
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _releaseCanvases).call(this, renderTaskState);
}
}
} else {
await renderer_worker_assertClassBrand(_RendererMessageHandler, this, _maybeSendInterimFrame).call(this, handler, renderTaskState);
}
return {
operatorListIdx: currentOperatorListIdx,
recordedBBoxesBuffer,
imageCoordinates
};
});
}
function _initializeFromPort(port) {
const handler = new MessageHandler("renderer", "main", port);
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _setup).call(this, handler);
handler.on("Connect", ({
sourceName,
targetName
}) => {
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _disconnect).call(this);
const connection = new MessageHandler(sourceName, targetName, port);
_connection._ = renderer_worker_assertClassBrand(_RendererMessageHandler, this, connection);
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _setup).call(this, connection);
connection.on("Disconnect", () => {
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _disconnect).call(this);
});
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _sendReady).call(this, connection);
});
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _sendReady).call(this, handler);
}
function _disconnect() {
if (!renderer_worker_assertClassBrand(_RendererMessageHandler, this, _connection)._) {
return;
}
for (const renderTaskId of renderer_worker_assertClassBrand(_RendererMessageHandler, this, _renderTaskStates)._.keys()) {
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _cleanupRenderTask).call(this, renderTaskId);
}
for (const objs of renderer_worker_assertClassBrand(_RendererMessageHandler, this, _objsMap)._.values()) {
objs.clear();
}
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _objsMap)._.clear();
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _operatorLists)._.clear();
_hasMeshPattern._ = renderer_worker_assertClassBrand(_RendererMessageHandler, this, false);
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _commonObjs)._.clear();
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _fontLoader)._.clear();
_commonObjs._ = renderer_worker_assertClassBrand(_RendererMessageHandler, this, new PDFObjects());
_fontLoader._ = renderer_worker_assertClassBrand(_RendererMessageHandler, this, new FontLoader({
ownerDocument: globalThis
}));
_canvasFactory._ = renderer_worker_assertClassBrand(_RendererMessageHandler, this, null);
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _filterFactory)._?.destroy();
_filterFactory._ = renderer_worker_assertClassBrand(_RendererMessageHandler, this, null);
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _connection)._.send("Disconnected", null);
renderer_worker_assertClassBrand(_RendererMessageHandler, this, _connection)._.destroy();
_connection._ = renderer_worker_assertClassBrand(_RendererMessageHandler, this, null);
}
function _sendReady(handler) {
const workerVersion = "6.5.1523";
const testObj = new Uint8Array();
handler.send("ready", {
testObj,
workerVersion
}, [testObj.buffer]);
}
var _canvasFactory = {
_: void 0
};
var _commonObjs = {
_: new PDFObjects()
};
var _connection = {
_: null
};
var renderer_worker_enableHWA = {
_: false
};
var _enableWebGPU = {
_: false
};
var _filterFactory = {
_: void 0
};
var _fontLoader = {
_: new FontLoader({
ownerDocument: globalThis
})
};
var _hasMeshPattern = {
_: false
};
var _objsMap = {
_: new Map()
};
var _operatorLists = {
_: new Map()
};
var _renderTaskStates = {
_: new Map()
};
var _yieldChannel = {
_: null
};
var _yieldResolvers = {
_: []
};
(() => {
if (typeof window === "undefined" && !isNodeJS && typeof self !== "undefined" && typeof self.postMessage === "function" && "onmessage" in self) {
renderer_worker_assertClassBrand(_RendererMessageHandler, _RendererMessageHandler, _initializeFromPort).call(_RendererMessageHandler, self);
}
})();
;// ./src/pdf.renderer.js