/* THIS IS A GENERATED/BUNDLED FILE BY ROLLUP if you want to view the source visit the plugins github repository */ 'use strict'; var obsidian = require('obsidian'); var view = require('@codemirror/view'); var path$1 = require('path'); var child_process = require('child_process'); var state$1 = require('@codemirror/state'); function _interopNamespaceDefault(e) { var n = Object.create(null); if (e) { Object.keys(e).forEach(function (k) { if (k !== 'default') { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); } n.default = e; return Object.freeze(n); } function _mergeNamespaces(n, m) { m.forEach(function (e) { e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) { if (k !== 'default' && !(k in n)) { var d = Object.getOwnPropertyDescriptor(e, k); Object.defineProperty(n, k, d.get ? d : { enumerable: true, get: function () { return e[k]; } }); } }); }); return Object.freeze(n); } var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path$1); var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {}; function getDefaultExportFromCjs (x) { return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; } function getAugmentedNamespace(n) { if (n.__esModule) return n; var f = n.default; if (typeof f == "function") { var a = function a () { if (this instanceof a) { return Reflect.construct(f, arguments, this.constructor); } return f.apply(this, arguments); }; a.prototype = f.prototype; } else a = {}; Object.defineProperty(a, '__esModule', {value: true}); Object.keys(n).forEach(function (k) { var d = Object.getOwnPropertyDescriptor(n, k); Object.defineProperty(a, k, d.get ? d : { enumerable: true, get: function () { return n[k]; } }); }); return a; } var es_error_toString = {}; var isCallable; var hasRequiredIsCallable; function requireIsCallable () { if (hasRequiredIsCallable) return isCallable; hasRequiredIsCallable = 1; // 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 isCallable = typeof documentAll == 'undefined' && documentAll !== undefined ? function (argument) { return typeof argument == 'function' || argument === documentAll; } : function (argument) { return typeof argument == 'function'; }; return isCallable; } var objectDefineProperty = {}; var fails; var hasRequiredFails; function requireFails () { if (hasRequiredFails) return fails; hasRequiredFails = 1; fails = function (exec) { try { return !!exec(); } catch (error) { return true; } }; return fails; } var descriptors; var hasRequiredDescriptors; function requireDescriptors () { if (hasRequiredDescriptors) return descriptors; hasRequiredDescriptors = 1; var fails = requireFails(); // Detect IE8's incomplete defineProperty implementation descriptors = !fails(function () { // eslint-disable-next-line es/no-object-defineproperty -- required for testing return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] !== 7; }); return descriptors; } var globalThis_1; var hasRequiredGlobalThis; function requireGlobalThis () { if (hasRequiredGlobalThis) return globalThis_1; hasRequiredGlobalThis = 1; var check = function (it) { return it && it.Math === Math && it; }; // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028 globalThis_1 = // 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 commonjsGlobal == 'object' && commonjsGlobal) || check(typeof globalThis_1 == 'object' && globalThis_1) || // eslint-disable-next-line no-new-func -- fallback (function () { return this; })() || Function('return this')(); return globalThis_1; } var isObject; var hasRequiredIsObject; function requireIsObject () { if (hasRequiredIsObject) return isObject; hasRequiredIsObject = 1; var isCallable = requireIsCallable(); isObject = function (it) { return typeof it == 'object' ? it !== null : isCallable(it); }; return isObject; } var documentCreateElement; var hasRequiredDocumentCreateElement; function requireDocumentCreateElement () { if (hasRequiredDocumentCreateElement) return documentCreateElement; hasRequiredDocumentCreateElement = 1; var globalThis = requireGlobalThis(); var isObject = requireIsObject(); var document = globalThis.document; // typeof document.createElement is 'object' in old IE var EXISTS = isObject(document) && isObject(document.createElement); documentCreateElement = function (it) { return EXISTS ? document.createElement(it) : {}; }; return documentCreateElement; } var ie8DomDefine; var hasRequiredIe8DomDefine; function requireIe8DomDefine () { if (hasRequiredIe8DomDefine) return ie8DomDefine; hasRequiredIe8DomDefine = 1; var DESCRIPTORS = requireDescriptors(); var fails = requireFails(); var createElement = requireDocumentCreateElement(); // Thanks to IE8 for its funny defineProperty ie8DomDefine = !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; }); return ie8DomDefine; } var v8PrototypeDefineBug; var hasRequiredV8PrototypeDefineBug; function requireV8PrototypeDefineBug () { if (hasRequiredV8PrototypeDefineBug) return v8PrototypeDefineBug; hasRequiredV8PrototypeDefineBug = 1; var DESCRIPTORS = requireDescriptors(); var fails = requireFails(); // V8 ~ Chrome 36- // https://bugs.chromium.org/p/v8/issues/detail?id=3334 v8PrototypeDefineBug = 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; }); return v8PrototypeDefineBug; } var anObject; var hasRequiredAnObject; function requireAnObject () { if (hasRequiredAnObject) return anObject; hasRequiredAnObject = 1; var isObject = requireIsObject(); var $String = String; var $TypeError = TypeError; // `Assert: Type(argument) is Object` anObject = function (argument) { if (isObject(argument)) return argument; throw new $TypeError($String(argument) + ' is not an object'); }; return anObject; } var functionBindNative; var hasRequiredFunctionBindNative; function requireFunctionBindNative () { if (hasRequiredFunctionBindNative) return functionBindNative; hasRequiredFunctionBindNative = 1; var fails = requireFails(); functionBindNative = !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'); }); return functionBindNative; } var functionCall; var hasRequiredFunctionCall; function requireFunctionCall () { if (hasRequiredFunctionCall) return functionCall; hasRequiredFunctionCall = 1; var NATIVE_BIND = requireFunctionBindNative(); var call = Function.prototype.call; functionCall = NATIVE_BIND ? call.bind(call) : function () { return call.apply(call, arguments); }; return functionCall; } var getBuiltIn; var hasRequiredGetBuiltIn; function requireGetBuiltIn () { if (hasRequiredGetBuiltIn) return getBuiltIn; hasRequiredGetBuiltIn = 1; var globalThis = requireGlobalThis(); var isCallable = requireIsCallable(); var aFunction = function (argument) { return isCallable(argument) ? argument : undefined; }; getBuiltIn = function (namespace, method) { return arguments.length < 2 ? aFunction(globalThis[namespace]) : globalThis[namespace] && globalThis[namespace][method]; }; return getBuiltIn; } var functionUncurryThis; var hasRequiredFunctionUncurryThis; function requireFunctionUncurryThis () { if (hasRequiredFunctionUncurryThis) return functionUncurryThis; hasRequiredFunctionUncurryThis = 1; var NATIVE_BIND = requireFunctionBindNative(); var FunctionPrototype = Function.prototype; var call = FunctionPrototype.call; var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call); functionUncurryThis = NATIVE_BIND ? uncurryThisWithBind : function (fn) { return function () { return call.apply(fn, arguments); }; }; return functionUncurryThis; } var objectIsPrototypeOf; var hasRequiredObjectIsPrototypeOf; function requireObjectIsPrototypeOf () { if (hasRequiredObjectIsPrototypeOf) return objectIsPrototypeOf; hasRequiredObjectIsPrototypeOf = 1; var uncurryThis = requireFunctionUncurryThis(); objectIsPrototypeOf = uncurryThis({}.isPrototypeOf); return objectIsPrototypeOf; } var environmentUserAgent; var hasRequiredEnvironmentUserAgent; function requireEnvironmentUserAgent () { if (hasRequiredEnvironmentUserAgent) return environmentUserAgent; hasRequiredEnvironmentUserAgent = 1; var globalThis = requireGlobalThis(); var navigator = globalThis.navigator; var userAgent = navigator && navigator.userAgent; environmentUserAgent = userAgent ? String(userAgent) : ''; return environmentUserAgent; } var environmentV8Version; var hasRequiredEnvironmentV8Version; function requireEnvironmentV8Version () { if (hasRequiredEnvironmentV8Version) return environmentV8Version; hasRequiredEnvironmentV8Version = 1; var globalThis = requireGlobalThis(); var userAgent = requireEnvironmentUserAgent(); 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]; } } environmentV8Version = version; return environmentV8Version; } var symbolConstructorDetection; var hasRequiredSymbolConstructorDetection; function requireSymbolConstructorDetection () { if (hasRequiredSymbolConstructorDetection) return symbolConstructorDetection; hasRequiredSymbolConstructorDetection = 1; /* eslint-disable es/no-symbol -- required for testing */ var V8_VERSION = requireEnvironmentV8Version(); var fails = requireFails(); var globalThis = requireGlobalThis(); var $String = globalThis.String; // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing symbolConstructorDetection = !!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; }); return symbolConstructorDetection; } var useSymbolAsUid; var hasRequiredUseSymbolAsUid; function requireUseSymbolAsUid () { if (hasRequiredUseSymbolAsUid) return useSymbolAsUid; hasRequiredUseSymbolAsUid = 1; /* eslint-disable es/no-symbol -- required for testing */ var NATIVE_SYMBOL = requireSymbolConstructorDetection(); useSymbolAsUid = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == 'symbol'; return useSymbolAsUid; } var isSymbol; var hasRequiredIsSymbol; function requireIsSymbol () { if (hasRequiredIsSymbol) return isSymbol; hasRequiredIsSymbol = 1; var getBuiltIn = requireGetBuiltIn(); var isCallable = requireIsCallable(); var isPrototypeOf = requireObjectIsPrototypeOf(); var USE_SYMBOL_AS_UID = requireUseSymbolAsUid(); var $Object = Object; isSymbol = USE_SYMBOL_AS_UID ? function (it) { return typeof it == 'symbol'; } : function (it) { var $Symbol = getBuiltIn('Symbol'); return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it)); }; return isSymbol; } var tryToString; var hasRequiredTryToString; function requireTryToString () { if (hasRequiredTryToString) return tryToString; hasRequiredTryToString = 1; var $String = String; tryToString = function (argument) { try { return $String(argument); } catch (error) { return 'Object'; } }; return tryToString; } var aCallable; var hasRequiredACallable; function requireACallable () { if (hasRequiredACallable) return aCallable; hasRequiredACallable = 1; var isCallable = requireIsCallable(); var tryToString = requireTryToString(); var $TypeError = TypeError; // `Assert: IsCallable(argument) is true` aCallable = function (argument) { if (isCallable(argument)) return argument; throw new $TypeError(tryToString(argument) + ' is not a function'); }; return aCallable; } var isNullOrUndefined$1; var hasRequiredIsNullOrUndefined; function requireIsNullOrUndefined () { if (hasRequiredIsNullOrUndefined) return isNullOrUndefined$1; hasRequiredIsNullOrUndefined = 1; // we can't use just `it == null` since of `document.all` special case // https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec isNullOrUndefined$1 = function (it) { return it === null || it === undefined; }; return isNullOrUndefined$1; } var getMethod$1; var hasRequiredGetMethod; function requireGetMethod () { if (hasRequiredGetMethod) return getMethod$1; hasRequiredGetMethod = 1; var aCallable = requireACallable(); var isNullOrUndefined = requireIsNullOrUndefined(); // `GetMethod` abstract operation // https://tc39.es/ecma262/#sec-getmethod getMethod$1 = function (V, P) { var func = V[P]; return isNullOrUndefined(func) ? undefined : aCallable(func); }; return getMethod$1; } var ordinaryToPrimitive; var hasRequiredOrdinaryToPrimitive; function requireOrdinaryToPrimitive () { if (hasRequiredOrdinaryToPrimitive) return ordinaryToPrimitive; hasRequiredOrdinaryToPrimitive = 1; var call = requireFunctionCall(); var isCallable = requireIsCallable(); var isObject = requireIsObject(); var $TypeError = TypeError; // `OrdinaryToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-ordinarytoprimitive ordinaryToPrimitive = 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"); }; return ordinaryToPrimitive; } var sharedStore = {exports: {}}; var isPure; var hasRequiredIsPure; function requireIsPure () { if (hasRequiredIsPure) return isPure; hasRequiredIsPure = 1; isPure = false; return isPure; } var defineGlobalProperty; var hasRequiredDefineGlobalProperty; function requireDefineGlobalProperty () { if (hasRequiredDefineGlobalProperty) return defineGlobalProperty; hasRequiredDefineGlobalProperty = 1; var globalThis = requireGlobalThis(); // eslint-disable-next-line es/no-object-defineproperty -- safe var defineProperty = Object.defineProperty; defineGlobalProperty = function (key, value) { try { defineProperty(globalThis, key, { value: value, configurable: true, writable: true }); } catch (error) { globalThis[key] = value; } return value; }; return defineGlobalProperty; } var hasRequiredSharedStore; function requireSharedStore () { if (hasRequiredSharedStore) return sharedStore.exports; hasRequiredSharedStore = 1; var IS_PURE = requireIsPure(); var globalThis = requireGlobalThis(); var defineGlobalProperty = requireDefineGlobalProperty(); var SHARED = '__core-js_shared__'; var store = sharedStore.exports = globalThis[SHARED] || defineGlobalProperty(SHARED, {}); (store.versions || (store.versions = [])).push({ version: '3.39.0', mode: IS_PURE ? 'pure' : 'global', copyright: '© 2014-2024 Denis Pushkarev (zloirock.ru)', license: 'https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE', source: 'https://github.com/zloirock/core-js' }); return sharedStore.exports; } var shared; var hasRequiredShared; function requireShared () { if (hasRequiredShared) return shared; hasRequiredShared = 1; var store = requireSharedStore(); shared = function (key, value) { return store[key] || (store[key] = value || {}); }; return shared; } var requireObjectCoercible; var hasRequiredRequireObjectCoercible; function requireRequireObjectCoercible () { if (hasRequiredRequireObjectCoercible) return requireObjectCoercible; hasRequiredRequireObjectCoercible = 1; var isNullOrUndefined = requireIsNullOrUndefined(); var $TypeError = TypeError; // `RequireObjectCoercible` abstract operation // https://tc39.es/ecma262/#sec-requireobjectcoercible requireObjectCoercible = function (it) { if (isNullOrUndefined(it)) throw new $TypeError("Can't call method on " + it); return it; }; return requireObjectCoercible; } var toObject; var hasRequiredToObject; function requireToObject () { if (hasRequiredToObject) return toObject; hasRequiredToObject = 1; var requireObjectCoercible = requireRequireObjectCoercible(); var $Object = Object; // `ToObject` abstract operation // https://tc39.es/ecma262/#sec-toobject toObject = function (argument) { return $Object(requireObjectCoercible(argument)); }; return toObject; } var hasOwnProperty_1; var hasRequiredHasOwnProperty; function requireHasOwnProperty () { if (hasRequiredHasOwnProperty) return hasOwnProperty_1; hasRequiredHasOwnProperty = 1; var uncurryThis = requireFunctionUncurryThis(); var toObject = requireToObject(); var hasOwnProperty = uncurryThis({}.hasOwnProperty); // `HasOwnProperty` abstract operation // https://tc39.es/ecma262/#sec-hasownproperty // eslint-disable-next-line es/no-object-hasown -- safe hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) { return hasOwnProperty(toObject(it), key); }; return hasOwnProperty_1; } var uid; var hasRequiredUid; function requireUid () { if (hasRequiredUid) return uid; hasRequiredUid = 1; var uncurryThis = requireFunctionUncurryThis(); var id = 0; var postfix = Math.random(); var toString = uncurryThis(1.0.toString); uid = function (key) { return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString(++id + postfix, 36); }; return uid; } var wellKnownSymbol; var hasRequiredWellKnownSymbol; function requireWellKnownSymbol () { if (hasRequiredWellKnownSymbol) return wellKnownSymbol; hasRequiredWellKnownSymbol = 1; var globalThis = requireGlobalThis(); var shared = requireShared(); var hasOwn = requireHasOwnProperty(); var uid = requireUid(); var NATIVE_SYMBOL = requireSymbolConstructorDetection(); var USE_SYMBOL_AS_UID = requireUseSymbolAsUid(); var Symbol = globalThis.Symbol; var WellKnownSymbolsStore = shared('wks'); var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol['for'] || Symbol : Symbol && Symbol.withoutSetter || uid; wellKnownSymbol = function (name) { if (!hasOwn(WellKnownSymbolsStore, name)) { WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol, name) ? Symbol[name] : createWellKnownSymbol('Symbol.' + name); } return WellKnownSymbolsStore[name]; }; return wellKnownSymbol; } var toPrimitive; var hasRequiredToPrimitive; function requireToPrimitive () { if (hasRequiredToPrimitive) return toPrimitive; hasRequiredToPrimitive = 1; var call = requireFunctionCall(); var isObject = requireIsObject(); var isSymbol = requireIsSymbol(); var getMethod = requireGetMethod(); var ordinaryToPrimitive = requireOrdinaryToPrimitive(); var wellKnownSymbol = requireWellKnownSymbol(); var $TypeError = TypeError; var TO_PRIMITIVE = wellKnownSymbol('toPrimitive'); // `ToPrimitive` abstract operation // https://tc39.es/ecma262/#sec-toprimitive toPrimitive = 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); }; return toPrimitive; } var toPropertyKey; var hasRequiredToPropertyKey; function requireToPropertyKey () { if (hasRequiredToPropertyKey) return toPropertyKey; hasRequiredToPropertyKey = 1; var toPrimitive = requireToPrimitive(); var isSymbol = requireIsSymbol(); // `ToPropertyKey` abstract operation // https://tc39.es/ecma262/#sec-topropertykey toPropertyKey = function (argument) { var key = toPrimitive(argument, 'string'); return isSymbol(key) ? key : key + ''; }; return toPropertyKey; } var hasRequiredObjectDefineProperty; function requireObjectDefineProperty () { if (hasRequiredObjectDefineProperty) return objectDefineProperty; hasRequiredObjectDefineProperty = 1; var DESCRIPTORS = requireDescriptors(); var IE8_DOM_DEFINE = requireIe8DomDefine(); var V8_PROTOTYPE_DEFINE_BUG = requireV8PrototypeDefineBug(); var anObject = requireAnObject(); var toPropertyKey = requireToPropertyKey(); 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 objectDefineProperty.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; }; return objectDefineProperty; } var makeBuiltIn = {exports: {}}; var functionName; var hasRequiredFunctionName; function requireFunctionName () { if (hasRequiredFunctionName) return functionName; hasRequiredFunctionName = 1; var DESCRIPTORS = requireDescriptors(); var hasOwn = requireHasOwnProperty(); 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)); functionName = { EXISTS: EXISTS, PROPER: PROPER, CONFIGURABLE: CONFIGURABLE }; return functionName; } var inspectSource; var hasRequiredInspectSource; function requireInspectSource () { if (hasRequiredInspectSource) return inspectSource; hasRequiredInspectSource = 1; var uncurryThis = requireFunctionUncurryThis(); var isCallable = requireIsCallable(); var store = requireSharedStore(); 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); }; } inspectSource = store.inspectSource; return inspectSource; } var weakMapBasicDetection; var hasRequiredWeakMapBasicDetection; function requireWeakMapBasicDetection () { if (hasRequiredWeakMapBasicDetection) return weakMapBasicDetection; hasRequiredWeakMapBasicDetection = 1; var globalThis = requireGlobalThis(); var isCallable = requireIsCallable(); var WeakMap = globalThis.WeakMap; weakMapBasicDetection = isCallable(WeakMap) && /native code/.test(String(WeakMap)); return weakMapBasicDetection; } var createPropertyDescriptor; var hasRequiredCreatePropertyDescriptor; function requireCreatePropertyDescriptor () { if (hasRequiredCreatePropertyDescriptor) return createPropertyDescriptor; hasRequiredCreatePropertyDescriptor = 1; createPropertyDescriptor = function (bitmap, value) { return { enumerable: !(bitmap & 1), configurable: !(bitmap & 2), writable: !(bitmap & 4), value: value }; }; return createPropertyDescriptor; } var createNonEnumerableProperty; var hasRequiredCreateNonEnumerableProperty; function requireCreateNonEnumerableProperty () { if (hasRequiredCreateNonEnumerableProperty) return createNonEnumerableProperty; hasRequiredCreateNonEnumerableProperty = 1; var DESCRIPTORS = requireDescriptors(); var definePropertyModule = requireObjectDefineProperty(); var createPropertyDescriptor = requireCreatePropertyDescriptor(); createNonEnumerableProperty = DESCRIPTORS ? function (object, key, value) { return definePropertyModule.f(object, key, createPropertyDescriptor(1, value)); } : function (object, key, value) { object[key] = value; return object; }; return createNonEnumerableProperty; } var sharedKey; var hasRequiredSharedKey; function requireSharedKey () { if (hasRequiredSharedKey) return sharedKey; hasRequiredSharedKey = 1; var shared = requireShared(); var uid = requireUid(); var keys = shared('keys'); sharedKey = function (key) { return keys[key] || (keys[key] = uid(key)); }; return sharedKey; } var hiddenKeys; var hasRequiredHiddenKeys; function requireHiddenKeys () { if (hasRequiredHiddenKeys) return hiddenKeys; hasRequiredHiddenKeys = 1; hiddenKeys = {}; return hiddenKeys; } var internalState; var hasRequiredInternalState; function requireInternalState () { if (hasRequiredInternalState) return internalState; hasRequiredInternalState = 1; var NATIVE_WEAK_MAP = requireWeakMapBasicDetection(); var globalThis = requireGlobalThis(); var isObject = requireIsObject(); var createNonEnumerableProperty = requireCreateNonEnumerableProperty(); var hasOwn = requireHasOwnProperty(); var shared = requireSharedStore(); var sharedKey = requireSharedKey(); var hiddenKeys = requireHiddenKeys(); 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); }; } internalState = { set: set, get: get, has: has, enforce: enforce, getterFor: getterFor }; return internalState; } var hasRequiredMakeBuiltIn; function requireMakeBuiltIn () { if (hasRequiredMakeBuiltIn) return makeBuiltIn.exports; hasRequiredMakeBuiltIn = 1; var uncurryThis = requireFunctionUncurryThis(); var fails = requireFails(); var isCallable = requireIsCallable(); var hasOwn = requireHasOwnProperty(); var DESCRIPTORS = requireDescriptors(); var CONFIGURABLE_FUNCTION_NAME = requireFunctionName().CONFIGURABLE; var inspectSource = requireInspectSource(); var InternalStateModule = requireInternalState(); 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$1 = makeBuiltIn.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$1(function toString() { return isCallable(this) && getInternalState(this).source || inspectSource(this); }, 'toString'); return makeBuiltIn.exports; } var defineBuiltIn; var hasRequiredDefineBuiltIn; function requireDefineBuiltIn () { if (hasRequiredDefineBuiltIn) return defineBuiltIn; hasRequiredDefineBuiltIn = 1; var isCallable = requireIsCallable(); var definePropertyModule = requireObjectDefineProperty(); var makeBuiltIn = requireMakeBuiltIn(); var defineGlobalProperty = requireDefineGlobalProperty(); defineBuiltIn = 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; }; return defineBuiltIn; } var toStringTagSupport; var hasRequiredToStringTagSupport; function requireToStringTagSupport () { if (hasRequiredToStringTagSupport) return toStringTagSupport; hasRequiredToStringTagSupport = 1; var wellKnownSymbol = requireWellKnownSymbol(); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); var test = {}; test[TO_STRING_TAG] = 'z'; toStringTagSupport = String(test) === '[object z]'; return toStringTagSupport; } var classofRaw; var hasRequiredClassofRaw; function requireClassofRaw () { if (hasRequiredClassofRaw) return classofRaw; hasRequiredClassofRaw = 1; var uncurryThis = requireFunctionUncurryThis(); var toString = uncurryThis({}.toString); var stringSlice = uncurryThis(''.slice); classofRaw = function (it) { return stringSlice(toString(it), 8, -1); }; return classofRaw; } var classof; var hasRequiredClassof; function requireClassof () { if (hasRequiredClassof) return classof; hasRequiredClassof = 1; var TO_STRING_TAG_SUPPORT = requireToStringTagSupport(); var isCallable = requireIsCallable(); var classofRaw = requireClassofRaw(); var wellKnownSymbol = requireWellKnownSymbol(); 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` classof = 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; }; return classof; } var toString; var hasRequiredToString; function requireToString () { if (hasRequiredToString) return toString; hasRequiredToString = 1; var classof = requireClassof(); var $String = String; toString = function (argument) { if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string'); return $String(argument); }; return toString; } var normalizeStringArgument; var hasRequiredNormalizeStringArgument; function requireNormalizeStringArgument () { if (hasRequiredNormalizeStringArgument) return normalizeStringArgument; hasRequiredNormalizeStringArgument = 1; var toString = requireToString(); normalizeStringArgument = function (argument, $default) { return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument); }; return normalizeStringArgument; } var errorToString; var hasRequiredErrorToString; function requireErrorToString () { if (hasRequiredErrorToString) return errorToString; hasRequiredErrorToString = 1; var DESCRIPTORS = requireDescriptors(); var fails = requireFails(); var anObject = requireAnObject(); var normalizeStringArgument = requireNormalizeStringArgument(); var nativeErrorToString = Error.prototype.toString; var INCORRECT_TO_STRING = fails(function () { if (DESCRIPTORS) { // Chrome 32- incorrectly call accessor // eslint-disable-next-line es/no-object-create, es/no-object-defineproperty -- safe var object = Object.create(Object.defineProperty({}, 'name', { get: function () { return this === object; } })); if (nativeErrorToString.call(object) !== 'true') return true; } // FF10- does not properly handle non-strings return nativeErrorToString.call({ message: 1, name: 2 }) !== '2: 1' // IE8 does not properly handle defaults || nativeErrorToString.call({}) !== 'Error'; }); errorToString = INCORRECT_TO_STRING ? function toString() { var O = anObject(this); var name = normalizeStringArgument(O.name, 'Error'); var message = normalizeStringArgument(O.message); return !name ? message : !message ? name : name + ': ' + message; } : nativeErrorToString; return errorToString; } var hasRequiredEs_error_toString; function requireEs_error_toString () { if (hasRequiredEs_error_toString) return es_error_toString; hasRequiredEs_error_toString = 1; var defineBuiltIn = requireDefineBuiltIn(); var errorToString = requireErrorToString(); var ErrorPrototype = Error.prototype; // `Error.prototype.toString` method fix // https://tc39.es/ecma262/#sec-error.prototype.tostring if (ErrorPrototype.toString !== errorToString) { defineBuiltIn(ErrorPrototype, 'toString', errorToString); } return es_error_toString; } var indexedObject; var hasRequiredIndexedObject; function requireIndexedObject () { if (hasRequiredIndexedObject) return indexedObject; hasRequiredIndexedObject = 1; var uncurryThis = requireFunctionUncurryThis(); var fails = requireFails(); var classof = requireClassofRaw(); var $Object = Object; var split = uncurryThis(''.split); // fallback for non-array-like ES3 and non-enumerable old V8 strings indexedObject = 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; return indexedObject; } var toIndexedObject; var hasRequiredToIndexedObject; function requireToIndexedObject () { if (hasRequiredToIndexedObject) return toIndexedObject; hasRequiredToIndexedObject = 1; // toObject with fallback for non-array-like ES3 strings var IndexedObject = requireIndexedObject(); var requireObjectCoercible = requireRequireObjectCoercible(); toIndexedObject = function (it) { return IndexedObject(requireObjectCoercible(it)); }; return toIndexedObject; } var objectDefineProperties = {}; var mathTrunc; var hasRequiredMathTrunc; function requireMathTrunc () { if (hasRequiredMathTrunc) return mathTrunc; hasRequiredMathTrunc = 1; 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 mathTrunc = Math.trunc || function trunc(x) { var n = +x; return (n > 0 ? floor : ceil)(n); }; return mathTrunc; } var toIntegerOrInfinity; var hasRequiredToIntegerOrInfinity; function requireToIntegerOrInfinity () { if (hasRequiredToIntegerOrInfinity) return toIntegerOrInfinity; hasRequiredToIntegerOrInfinity = 1; var trunc = requireMathTrunc(); // `ToIntegerOrInfinity` abstract operation // https://tc39.es/ecma262/#sec-tointegerorinfinity toIntegerOrInfinity = function (argument) { var number = +argument; // eslint-disable-next-line no-self-compare -- NaN check return number !== number || number === 0 ? 0 : trunc(number); }; return toIntegerOrInfinity; } var toAbsoluteIndex; var hasRequiredToAbsoluteIndex; function requireToAbsoluteIndex () { if (hasRequiredToAbsoluteIndex) return toAbsoluteIndex; hasRequiredToAbsoluteIndex = 1; var toIntegerOrInfinity = requireToIntegerOrInfinity(); 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). toAbsoluteIndex = function (index, length) { var integer = toIntegerOrInfinity(index); return integer < 0 ? max(integer + length, 0) : min(integer, length); }; return toAbsoluteIndex; } var toLength; var hasRequiredToLength; function requireToLength () { if (hasRequiredToLength) return toLength; hasRequiredToLength = 1; var toIntegerOrInfinity = requireToIntegerOrInfinity(); var min = Math.min; // `ToLength` abstract operation // https://tc39.es/ecma262/#sec-tolength toLength = function (argument) { var len = toIntegerOrInfinity(argument); return len > 0 ? min(len, 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991 }; return toLength; } var lengthOfArrayLike; var hasRequiredLengthOfArrayLike; function requireLengthOfArrayLike () { if (hasRequiredLengthOfArrayLike) return lengthOfArrayLike; hasRequiredLengthOfArrayLike = 1; var toLength = requireToLength(); // `LengthOfArrayLike` abstract operation // https://tc39.es/ecma262/#sec-lengthofarraylike lengthOfArrayLike = function (obj) { return toLength(obj.length); }; return lengthOfArrayLike; } var arrayIncludes; var hasRequiredArrayIncludes; function requireArrayIncludes () { if (hasRequiredArrayIncludes) return arrayIncludes; hasRequiredArrayIncludes = 1; var toIndexedObject = requireToIndexedObject(); var toAbsoluteIndex = requireToAbsoluteIndex(); var lengthOfArrayLike = requireLengthOfArrayLike(); // `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; }; }; arrayIncludes = { // `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) }; return arrayIncludes; } var objectKeysInternal; var hasRequiredObjectKeysInternal; function requireObjectKeysInternal () { if (hasRequiredObjectKeysInternal) return objectKeysInternal; hasRequiredObjectKeysInternal = 1; var uncurryThis = requireFunctionUncurryThis(); var hasOwn = requireHasOwnProperty(); var toIndexedObject = requireToIndexedObject(); var indexOf = requireArrayIncludes().indexOf; var hiddenKeys = requireHiddenKeys(); var push = uncurryThis([].push); objectKeysInternal = 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; }; return objectKeysInternal; } var enumBugKeys; var hasRequiredEnumBugKeys; function requireEnumBugKeys () { if (hasRequiredEnumBugKeys) return enumBugKeys; hasRequiredEnumBugKeys = 1; // IE8- don't enum bug keys enumBugKeys = [ 'constructor', 'hasOwnProperty', 'isPrototypeOf', 'propertyIsEnumerable', 'toLocaleString', 'toString', 'valueOf' ]; return enumBugKeys; } var objectKeys; var hasRequiredObjectKeys; function requireObjectKeys () { if (hasRequiredObjectKeys) return objectKeys; hasRequiredObjectKeys = 1; var internalObjectKeys = requireObjectKeysInternal(); var enumBugKeys = requireEnumBugKeys(); // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys // eslint-disable-next-line es/no-object-keys -- safe objectKeys = Object.keys || function keys(O) { return internalObjectKeys(O, enumBugKeys); }; return objectKeys; } var hasRequiredObjectDefineProperties; function requireObjectDefineProperties () { if (hasRequiredObjectDefineProperties) return objectDefineProperties; hasRequiredObjectDefineProperties = 1; var DESCRIPTORS = requireDescriptors(); var V8_PROTOTYPE_DEFINE_BUG = requireV8PrototypeDefineBug(); var definePropertyModule = requireObjectDefineProperty(); var anObject = requireAnObject(); var toIndexedObject = requireToIndexedObject(); var objectKeys = requireObjectKeys(); // `Object.defineProperties` method // https://tc39.es/ecma262/#sec-object.defineproperties // eslint-disable-next-line es/no-object-defineproperties -- safe objectDefineProperties.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; }; return objectDefineProperties; } var html$1; var hasRequiredHtml; function requireHtml () { if (hasRequiredHtml) return html$1; hasRequiredHtml = 1; var getBuiltIn = requireGetBuiltIn(); html$1 = getBuiltIn('document', 'documentElement'); return html$1; } var objectCreate; var hasRequiredObjectCreate; function requireObjectCreate () { if (hasRequiredObjectCreate) return objectCreate; hasRequiredObjectCreate = 1; /* global ActiveXObject -- old IE, WSH */ var anObject = requireAnObject(); var definePropertiesModule = requireObjectDefineProperties(); var enumBugKeys = requireEnumBugKeys(); var hiddenKeys = requireHiddenKeys(); var html = requireHtml(); var documentCreateElement = requireDocumentCreateElement(); var sharedKey = requireSharedKey(); 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 objectCreate = 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); }; return objectCreate; } var addToUnscopables; var hasRequiredAddToUnscopables; function requireAddToUnscopables () { if (hasRequiredAddToUnscopables) return addToUnscopables; hasRequiredAddToUnscopables = 1; var wellKnownSymbol = requireWellKnownSymbol(); var create = requireObjectCreate(); var defineProperty = requireObjectDefineProperty().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] addToUnscopables = function (key) { ArrayPrototype[UNSCOPABLES][key] = true; }; return addToUnscopables; } var iterators; var hasRequiredIterators; function requireIterators () { if (hasRequiredIterators) return iterators; hasRequiredIterators = 1; iterators = {}; return iterators; } var objectGetOwnPropertyDescriptor = {}; var objectPropertyIsEnumerable = {}; var hasRequiredObjectPropertyIsEnumerable; function requireObjectPropertyIsEnumerable () { if (hasRequiredObjectPropertyIsEnumerable) return objectPropertyIsEnumerable; hasRequiredObjectPropertyIsEnumerable = 1; 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 objectPropertyIsEnumerable.f = NASHORN_BUG ? function propertyIsEnumerable(V) { var descriptor = getOwnPropertyDescriptor(this, V); return !!descriptor && descriptor.enumerable; } : $propertyIsEnumerable; return objectPropertyIsEnumerable; } var hasRequiredObjectGetOwnPropertyDescriptor; function requireObjectGetOwnPropertyDescriptor () { if (hasRequiredObjectGetOwnPropertyDescriptor) return objectGetOwnPropertyDescriptor; hasRequiredObjectGetOwnPropertyDescriptor = 1; var DESCRIPTORS = requireDescriptors(); var call = requireFunctionCall(); var propertyIsEnumerableModule = requireObjectPropertyIsEnumerable(); var createPropertyDescriptor = requireCreatePropertyDescriptor(); var toIndexedObject = requireToIndexedObject(); var toPropertyKey = requireToPropertyKey(); var hasOwn = requireHasOwnProperty(); var IE8_DOM_DEFINE = requireIe8DomDefine(); // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor; // `Object.getOwnPropertyDescriptor` method // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor objectGetOwnPropertyDescriptor.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]); }; return objectGetOwnPropertyDescriptor; } var objectGetOwnPropertyNames = {}; var hasRequiredObjectGetOwnPropertyNames; function requireObjectGetOwnPropertyNames () { if (hasRequiredObjectGetOwnPropertyNames) return objectGetOwnPropertyNames; hasRequiredObjectGetOwnPropertyNames = 1; var internalObjectKeys = requireObjectKeysInternal(); var enumBugKeys = requireEnumBugKeys(); 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 objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) { return internalObjectKeys(O, hiddenKeys); }; return objectGetOwnPropertyNames; } var objectGetOwnPropertySymbols = {}; var hasRequiredObjectGetOwnPropertySymbols; function requireObjectGetOwnPropertySymbols () { if (hasRequiredObjectGetOwnPropertySymbols) return objectGetOwnPropertySymbols; hasRequiredObjectGetOwnPropertySymbols = 1; // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols; return objectGetOwnPropertySymbols; } var ownKeys$1; var hasRequiredOwnKeys; function requireOwnKeys () { if (hasRequiredOwnKeys) return ownKeys$1; hasRequiredOwnKeys = 1; var getBuiltIn = requireGetBuiltIn(); var uncurryThis = requireFunctionUncurryThis(); var getOwnPropertyNamesModule = requireObjectGetOwnPropertyNames(); var getOwnPropertySymbolsModule = requireObjectGetOwnPropertySymbols(); var anObject = requireAnObject(); var concat = uncurryThis([].concat); // all object keys, includes non-enumerable and symbols ownKeys$1 = getBuiltIn('Reflect', 'ownKeys') || function ownKeys(it) { var keys = getOwnPropertyNamesModule.f(anObject(it)); var getOwnPropertySymbols = getOwnPropertySymbolsModule.f; return getOwnPropertySymbols ? concat(keys, getOwnPropertySymbols(it)) : keys; }; return ownKeys$1; } var copyConstructorProperties; var hasRequiredCopyConstructorProperties; function requireCopyConstructorProperties () { if (hasRequiredCopyConstructorProperties) return copyConstructorProperties; hasRequiredCopyConstructorProperties = 1; var hasOwn = requireHasOwnProperty(); var ownKeys = requireOwnKeys(); var getOwnPropertyDescriptorModule = requireObjectGetOwnPropertyDescriptor(); var definePropertyModule = requireObjectDefineProperty(); copyConstructorProperties = 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)); } } }; return copyConstructorProperties; } var isForced_1; var hasRequiredIsForced; function requireIsForced () { if (hasRequiredIsForced) return isForced_1; hasRequiredIsForced = 1; var fails = requireFails(); var isCallable = requireIsCallable(); 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'; isForced_1 = isForced; return isForced_1; } var _export; var hasRequired_export; function require_export () { if (hasRequired_export) return _export; hasRequired_export = 1; var globalThis = requireGlobalThis(); var getOwnPropertyDescriptor = requireObjectGetOwnPropertyDescriptor().f; var createNonEnumerableProperty = requireCreateNonEnumerableProperty(); var defineBuiltIn = requireDefineBuiltIn(); var defineGlobalProperty = requireDefineGlobalProperty(); var copyConstructorProperties = requireCopyConstructorProperties(); var isForced = requireIsForced(); /* 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 */ _export = 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); } }; return _export; } var correctPrototypeGetter; var hasRequiredCorrectPrototypeGetter; function requireCorrectPrototypeGetter () { if (hasRequiredCorrectPrototypeGetter) return correctPrototypeGetter; hasRequiredCorrectPrototypeGetter = 1; var fails = requireFails(); correctPrototypeGetter = !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; }); return correctPrototypeGetter; } var objectGetPrototypeOf; var hasRequiredObjectGetPrototypeOf; function requireObjectGetPrototypeOf () { if (hasRequiredObjectGetPrototypeOf) return objectGetPrototypeOf; hasRequiredObjectGetPrototypeOf = 1; var hasOwn = requireHasOwnProperty(); var isCallable = requireIsCallable(); var toObject = requireToObject(); var sharedKey = requireSharedKey(); var CORRECT_PROTOTYPE_GETTER = requireCorrectPrototypeGetter(); 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 objectGetPrototypeOf = 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; }; return objectGetPrototypeOf; } var iteratorsCore; var hasRequiredIteratorsCore; function requireIteratorsCore () { if (hasRequiredIteratorsCore) return iteratorsCore; hasRequiredIteratorsCore = 1; var fails = requireFails(); var isCallable = requireIsCallable(); var isObject = requireIsObject(); var create = requireObjectCreate(); var getPrototypeOf = requireObjectGetPrototypeOf(); var defineBuiltIn = requireDefineBuiltIn(); var wellKnownSymbol = requireWellKnownSymbol(); var IS_PURE = requireIsPure(); 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; }); } iteratorsCore = { IteratorPrototype: IteratorPrototype, BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS }; return iteratorsCore; } var setToStringTag; var hasRequiredSetToStringTag; function requireSetToStringTag () { if (hasRequiredSetToStringTag) return setToStringTag; hasRequiredSetToStringTag = 1; var defineProperty = requireObjectDefineProperty().f; var hasOwn = requireHasOwnProperty(); var wellKnownSymbol = requireWellKnownSymbol(); var TO_STRING_TAG = wellKnownSymbol('toStringTag'); setToStringTag = 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 }); } }; return setToStringTag; } var iteratorCreateConstructor; var hasRequiredIteratorCreateConstructor; function requireIteratorCreateConstructor () { if (hasRequiredIteratorCreateConstructor) return iteratorCreateConstructor; hasRequiredIteratorCreateConstructor = 1; var IteratorPrototype = requireIteratorsCore().IteratorPrototype; var create = requireObjectCreate(); var createPropertyDescriptor = requireCreatePropertyDescriptor(); var setToStringTag = requireSetToStringTag(); var Iterators = requireIterators(); var returnThis = function () { return this; }; iteratorCreateConstructor = 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; }; return iteratorCreateConstructor; } var functionUncurryThisAccessor; var hasRequiredFunctionUncurryThisAccessor; function requireFunctionUncurryThisAccessor () { if (hasRequiredFunctionUncurryThisAccessor) return functionUncurryThisAccessor; hasRequiredFunctionUncurryThisAccessor = 1; var uncurryThis = requireFunctionUncurryThis(); var aCallable = requireACallable(); functionUncurryThisAccessor = 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 */ } }; return functionUncurryThisAccessor; } var isPossiblePrototype; var hasRequiredIsPossiblePrototype; function requireIsPossiblePrototype () { if (hasRequiredIsPossiblePrototype) return isPossiblePrototype; hasRequiredIsPossiblePrototype = 1; var isObject = requireIsObject(); isPossiblePrototype = function (argument) { return isObject(argument) || argument === null; }; return isPossiblePrototype; } var aPossiblePrototype; var hasRequiredAPossiblePrototype; function requireAPossiblePrototype () { if (hasRequiredAPossiblePrototype) return aPossiblePrototype; hasRequiredAPossiblePrototype = 1; var isPossiblePrototype = requireIsPossiblePrototype(); var $String = String; var $TypeError = TypeError; aPossiblePrototype = function (argument) { if (isPossiblePrototype(argument)) return argument; throw new $TypeError("Can't set " + $String(argument) + ' as a prototype'); }; return aPossiblePrototype; } var objectSetPrototypeOf; var hasRequiredObjectSetPrototypeOf; function requireObjectSetPrototypeOf () { if (hasRequiredObjectSetPrototypeOf) return objectSetPrototypeOf; hasRequiredObjectSetPrototypeOf = 1; /* eslint-disable no-proto -- safe */ var uncurryThisAccessor = requireFunctionUncurryThisAccessor(); var isObject = requireIsObject(); var requireObjectCoercible = requireRequireObjectCoercible(); var aPossiblePrototype = requireAPossiblePrototype(); // `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 objectSetPrototypeOf = 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); return objectSetPrototypeOf; } var iteratorDefine; var hasRequiredIteratorDefine; function requireIteratorDefine () { if (hasRequiredIteratorDefine) return iteratorDefine; hasRequiredIteratorDefine = 1; var $ = require_export(); var call = requireFunctionCall(); var IS_PURE = requireIsPure(); var FunctionName = requireFunctionName(); var isCallable = requireIsCallable(); var createIteratorConstructor = requireIteratorCreateConstructor(); var getPrototypeOf = requireObjectGetPrototypeOf(); var setPrototypeOf = requireObjectSetPrototypeOf(); var setToStringTag = requireSetToStringTag(); var createNonEnumerableProperty = requireCreateNonEnumerableProperty(); var defineBuiltIn = requireDefineBuiltIn(); var wellKnownSymbol = requireWellKnownSymbol(); var Iterators = requireIterators(); var IteratorsCore = requireIteratorsCore(); 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; }; iteratorDefine = 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; }; return iteratorDefine; } var createIterResultObject; var hasRequiredCreateIterResultObject; function requireCreateIterResultObject () { if (hasRequiredCreateIterResultObject) return createIterResultObject; hasRequiredCreateIterResultObject = 1; // `CreateIterResultObject` abstract operation // https://tc39.es/ecma262/#sec-createiterresultobject createIterResultObject = function (value, done) { return { value: value, done: done }; }; return createIterResultObject; } var es_array_iterator; var hasRequiredEs_array_iterator; function requireEs_array_iterator () { if (hasRequiredEs_array_iterator) return es_array_iterator; hasRequiredEs_array_iterator = 1; var toIndexedObject = requireToIndexedObject(); var addToUnscopables = requireAddToUnscopables(); var Iterators = requireIterators(); var InternalStateModule = requireInternalState(); var defineProperty = requireObjectDefineProperty().f; var defineIterator = requireIteratorDefine(); var createIterResultObject = requireCreateIterResultObject(); var IS_PURE = requireIsPure(); var DESCRIPTORS = requireDescriptors(); 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 es_array_iterator = 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 */ } return es_array_iterator; } var es_object_keys = {}; var hasRequiredEs_object_keys; function requireEs_object_keys () { if (hasRequiredEs_object_keys) return es_object_keys; hasRequiredEs_object_keys = 1; var $ = require_export(); var toObject = requireToObject(); var nativeKeys = requireObjectKeys(); var fails = requireFails(); var FAILS_ON_PRIMITIVES = fails(function () { nativeKeys(1); }); // `Object.keys` method // https://tc39.es/ecma262/#sec-object.keys $({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES }, { keys: function keys(it) { return nativeKeys(toObject(it)); } }); return es_object_keys; } var es_object_toString = {}; var objectToString; var hasRequiredObjectToString; function requireObjectToString () { if (hasRequiredObjectToString) return objectToString; hasRequiredObjectToString = 1; var TO_STRING_TAG_SUPPORT = requireToStringTagSupport(); var classof = requireClassof(); // `Object.prototype.toString` method implementation // https://tc39.es/ecma262/#sec-object.prototype.tostring objectToString = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() { return '[object ' + classof(this) + ']'; }; return objectToString; } var hasRequiredEs_object_toString; function requireEs_object_toString () { if (hasRequiredEs_object_toString) return es_object_toString; hasRequiredEs_object_toString = 1; var TO_STRING_TAG_SUPPORT = requireToStringTagSupport(); var defineBuiltIn = requireDefineBuiltIn(); var toString = requireObjectToString(); // `Object.prototype.toString` method // https://tc39.es/ecma262/#sec-object.prototype.tostring if (!TO_STRING_TAG_SUPPORT) { defineBuiltIn(Object.prototype, 'toString', toString, { unsafe: true }); } return es_object_toString; } var es_map = {}; var es_map_constructor = {}; var internalMetadata = {exports: {}}; var objectGetOwnPropertyNamesExternal = {}; var arraySlice; var hasRequiredArraySlice; function requireArraySlice () { if (hasRequiredArraySlice) return arraySlice; hasRequiredArraySlice = 1; var uncurryThis = requireFunctionUncurryThis(); arraySlice = uncurryThis([].slice); return arraySlice; } var hasRequiredObjectGetOwnPropertyNamesExternal; function requireObjectGetOwnPropertyNamesExternal () { if (hasRequiredObjectGetOwnPropertyNamesExternal) return objectGetOwnPropertyNamesExternal; hasRequiredObjectGetOwnPropertyNamesExternal = 1; /* eslint-disable es/no-object-getownpropertynames -- safe */ var classof = requireClassofRaw(); var toIndexedObject = requireToIndexedObject(); var $getOwnPropertyNames = requireObjectGetOwnPropertyNames().f; var arraySlice = requireArraySlice(); var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : []; var getWindowNames = function (it) { try { return $getOwnPropertyNames(it); } catch (error) { return arraySlice(windowNames); } }; // fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window objectGetOwnPropertyNamesExternal.f = function getOwnPropertyNames(it) { return windowNames && classof(it) === 'Window' ? getWindowNames(it) : $getOwnPropertyNames(toIndexedObject(it)); }; return objectGetOwnPropertyNamesExternal; } var arrayBufferNonExtensible; var hasRequiredArrayBufferNonExtensible; function requireArrayBufferNonExtensible () { if (hasRequiredArrayBufferNonExtensible) return arrayBufferNonExtensible; hasRequiredArrayBufferNonExtensible = 1; // FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it var fails = requireFails(); arrayBufferNonExtensible = fails(function () { if (typeof ArrayBuffer == 'function') { var buffer = new ArrayBuffer(8); // eslint-disable-next-line es/no-object-isextensible, es/no-object-defineproperty -- safe if (Object.isExtensible(buffer)) Object.defineProperty(buffer, 'a', { value: 8 }); } }); return arrayBufferNonExtensible; } var objectIsExtensible; var hasRequiredObjectIsExtensible; function requireObjectIsExtensible () { if (hasRequiredObjectIsExtensible) return objectIsExtensible; hasRequiredObjectIsExtensible = 1; var fails = requireFails(); var isObject = requireIsObject(); var classof = requireClassofRaw(); var ARRAY_BUFFER_NON_EXTENSIBLE = requireArrayBufferNonExtensible(); // eslint-disable-next-line es/no-object-isextensible -- safe var $isExtensible = Object.isExtensible; var FAILS_ON_PRIMITIVES = fails(function () { }); // `Object.isExtensible` method // https://tc39.es/ecma262/#sec-object.isextensible objectIsExtensible = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) { if (!isObject(it)) return false; if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it) === 'ArrayBuffer') return false; return $isExtensible ? $isExtensible(it) : true; } : $isExtensible; return objectIsExtensible; } var freezing; var hasRequiredFreezing; function requireFreezing () { if (hasRequiredFreezing) return freezing; hasRequiredFreezing = 1; var fails = requireFails(); freezing = !fails(function () { // eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing return Object.isExtensible(Object.preventExtensions({})); }); return freezing; } var hasRequiredInternalMetadata; function requireInternalMetadata () { if (hasRequiredInternalMetadata) return internalMetadata.exports; hasRequiredInternalMetadata = 1; var $ = require_export(); var uncurryThis = requireFunctionUncurryThis(); var hiddenKeys = requireHiddenKeys(); var isObject = requireIsObject(); var hasOwn = requireHasOwnProperty(); var defineProperty = requireObjectDefineProperty().f; var getOwnPropertyNamesModule = requireObjectGetOwnPropertyNames(); var getOwnPropertyNamesExternalModule = requireObjectGetOwnPropertyNamesExternal(); var isExtensible = requireObjectIsExtensible(); var uid = requireUid(); var FREEZING = requireFreezing(); var REQUIRED = false; var METADATA = uid('meta'); var id = 0; var setMetadata = function (it) { defineProperty(it, METADATA, { value: { objectID: 'O' + id++, // object ID weakData: {} // weak collections IDs } }); }; var fastKey = function (it, create) { // return a primitive with prefix if (!isObject(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it; if (!hasOwn(it, METADATA)) { // can't set metadata to uncaught frozen object if (!isExtensible(it)) return 'F'; // not necessary to add metadata if (!create) return 'E'; // add missing metadata setMetadata(it); // return object ID } return it[METADATA].objectID; }; var getWeakData = function (it, create) { if (!hasOwn(it, METADATA)) { // can't set metadata to uncaught frozen object if (!isExtensible(it)) return true; // not necessary to add metadata if (!create) return false; // add missing metadata setMetadata(it); // return the store of weak collections IDs } return it[METADATA].weakData; }; // add metadata on freeze-family methods calling var onFreeze = function (it) { if (FREEZING && REQUIRED && isExtensible(it) && !hasOwn(it, METADATA)) setMetadata(it); return it; }; var enable = function () { meta.enable = function () { /* empty */ }; REQUIRED = true; var getOwnPropertyNames = getOwnPropertyNamesModule.f; var splice = uncurryThis([].splice); var test = {}; test[METADATA] = 1; // prevent exposing of metadata key if (getOwnPropertyNames(test).length) { getOwnPropertyNamesModule.f = function (it) { var result = getOwnPropertyNames(it); for (var i = 0, length = result.length; i < length; i++) { if (result[i] === METADATA) { splice(result, i, 1); break; } } return result; }; $({ target: 'Object', stat: true, forced: true }, { getOwnPropertyNames: getOwnPropertyNamesExternalModule.f }); } }; var meta = internalMetadata.exports = { enable: enable, fastKey: fastKey, getWeakData: getWeakData, onFreeze: onFreeze }; hiddenKeys[METADATA] = true; return internalMetadata.exports; } var functionUncurryThisClause; var hasRequiredFunctionUncurryThisClause; function requireFunctionUncurryThisClause () { if (hasRequiredFunctionUncurryThisClause) return functionUncurryThisClause; hasRequiredFunctionUncurryThisClause = 1; var classofRaw = requireClassofRaw(); var uncurryThis = requireFunctionUncurryThis(); functionUncurryThisClause = 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); }; return functionUncurryThisClause; } var functionBindContext; var hasRequiredFunctionBindContext; function requireFunctionBindContext () { if (hasRequiredFunctionBindContext) return functionBindContext; hasRequiredFunctionBindContext = 1; var uncurryThis = requireFunctionUncurryThisClause(); var aCallable = requireACallable(); var NATIVE_BIND = requireFunctionBindNative(); var bind = uncurryThis(uncurryThis.bind); // optional / simple context binding functionBindContext = function (fn, that) { aCallable(fn); return that === undefined ? fn : NATIVE_BIND ? bind(fn, that) : function (/* ...args */) { return fn.apply(that, arguments); }; }; return functionBindContext; } var isArrayIteratorMethod; var hasRequiredIsArrayIteratorMethod; function requireIsArrayIteratorMethod () { if (hasRequiredIsArrayIteratorMethod) return isArrayIteratorMethod; hasRequiredIsArrayIteratorMethod = 1; var wellKnownSymbol = requireWellKnownSymbol(); var Iterators = requireIterators(); var ITERATOR = wellKnownSymbol('iterator'); var ArrayPrototype = Array.prototype; // check on default Array iterator isArrayIteratorMethod = function (it) { return it !== undefined && (Iterators.Array === it || ArrayPrototype[ITERATOR] === it); }; return isArrayIteratorMethod; } var getIteratorMethod; var hasRequiredGetIteratorMethod; function requireGetIteratorMethod () { if (hasRequiredGetIteratorMethod) return getIteratorMethod; hasRequiredGetIteratorMethod = 1; var classof = requireClassof(); var getMethod = requireGetMethod(); var isNullOrUndefined = requireIsNullOrUndefined(); var Iterators = requireIterators(); var wellKnownSymbol = requireWellKnownSymbol(); var ITERATOR = wellKnownSymbol('iterator'); getIteratorMethod = function (it) { if (!isNullOrUndefined(it)) return getMethod(it, ITERATOR) || getMethod(it, '@@iterator') || Iterators[classof(it)]; }; return getIteratorMethod; } var getIterator; var hasRequiredGetIterator; function requireGetIterator () { if (hasRequiredGetIterator) return getIterator; hasRequiredGetIterator = 1; var call = requireFunctionCall(); var aCallable = requireACallable(); var anObject = requireAnObject(); var tryToString = requireTryToString(); var getIteratorMethod = requireGetIteratorMethod(); var $TypeError = TypeError; getIterator = function (argument, usingIterator) { var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator; if (aCallable(iteratorMethod)) return anObject(call(iteratorMethod, argument)); throw new $TypeError(tryToString(argument) + ' is not iterable'); }; return getIterator; } var iteratorClose; var hasRequiredIteratorClose; function requireIteratorClose () { if (hasRequiredIteratorClose) return iteratorClose; hasRequiredIteratorClose = 1; var call = requireFunctionCall(); var anObject = requireAnObject(); var getMethod = requireGetMethod(); iteratorClose = 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; }; return iteratorClose; } var iterate; var hasRequiredIterate; function requireIterate () { if (hasRequiredIterate) return iterate; hasRequiredIterate = 1; var bind = requireFunctionBindContext(); var call = requireFunctionCall(); var anObject = requireAnObject(); var tryToString = requireTryToString(); var isArrayIteratorMethod = requireIsArrayIteratorMethod(); var lengthOfArrayLike = requireLengthOfArrayLike(); var isPrototypeOf = requireObjectIsPrototypeOf(); var getIterator = requireGetIterator(); var getIteratorMethod = requireGetIteratorMethod(); var iteratorClose = requireIteratorClose(); var $TypeError = TypeError; var Result = function (stopped, result) { this.stopped = stopped; this.result = result; }; var ResultPrototype = Result.prototype; iterate = 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) { if (iterator) iteratorClose(iterator, 'normal', condition); 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) { try { result = callFn(step.value); } catch (error) { iteratorClose(iterator, 'throw', error); } if (typeof result == 'object' && result && isPrototypeOf(ResultPrototype, result)) return result; } return new Result(false); }; return iterate; } var anInstance; var hasRequiredAnInstance; function requireAnInstance () { if (hasRequiredAnInstance) return anInstance; hasRequiredAnInstance = 1; var isPrototypeOf = requireObjectIsPrototypeOf(); var $TypeError = TypeError; anInstance = function (it, Prototype) { if (isPrototypeOf(Prototype, it)) return it; throw new $TypeError('Incorrect invocation'); }; return anInstance; } var checkCorrectnessOfIteration; var hasRequiredCheckCorrectnessOfIteration; function requireCheckCorrectnessOfIteration () { if (hasRequiredCheckCorrectnessOfIteration) return checkCorrectnessOfIteration; hasRequiredCheckCorrectnessOfIteration = 1; var wellKnownSymbol = requireWellKnownSymbol(); var ITERATOR = wellKnownSymbol('iterator'); var SAFE_CLOSING = false; try { var called = 0; var iteratorWithReturn = { next: function () { return { done: !!called++ }; }, 'return': function () { SAFE_CLOSING = true; } }; 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 */ } checkCorrectnessOfIteration = 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 = {}; object[ITERATOR] = function () { return { next: function () { return { done: ITERATION_SUPPORT = true }; } }; }; exec(object); } catch (error) { /* empty */ } return ITERATION_SUPPORT; }; return checkCorrectnessOfIteration; } var inheritIfRequired; var hasRequiredInheritIfRequired; function requireInheritIfRequired () { if (hasRequiredInheritIfRequired) return inheritIfRequired; hasRequiredInheritIfRequired = 1; var isCallable = requireIsCallable(); var isObject = requireIsObject(); var setPrototypeOf = requireObjectSetPrototypeOf(); // makes subclassing work correct for wrapped built-ins inheritIfRequired = 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; }; return inheritIfRequired; } var collection; var hasRequiredCollection; function requireCollection () { if (hasRequiredCollection) return collection; hasRequiredCollection = 1; var $ = require_export(); var globalThis = requireGlobalThis(); var uncurryThis = requireFunctionUncurryThis(); var isForced = requireIsForced(); var defineBuiltIn = requireDefineBuiltIn(); var InternalMetadataModule = requireInternalMetadata(); var iterate = requireIterate(); var anInstance = requireAnInstance(); var isCallable = requireIsCallable(); var isNullOrUndefined = requireIsNullOrUndefined(); var isObject = requireIsObject(); var fails = requireFails(); var checkCorrectnessOfIteration = requireCheckCorrectnessOfIteration(); var setToStringTag = requireSetToStringTag(); var inheritIfRequired = requireInheritIfRequired(); collection = function (CONSTRUCTOR_NAME, wrapper, common) { var IS_MAP = CONSTRUCTOR_NAME.indexOf('Map') !== -1; var IS_WEAK = CONSTRUCTOR_NAME.indexOf('Weak') !== -1; var ADDER = IS_MAP ? 'set' : 'add'; var NativeConstructor = globalThis[CONSTRUCTOR_NAME]; var NativePrototype = NativeConstructor && NativeConstructor.prototype; var Constructor = NativeConstructor; var exported = {}; var fixMethod = function (KEY) { var uncurriedNativeMethod = uncurryThis(NativePrototype[KEY]); defineBuiltIn(NativePrototype, KEY, KEY === 'add' ? function add(value) { uncurriedNativeMethod(this, value === 0 ? 0 : value); return this; } : KEY === 'delete' ? function (key) { return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key); } : KEY === 'get' ? function get(key) { return IS_WEAK && !isObject(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key); } : KEY === 'has' ? function has(key) { return IS_WEAK && !isObject(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key); } : function set(key, value) { uncurriedNativeMethod(this, key === 0 ? 0 : key, value); return this; } ); }; var REPLACE = isForced( CONSTRUCTOR_NAME, !isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function () { new NativeConstructor().entries().next(); })) ); if (REPLACE) { // create collection constructor Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER); InternalMetadataModule.enable(); } else if (isForced(CONSTRUCTOR_NAME, true)) { var instance = new Constructor(); // early implementations not supports chaining var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) !== instance; // V8 ~ Chromium 40- weak-collections throws on primitives, but should return false var THROWS_ON_PRIMITIVES = fails(function () { instance.has(1); }); // most early implementations doesn't supports iterables, most modern - not close it correctly // eslint-disable-next-line no-new -- required for testing var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function (iterable) { new NativeConstructor(iterable); }); // for early implementations -0 and +0 not the same var BUGGY_ZERO = !IS_WEAK && fails(function () { // V8 ~ Chromium 42- fails only with 5+ elements var $instance = new NativeConstructor(); var index = 5; while (index--) $instance[ADDER](index, index); return !$instance.has(-0); }); if (!ACCEPT_ITERABLES) { Constructor = wrapper(function (dummy, iterable) { anInstance(dummy, NativePrototype); var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor); if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); return that; }); Constructor.prototype = NativePrototype; NativePrototype.constructor = Constructor; } if (THROWS_ON_PRIMITIVES || BUGGY_ZERO) { fixMethod('delete'); fixMethod('has'); IS_MAP && fixMethod('get'); } if (BUGGY_ZERO || HASNT_CHAINING) fixMethod(ADDER); // weak collections should not contains .clear method if (IS_WEAK && NativePrototype.clear) delete NativePrototype.clear; } exported[CONSTRUCTOR_NAME] = Constructor; $({ global: true, constructor: true, forced: Constructor !== NativeConstructor }, exported); setToStringTag(Constructor, CONSTRUCTOR_NAME); if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP); return Constructor; }; return collection; } var defineBuiltInAccessor; var hasRequiredDefineBuiltInAccessor; function requireDefineBuiltInAccessor () { if (hasRequiredDefineBuiltInAccessor) return defineBuiltInAccessor; hasRequiredDefineBuiltInAccessor = 1; var makeBuiltIn = requireMakeBuiltIn(); var defineProperty = requireObjectDefineProperty(); defineBuiltInAccessor = 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); }; return defineBuiltInAccessor; } var defineBuiltIns; var hasRequiredDefineBuiltIns; function requireDefineBuiltIns () { if (hasRequiredDefineBuiltIns) return defineBuiltIns; hasRequiredDefineBuiltIns = 1; var defineBuiltIn = requireDefineBuiltIn(); defineBuiltIns = function (target, src, options) { for (var key in src) defineBuiltIn(target, key, src[key], options); return target; }; return defineBuiltIns; } var setSpecies; var hasRequiredSetSpecies; function requireSetSpecies () { if (hasRequiredSetSpecies) return setSpecies; hasRequiredSetSpecies = 1; var getBuiltIn = requireGetBuiltIn(); var defineBuiltInAccessor = requireDefineBuiltInAccessor(); var wellKnownSymbol = requireWellKnownSymbol(); var DESCRIPTORS = requireDescriptors(); var SPECIES = wellKnownSymbol('species'); setSpecies = function (CONSTRUCTOR_NAME) { var Constructor = getBuiltIn(CONSTRUCTOR_NAME); if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) { defineBuiltInAccessor(Constructor, SPECIES, { configurable: true, get: function () { return this; } }); } }; return setSpecies; } var collectionStrong; var hasRequiredCollectionStrong; function requireCollectionStrong () { if (hasRequiredCollectionStrong) return collectionStrong; hasRequiredCollectionStrong = 1; var create = requireObjectCreate(); var defineBuiltInAccessor = requireDefineBuiltInAccessor(); var defineBuiltIns = requireDefineBuiltIns(); var bind = requireFunctionBindContext(); var anInstance = requireAnInstance(); var isNullOrUndefined = requireIsNullOrUndefined(); var iterate = requireIterate(); var defineIterator = requireIteratorDefine(); var createIterResultObject = requireCreateIterResultObject(); var setSpecies = requireSetSpecies(); var DESCRIPTORS = requireDescriptors(); var fastKey = requireInternalMetadata().fastKey; var InternalStateModule = requireInternalState(); var setInternalState = InternalStateModule.set; var internalStateGetterFor = InternalStateModule.getterFor; collectionStrong = { getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) { var Constructor = wrapper(function (that, iterable) { anInstance(that, Prototype); setInternalState(that, { type: CONSTRUCTOR_NAME, index: create(null), first: null, last: null, size: 0 }); if (!DESCRIPTORS) that.size = 0; if (!isNullOrUndefined(iterable)) iterate(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP }); }); var Prototype = Constructor.prototype; var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME); var define = function (that, key, value) { var state = getInternalState(that); var entry = getEntry(that, key); var previous, index; // change existing entry if (entry) { entry.value = value; // create new entry } else { state.last = entry = { index: index = fastKey(key, true), key: key, value: value, previous: previous = state.last, next: null, removed: false }; if (!state.first) state.first = entry; if (previous) previous.next = entry; if (DESCRIPTORS) state.size++; else that.size++; // add to index if (index !== 'F') state.index[index] = entry; } return that; }; var getEntry = function (that, key) { var state = getInternalState(that); // fast case var index = fastKey(key); var entry; if (index !== 'F') return state.index[index]; // frozen object case for (entry = state.first; entry; entry = entry.next) { if (entry.key === key) return entry; } }; defineBuiltIns(Prototype, { // `{ Map, Set }.prototype.clear()` methods // https://tc39.es/ecma262/#sec-map.prototype.clear // https://tc39.es/ecma262/#sec-set.prototype.clear clear: function clear() { var that = this; var state = getInternalState(that); var entry = state.first; while (entry) { entry.removed = true; if (entry.previous) entry.previous = entry.previous.next = null; entry = entry.next; } state.first = state.last = null; state.index = create(null); if (DESCRIPTORS) state.size = 0; else that.size = 0; }, // `{ Map, Set }.prototype.delete(key)` methods // https://tc39.es/ecma262/#sec-map.prototype.delete // https://tc39.es/ecma262/#sec-set.prototype.delete 'delete': function (key) { var that = this; var state = getInternalState(that); var entry = getEntry(that, key); if (entry) { var next = entry.next; var prev = entry.previous; delete state.index[entry.index]; entry.removed = true; if (prev) prev.next = next; if (next) next.previous = prev; if (state.first === entry) state.first = next; if (state.last === entry) state.last = prev; if (DESCRIPTORS) state.size--; else that.size--; } return !!entry; }, // `{ Map, Set }.prototype.forEach(callbackfn, thisArg = undefined)` methods // https://tc39.es/ecma262/#sec-map.prototype.foreach // https://tc39.es/ecma262/#sec-set.prototype.foreach forEach: function forEach(callbackfn /* , that = undefined */) { var state = getInternalState(this); var boundFunction = bind(callbackfn, arguments.length > 1 ? arguments[1] : undefined); var entry; while (entry = entry ? entry.next : state.first) { boundFunction(entry.value, entry.key, this); // revert to the last existing entry while (entry && entry.removed) entry = entry.previous; } }, // `{ Map, Set}.prototype.has(key)` methods // https://tc39.es/ecma262/#sec-map.prototype.has // https://tc39.es/ecma262/#sec-set.prototype.has has: function has(key) { return !!getEntry(this, key); } }); defineBuiltIns(Prototype, IS_MAP ? { // `Map.prototype.get(key)` method // https://tc39.es/ecma262/#sec-map.prototype.get get: function get(key) { var entry = getEntry(this, key); return entry && entry.value; }, // `Map.prototype.set(key, value)` method // https://tc39.es/ecma262/#sec-map.prototype.set set: function set(key, value) { return define(this, key === 0 ? 0 : key, value); } } : { // `Set.prototype.add(value)` method // https://tc39.es/ecma262/#sec-set.prototype.add add: function add(value) { return define(this, value = value === 0 ? 0 : value, value); } }); if (DESCRIPTORS) defineBuiltInAccessor(Prototype, 'size', { configurable: true, get: function () { return getInternalState(this).size; } }); return Constructor; }, setStrong: function (Constructor, CONSTRUCTOR_NAME, IS_MAP) { var ITERATOR_NAME = CONSTRUCTOR_NAME + ' Iterator'; var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME); var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME); // `{ Map, Set }.prototype.{ keys, values, entries, @@iterator }()` methods // https://tc39.es/ecma262/#sec-map.prototype.entries // https://tc39.es/ecma262/#sec-map.prototype.keys // https://tc39.es/ecma262/#sec-map.prototype.values // https://tc39.es/ecma262/#sec-map.prototype-@@iterator // https://tc39.es/ecma262/#sec-set.prototype.entries // https://tc39.es/ecma262/#sec-set.prototype.keys // https://tc39.es/ecma262/#sec-set.prototype.values // https://tc39.es/ecma262/#sec-set.prototype-@@iterator defineIterator(Constructor, CONSTRUCTOR_NAME, function (iterated, kind) { setInternalState(this, { type: ITERATOR_NAME, target: iterated, state: getInternalCollectionState(iterated), kind: kind, last: null }); }, function () { var state = getInternalIteratorState(this); var kind = state.kind; var entry = state.last; // revert to the last existing entry while (entry && entry.removed) entry = entry.previous; // get next entry if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) { // or finish the iteration state.target = null; return createIterResultObject(undefined, true); } // return step by kind if (kind === 'keys') return createIterResultObject(entry.key, false); if (kind === 'values') return createIterResultObject(entry.value, false); return createIterResultObject([entry.key, entry.value], false); }, IS_MAP ? 'entries' : 'values', !IS_MAP, true); // `{ Map, Set }.prototype[@@species]` accessors // https://tc39.es/ecma262/#sec-get-map-@@species // https://tc39.es/ecma262/#sec-get-set-@@species setSpecies(CONSTRUCTOR_NAME); } }; return collectionStrong; } var hasRequiredEs_map_constructor; function requireEs_map_constructor () { if (hasRequiredEs_map_constructor) return es_map_constructor; hasRequiredEs_map_constructor = 1; var collection = requireCollection(); var collectionStrong = requireCollectionStrong(); // `Map` constructor // https://tc39.es/ecma262/#sec-map-objects collection('Map', function (init) { return function Map() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionStrong); return es_map_constructor; } var hasRequiredEs_map; function requireEs_map () { if (hasRequiredEs_map) return es_map; hasRequiredEs_map = 1; // TODO: Remove this module from `core-js@4` since it's replaced to module below requireEs_map_constructor(); return es_map; } var es_set = {}; var es_set_constructor = {}; var hasRequiredEs_set_constructor; function requireEs_set_constructor () { if (hasRequiredEs_set_constructor) return es_set_constructor; hasRequiredEs_set_constructor = 1; var collection = requireCollection(); var collectionStrong = requireCollectionStrong(); // `Set` constructor // https://tc39.es/ecma262/#sec-set-objects collection('Set', function (init) { return function Set() { return init(this, arguments.length ? arguments[0] : undefined); }; }, collectionStrong); return es_set_constructor; } var hasRequiredEs_set; function requireEs_set () { if (hasRequiredEs_set) return es_set; hasRequiredEs_set = 1; // TODO: Remove this module from `core-js@4` since it's replaced to module below requireEs_set_constructor(); return es_set; } var web_domException_constructor = {}; var environment; var hasRequiredEnvironment; function requireEnvironment () { if (hasRequiredEnvironment) return environment; hasRequiredEnvironment = 1; /* global Bun, Deno -- detection */ var globalThis = requireGlobalThis(); var userAgent = requireEnvironmentUserAgent(); var classof = requireClassofRaw(); var userAgentStartsWith = function (string) { return userAgent.slice(0, string.length) === string; }; environment = (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'; })(); return environment; } var environmentIsNode; var hasRequiredEnvironmentIsNode; function requireEnvironmentIsNode () { if (hasRequiredEnvironmentIsNode) return environmentIsNode; hasRequiredEnvironmentIsNode = 1; var ENVIRONMENT = requireEnvironment(); environmentIsNode = ENVIRONMENT === 'NODE'; return environmentIsNode; } var getBuiltInNodeModule; var hasRequiredGetBuiltInNodeModule; function requireGetBuiltInNodeModule () { if (hasRequiredGetBuiltInNodeModule) return getBuiltInNodeModule; hasRequiredGetBuiltInNodeModule = 1; var globalThis = requireGlobalThis(); var IS_NODE = requireEnvironmentIsNode(); getBuiltInNodeModule = 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 */ } } }; return getBuiltInNodeModule; } var domExceptionConstants; var hasRequiredDomExceptionConstants; function requireDomExceptionConstants () { if (hasRequiredDomExceptionConstants) return domExceptionConstants; hasRequiredDomExceptionConstants = 1; domExceptionConstants = { 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 } }; return domExceptionConstants; } var errorStackClear; var hasRequiredErrorStackClear; function requireErrorStackClear () { if (hasRequiredErrorStackClear) return errorStackClear; hasRequiredErrorStackClear = 1; var uncurryThis = requireFunctionUncurryThis(); 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, sonarjs/slow-regex -- safe var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/; var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST); errorStackClear = 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; }; return errorStackClear; } var hasRequiredWeb_domException_constructor; function requireWeb_domException_constructor () { if (hasRequiredWeb_domException_constructor) return web_domException_constructor; hasRequiredWeb_domException_constructor = 1; var $ = require_export(); var getBuiltIn = requireGetBuiltIn(); var getBuiltInNodeModule = requireGetBuiltInNodeModule(); var fails = requireFails(); var create = requireObjectCreate(); var createPropertyDescriptor = requireCreatePropertyDescriptor(); var defineProperty = requireObjectDefineProperty().f; var defineBuiltIn = requireDefineBuiltIn(); var defineBuiltInAccessor = requireDefineBuiltInAccessor(); var hasOwn = requireHasOwnProperty(); var anInstance = requireAnInstance(); var anObject = requireAnObject(); var errorToString = requireErrorToString(); var normalizeStringArgument = requireNormalizeStringArgument(); var DOMExceptionConstants = requireDomExceptionConstants(); var clearErrorStack = requireErrorStackClear(); var InternalStateModule = requireInternalState(); var DESCRIPTORS = requireDescriptors(); var IS_PURE = requireIsPure(); var DOM_EXCEPTION = 'DOMException'; var DATA_CLONE_ERR = 'DATA_CLONE_ERR'; var Error = getBuiltIn('Error'); // NodeJS < 17.0 does not expose `DOMException` to global var NativeDOMException = getBuiltIn(DOM_EXCEPTION) || (function () { try { // NodeJS < 15.0 does not expose `MessageChannel` to global var MessageChannel = getBuiltIn('MessageChannel') || getBuiltInNodeModule('worker_threads').MessageChannel; // eslint-disable-next-line es/no-weak-map, unicorn/require-post-message-target-origin -- safe new MessageChannel().port1.postMessage(new WeakMap()); } catch (error) { if (error.name === DATA_CLONE_ERR && error.code === 25) return error.constructor; } })(); var NativeDOMExceptionPrototype = NativeDOMException && NativeDOMException.prototype; var ErrorPrototype = Error.prototype; var setInternalState = InternalStateModule.set; var getInternalState = InternalStateModule.getterFor(DOM_EXCEPTION); var HAS_STACK = 'stack' in new Error(DOM_EXCEPTION); var codeFor = function (name) { return hasOwn(DOMExceptionConstants, name) && DOMExceptionConstants[name].m ? DOMExceptionConstants[name].c : 0; }; 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 code = codeFor(name); setInternalState(this, { type: DOM_EXCEPTION, name: name, message: message, code: code }); if (!DESCRIPTORS) { this.name = name; this.message = message; this.code = code; } if (HAS_STACK) { var error = new Error(message); error.name = DOM_EXCEPTION; defineProperty(this, 'stack', createPropertyDescriptor(1, clearErrorStack(error.stack, 1))); } }; var DOMExceptionPrototype = $DOMException.prototype = create(ErrorPrototype); var createGetterDescriptor = function (get) { return { enumerable: true, configurable: true, get: get }; }; var getterFor = function (key) { return createGetterDescriptor(function () { return getInternalState(this)[key]; }); }; if (DESCRIPTORS) { // `DOMException.prototype.code` getter defineBuiltInAccessor(DOMExceptionPrototype, 'code', getterFor('code')); // `DOMException.prototype.message` getter defineBuiltInAccessor(DOMExceptionPrototype, 'message', getterFor('message')); // `DOMException.prototype.name` getter defineBuiltInAccessor(DOMExceptionPrototype, 'name', getterFor('name')); } defineProperty(DOMExceptionPrototype, 'constructor', createPropertyDescriptor(1, $DOMException)); // FF36- DOMException is a function, but can't be constructed var INCORRECT_CONSTRUCTOR = fails(function () { return !(new NativeDOMException() instanceof Error); }); // Safari 10.1 / Chrome 32- / IE8- DOMException.prototype.toString bugs var INCORRECT_TO_STRING = INCORRECT_CONSTRUCTOR || fails(function () { return ErrorPrototype.toString !== errorToString || String(new NativeDOMException(1, 2)) !== '2: 1'; }); // Deno 1.6.3- DOMException.prototype.code just missed var INCORRECT_CODE = INCORRECT_CONSTRUCTOR || fails(function () { return new NativeDOMException(1, 'DataCloneError').code !== 25; }); // Deno 1.6.3- DOMException constants just missed var MISSED_CONSTANTS = INCORRECT_CONSTRUCTOR || NativeDOMException[DATA_CLONE_ERR] !== 25 || NativeDOMExceptionPrototype[DATA_CLONE_ERR] !== 25; var FORCED_CONSTRUCTOR = IS_PURE ? INCORRECT_TO_STRING || INCORRECT_CODE || MISSED_CONSTANTS : INCORRECT_CONSTRUCTOR; // `DOMException` constructor // https://webidl.spec.whatwg.org/#idl-DOMException $({ global: true, constructor: true, forced: FORCED_CONSTRUCTOR }, { DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException }); var PolyfilledDOMException = getBuiltIn(DOM_EXCEPTION); var PolyfilledDOMExceptionPrototype = PolyfilledDOMException.prototype; if (INCORRECT_TO_STRING && (IS_PURE || NativeDOMException === PolyfilledDOMException)) { defineBuiltIn(PolyfilledDOMExceptionPrototype, 'toString', errorToString); } if (INCORRECT_CODE && DESCRIPTORS && NativeDOMException === PolyfilledDOMException) { defineBuiltInAccessor(PolyfilledDOMExceptionPrototype, 'code', createGetterDescriptor(function () { return codeFor(anObject(this).name); })); } // `DOMException` constants for (var key in DOMExceptionConstants) if (hasOwn(DOMExceptionConstants, key)) { var constant = DOMExceptionConstants[key]; var constantName = constant.s; var descriptor = createPropertyDescriptor(6, constant.c); if (!hasOwn(PolyfilledDOMException, constantName)) { defineProperty(PolyfilledDOMException, constantName, descriptor); } if (!hasOwn(PolyfilledDOMExceptionPrototype, constantName)) { defineProperty(PolyfilledDOMExceptionPrototype, constantName, descriptor); } } return web_domException_constructor; } var web_domException_stack = {}; var hasRequiredWeb_domException_stack; function requireWeb_domException_stack () { if (hasRequiredWeb_domException_stack) return web_domException_stack; hasRequiredWeb_domException_stack = 1; var $ = require_export(); var globalThis = requireGlobalThis(); var getBuiltIn = requireGetBuiltIn(); var createPropertyDescriptor = requireCreatePropertyDescriptor(); var defineProperty = requireObjectDefineProperty().f; var hasOwn = requireHasOwnProperty(); var anInstance = requireAnInstance(); var inheritIfRequired = requireInheritIfRequired(); var normalizeStringArgument = requireNormalizeStringArgument(); var DOMExceptionConstants = requireDomExceptionConstants(); var clearErrorStack = requireErrorStackClear(); var DESCRIPTORS = requireDescriptors(); var IS_PURE = requireIsPure(); 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)); } } } return web_domException_stack; } var web_domException_toStringTag = {}; var hasRequiredWeb_domException_toStringTag; function requireWeb_domException_toStringTag () { if (hasRequiredWeb_domException_toStringTag) return web_domException_toStringTag; hasRequiredWeb_domException_toStringTag = 1; var getBuiltIn = requireGetBuiltIn(); var setToStringTag = requireSetToStringTag(); var DOM_EXCEPTION = 'DOMException'; // `DOMException.prototype[@@toStringTag]` property setToStringTag(getBuiltIn(DOM_EXCEPTION), DOM_EXCEPTION); return web_domException_toStringTag; } var web_structuredClone = {}; var isConstructor; var hasRequiredIsConstructor; function requireIsConstructor () { if (hasRequiredIsConstructor) return isConstructor; hasRequiredIsConstructor = 1; var uncurryThis = requireFunctionUncurryThis(); var fails = requireFails(); var isCallable = requireIsCallable(); var classof = requireClassof(); var getBuiltIn = requireGetBuiltIn(); var inspectSource = requireInspectSource(); 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 isConstructor = !construct || fails(function () { var called; return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function () { called = true; }) || called; }) ? isConstructorLegacy : isConstructorModern; return isConstructor; } var createProperty; var hasRequiredCreateProperty; function requireCreateProperty () { if (hasRequiredCreateProperty) return createProperty; hasRequiredCreateProperty = 1; var DESCRIPTORS = requireDescriptors(); var definePropertyModule = requireObjectDefineProperty(); var createPropertyDescriptor = requireCreatePropertyDescriptor(); createProperty = function (object, key, value) { if (DESCRIPTORS) definePropertyModule.f(object, key, createPropertyDescriptor(0, value)); else object[key] = value; }; return createProperty; } var validateArgumentsLength; var hasRequiredValidateArgumentsLength; function requireValidateArgumentsLength () { if (hasRequiredValidateArgumentsLength) return validateArgumentsLength; hasRequiredValidateArgumentsLength = 1; var $TypeError = TypeError; validateArgumentsLength = function (passed, required) { if (passed < required) throw new $TypeError('Not enough arguments'); return passed; }; return validateArgumentsLength; } var regexpFlags; var hasRequiredRegexpFlags; function requireRegexpFlags () { if (hasRequiredRegexpFlags) return regexpFlags; hasRequiredRegexpFlags = 1; var anObject = requireAnObject(); // `RegExp.prototype.flags` getter implementation // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags regexpFlags = 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; }; return regexpFlags; } var regexpGetFlags; var hasRequiredRegexpGetFlags; function requireRegexpGetFlags () { if (hasRequiredRegexpGetFlags) return regexpGetFlags; hasRequiredRegexpGetFlags = 1; var call = requireFunctionCall(); var hasOwn = requireHasOwnProperty(); var isPrototypeOf = requireObjectIsPrototypeOf(); var regExpFlags = requireRegexpFlags(); var RegExpPrototype = RegExp.prototype; regexpGetFlags = function (R) { var flags = R.flags; return flags === undefined && !('flags' in RegExpPrototype) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype, R) ? call(regExpFlags, R) : flags; }; return regexpGetFlags; } var mapHelpers; var hasRequiredMapHelpers; function requireMapHelpers () { if (hasRequiredMapHelpers) return mapHelpers; hasRequiredMapHelpers = 1; var uncurryThis = requireFunctionUncurryThis(); // eslint-disable-next-line es/no-map -- safe var MapPrototype = Map.prototype; mapHelpers = { // 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 }; return mapHelpers; } var setHelpers; var hasRequiredSetHelpers; function requireSetHelpers () { if (hasRequiredSetHelpers) return setHelpers; hasRequiredSetHelpers = 1; var uncurryThis = requireFunctionUncurryThis(); // eslint-disable-next-line es/no-set -- safe var SetPrototype = Set.prototype; setHelpers = { // eslint-disable-next-line es/no-set -- safe Set: Set, add: uncurryThis(SetPrototype.add), has: uncurryThis(SetPrototype.has), remove: uncurryThis(SetPrototype['delete']), proto: SetPrototype }; return setHelpers; } var iterateSimple; var hasRequiredIterateSimple; function requireIterateSimple () { if (hasRequiredIterateSimple) return iterateSimple; hasRequiredIterateSimple = 1; var call = requireFunctionCall(); iterateSimple = 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; } }; return iterateSimple; } var setIterate; var hasRequiredSetIterate; function requireSetIterate () { if (hasRequiredSetIterate) return setIterate; hasRequiredSetIterate = 1; var uncurryThis = requireFunctionUncurryThis(); var iterateSimple = requireIterateSimple(); var SetHelpers = requireSetHelpers(); var Set = SetHelpers.Set; var SetPrototype = SetHelpers.proto; var forEach = uncurryThis(SetPrototype.forEach); var keys = uncurryThis(SetPrototype.keys); var next = keys(new Set()).next; setIterate = function (set, fn, interruptible) { return interruptible ? iterateSimple({ iterator: keys(set), next: next }, fn) : forEach(set, fn); }; return setIterate; } var structuredCloneProperTransfer; var hasRequiredStructuredCloneProperTransfer; function requireStructuredCloneProperTransfer () { if (hasRequiredStructuredCloneProperTransfer) return structuredCloneProperTransfer; hasRequiredStructuredCloneProperTransfer = 1; var globalThis = requireGlobalThis(); var fails = requireFails(); var V8 = requireEnvironmentV8Version(); var ENVIRONMENT = requireEnvironment(); var structuredClone = globalThis.structuredClone; structuredCloneProperTransfer = !!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; }); return structuredCloneProperTransfer; } var detachTransferable; var hasRequiredDetachTransferable; function requireDetachTransferable () { if (hasRequiredDetachTransferable) return detachTransferable; hasRequiredDetachTransferable = 1; var globalThis = requireGlobalThis(); var getBuiltInNodeModule = requireGetBuiltInNodeModule(); var PROPER_STRUCTURED_CLONE_TRANSFER = requireStructuredCloneProperTransfer(); 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 */ } detachTransferable = detach; return detachTransferable; } var errorStackInstallable; var hasRequiredErrorStackInstallable; function requireErrorStackInstallable () { if (hasRequiredErrorStackInstallable) return errorStackInstallable; hasRequiredErrorStackInstallable = 1; var fails = requireFails(); var createPropertyDescriptor = requireCreatePropertyDescriptor(); errorStackInstallable = !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; }); return errorStackInstallable; } var hasRequiredWeb_structuredClone; function requireWeb_structuredClone () { if (hasRequiredWeb_structuredClone) return web_structuredClone; hasRequiredWeb_structuredClone = 1; var IS_PURE = requireIsPure(); var $ = require_export(); var globalThis = requireGlobalThis(); var getBuiltIn = requireGetBuiltIn(); var uncurryThis = requireFunctionUncurryThis(); var fails = requireFails(); var uid = requireUid(); var isCallable = requireIsCallable(); var isConstructor = requireIsConstructor(); var isNullOrUndefined = requireIsNullOrUndefined(); var isObject = requireIsObject(); var isSymbol = requireIsSymbol(); var iterate = requireIterate(); var anObject = requireAnObject(); var classof = requireClassof(); var hasOwn = requireHasOwnProperty(); var createProperty = requireCreateProperty(); var createNonEnumerableProperty = requireCreateNonEnumerableProperty(); var lengthOfArrayLike = requireLengthOfArrayLike(); var validateArgumentsLength = requireValidateArgumentsLength(); var getRegExpFlags = requireRegexpGetFlags(); var MapHelpers = requireMapHelpers(); var SetHelpers = requireSetHelpers(); var setIterate = requireSetIterate(); var detachTransferable = requireDetachTransferable(); var ERROR_STACK_INSTALLABLE = requireErrorStackInstallable(); var PROPER_STRUCTURED_CLONE_TRANSFER = requireStructuredCloneProperTransfer(); var Object = globalThis.Object; var Array = globalThis.Array; var Date = globalThis.Date; var Error = globalThis.Error; var TypeError = globalThis.TypeError; var PerformanceMark = globalThis.PerformanceMark; var DOMException = getBuiltIn('DOMException'); var Map = MapHelpers.Map; var mapHas = MapHelpers.has; var mapGet = MapHelpers.get; var mapSet = MapHelpers.set; var Set = SetHelpers.Set; var setAdd = SetHelpers.add; var setHas = SetHelpers.has; var objectKeys = getBuiltIn('Object', 'keys'); var push = uncurryThis([].push); var thisBooleanValue = uncurryThis(true.valueOf); var thisNumberValue = uncurryThis(1.0.valueOf); var thisStringValue = uncurryThis(''.valueOf); var thisTimeValue = uncurryThis(Date.prototype.getTime); var PERFORMANCE_MARK = uid('structuredClone'); var DATA_CLONE_ERROR = 'DataCloneError'; var TRANSFERRING = 'Transferring'; var checkBasicSemantic = function (structuredCloneImplementation) { return !fails(function () { var set1 = new globalThis.Set([7]); var set2 = structuredCloneImplementation(set1); var number = structuredCloneImplementation(Object(7)); return set2 === set1 || !set2.has(7) || !isObject(number) || +number !== 7; }) && structuredCloneImplementation; }; var checkErrorsCloning = function (structuredCloneImplementation, $Error) { return !fails(function () { var error = new $Error(); var test = structuredCloneImplementation({ a: error, b: error }); return !(test && test.a === test.b && test.a instanceof $Error && test.a.stack === error.stack); }); }; // https://github.com/whatwg/html/pull/5749 var checkNewErrorsCloningSemantic = function (structuredCloneImplementation) { return !fails(function () { var test = structuredCloneImplementation(new globalThis.AggregateError([1], PERFORMANCE_MARK, { cause: 3 })); return test.name !== 'AggregateError' || test.errors[0] !== 1 || test.message !== PERFORMANCE_MARK || test.cause !== 3; }); }; // FF94+, Safari 15.4+, Chrome 98+, NodeJS 17.0+, Deno 1.13+ // FF<103 and Safari implementations can't clone errors // https://bugzilla.mozilla.org/show_bug.cgi?id=1556604 // FF103 can clone errors, but `.stack` of clone is an empty string // https://bugzilla.mozilla.org/show_bug.cgi?id=1778762 // FF104+ fixed it on usual errors, but not on DOMExceptions // https://bugzilla.mozilla.org/show_bug.cgi?id=1777321 // Chrome <102 returns `null` if cloned object contains multiple references to one error // https://bugs.chromium.org/p/v8/issues/detail?id=12542 // NodeJS implementation can't clone DOMExceptions // https://github.com/nodejs/node/issues/41038 // only FF103+ supports new (html/5749) error cloning semantic var nativeStructuredClone = globalThis.structuredClone; var FORCED_REPLACEMENT = IS_PURE || !checkErrorsCloning(nativeStructuredClone, Error) || !checkErrorsCloning(nativeStructuredClone, DOMException) || !checkNewErrorsCloningSemantic(nativeStructuredClone); // Chrome 82+, Safari 14.1+, Deno 1.11+ // Chrome 78-81 implementation swaps `.name` and `.message` of cloned `DOMException` // Chrome returns `null` if cloned object contains multiple references to one error // Safari 14.1 implementation doesn't clone some `RegExp` flags, so requires a workaround // Safari implementation can't clone errors // Deno 1.2-1.10 implementations too naive // NodeJS 16.0+ does not have `PerformanceMark` constructor // NodeJS <17.2 structured cloning implementation from `performance.mark` is too naive // and can't clone, for example, `RegExp` or some boxed primitives // https://github.com/nodejs/node/issues/40840 // no one of those implementations supports new (html/5749) error cloning semantic var structuredCloneFromMark = !nativeStructuredClone && checkBasicSemantic(function (value) { return new PerformanceMark(PERFORMANCE_MARK, { detail: value }).detail; }); var nativeRestrictedStructuredClone = checkBasicSemantic(nativeStructuredClone) || structuredCloneFromMark; var throwUncloneable = function (type) { throw new DOMException('Uncloneable type: ' + type, DATA_CLONE_ERROR); }; var throwUnpolyfillable = function (type, action) { throw new DOMException((action || 'Cloning') + ' of ' + type + ' cannot be properly polyfilled in this engine', DATA_CLONE_ERROR); }; var tryNativeRestrictedStructuredClone = function (value, type) { if (!nativeRestrictedStructuredClone) throwUnpolyfillable(type); return nativeRestrictedStructuredClone(value); }; var createDataTransfer = function () { var dataTransfer; try { dataTransfer = new globalThis.DataTransfer(); } catch (error) { try { dataTransfer = new globalThis.ClipboardEvent('').clipboardData; } catch (error2) { /* empty */ } } return dataTransfer && dataTransfer.items && dataTransfer.files ? dataTransfer : null; }; var cloneBuffer = function (value, map, $type) { if (mapHas(map, value)) return mapGet(map, value); var type = $type || classof(value); var clone, length, options, source, target, i; if (type === 'SharedArrayBuffer') { if (nativeRestrictedStructuredClone) clone = nativeRestrictedStructuredClone(value); // SharedArrayBuffer should use shared memory, we can't polyfill it, so return the original else clone = value; } else { var DataView = globalThis.DataView; // `ArrayBuffer#slice` is not available in IE10 // `ArrayBuffer#slice` and `DataView` are not available in old FF if (!DataView && !isCallable(value.slice)) throwUnpolyfillable('ArrayBuffer'); // detached buffers throws in `DataView` and `.slice` try { if (isCallable(value.slice) && !value.resizable) { clone = value.slice(0); } else { length = value.byteLength; options = 'maxByteLength' in value ? { maxByteLength: value.maxByteLength } : undefined; // eslint-disable-next-line es/no-resizable-and-growable-arraybuffers -- safe clone = new ArrayBuffer(length, options); source = new DataView(value); target = new DataView(clone); for (i = 0; i < length; i++) { target.setUint8(i, source.getUint8(i)); } } } catch (error) { throw new DOMException('ArrayBuffer is detached', DATA_CLONE_ERROR); } } mapSet(map, value, clone); return clone; }; var cloneView = function (value, type, offset, length, map) { var C = globalThis[type]; // in some old engines like Safari 9, typeof C is 'object' // on Uint8ClampedArray or some other constructors if (!isObject(C)) throwUnpolyfillable(type); return new C(cloneBuffer(value.buffer, map), offset, length); }; var structuredCloneInternal = function (value, map) { if (isSymbol(value)) throwUncloneable('Symbol'); if (!isObject(value)) return value; // effectively preserves circular references if (map) { if (mapHas(map, value)) return mapGet(map, value); } else map = new Map(); var type = classof(value); var C, name, cloned, dataTransfer, i, length, keys, key; switch (type) { case 'Array': cloned = Array(lengthOfArrayLike(value)); break; case 'Object': cloned = {}; break; case 'Map': cloned = new Map(); break; case 'Set': cloned = new Set(); break; case 'RegExp': // in this block because of a Safari 14.1 bug // old FF does not clone regexes passed to the constructor, so get the source and flags directly cloned = new RegExp(value.source, getRegExpFlags(value)); break; case 'Error': name = value.name; switch (name) { case 'AggregateError': cloned = new (getBuiltIn(name))([]); break; case 'EvalError': case 'RangeError': case 'ReferenceError': case 'SuppressedError': case 'SyntaxError': case 'TypeError': case 'URIError': cloned = new (getBuiltIn(name))(); break; case 'CompileError': case 'LinkError': case 'RuntimeError': cloned = new (getBuiltIn('WebAssembly', name))(); break; default: cloned = new Error(); } break; case 'DOMException': cloned = new DOMException(value.message, value.name); break; case 'ArrayBuffer': case 'SharedArrayBuffer': cloned = cloneBuffer(value, map, type); break; case 'DataView': case 'Int8Array': case 'Uint8Array': case 'Uint8ClampedArray': case 'Int16Array': case 'Uint16Array': case 'Int32Array': case 'Uint32Array': case 'Float16Array': case 'Float32Array': case 'Float64Array': case 'BigInt64Array': case 'BigUint64Array': length = type === 'DataView' ? value.byteLength : value.length; cloned = cloneView(value, type, value.byteOffset, length, map); break; case 'DOMQuad': try { cloned = new DOMQuad( structuredCloneInternal(value.p1, map), structuredCloneInternal(value.p2, map), structuredCloneInternal(value.p3, map), structuredCloneInternal(value.p4, map) ); } catch (error) { cloned = tryNativeRestrictedStructuredClone(value, type); } break; case 'File': if (nativeRestrictedStructuredClone) try { cloned = nativeRestrictedStructuredClone(value); // NodeJS 20.0.0 bug, https://github.com/nodejs/node/issues/47612 if (classof(cloned) !== type) cloned = undefined; } catch (error) { /* empty */ } if (!cloned) try { cloned = new File([value], value.name, value); } catch (error) { /* empty */ } if (!cloned) throwUnpolyfillable(type); break; case 'FileList': dataTransfer = createDataTransfer(); if (dataTransfer) { for (i = 0, length = lengthOfArrayLike(value); i < length; i++) { dataTransfer.items.add(structuredCloneInternal(value[i], map)); } cloned = dataTransfer.files; } else cloned = tryNativeRestrictedStructuredClone(value, type); break; case 'ImageData': // Safari 9 ImageData is a constructor, but typeof ImageData is 'object' try { cloned = new ImageData( structuredCloneInternal(value.data, map), value.width, value.height, { colorSpace: value.colorSpace } ); } catch (error) { cloned = tryNativeRestrictedStructuredClone(value, type); } break; default: if (nativeRestrictedStructuredClone) { cloned = nativeRestrictedStructuredClone(value); } else switch (type) { case 'BigInt': // can be a 3rd party polyfill cloned = Object(value.valueOf()); break; case 'Boolean': cloned = Object(thisBooleanValue(value)); break; case 'Number': cloned = Object(thisNumberValue(value)); break; case 'String': cloned = Object(thisStringValue(value)); break; case 'Date': cloned = new Date(thisTimeValue(value)); break; case 'Blob': try { cloned = value.slice(0, value.size, value.type); } catch (error) { throwUnpolyfillable(type); } break; case 'DOMPoint': case 'DOMPointReadOnly': C = globalThis[type]; try { cloned = C.fromPoint ? C.fromPoint(value) : new C(value.x, value.y, value.z, value.w); } catch (error) { throwUnpolyfillable(type); } break; case 'DOMRect': case 'DOMRectReadOnly': C = globalThis[type]; try { cloned = C.fromRect ? C.fromRect(value) : new C(value.x, value.y, value.width, value.height); } catch (error) { throwUnpolyfillable(type); } break; case 'DOMMatrix': case 'DOMMatrixReadOnly': C = globalThis[type]; try { cloned = C.fromMatrix ? C.fromMatrix(value) : new C(value); } catch (error) { throwUnpolyfillable(type); } break; case 'AudioData': case 'VideoFrame': if (!isCallable(value.clone)) throwUnpolyfillable(type); try { cloned = value.clone(); } catch (error) { throwUncloneable(type); } break; case 'CropTarget': case 'CryptoKey': case 'FileSystemDirectoryHandle': case 'FileSystemFileHandle': case 'FileSystemHandle': case 'GPUCompilationInfo': case 'GPUCompilationMessage': case 'ImageBitmap': case 'RTCCertificate': case 'WebAssembly.Module': throwUnpolyfillable(type); // break omitted default: throwUncloneable(type); } } mapSet(map, value, cloned); switch (type) { case 'Array': case 'Object': keys = objectKeys(value); for (i = 0, length = lengthOfArrayLike(keys); i < length; i++) { key = keys[i]; createProperty(cloned, key, structuredCloneInternal(value[key], map)); } break; case 'Map': value.forEach(function (v, k) { mapSet(cloned, structuredCloneInternal(k, map), structuredCloneInternal(v, map)); }); break; case 'Set': value.forEach(function (v) { setAdd(cloned, structuredCloneInternal(v, map)); }); break; case 'Error': createNonEnumerableProperty(cloned, 'message', structuredCloneInternal(value.message, map)); if (hasOwn(value, 'cause')) { createNonEnumerableProperty(cloned, 'cause', structuredCloneInternal(value.cause, map)); } if (name === 'AggregateError') { cloned.errors = structuredCloneInternal(value.errors, map); } else if (name === 'SuppressedError') { cloned.error = structuredCloneInternal(value.error, map); cloned.suppressed = structuredCloneInternal(value.suppressed, map); } // break omitted case 'DOMException': if (ERROR_STACK_INSTALLABLE) { createNonEnumerableProperty(cloned, 'stack', structuredCloneInternal(value.stack, map)); } } return cloned; }; var tryToTransfer = function (rawTransfer, map) { if (!isObject(rawTransfer)) throw new TypeError('Transfer option cannot be converted to a sequence'); var transfer = []; iterate(rawTransfer, function (value) { push(transfer, anObject(value)); }); var i = 0; var length = lengthOfArrayLike(transfer); var buffers = new Set(); var value, type, C, transferred, canvas, context; while (i < length) { value = transfer[i++]; type = classof(value); if (type === 'ArrayBuffer' ? setHas(buffers, value) : mapHas(map, value)) { throw new DOMException('Duplicate transferable', DATA_CLONE_ERROR); } if (type === 'ArrayBuffer') { setAdd(buffers, value); continue; } if (PROPER_STRUCTURED_CLONE_TRANSFER) { transferred = nativeStructuredClone(value, { transfer: [value] }); } else switch (type) { case 'ImageBitmap': C = globalThis.OffscreenCanvas; if (!isConstructor(C)) throwUnpolyfillable(type, TRANSFERRING); try { canvas = new C(value.width, value.height); context = canvas.getContext('bitmaprenderer'); context.transferFromImageBitmap(value); transferred = canvas.transferToImageBitmap(); } catch (error) { /* empty */ } break; case 'AudioData': case 'VideoFrame': if (!isCallable(value.clone) || !isCallable(value.close)) throwUnpolyfillable(type, TRANSFERRING); try { transferred = value.clone(); value.close(); } catch (error) { /* empty */ } break; case 'MediaSourceHandle': case 'MessagePort': case 'MIDIAccess': case 'OffscreenCanvas': case 'ReadableStream': case 'RTCDataChannel': case 'TransformStream': case 'WebTransportReceiveStream': case 'WebTransportSendStream': case 'WritableStream': throwUnpolyfillable(type, TRANSFERRING); } if (transferred === undefined) throw new DOMException('This object cannot be transferred: ' + type, DATA_CLONE_ERROR); mapSet(map, value, transferred); } return buffers; }; var detachBuffers = function (buffers) { setIterate(buffers, function (buffer) { if (PROPER_STRUCTURED_CLONE_TRANSFER) { nativeRestrictedStructuredClone(buffer, { transfer: [buffer] }); } else if (isCallable(buffer.transfer)) { buffer.transfer(); } else if (detachTransferable) { detachTransferable(buffer); } else { throwUnpolyfillable('ArrayBuffer', TRANSFERRING); } }); }; // `structuredClone` method // https://html.spec.whatwg.org/multipage/structured-data.html#dom-structuredclone $({ global: true, enumerable: true, sham: !PROPER_STRUCTURED_CLONE_TRANSFER, forced: FORCED_REPLACEMENT }, { structuredClone: function structuredClone(value /* , { transfer } */) { var options = validateArgumentsLength(arguments.length, 1) > 1 && !isNullOrUndefined(arguments[1]) ? anObject(arguments[1]) : undefined; var transfer = options ? options.transfer : undefined; var map, buffers; if (transfer !== undefined) { map = new Map(); buffers = tryToTransfer(transfer, map); } var clone = structuredCloneInternal(value, map); // since of an issue with cloning views of transferred buffers, we a forced to detach them later // https://github.com/zloirock/core-js/issues/1265 if (buffers) detachBuffers(buffers); return clone; } }); return web_structuredClone; } var path; var hasRequiredPath; function requirePath () { if (hasRequiredPath) return path; hasRequiredPath = 1; var globalThis = requireGlobalThis(); path = globalThis; return path; } var structuredClone$2; var hasRequiredStructuredClone$1; function requireStructuredClone$1 () { if (hasRequiredStructuredClone$1) return structuredClone$2; hasRequiredStructuredClone$1 = 1; requireEs_error_toString(); requireEs_array_iterator(); requireEs_object_keys(); requireEs_object_toString(); requireEs_map(); requireEs_set(); requireWeb_domException_constructor(); requireWeb_domException_stack(); requireWeb_domException_toStringTag(); requireWeb_structuredClone(); var path = requirePath(); structuredClone$2 = path.structuredClone; return structuredClone$2; } var structuredClone$1; var hasRequiredStructuredClone; function requireStructuredClone () { if (hasRequiredStructuredClone) return structuredClone$1; hasRequiredStructuredClone = 1; var parent = requireStructuredClone$1(); structuredClone$1 = parent; return structuredClone$1; } requireStructuredClone(); var leafletSrc$2 = {exports: {}}; /* @preserve * Leaflet 1.9.4, a JS library for interactive maps. https://leafletjs.com * (c) 2010-2023 Vladimir Agafonkin, (c) 2010-2011 CloudMade */ var leafletSrc$1 = leafletSrc$2.exports; var hasRequiredLeafletSrc; function requireLeafletSrc () { if (hasRequiredLeafletSrc) return leafletSrc$2.exports; hasRequiredLeafletSrc = 1; (function (module, exports) { (function (global, factory) { factory(exports) ; })(leafletSrc$1, (function (exports) { var version = "1.9.4"; /* * @namespace Util * * Various utility functions, used by Leaflet internally. */ // @function extend(dest: Object, src?: Object): Object // Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. Has an `L.extend` shortcut. function extend(dest) { var i, j, len, src; for (j = 1, len = arguments.length; j < len; j++) { src = arguments[j]; for (i in src) { dest[i] = src[i]; } } return dest; } // @function create(proto: Object, properties?: Object): Object // Compatibility polyfill for [Object.create](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/create) var create$2 = Object.create || (function () { function F() {} return function (proto) { F.prototype = proto; return new F(); }; })(); // @function bind(fn: Function, …): Function // Returns a new function bound to the arguments passed, like [Function.prototype.bind](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Function/bind). // Has a `L.bind()` shortcut. function bind(fn, obj) { var slice = Array.prototype.slice; if (fn.bind) { return fn.bind.apply(fn, slice.call(arguments, 1)); } var args = slice.call(arguments, 2); return function () { return fn.apply(obj, args.length ? args.concat(slice.call(arguments)) : arguments); }; } // @property lastId: Number // Last unique ID used by [`stamp()`](#util-stamp) var lastId = 0; // @function stamp(obj: Object): Number // Returns the unique ID of an object, assigning it one if it doesn't have it. function stamp(obj) { if (!('_leaflet_id' in obj)) { obj['_leaflet_id'] = ++lastId; } return obj._leaflet_id; } // @function throttle(fn: Function, time: Number, context: Object): Function // Returns a function which executes function `fn` with the given scope `context` // (so that the `this` keyword refers to `context` inside `fn`'s code). The function // `fn` will be called no more than one time per given amount of `time`. The arguments // received by the bound function will be any arguments passed when binding the // function, followed by any arguments passed when invoking the bound function. // Has an `L.throttle` shortcut. function throttle(fn, time, context) { var lock, args, wrapperFn, later; later = function () { // reset lock and call if queued lock = false; if (args) { wrapperFn.apply(context, args); args = false; } }; wrapperFn = function () { if (lock) { // called too soon, queue to call later args = arguments; } else { // call and lock until later fn.apply(context, arguments); setTimeout(later, time); lock = true; } }; return wrapperFn; } // @function wrapNum(num: Number, range: Number[], includeMax?: Boolean): Number // Returns the number `num` modulo `range` in such a way so it lies within // `range[0]` and `range[1]`. The returned value will be always smaller than // `range[1]` unless `includeMax` is set to `true`. function wrapNum(x, range, includeMax) { var max = range[1], min = range[0], d = max - min; return x === max && includeMax ? x : ((x - min) % d + d) % d + min; } // @function falseFn(): Function // Returns a function which always returns `false`. function falseFn() { return false; } // @function formatNum(num: Number, precision?: Number|false): Number // Returns the number `num` rounded with specified `precision`. // The default `precision` value is 6 decimal places. // `false` can be passed to skip any processing (can be useful to avoid round-off errors). function formatNum(num, precision) { if (precision === false) { return num; } var pow = Math.pow(10, precision === undefined ? 6 : precision); return Math.round(num * pow) / pow; } // @function trim(str: String): String // Compatibility polyfill for [String.prototype.trim](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim) function trim(str) { return str.trim ? str.trim() : str.replace(/^\s+|\s+$/g, ''); } // @function splitWords(str: String): String[] // Trims and splits the string on whitespace and returns the array of parts. function splitWords(str) { return trim(str).split(/\s+/); } // @function setOptions(obj: Object, options: Object): Object // Merges the given properties to the `options` of the `obj` object, returning the resulting options. See `Class options`. Has an `L.setOptions` shortcut. function setOptions(obj, options) { if (!Object.prototype.hasOwnProperty.call(obj, 'options')) { obj.options = obj.options ? create$2(obj.options) : {}; } for (var i in options) { obj.options[i] = options[i]; } return obj.options; } // @function getParamString(obj: Object, existingUrl?: String, uppercase?: Boolean): String // Converts an object into a parameter URL string, e.g. `{a: "foo", b: "bar"}` // translates to `'?a=foo&b=bar'`. If `existingUrl` is set, the parameters will // be appended at the end. If `uppercase` is `true`, the parameter names will // be uppercased (e.g. `'?A=foo&B=bar'`) function getParamString(obj, existingUrl, uppercase) { var params = []; for (var i in obj) { params.push(encodeURIComponent(uppercase ? i.toUpperCase() : i) + '=' + encodeURIComponent(obj[i])); } return ((!existingUrl || existingUrl.indexOf('?') === -1) ? '?' : '&') + params.join('&'); } var templateRe = /\{ *([\w_ -]+) *\}/g; // @function template(str: String, data: Object): String // Simple templating facility, accepts a template string of the form `'Hello {a}, {b}'` // and a data object like `{a: 'foo', b: 'bar'}`, returns evaluated string // `('Hello foo, bar')`. You can also specify functions instead of strings for // data values — they will be evaluated passing `data` as an argument. function template(str, data) { return str.replace(templateRe, function (str, key) { var value = data[key]; if (value === undefined) { throw new Error('No value provided for variable ' + str); } else if (typeof value === 'function') { value = value(data); } return value; }); } // @function isArray(obj): Boolean // Compatibility polyfill for [Array.isArray](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/isArray) var isArray = Array.isArray || function (obj) { return (Object.prototype.toString.call(obj) === '[object Array]'); }; // @function indexOf(array: Array, el: Object): Number // Compatibility polyfill for [Array.prototype.indexOf](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf) function indexOf(array, el) { for (var i = 0; i < array.length; i++) { if (array[i] === el) { return i; } } return -1; } // @property emptyImageUrl: String // Data URI string containing a base64-encoded empty GIF image. // Used as a hack to free memory from unused images on WebKit-powered // mobile devices (by setting image `src` to this string). var emptyImageUrl = 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs='; // inspired by https://paulirish.com/2011/requestanimationframe-for-smart-animating/ function getPrefixed(name) { return window['webkit' + name] || window['moz' + name] || window['ms' + name]; } var lastTime = 0; // fallback for IE 7-8 function timeoutDefer(fn) { var time = +new Date(), timeToCall = Math.max(0, 16 - (time - lastTime)); lastTime = time + timeToCall; return window.setTimeout(fn, timeToCall); } var requestFn = window.requestAnimationFrame || getPrefixed('RequestAnimationFrame') || timeoutDefer; var cancelFn = window.cancelAnimationFrame || getPrefixed('CancelAnimationFrame') || getPrefixed('CancelRequestAnimationFrame') || function (id) { window.clearTimeout(id); }; // @function requestAnimFrame(fn: Function, context?: Object, immediate?: Boolean): Number // Schedules `fn` to be executed when the browser repaints. `fn` is bound to // `context` if given. When `immediate` is set, `fn` is called immediately if // the browser doesn't have native support for // [`window.requestAnimationFrame`](https://developer.mozilla.org/docs/Web/API/window/requestAnimationFrame), // otherwise it's delayed. Returns a request ID that can be used to cancel the request. function requestAnimFrame(fn, context, immediate) { if (immediate && requestFn === timeoutDefer) { fn.call(context); } else { return requestFn.call(window, bind(fn, context)); } } // @function cancelAnimFrame(id: Number): undefined // Cancels a previous `requestAnimFrame`. See also [window.cancelAnimationFrame](https://developer.mozilla.org/docs/Web/API/window/cancelAnimationFrame). function cancelAnimFrame(id) { if (id) { cancelFn.call(window, id); } } var Util = { __proto__: null, extend: extend, create: create$2, bind: bind, get lastId () { return lastId; }, stamp: stamp, throttle: throttle, wrapNum: wrapNum, falseFn: falseFn, formatNum: formatNum, trim: trim, splitWords: splitWords, setOptions: setOptions, getParamString: getParamString, template: template, isArray: isArray, indexOf: indexOf, emptyImageUrl: emptyImageUrl, requestFn: requestFn, cancelFn: cancelFn, requestAnimFrame: requestAnimFrame, cancelAnimFrame: cancelAnimFrame }; // @class Class // @aka L.Class // @section // @uninheritable // Thanks to John Resig and Dean Edwards for inspiration! function Class() {} Class.extend = function (props) { // @function extend(props: Object): Function // [Extends the current class](#class-inheritance) given the properties to be included. // Returns a Javascript function that is a class constructor (to be called with `new`). var NewClass = function () { setOptions(this); // call the constructor if (this.initialize) { this.initialize.apply(this, arguments); } // call all constructor hooks this.callInitHooks(); }; var parentProto = NewClass.__super__ = this.prototype; var proto = create$2(parentProto); proto.constructor = NewClass; NewClass.prototype = proto; // inherit parent's statics for (var i in this) { if (Object.prototype.hasOwnProperty.call(this, i) && i !== 'prototype' && i !== '__super__') { NewClass[i] = this[i]; } } // mix static properties into the class if (props.statics) { extend(NewClass, props.statics); } // mix includes into the prototype if (props.includes) { checkDeprecatedMixinEvents(props.includes); extend.apply(null, [proto].concat(props.includes)); } // mix given properties into the prototype extend(proto, props); delete proto.statics; delete proto.includes; // merge options if (proto.options) { proto.options = parentProto.options ? create$2(parentProto.options) : {}; extend(proto.options, props.options); } proto._initHooks = []; // add method for calling all hooks proto.callInitHooks = function () { if (this._initHooksCalled) { return; } if (parentProto.callInitHooks) { parentProto.callInitHooks.call(this); } this._initHooksCalled = true; for (var i = 0, len = proto._initHooks.length; i < len; i++) { proto._initHooks[i].call(this); } }; return NewClass; }; // @function include(properties: Object): this // [Includes a mixin](#class-includes) into the current class. Class.include = function (props) { var parentOptions = this.prototype.options; extend(this.prototype, props); if (props.options) { this.prototype.options = parentOptions; this.mergeOptions(props.options); } return this; }; // @function mergeOptions(options: Object): this // [Merges `options`](#class-options) into the defaults of the class. Class.mergeOptions = function (options) { extend(this.prototype.options, options); return this; }; // @function addInitHook(fn: Function): this // Adds a [constructor hook](#class-constructor-hooks) to the class. Class.addInitHook = function (fn) { // (Function) || (String, args...) var args = Array.prototype.slice.call(arguments, 1); var init = typeof fn === 'function' ? fn : function () { this[fn].apply(this, args); }; this.prototype._initHooks = this.prototype._initHooks || []; this.prototype._initHooks.push(init); return this; }; function checkDeprecatedMixinEvents(includes) { /* global L: true */ if (typeof L === 'undefined' || !L || !L.Mixin) { return; } includes = isArray(includes) ? includes : [includes]; for (var i = 0; i < includes.length; i++) { if (includes[i] === L.Mixin.Events) { console.warn('Deprecated include of L.Mixin.Events: ' + 'this property will be removed in future releases, ' + 'please inherit from L.Evented instead.', new Error().stack); } } } /* * @class Evented * @aka L.Evented * @inherits Class * * A set of methods shared between event-powered classes (like `Map` and `Marker`). Generally, events allow you to execute some function when something happens with an object (e.g. the user clicks on the map, causing the map to fire `'click'` event). * * @example * * ```js * map.on('click', function(e) { * alert(e.latlng); * } ); * ``` * * Leaflet deals with event listeners by reference, so if you want to add a listener and then remove it, define it as a function: * * ```js * function onClick(e) { ... } * * map.on('click', onClick); * map.off('click', onClick); * ``` */ var Events = { /* @method on(type: String, fn: Function, context?: Object): this * Adds a listener function (`fn`) to a particular event type of the object. You can optionally specify the context of the listener (object the this keyword will point to). You can also pass several space-separated types (e.g. `'click dblclick'`). * * @alternative * @method on(eventMap: Object): this * Adds a set of type/listener pairs, e.g. `{click: onClick, mousemove: onMouseMove}` */ on: function (types, fn, context) { // types can be a map of types/handlers if (typeof types === 'object') { for (var type in types) { // we don't process space-separated events here for performance; // it's a hot path since Layer uses the on(obj) syntax this._on(type, types[type], fn); } } else { // types can be a string of space-separated words types = splitWords(types); for (var i = 0, len = types.length; i < len; i++) { this._on(types[i], fn, context); } } return this; }, /* @method off(type: String, fn?: Function, context?: Object): this * Removes a previously added listener function. If no function is specified, it will remove all the listeners of that particular event from the object. Note that if you passed a custom context to `on`, you must pass the same context to `off` in order to remove the listener. * * @alternative * @method off(eventMap: Object): this * Removes a set of type/listener pairs. * * @alternative * @method off: this * Removes all listeners to all events on the object. This includes implicitly attached events. */ off: function (types, fn, context) { if (!arguments.length) { // clear all listeners if called without arguments delete this._events; } else if (typeof types === 'object') { for (var type in types) { this._off(type, types[type], fn); } } else { types = splitWords(types); var removeAll = arguments.length === 1; for (var i = 0, len = types.length; i < len; i++) { if (removeAll) { this._off(types[i]); } else { this._off(types[i], fn, context); } } } return this; }, // attach listener (without syntactic sugar now) _on: function (type, fn, context, _once) { if (typeof fn !== 'function') { console.warn('wrong listener type: ' + typeof fn); return; } // check if fn already there if (this._listens(type, fn, context) !== false) { return; } if (context === this) { // Less memory footprint. context = undefined; } var newListener = {fn: fn, ctx: context}; if (_once) { newListener.once = true; } this._events = this._events || {}; this._events[type] = this._events[type] || []; this._events[type].push(newListener); }, _off: function (type, fn, context) { var listeners, i, len; if (!this._events) { return; } listeners = this._events[type]; if (!listeners) { return; } if (arguments.length === 1) { // remove all if (this._firingCount) { // Set all removed listeners to noop // so they are not called if remove happens in fire for (i = 0, len = listeners.length; i < len; i++) { listeners[i].fn = falseFn; } } // clear all listeners for a type if function isn't specified delete this._events[type]; return; } if (typeof fn !== 'function') { console.warn('wrong listener type: ' + typeof fn); return; } // find fn and remove it var index = this._listens(type, fn, context); if (index !== false) { var listener = listeners[index]; if (this._firingCount) { // set the removed listener to noop so that's not called if remove happens in fire listener.fn = falseFn; /* copy array in case events are being fired */ this._events[type] = listeners = listeners.slice(); } listeners.splice(index, 1); } }, // @method fire(type: String, data?: Object, propagate?: Boolean): this // Fires an event of the specified type. You can optionally provide a data // object — the first argument of the listener function will contain its // properties. The event can optionally be propagated to event parents. fire: function (type, data, propagate) { if (!this.listens(type, propagate)) { return this; } var event = extend({}, data, { type: type, target: this, sourceTarget: data && data.sourceTarget || this }); if (this._events) { var listeners = this._events[type]; if (listeners) { this._firingCount = (this._firingCount + 1) || 1; for (var i = 0, len = listeners.length; i < len; i++) { var l = listeners[i]; // off overwrites l.fn, so we need to copy fn to a var var fn = l.fn; if (l.once) { this.off(type, fn, l.ctx); } fn.call(l.ctx || this, event); } this._firingCount--; } } if (propagate) { // propagate the event to parents (set with addEventParent) this._propagateEvent(event); } return this; }, // @method listens(type: String, propagate?: Boolean): Boolean // @method listens(type: String, fn: Function, context?: Object, propagate?: Boolean): Boolean // Returns `true` if a particular event type has any listeners attached to it. // The verification can optionally be propagated, it will return `true` if parents have the listener attached to it. listens: function (type, fn, context, propagate) { if (typeof type !== 'string') { console.warn('"string" type argument expected'); } // we don't overwrite the input `fn` value, because we need to use it for propagation var _fn = fn; if (typeof fn !== 'function') { propagate = !!fn; _fn = undefined; context = undefined; } var listeners = this._events && this._events[type]; if (listeners && listeners.length) { if (this._listens(type, _fn, context) !== false) { return true; } } if (propagate) { // also check parents for listeners if event propagates for (var id in this._eventParents) { if (this._eventParents[id].listens(type, fn, context, propagate)) { return true; } } } return false; }, // returns the index (number) or false _listens: function (type, fn, context) { if (!this._events) { return false; } var listeners = this._events[type] || []; if (!fn) { return !!listeners.length; } if (context === this) { // Less memory footprint. context = undefined; } for (var i = 0, len = listeners.length; i < len; i++) { if (listeners[i].fn === fn && listeners[i].ctx === context) { return i; } } return false; }, // @method once(…): this // Behaves as [`on(…)`](#evented-on), except the listener will only get fired once and then removed. once: function (types, fn, context) { // types can be a map of types/handlers if (typeof types === 'object') { for (var type in types) { // we don't process space-separated events here for performance; // it's a hot path since Layer uses the on(obj) syntax this._on(type, types[type], fn, true); } } else { // types can be a string of space-separated words types = splitWords(types); for (var i = 0, len = types.length; i < len; i++) { this._on(types[i], fn, context, true); } } return this; }, // @method addEventParent(obj: Evented): this // Adds an event parent - an `Evented` that will receive propagated events addEventParent: function (obj) { this._eventParents = this._eventParents || {}; this._eventParents[stamp(obj)] = obj; return this; }, // @method removeEventParent(obj: Evented): this // Removes an event parent, so it will stop receiving propagated events removeEventParent: function (obj) { if (this._eventParents) { delete this._eventParents[stamp(obj)]; } return this; }, _propagateEvent: function (e) { for (var id in this._eventParents) { this._eventParents[id].fire(e.type, extend({ layer: e.target, propagatedFrom: e.target }, e), true); } } }; // aliases; we should ditch those eventually // @method addEventListener(…): this // Alias to [`on(…)`](#evented-on) Events.addEventListener = Events.on; // @method removeEventListener(…): this // Alias to [`off(…)`](#evented-off) // @method clearAllEventListeners(…): this // Alias to [`off()`](#evented-off) Events.removeEventListener = Events.clearAllEventListeners = Events.off; // @method addOneTimeEventListener(…): this // Alias to [`once(…)`](#evented-once) Events.addOneTimeEventListener = Events.once; // @method fireEvent(…): this // Alias to [`fire(…)`](#evented-fire) Events.fireEvent = Events.fire; // @method hasEventListeners(…): Boolean // Alias to [`listens(…)`](#evented-listens) Events.hasEventListeners = Events.listens; var Evented = Class.extend(Events); /* * @class Point * @aka L.Point * * Represents a point with `x` and `y` coordinates in pixels. * * @example * * ```js * var point = L.point(200, 300); * ``` * * All Leaflet methods and options that accept `Point` objects also accept them in a simple Array form (unless noted otherwise), so these lines are equivalent: * * ```js * map.panBy([200, 300]); * map.panBy(L.point(200, 300)); * ``` * * Note that `Point` does not inherit from Leaflet's `Class` object, * which means new classes can't inherit from it, and new methods * can't be added to it with the `include` function. */ function Point(x, y, round) { // @property x: Number; The `x` coordinate of the point this.x = (round ? Math.round(x) : x); // @property y: Number; The `y` coordinate of the point this.y = (round ? Math.round(y) : y); } var trunc = Math.trunc || function (v) { return v > 0 ? Math.floor(v) : Math.ceil(v); }; Point.prototype = { // @method clone(): Point // Returns a copy of the current point. clone: function () { return new Point(this.x, this.y); }, // @method add(otherPoint: Point): Point // Returns the result of addition of the current and the given points. add: function (point) { // non-destructive, returns a new point return this.clone()._add(toPoint(point)); }, _add: function (point) { // destructive, used directly for performance in situations where it's safe to modify existing point this.x += point.x; this.y += point.y; return this; }, // @method subtract(otherPoint: Point): Point // Returns the result of subtraction of the given point from the current. subtract: function (point) { return this.clone()._subtract(toPoint(point)); }, _subtract: function (point) { this.x -= point.x; this.y -= point.y; return this; }, // @method divideBy(num: Number): Point // Returns the result of division of the current point by the given number. divideBy: function (num) { return this.clone()._divideBy(num); }, _divideBy: function (num) { this.x /= num; this.y /= num; return this; }, // @method multiplyBy(num: Number): Point // Returns the result of multiplication of the current point by the given number. multiplyBy: function (num) { return this.clone()._multiplyBy(num); }, _multiplyBy: function (num) { this.x *= num; this.y *= num; return this; }, // @method scaleBy(scale: Point): Point // Multiply each coordinate of the current point by each coordinate of // `scale`. In linear algebra terms, multiply the point by the // [scaling matrix](https://en.wikipedia.org/wiki/Scaling_%28geometry%29#Matrix_representation) // defined by `scale`. scaleBy: function (point) { return new Point(this.x * point.x, this.y * point.y); }, // @method unscaleBy(scale: Point): Point // Inverse of `scaleBy`. Divide each coordinate of the current point by // each coordinate of `scale`. unscaleBy: function (point) { return new Point(this.x / point.x, this.y / point.y); }, // @method round(): Point // Returns a copy of the current point with rounded coordinates. round: function () { return this.clone()._round(); }, _round: function () { this.x = Math.round(this.x); this.y = Math.round(this.y); return this; }, // @method floor(): Point // Returns a copy of the current point with floored coordinates (rounded down). floor: function () { return this.clone()._floor(); }, _floor: function () { this.x = Math.floor(this.x); this.y = Math.floor(this.y); return this; }, // @method ceil(): Point // Returns a copy of the current point with ceiled coordinates (rounded up). ceil: function () { return this.clone()._ceil(); }, _ceil: function () { this.x = Math.ceil(this.x); this.y = Math.ceil(this.y); return this; }, // @method trunc(): Point // Returns a copy of the current point with truncated coordinates (rounded towards zero). trunc: function () { return this.clone()._trunc(); }, _trunc: function () { this.x = trunc(this.x); this.y = trunc(this.y); return this; }, // @method distanceTo(otherPoint: Point): Number // Returns the cartesian distance between the current and the given points. distanceTo: function (point) { point = toPoint(point); var x = point.x - this.x, y = point.y - this.y; return Math.sqrt(x * x + y * y); }, // @method equals(otherPoint: Point): Boolean // Returns `true` if the given point has the same coordinates. equals: function (point) { point = toPoint(point); return point.x === this.x && point.y === this.y; }, // @method contains(otherPoint: Point): Boolean // Returns `true` if both coordinates of the given point are less than the corresponding current point coordinates (in absolute values). contains: function (point) { point = toPoint(point); return Math.abs(point.x) <= Math.abs(this.x) && Math.abs(point.y) <= Math.abs(this.y); }, // @method toString(): String // Returns a string representation of the point for debugging purposes. toString: function () { return 'Point(' + formatNum(this.x) + ', ' + formatNum(this.y) + ')'; } }; // @factory L.point(x: Number, y: Number, round?: Boolean) // Creates a Point object with the given `x` and `y` coordinates. If optional `round` is set to true, rounds the `x` and `y` values. // @alternative // @factory L.point(coords: Number[]) // Expects an array of the form `[x, y]` instead. // @alternative // @factory L.point(coords: Object) // Expects a plain object of the form `{x: Number, y: Number}` instead. function toPoint(x, y, round) { if (x instanceof Point) { return x; } if (isArray(x)) { return new Point(x[0], x[1]); } if (x === undefined || x === null) { return x; } if (typeof x === 'object' && 'x' in x && 'y' in x) { return new Point(x.x, x.y); } return new Point(x, y, round); } /* * @class Bounds * @aka L.Bounds * * Represents a rectangular area in pixel coordinates. * * @example * * ```js * var p1 = L.point(10, 10), * p2 = L.point(40, 60), * bounds = L.bounds(p1, p2); * ``` * * All Leaflet methods that accept `Bounds` objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this: * * ```js * otherBounds.intersects([[10, 10], [40, 60]]); * ``` * * Note that `Bounds` does not inherit from Leaflet's `Class` object, * which means new classes can't inherit from it, and new methods * can't be added to it with the `include` function. */ function Bounds(a, b) { if (!a) { return; } var points = b ? [a, b] : a; for (var i = 0, len = points.length; i < len; i++) { this.extend(points[i]); } } Bounds.prototype = { // @method extend(point: Point): this // Extends the bounds to contain the given point. // @alternative // @method extend(otherBounds: Bounds): this // Extend the bounds to contain the given bounds extend: function (obj) { var min2, max2; if (!obj) { return this; } if (obj instanceof Point || typeof obj[0] === 'number' || 'x' in obj) { min2 = max2 = toPoint(obj); } else { obj = toBounds(obj); min2 = obj.min; max2 = obj.max; if (!min2 || !max2) { return this; } } // @property min: Point // The top left corner of the rectangle. // @property max: Point // The bottom right corner of the rectangle. if (!this.min && !this.max) { this.min = min2.clone(); this.max = max2.clone(); } else { this.min.x = Math.min(min2.x, this.min.x); this.max.x = Math.max(max2.x, this.max.x); this.min.y = Math.min(min2.y, this.min.y); this.max.y = Math.max(max2.y, this.max.y); } return this; }, // @method getCenter(round?: Boolean): Point // Returns the center point of the bounds. getCenter: function (round) { return toPoint( (this.min.x + this.max.x) / 2, (this.min.y + this.max.y) / 2, round); }, // @method getBottomLeft(): Point // Returns the bottom-left point of the bounds. getBottomLeft: function () { return toPoint(this.min.x, this.max.y); }, // @method getTopRight(): Point // Returns the top-right point of the bounds. getTopRight: function () { // -> Point return toPoint(this.max.x, this.min.y); }, // @method getTopLeft(): Point // Returns the top-left point of the bounds (i.e. [`this.min`](#bounds-min)). getTopLeft: function () { return this.min; // left, top }, // @method getBottomRight(): Point // Returns the bottom-right point of the bounds (i.e. [`this.max`](#bounds-max)). getBottomRight: function () { return this.max; // right, bottom }, // @method getSize(): Point // Returns the size of the given bounds getSize: function () { return this.max.subtract(this.min); }, // @method contains(otherBounds: Bounds): Boolean // Returns `true` if the rectangle contains the given one. // @alternative // @method contains(point: Point): Boolean // Returns `true` if the rectangle contains the given point. contains: function (obj) { var min, max; if (typeof obj[0] === 'number' || obj instanceof Point) { obj = toPoint(obj); } else { obj = toBounds(obj); } if (obj instanceof Bounds) { min = obj.min; max = obj.max; } else { min = max = obj; } return (min.x >= this.min.x) && (max.x <= this.max.x) && (min.y >= this.min.y) && (max.y <= this.max.y); }, // @method intersects(otherBounds: Bounds): Boolean // Returns `true` if the rectangle intersects the given bounds. Two bounds // intersect if they have at least one point in common. intersects: function (bounds) { // (Bounds) -> Boolean bounds = toBounds(bounds); var min = this.min, max = this.max, min2 = bounds.min, max2 = bounds.max, xIntersects = (max2.x >= min.x) && (min2.x <= max.x), yIntersects = (max2.y >= min.y) && (min2.y <= max.y); return xIntersects && yIntersects; }, // @method overlaps(otherBounds: Bounds): Boolean // Returns `true` if the rectangle overlaps the given bounds. Two bounds // overlap if their intersection is an area. overlaps: function (bounds) { // (Bounds) -> Boolean bounds = toBounds(bounds); var min = this.min, max = this.max, min2 = bounds.min, max2 = bounds.max, xOverlaps = (max2.x > min.x) && (min2.x < max.x), yOverlaps = (max2.y > min.y) && (min2.y < max.y); return xOverlaps && yOverlaps; }, // @method isValid(): Boolean // Returns `true` if the bounds are properly initialized. isValid: function () { return !!(this.min && this.max); }, // @method pad(bufferRatio: Number): Bounds // Returns bounds created by extending or retracting the current bounds by a given ratio in each direction. // For example, a ratio of 0.5 extends the bounds by 50% in each direction. // Negative values will retract the bounds. pad: function (bufferRatio) { var min = this.min, max = this.max, heightBuffer = Math.abs(min.x - max.x) * bufferRatio, widthBuffer = Math.abs(min.y - max.y) * bufferRatio; return toBounds( toPoint(min.x - heightBuffer, min.y - widthBuffer), toPoint(max.x + heightBuffer, max.y + widthBuffer)); }, // @method equals(otherBounds: Bounds): Boolean // Returns `true` if the rectangle is equivalent to the given bounds. equals: function (bounds) { if (!bounds) { return false; } bounds = toBounds(bounds); return this.min.equals(bounds.getTopLeft()) && this.max.equals(bounds.getBottomRight()); }, }; // @factory L.bounds(corner1: Point, corner2: Point) // Creates a Bounds object from two corners coordinate pairs. // @alternative // @factory L.bounds(points: Point[]) // Creates a Bounds object from the given array of points. function toBounds(a, b) { if (!a || a instanceof Bounds) { return a; } return new Bounds(a, b); } /* * @class LatLngBounds * @aka L.LatLngBounds * * Represents a rectangular geographical area on a map. * * @example * * ```js * var corner1 = L.latLng(40.712, -74.227), * corner2 = L.latLng(40.774, -74.125), * bounds = L.latLngBounds(corner1, corner2); * ``` * * All Leaflet methods that accept LatLngBounds objects also accept them in a simple Array form (unless noted otherwise), so the bounds example above can be passed like this: * * ```js * map.fitBounds([ * [40.712, -74.227], * [40.774, -74.125] * ]); * ``` * * Caution: if the area crosses the antimeridian (often confused with the International Date Line), you must specify corners _outside_ the [-180, 180] degrees longitude range. * * Note that `LatLngBounds` does not inherit from Leaflet's `Class` object, * which means new classes can't inherit from it, and new methods * can't be added to it with the `include` function. */ function LatLngBounds(corner1, corner2) { // (LatLng, LatLng) or (LatLng[]) if (!corner1) { return; } var latlngs = corner2 ? [corner1, corner2] : corner1; for (var i = 0, len = latlngs.length; i < len; i++) { this.extend(latlngs[i]); } } LatLngBounds.prototype = { // @method extend(latlng: LatLng): this // Extend the bounds to contain the given point // @alternative // @method extend(otherBounds: LatLngBounds): this // Extend the bounds to contain the given bounds extend: function (obj) { var sw = this._southWest, ne = this._northEast, sw2, ne2; if (obj instanceof LatLng) { sw2 = obj; ne2 = obj; } else if (obj instanceof LatLngBounds) { sw2 = obj._southWest; ne2 = obj._northEast; if (!sw2 || !ne2) { return this; } } else { return obj ? this.extend(toLatLng(obj) || toLatLngBounds(obj)) : this; } if (!sw && !ne) { this._southWest = new LatLng(sw2.lat, sw2.lng); this._northEast = new LatLng(ne2.lat, ne2.lng); } else { sw.lat = Math.min(sw2.lat, sw.lat); sw.lng = Math.min(sw2.lng, sw.lng); ne.lat = Math.max(ne2.lat, ne.lat); ne.lng = Math.max(ne2.lng, ne.lng); } return this; }, // @method pad(bufferRatio: Number): LatLngBounds // Returns bounds created by extending or retracting the current bounds by a given ratio in each direction. // For example, a ratio of 0.5 extends the bounds by 50% in each direction. // Negative values will retract the bounds. pad: function (bufferRatio) { var sw = this._southWest, ne = this._northEast, heightBuffer = Math.abs(sw.lat - ne.lat) * bufferRatio, widthBuffer = Math.abs(sw.lng - ne.lng) * bufferRatio; return new LatLngBounds( new LatLng(sw.lat - heightBuffer, sw.lng - widthBuffer), new LatLng(ne.lat + heightBuffer, ne.lng + widthBuffer)); }, // @method getCenter(): LatLng // Returns the center point of the bounds. getCenter: function () { return new LatLng( (this._southWest.lat + this._northEast.lat) / 2, (this._southWest.lng + this._northEast.lng) / 2); }, // @method getSouthWest(): LatLng // Returns the south-west point of the bounds. getSouthWest: function () { return this._southWest; }, // @method getNorthEast(): LatLng // Returns the north-east point of the bounds. getNorthEast: function () { return this._northEast; }, // @method getNorthWest(): LatLng // Returns the north-west point of the bounds. getNorthWest: function () { return new LatLng(this.getNorth(), this.getWest()); }, // @method getSouthEast(): LatLng // Returns the south-east point of the bounds. getSouthEast: function () { return new LatLng(this.getSouth(), this.getEast()); }, // @method getWest(): Number // Returns the west longitude of the bounds getWest: function () { return this._southWest.lng; }, // @method getSouth(): Number // Returns the south latitude of the bounds getSouth: function () { return this._southWest.lat; }, // @method getEast(): Number // Returns the east longitude of the bounds getEast: function () { return this._northEast.lng; }, // @method getNorth(): Number // Returns the north latitude of the bounds getNorth: function () { return this._northEast.lat; }, // @method contains(otherBounds: LatLngBounds): Boolean // Returns `true` if the rectangle contains the given one. // @alternative // @method contains (latlng: LatLng): Boolean // Returns `true` if the rectangle contains the given point. contains: function (obj) { // (LatLngBounds) or (LatLng) -> Boolean if (typeof obj[0] === 'number' || obj instanceof LatLng || 'lat' in obj) { obj = toLatLng(obj); } else { obj = toLatLngBounds(obj); } var sw = this._southWest, ne = this._northEast, sw2, ne2; if (obj instanceof LatLngBounds) { sw2 = obj.getSouthWest(); ne2 = obj.getNorthEast(); } else { sw2 = ne2 = obj; } return (sw2.lat >= sw.lat) && (ne2.lat <= ne.lat) && (sw2.lng >= sw.lng) && (ne2.lng <= ne.lng); }, // @method intersects(otherBounds: LatLngBounds): Boolean // Returns `true` if the rectangle intersects the given bounds. Two bounds intersect if they have at least one point in common. intersects: function (bounds) { bounds = toLatLngBounds(bounds); var sw = this._southWest, ne = this._northEast, sw2 = bounds.getSouthWest(), ne2 = bounds.getNorthEast(), latIntersects = (ne2.lat >= sw.lat) && (sw2.lat <= ne.lat), lngIntersects = (ne2.lng >= sw.lng) && (sw2.lng <= ne.lng); return latIntersects && lngIntersects; }, // @method overlaps(otherBounds: LatLngBounds): Boolean // Returns `true` if the rectangle overlaps the given bounds. Two bounds overlap if their intersection is an area. overlaps: function (bounds) { bounds = toLatLngBounds(bounds); var sw = this._southWest, ne = this._northEast, sw2 = bounds.getSouthWest(), ne2 = bounds.getNorthEast(), latOverlaps = (ne2.lat > sw.lat) && (sw2.lat < ne.lat), lngOverlaps = (ne2.lng > sw.lng) && (sw2.lng < ne.lng); return latOverlaps && lngOverlaps; }, // @method toBBoxString(): String // Returns a string with bounding box coordinates in a 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for sending requests to web services that return geo data. toBBoxString: function () { return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(','); }, // @method equals(otherBounds: LatLngBounds, maxMargin?: Number): Boolean // Returns `true` if the rectangle is equivalent (within a small margin of error) to the given bounds. The margin of error can be overridden by setting `maxMargin` to a small number. equals: function (bounds, maxMargin) { if (!bounds) { return false; } bounds = toLatLngBounds(bounds); return this._southWest.equals(bounds.getSouthWest(), maxMargin) && this._northEast.equals(bounds.getNorthEast(), maxMargin); }, // @method isValid(): Boolean // Returns `true` if the bounds are properly initialized. isValid: function () { return !!(this._southWest && this._northEast); } }; // TODO International date line? // @factory L.latLngBounds(corner1: LatLng, corner2: LatLng) // Creates a `LatLngBounds` object by defining two diagonally opposite corners of the rectangle. // @alternative // @factory L.latLngBounds(latlngs: LatLng[]) // Creates a `LatLngBounds` object defined by the geographical points it contains. Very useful for zooming the map to fit a particular set of locations with [`fitBounds`](#map-fitbounds). function toLatLngBounds(a, b) { if (a instanceof LatLngBounds) { return a; } return new LatLngBounds(a, b); } /* @class LatLng * @aka L.LatLng * * Represents a geographical point with a certain latitude and longitude. * * @example * * ``` * var latlng = L.latLng(50.5, 30.5); * ``` * * All Leaflet methods that accept LatLng objects also accept them in a simple Array form and simple object form (unless noted otherwise), so these lines are equivalent: * * ``` * map.panTo([50, 30]); * map.panTo({lon: 30, lat: 50}); * map.panTo({lat: 50, lng: 30}); * map.panTo(L.latLng(50, 30)); * ``` * * Note that `LatLng` does not inherit from Leaflet's `Class` object, * which means new classes can't inherit from it, and new methods * can't be added to it with the `include` function. */ function LatLng(lat, lng, alt) { if (isNaN(lat) || isNaN(lng)) { throw new Error('Invalid LatLng object: (' + lat + ', ' + lng + ')'); } // @property lat: Number // Latitude in degrees this.lat = +lat; // @property lng: Number // Longitude in degrees this.lng = +lng; // @property alt: Number // Altitude in meters (optional) if (alt !== undefined) { this.alt = +alt; } } LatLng.prototype = { // @method equals(otherLatLng: LatLng, maxMargin?: Number): Boolean // Returns `true` if the given `LatLng` point is at the same position (within a small margin of error). The margin of error can be overridden by setting `maxMargin` to a small number. equals: function (obj, maxMargin) { if (!obj) { return false; } obj = toLatLng(obj); var margin = Math.max( Math.abs(this.lat - obj.lat), Math.abs(this.lng - obj.lng)); return margin <= (maxMargin === undefined ? 1.0E-9 : maxMargin); }, // @method toString(): String // Returns a string representation of the point (for debugging purposes). toString: function (precision) { return 'LatLng(' + formatNum(this.lat, precision) + ', ' + formatNum(this.lng, precision) + ')'; }, // @method distanceTo(otherLatLng: LatLng): Number // Returns the distance (in meters) to the given `LatLng` calculated using the [Spherical Law of Cosines](https://en.wikipedia.org/wiki/Spherical_law_of_cosines). distanceTo: function (other) { return Earth.distance(this, toLatLng(other)); }, // @method wrap(): LatLng // Returns a new `LatLng` object with the longitude wrapped so it's always between -180 and +180 degrees. wrap: function () { return Earth.wrapLatLng(this); }, // @method toBounds(sizeInMeters: Number): LatLngBounds // Returns a new `LatLngBounds` object in which each boundary is `sizeInMeters/2` meters apart from the `LatLng`. toBounds: function (sizeInMeters) { var latAccuracy = 180 * sizeInMeters / 40075017, lngAccuracy = latAccuracy / Math.cos((Math.PI / 180) * this.lat); return toLatLngBounds( [this.lat - latAccuracy, this.lng - lngAccuracy], [this.lat + latAccuracy, this.lng + lngAccuracy]); }, clone: function () { return new LatLng(this.lat, this.lng, this.alt); } }; // @factory L.latLng(latitude: Number, longitude: Number, altitude?: Number): LatLng // Creates an object representing a geographical point with the given latitude and longitude (and optionally altitude). // @alternative // @factory L.latLng(coords: Array): LatLng // Expects an array of the form `[Number, Number]` or `[Number, Number, Number]` instead. // @alternative // @factory L.latLng(coords: Object): LatLng // Expects an plain object of the form `{lat: Number, lng: Number}` or `{lat: Number, lng: Number, alt: Number}` instead. function toLatLng(a, b, c) { if (a instanceof LatLng) { return a; } if (isArray(a) && typeof a[0] !== 'object') { if (a.length === 3) { return new LatLng(a[0], a[1], a[2]); } if (a.length === 2) { return new LatLng(a[0], a[1]); } return null; } if (a === undefined || a === null) { return a; } if (typeof a === 'object' && 'lat' in a) { return new LatLng(a.lat, 'lng' in a ? a.lng : a.lon, a.alt); } if (b === undefined) { return null; } return new LatLng(a, b, c); } /* * @namespace CRS * @crs L.CRS.Base * Object that defines coordinate reference systems for projecting * geographical points into pixel (screen) coordinates and back (and to * coordinates in other units for [WMS](https://en.wikipedia.org/wiki/Web_Map_Service) services). See * [spatial reference system](https://en.wikipedia.org/wiki/Spatial_reference_system). * * Leaflet defines the most usual CRSs by default. If you want to use a * CRS not defined by default, take a look at the * [Proj4Leaflet](https://github.com/kartena/Proj4Leaflet) plugin. * * Note that the CRS instances do not inherit from Leaflet's `Class` object, * and can't be instantiated. Also, new classes can't inherit from them, * and methods can't be added to them with the `include` function. */ var CRS = { // @method latLngToPoint(latlng: LatLng, zoom: Number): Point // Projects geographical coordinates into pixel coordinates for a given zoom. latLngToPoint: function (latlng, zoom) { var projectedPoint = this.projection.project(latlng), scale = this.scale(zoom); return this.transformation._transform(projectedPoint, scale); }, // @method pointToLatLng(point: Point, zoom: Number): LatLng // The inverse of `latLngToPoint`. Projects pixel coordinates on a given // zoom into geographical coordinates. pointToLatLng: function (point, zoom) { var scale = this.scale(zoom), untransformedPoint = this.transformation.untransform(point, scale); return this.projection.unproject(untransformedPoint); }, // @method project(latlng: LatLng): Point // Projects geographical coordinates into coordinates in units accepted for // this CRS (e.g. meters for EPSG:3857, for passing it to WMS services). project: function (latlng) { return this.projection.project(latlng); }, // @method unproject(point: Point): LatLng // Given a projected coordinate returns the corresponding LatLng. // The inverse of `project`. unproject: function (point) { return this.projection.unproject(point); }, // @method scale(zoom: Number): Number // Returns the scale used when transforming projected coordinates into // pixel coordinates for a particular zoom. For example, it returns // `256 * 2^zoom` for Mercator-based CRS. scale: function (zoom) { return 256 * Math.pow(2, zoom); }, // @method zoom(scale: Number): Number // Inverse of `scale()`, returns the zoom level corresponding to a scale // factor of `scale`. zoom: function (scale) { return Math.log(scale / 256) / Math.LN2; }, // @method getProjectedBounds(zoom: Number): Bounds // Returns the projection's bounds scaled and transformed for the provided `zoom`. getProjectedBounds: function (zoom) { if (this.infinite) { return null; } var b = this.projection.bounds, s = this.scale(zoom), min = this.transformation.transform(b.min, s), max = this.transformation.transform(b.max, s); return new Bounds(min, max); }, // @method distance(latlng1: LatLng, latlng2: LatLng): Number // Returns the distance between two geographical coordinates. // @property code: String // Standard code name of the CRS passed into WMS services (e.g. `'EPSG:3857'`) // // @property wrapLng: Number[] // An array of two numbers defining whether the longitude (horizontal) coordinate // axis wraps around a given range and how. Defaults to `[-180, 180]` in most // geographical CRSs. If `undefined`, the longitude axis does not wrap around. // // @property wrapLat: Number[] // Like `wrapLng`, but for the latitude (vertical) axis. // wrapLng: [min, max], // wrapLat: [min, max], // @property infinite: Boolean // If true, the coordinate space will be unbounded (infinite in both axes) infinite: false, // @method wrapLatLng(latlng: LatLng): LatLng // Returns a `LatLng` where lat and lng has been wrapped according to the // CRS's `wrapLat` and `wrapLng` properties, if they are outside the CRS's bounds. wrapLatLng: function (latlng) { var lng = this.wrapLng ? wrapNum(latlng.lng, this.wrapLng, true) : latlng.lng, lat = this.wrapLat ? wrapNum(latlng.lat, this.wrapLat, true) : latlng.lat, alt = latlng.alt; return new LatLng(lat, lng, alt); }, // @method wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds // Returns a `LatLngBounds` with the same size as the given one, ensuring // that its center is within the CRS's bounds. // Only accepts actual `L.LatLngBounds` instances, not arrays. wrapLatLngBounds: function (bounds) { var center = bounds.getCenter(), newCenter = this.wrapLatLng(center), latShift = center.lat - newCenter.lat, lngShift = center.lng - newCenter.lng; if (latShift === 0 && lngShift === 0) { return bounds; } var sw = bounds.getSouthWest(), ne = bounds.getNorthEast(), newSw = new LatLng(sw.lat - latShift, sw.lng - lngShift), newNe = new LatLng(ne.lat - latShift, ne.lng - lngShift); return new LatLngBounds(newSw, newNe); } }; /* * @namespace CRS * @crs L.CRS.Earth * * Serves as the base for CRS that are global such that they cover the earth. * Can only be used as the base for other CRS and cannot be used directly, * since it does not have a `code`, `projection` or `transformation`. `distance()` returns * meters. */ var Earth = extend({}, CRS, { wrapLng: [-180, 180], // Mean Earth Radius, as recommended for use by // the International Union of Geodesy and Geophysics, // see https://rosettacode.org/wiki/Haversine_formula R: 6371000, // distance between two geographical points using spherical law of cosines approximation distance: function (latlng1, latlng2) { var rad = Math.PI / 180, lat1 = latlng1.lat * rad, lat2 = latlng2.lat * rad, sinDLat = Math.sin((latlng2.lat - latlng1.lat) * rad / 2), sinDLon = Math.sin((latlng2.lng - latlng1.lng) * rad / 2), a = sinDLat * sinDLat + Math.cos(lat1) * Math.cos(lat2) * sinDLon * sinDLon, c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)); return this.R * c; } }); /* * @namespace Projection * @projection L.Projection.SphericalMercator * * Spherical Mercator projection — the most common projection for online maps, * used by almost all free and commercial tile providers. Assumes that Earth is * a sphere. Used by the `EPSG:3857` CRS. */ var earthRadius = 6378137; var SphericalMercator = { R: earthRadius, MAX_LATITUDE: 85.0511287798, project: function (latlng) { var d = Math.PI / 180, max = this.MAX_LATITUDE, lat = Math.max(Math.min(max, latlng.lat), -max), sin = Math.sin(lat * d); return new Point( this.R * latlng.lng * d, this.R * Math.log((1 + sin) / (1 - sin)) / 2); }, unproject: function (point) { var d = 180 / Math.PI; return new LatLng( (2 * Math.atan(Math.exp(point.y / this.R)) - (Math.PI / 2)) * d, point.x * d / this.R); }, bounds: (function () { var d = earthRadius * Math.PI; return new Bounds([-d, -d], [d, d]); })() }; /* * @class Transformation * @aka L.Transformation * * Represents an affine transformation: a set of coefficients `a`, `b`, `c`, `d` * for transforming a point of a form `(x, y)` into `(a*x + b, c*y + d)` and doing * the reverse. Used by Leaflet in its projections code. * * @example * * ```js * var transformation = L.transformation(2, 5, -1, 10), * p = L.point(1, 2), * p2 = transformation.transform(p), // L.point(7, 8) * p3 = transformation.untransform(p2); // L.point(1, 2) * ``` */ // factory new L.Transformation(a: Number, b: Number, c: Number, d: Number) // Creates a `Transformation` object with the given coefficients. function Transformation(a, b, c, d) { if (isArray(a)) { // use array properties this._a = a[0]; this._b = a[1]; this._c = a[2]; this._d = a[3]; return; } this._a = a; this._b = b; this._c = c; this._d = d; } Transformation.prototype = { // @method transform(point: Point, scale?: Number): Point // Returns a transformed point, optionally multiplied by the given scale. // Only accepts actual `L.Point` instances, not arrays. transform: function (point, scale) { // (Point, Number) -> Point return this._transform(point.clone(), scale); }, // destructive transform (faster) _transform: function (point, scale) { scale = scale || 1; point.x = scale * (this._a * point.x + this._b); point.y = scale * (this._c * point.y + this._d); return point; }, // @method untransform(point: Point, scale?: Number): Point // Returns the reverse transformation of the given point, optionally divided // by the given scale. Only accepts actual `L.Point` instances, not arrays. untransform: function (point, scale) { scale = scale || 1; return new Point( (point.x / scale - this._b) / this._a, (point.y / scale - this._d) / this._c); } }; // factory L.transformation(a: Number, b: Number, c: Number, d: Number) // @factory L.transformation(a: Number, b: Number, c: Number, d: Number) // Instantiates a Transformation object with the given coefficients. // @alternative // @factory L.transformation(coefficients: Array): Transformation // Expects an coefficients array of the form // `[a: Number, b: Number, c: Number, d: Number]`. function toTransformation(a, b, c, d) { return new Transformation(a, b, c, d); } /* * @namespace CRS * @crs L.CRS.EPSG3857 * * The most common CRS for online maps, used by almost all free and commercial * tile providers. Uses Spherical Mercator projection. Set in by default in * Map's `crs` option. */ var EPSG3857 = extend({}, Earth, { code: 'EPSG:3857', projection: SphericalMercator, transformation: (function () { var scale = 0.5 / (Math.PI * SphericalMercator.R); return toTransformation(scale, 0.5, -scale, 0.5); }()) }); var EPSG900913 = extend({}, EPSG3857, { code: 'EPSG:900913' }); // @namespace SVG; @section // There are several static functions which can be called without instantiating L.SVG: // @function create(name: String): SVGElement // Returns a instance of [SVGElement](https://developer.mozilla.org/docs/Web/API/SVGElement), // corresponding to the class name passed. For example, using 'line' will return // an instance of [SVGLineElement](https://developer.mozilla.org/docs/Web/API/SVGLineElement). function svgCreate(name) { return document.createElementNS('http://www.w3.org/2000/svg', name); } // @function pointsToPath(rings: Point[], closed: Boolean): String // Generates a SVG path string for multiple rings, with each ring turning // into "M..L..L.." instructions function pointsToPath(rings, closed) { var str = '', i, j, len, len2, points, p; for (i = 0, len = rings.length; i < len; i++) { points = rings[i]; for (j = 0, len2 = points.length; j < len2; j++) { p = points[j]; str += (j ? 'L' : 'M') + p.x + ' ' + p.y; } // closes the ring for polygons; "x" is VML syntax str += closed ? (Browser.svg ? 'z' : 'x') : ''; } // SVG complains about empty path strings return str || 'M0 0'; } /* * @namespace Browser * @aka L.Browser * * A namespace with static properties for browser/feature detection used by Leaflet internally. * * @example * * ```js * if (L.Browser.ielt9) { * alert('Upgrade your browser, dude!'); * } * ``` */ var style = document.documentElement.style; // @property ie: Boolean; `true` for all Internet Explorer versions (not Edge). var ie = 'ActiveXObject' in window; // @property ielt9: Boolean; `true` for Internet Explorer versions less than 9. var ielt9 = ie && !document.addEventListener; // @property edge: Boolean; `true` for the Edge web browser. var edge = 'msLaunchUri' in navigator && !('documentMode' in document); // @property webkit: Boolean; // `true` for webkit-based browsers like Chrome and Safari (including mobile versions). var webkit = userAgentContains('webkit'); // @property android: Boolean // **Deprecated.** `true` for any browser running on an Android platform. var android = userAgentContains('android'); // @property android23: Boolean; **Deprecated.** `true` for browsers running on Android 2 or Android 3. var android23 = userAgentContains('android 2') || userAgentContains('android 3'); /* See https://stackoverflow.com/a/17961266 for details on detecting stock Android */ var webkitVer = parseInt(/WebKit\/([0-9]+)|$/.exec(navigator.userAgent)[1], 10); // also matches AppleWebKit // @property androidStock: Boolean; **Deprecated.** `true` for the Android stock browser (i.e. not Chrome) var androidStock = android && userAgentContains('Google') && webkitVer < 537 && !('AudioNode' in window); // @property opera: Boolean; `true` for the Opera browser var opera = !!window.opera; // @property chrome: Boolean; `true` for the Chrome browser. var chrome = !edge && userAgentContains('chrome'); // @property gecko: Boolean; `true` for gecko-based browsers like Firefox. var gecko = userAgentContains('gecko') && !webkit && !opera && !ie; // @property safari: Boolean; `true` for the Safari browser. var safari = !chrome && userAgentContains('safari'); var phantom = userAgentContains('phantom'); // @property opera12: Boolean // `true` for the Opera browser supporting CSS transforms (version 12 or later). var opera12 = 'OTransition' in style; // @property win: Boolean; `true` when the browser is running in a Windows platform var win = navigator.platform.indexOf('Win') === 0; // @property ie3d: Boolean; `true` for all Internet Explorer versions supporting CSS transforms. var ie3d = ie && ('transition' in style); // @property webkit3d: Boolean; `true` for webkit-based browsers supporting CSS transforms. var webkit3d = ('WebKitCSSMatrix' in window) && ('m11' in new window.WebKitCSSMatrix()) && !android23; // @property gecko3d: Boolean; `true` for gecko-based browsers supporting CSS transforms. var gecko3d = 'MozPerspective' in style; // @property any3d: Boolean // `true` for all browsers supporting CSS transforms. var any3d = !window.L_DISABLE_3D && (ie3d || webkit3d || gecko3d) && !opera12 && !phantom; // @property mobile: Boolean; `true` for all browsers running in a mobile device. var mobile = typeof orientation !== 'undefined' || userAgentContains('mobile'); // @property mobileWebkit: Boolean; `true` for all webkit-based browsers in a mobile device. var mobileWebkit = mobile && webkit; // @property mobileWebkit3d: Boolean // `true` for all webkit-based browsers in a mobile device supporting CSS transforms. var mobileWebkit3d = mobile && webkit3d; // @property msPointer: Boolean // `true` for browsers implementing the Microsoft touch events model (notably IE10). var msPointer = !window.PointerEvent && window.MSPointerEvent; // @property pointer: Boolean // `true` for all browsers supporting [pointer events](https://msdn.microsoft.com/en-us/library/dn433244%28v=vs.85%29.aspx). var pointer = !!(window.PointerEvent || msPointer); // @property touchNative: Boolean // `true` for all browsers supporting [touch events](https://developer.mozilla.org/docs/Web/API/Touch_events). // **This does not necessarily mean** that the browser is running in a computer with // a touchscreen, it only means that the browser is capable of understanding // touch events. var touchNative = 'ontouchstart' in window || !!window.TouchEvent; // @property touch: Boolean // `true` for all browsers supporting either [touch](#browser-touch) or [pointer](#browser-pointer) events. // Note: pointer events will be preferred (if available), and processed for all `touch*` listeners. var touch = !window.L_NO_TOUCH && (touchNative || pointer); // @property mobileOpera: Boolean; `true` for the Opera browser in a mobile device. var mobileOpera = mobile && opera; // @property mobileGecko: Boolean // `true` for gecko-based browsers running in a mobile device. var mobileGecko = mobile && gecko; // @property retina: Boolean // `true` for browsers on a high-resolution "retina" screen or on any screen when browser's display zoom is more than 100%. var retina = (window.devicePixelRatio || (window.screen.deviceXDPI / window.screen.logicalXDPI)) > 1; // @property passiveEvents: Boolean // `true` for browsers that support passive events. var passiveEvents = (function () { var supportsPassiveOption = false; try { var opts = Object.defineProperty({}, 'passive', { get: function () { // eslint-disable-line getter-return supportsPassiveOption = true; } }); window.addEventListener('testPassiveEventSupport', falseFn, opts); window.removeEventListener('testPassiveEventSupport', falseFn, opts); } catch (e) { // Errors can safely be ignored since this is only a browser support test. } return supportsPassiveOption; }()); // @property canvas: Boolean // `true` when the browser supports [``](https://developer.mozilla.org/docs/Web/API/Canvas_API). var canvas$1 = (function () { return !!document.createElement('canvas').getContext; }()); // @property svg: Boolean // `true` when the browser supports [SVG](https://developer.mozilla.org/docs/Web/SVG). var svg$1 = !!(document.createElementNS && svgCreate('svg').createSVGRect); var inlineSvg = !!svg$1 && (function () { var div = document.createElement('div'); div.innerHTML = ''; return (div.firstChild && div.firstChild.namespaceURI) === 'http://www.w3.org/2000/svg'; })(); // @property vml: Boolean // `true` if the browser supports [VML](https://en.wikipedia.org/wiki/Vector_Markup_Language). var vml = !svg$1 && (function () { try { var div = document.createElement('div'); div.innerHTML = ''; var shape = div.firstChild; shape.style.behavior = 'url(#default#VML)'; return shape && (typeof shape.adj === 'object'); } catch (e) { return false; } }()); // @property mac: Boolean; `true` when the browser is running in a Mac platform var mac = navigator.platform.indexOf('Mac') === 0; // @property mac: Boolean; `true` when the browser is running in a Linux platform var linux = navigator.platform.indexOf('Linux') === 0; function userAgentContains(str) { return navigator.userAgent.toLowerCase().indexOf(str) >= 0; } var Browser = { ie: ie, ielt9: ielt9, edge: edge, webkit: webkit, android: android, android23: android23, androidStock: androidStock, opera: opera, chrome: chrome, gecko: gecko, safari: safari, phantom: phantom, opera12: opera12, win: win, ie3d: ie3d, webkit3d: webkit3d, gecko3d: gecko3d, any3d: any3d, mobile: mobile, mobileWebkit: mobileWebkit, mobileWebkit3d: mobileWebkit3d, msPointer: msPointer, pointer: pointer, touch: touch, touchNative: touchNative, mobileOpera: mobileOpera, mobileGecko: mobileGecko, retina: retina, passiveEvents: passiveEvents, canvas: canvas$1, svg: svg$1, vml: vml, inlineSvg: inlineSvg, mac: mac, linux: linux }; /* * Extends L.DomEvent to provide touch support for Internet Explorer and Windows-based devices. */ var POINTER_DOWN = Browser.msPointer ? 'MSPointerDown' : 'pointerdown'; var POINTER_MOVE = Browser.msPointer ? 'MSPointerMove' : 'pointermove'; var POINTER_UP = Browser.msPointer ? 'MSPointerUp' : 'pointerup'; var POINTER_CANCEL = Browser.msPointer ? 'MSPointerCancel' : 'pointercancel'; var pEvent = { touchstart : POINTER_DOWN, touchmove : POINTER_MOVE, touchend : POINTER_UP, touchcancel : POINTER_CANCEL }; var handle = { touchstart : _onPointerStart, touchmove : _handlePointer, touchend : _handlePointer, touchcancel : _handlePointer }; var _pointers = {}; var _pointerDocListener = false; // Provides a touch events wrapper for (ms)pointer events. // ref https://www.w3.org/TR/pointerevents/ https://www.w3.org/Bugs/Public/show_bug.cgi?id=22890 function addPointerListener(obj, type, handler) { if (type === 'touchstart') { _addPointerDocListener(); } if (!handle[type]) { console.warn('wrong event specified:', type); return falseFn; } handler = handle[type].bind(this, handler); obj.addEventListener(pEvent[type], handler, false); return handler; } function removePointerListener(obj, type, handler) { if (!pEvent[type]) { console.warn('wrong event specified:', type); return; } obj.removeEventListener(pEvent[type], handler, false); } function _globalPointerDown(e) { _pointers[e.pointerId] = e; } function _globalPointerMove(e) { if (_pointers[e.pointerId]) { _pointers[e.pointerId] = e; } } function _globalPointerUp(e) { delete _pointers[e.pointerId]; } function _addPointerDocListener() { // need to keep track of what pointers and how many are active to provide e.touches emulation if (!_pointerDocListener) { // we listen document as any drags that end by moving the touch off the screen get fired there document.addEventListener(POINTER_DOWN, _globalPointerDown, true); document.addEventListener(POINTER_MOVE, _globalPointerMove, true); document.addEventListener(POINTER_UP, _globalPointerUp, true); document.addEventListener(POINTER_CANCEL, _globalPointerUp, true); _pointerDocListener = true; } } function _handlePointer(handler, e) { if (e.pointerType === (e.MSPOINTER_TYPE_MOUSE || 'mouse')) { return; } e.touches = []; for (var i in _pointers) { e.touches.push(_pointers[i]); } e.changedTouches = [e]; handler(e); } function _onPointerStart(handler, e) { // IE10 specific: MsTouch needs preventDefault. See #2000 if (e.MSPOINTER_TYPE_TOUCH && e.pointerType === e.MSPOINTER_TYPE_TOUCH) { preventDefault(e); } _handlePointer(handler, e); } /* * Extends the event handling code with double tap support for mobile browsers. * * Note: currently most browsers fire native dblclick, with only a few exceptions * (see https://github.com/Leaflet/Leaflet/issues/7012#issuecomment-595087386) */ function makeDblclick(event) { // in modern browsers `type` cannot be just overridden: // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only var newEvent = {}, prop, i; for (i in event) { prop = event[i]; newEvent[i] = prop && prop.bind ? prop.bind(event) : prop; } event = newEvent; newEvent.type = 'dblclick'; newEvent.detail = 2; newEvent.isTrusted = false; newEvent._simulated = true; // for debug purposes return newEvent; } var delay = 200; function addDoubleTapListener(obj, handler) { // Most browsers handle double tap natively obj.addEventListener('dblclick', handler); // On some platforms the browser doesn't fire native dblclicks for touch events. // It seems that in all such cases `detail` property of `click` event is always `1`. // So here we rely on that fact to avoid excessive 'dblclick' simulation when not needed. var last = 0, detail; function simDblclick(e) { if (e.detail !== 1) { detail = e.detail; // keep in sync to avoid false dblclick in some cases return; } if (e.pointerType === 'mouse' || (e.sourceCapabilities && !e.sourceCapabilities.firesTouchEvents)) { return; } // When clicking on an , the browser generates a click on its //