/*!
* OneCloud Reimagine v0.402.0
* MWF (Moray) v2.8.1
* Copyright (c) Microsoft Corporation. All rights reserved.
* Copyright 2011-2020 The Bootstrap Authors and Twitter, Inc.
*/
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
typeof define === 'function' && define.amd ? define(['exports'], factory) :
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.ocrReimagine = {}));
})(this, (function (exports) { 'use strict';
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;
}
var check = function (it) {
return it && it.Math == Math && it;
};
// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
var global$y =
// 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) ||
// eslint-disable-next-line no-new-func -- fallback
(function () { return this; })() || Function('return this')();
var objectGetOwnPropertyDescriptor = {};
var fails$I = function (exec) {
try {
return !!exec();
} catch (error) {
return true;
}
};
var fails$H = fails$I;
// Detect IE8's incomplete defineProperty implementation
var descriptors = !fails$H(function () {
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
});
var fails$G = fails$I;
var functionBindNative = !fails$G(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');
});
var NATIVE_BIND$4 = functionBindNative;
var call$o = Function.prototype.call;
var functionCall = NATIVE_BIND$4 ? call$o.bind(call$o) : function () {
return call$o.apply(call$o, arguments);
};
var objectPropertyIsEnumerable = {};
var $propertyIsEnumerable$1 = {}.propertyIsEnumerable;
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var getOwnPropertyDescriptor$6 = Object.getOwnPropertyDescriptor;
// Nashorn ~ JDK8 bug
var NASHORN_BUG = getOwnPropertyDescriptor$6 && !$propertyIsEnumerable$1.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$6(this, V);
return !!descriptor && descriptor.enumerable;
} : $propertyIsEnumerable$1;
var createPropertyDescriptor$8 = function (bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value: value
};
};
var NATIVE_BIND$3 = functionBindNative;
var FunctionPrototype$3 = Function.prototype;
var call$n = FunctionPrototype$3.call;
var uncurryThisWithBind = NATIVE_BIND$3 && FunctionPrototype$3.bind.bind(call$n, call$n);
var functionUncurryThis = NATIVE_BIND$3 ? uncurryThisWithBind : function (fn) {
return function () {
return call$n.apply(fn, arguments);
};
};
var uncurryThis$N = functionUncurryThis;
var toString$l = uncurryThis$N({}.toString);
var stringSlice$a = uncurryThis$N(''.slice);
var classofRaw$2 = function (it) {
return stringSlice$a(toString$l(it), 8, -1);
};
var uncurryThis$M = functionUncurryThis;
var fails$F = fails$I;
var classof$d = classofRaw$2;
var $Object$5 = Object;
var split$3 = uncurryThis$M(''.split);
// fallback for non-array-like ES3 and non-enumerable old V8 strings
var indexedObject = fails$F(function () {
// throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
// eslint-disable-next-line no-prototype-builtins -- safe
return !$Object$5('z').propertyIsEnumerable(0);
}) ? function (it) {
return classof$d(it) == 'String' ? split$3(it, '') : $Object$5(it);
} : $Object$5;
// we can't use just `it == null` since of `document.all` special case
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot-aec
var isNullOrUndefined$9 = function (it) {
return it === null || it === undefined;
};
var isNullOrUndefined$8 = isNullOrUndefined$9;
var $TypeError$h = TypeError;
// `RequireObjectCoercible` abstract operation
// https://tc39.es/ecma262/#sec-requireobjectcoercible
var requireObjectCoercible$b = function (it) {
if (isNullOrUndefined$8(it)) throw $TypeError$h("Can't call method on " + it);
return it;
};
// toObject with fallback for non-array-like ES3 strings
var IndexedObject$3 = indexedObject;
var requireObjectCoercible$a = requireObjectCoercible$b;
var toIndexedObject$a = function (it) {
return IndexedObject$3(requireObjectCoercible$a(it));
};
var documentAll$2 = typeof document == 'object' && document.all;
// https://tc39.es/ecma262/#sec-IsHTMLDDA-internal-slot
// eslint-disable-next-line unicorn/no-typeof-undefined -- required for testing
var IS_HTMLDDA = typeof documentAll$2 == 'undefined' && documentAll$2 !== undefined;
var documentAll_1 = {
all: documentAll$2,
IS_HTMLDDA: IS_HTMLDDA
};
var $documentAll$1 = documentAll_1;
var documentAll$1 = $documentAll$1.all;
// `IsCallable` abstract operation
// https://tc39.es/ecma262/#sec-iscallable
var isCallable$u = $documentAll$1.IS_HTMLDDA ? function (argument) {
return typeof argument == 'function' || argument === documentAll$1;
} : function (argument) {
return typeof argument == 'function';
};
var isCallable$t = isCallable$u;
var $documentAll = documentAll_1;
var documentAll = $documentAll.all;
var isObject$l = $documentAll.IS_HTMLDDA ? function (it) {
return typeof it == 'object' ? it !== null : isCallable$t(it) || it === documentAll;
} : function (it) {
return typeof it == 'object' ? it !== null : isCallable$t(it);
};
var global$x = global$y;
var isCallable$s = isCallable$u;
var aFunction = function (argument) {
return isCallable$s(argument) ? argument : undefined;
};
var getBuiltIn$e = function (namespace, method) {
return arguments.length < 2 ? aFunction(global$x[namespace]) : global$x[namespace] && global$x[namespace][method];
};
var uncurryThis$L = functionUncurryThis;
var objectIsPrototypeOf = uncurryThis$L({}.isPrototypeOf);
var engineUserAgent = typeof navigator != 'undefined' && String(navigator.userAgent) || '';
var global$w = global$y;
var userAgent$6 = engineUserAgent;
var process$4 = global$w.process;
var Deno$1 = global$w.Deno;
var versions = process$4 && process$4.versions || Deno$1 && Deno$1.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$6) {
match = userAgent$6.match(/Edge\/(\d+)/);
if (!match || match[1] >= 74) {
match = userAgent$6.match(/Chrome\/(\d+)/);
if (match) version = +match[1];
}
}
var engineV8Version = version;
/* eslint-disable es/no-symbol -- required for testing */
var V8_VERSION$3 = engineV8Version;
var fails$E = fails$I;
// eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
var symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$E(function () {
var symbol = Symbol();
// Chrome 38 Symbol has incorrect toString conversion
// `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
return !String(symbol) || !(Object(symbol) instanceof Symbol) ||
// Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
!Symbol.sham && V8_VERSION$3 && V8_VERSION$3 < 41;
});
/* eslint-disable es/no-symbol -- required for testing */
var NATIVE_SYMBOL$2 = symbolConstructorDetection;
var useSymbolAsUid = NATIVE_SYMBOL$2
&& !Symbol.sham
&& typeof Symbol.iterator == 'symbol';
var getBuiltIn$d = getBuiltIn$e;
var isCallable$r = isCallable$u;
var isPrototypeOf$5 = objectIsPrototypeOf;
var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
var $Object$4 = Object;
var isSymbol$4 = USE_SYMBOL_AS_UID$1 ? function (it) {
return typeof it == 'symbol';
} : function (it) {
var $Symbol = getBuiltIn$d('Symbol');
return isCallable$r($Symbol) && isPrototypeOf$5($Symbol.prototype, $Object$4(it));
};
var $String$5 = String;
var tryToString$5 = function (argument) {
try {
return $String$5(argument);
} catch (error) {
return 'Object';
}
};
var isCallable$q = isCallable$u;
var tryToString$4 = tryToString$5;
var $TypeError$g = TypeError;
// `Assert: IsCallable(argument) is true`
var aCallable$a = function (argument) {
if (isCallable$q(argument)) return argument;
throw $TypeError$g(tryToString$4(argument) + ' is not a function');
};
var aCallable$9 = aCallable$a;
var isNullOrUndefined$7 = isNullOrUndefined$9;
// `GetMethod` abstract operation
// https://tc39.es/ecma262/#sec-getmethod
var getMethod$5 = function (V, P) {
var func = V[P];
return isNullOrUndefined$7(func) ? undefined : aCallable$9(func);
};
var call$m = functionCall;
var isCallable$p = isCallable$u;
var isObject$k = isObject$l;
var $TypeError$f = TypeError;
// `OrdinaryToPrimitive` abstract operation
// https://tc39.es/ecma262/#sec-ordinarytoprimitive
var ordinaryToPrimitive$1 = function (input, pref) {
var fn, val;
if (pref === 'string' && isCallable$p(fn = input.toString) && !isObject$k(val = call$m(fn, input))) return val;
if (isCallable$p(fn = input.valueOf) && !isObject$k(val = call$m(fn, input))) return val;
if (pref !== 'string' && isCallable$p(fn = input.toString) && !isObject$k(val = call$m(fn, input))) return val;
throw $TypeError$f("Can't convert object to primitive value");
};
var shared$4 = {exports: {}};
var isPure = false;
var global$v = global$y;
// eslint-disable-next-line es/no-object-defineproperty -- safe
var defineProperty$c = Object.defineProperty;
var defineGlobalProperty$3 = function (key, value) {
try {
defineProperty$c(global$v, key, { value: value, configurable: true, writable: true });
} catch (error) {
global$v[key] = value;
} return value;
};
var global$u = global$y;
var defineGlobalProperty$2 = defineGlobalProperty$3;
var SHARED = '__core-js_shared__';
var store$3 = global$u[SHARED] || defineGlobalProperty$2(SHARED, {});
var sharedStore = store$3;
var store$2 = sharedStore;
(shared$4.exports = function (key, value) {
return store$2[key] || (store$2[key] = value !== undefined ? value : {});
})('versions', []).push({
version: '3.30.1',
mode: 'global',
copyright: '© 2014-2023 Denis Pushkarev (zloirock.ru)',
license: 'https://github.com/zloirock/core-js/blob/v3.30.1/LICENSE',
source: 'https://github.com/zloirock/core-js'
});
var sharedExports = shared$4.exports;
var requireObjectCoercible$9 = requireObjectCoercible$b;
var $Object$3 = Object;
// `ToObject` abstract operation
// https://tc39.es/ecma262/#sec-toobject
var toObject$b = function (argument) {
return $Object$3(requireObjectCoercible$9(argument));
};
var uncurryThis$K = functionUncurryThis;
var toObject$a = toObject$b;
var hasOwnProperty = uncurryThis$K({}.hasOwnProperty);
// `HasOwnProperty` abstract operation
// https://tc39.es/ecma262/#sec-hasownproperty
// eslint-disable-next-line es/no-object-hasown -- safe
var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
return hasOwnProperty(toObject$a(it), key);
};
var uncurryThis$J = functionUncurryThis;
var id$3 = 0;
var postfix = Math.random();
var toString$k = uncurryThis$J(1.0.toString);
var uid$3 = function (key) {
return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$k(++id$3 + postfix, 36);
};
var global$t = global$y;
var shared$3 = sharedExports;
var hasOwn$l = hasOwnProperty_1;
var uid$2 = uid$3;
var NATIVE_SYMBOL$1 = symbolConstructorDetection;
var USE_SYMBOL_AS_UID = useSymbolAsUid;
var Symbol$3 = global$t.Symbol;
var WellKnownSymbolsStore = shared$3('wks');
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$3['for'] || Symbol$3 : Symbol$3 && Symbol$3.withoutSetter || uid$2;
var wellKnownSymbol$o = function (name) {
if (!hasOwn$l(WellKnownSymbolsStore, name)) {
WellKnownSymbolsStore[name] = NATIVE_SYMBOL$1 && hasOwn$l(Symbol$3, name)
? Symbol$3[name]
: createWellKnownSymbol('Symbol.' + name);
} return WellKnownSymbolsStore[name];
};
var call$l = functionCall;
var isObject$j = isObject$l;
var isSymbol$3 = isSymbol$4;
var getMethod$4 = getMethod$5;
var ordinaryToPrimitive = ordinaryToPrimitive$1;
var wellKnownSymbol$n = wellKnownSymbol$o;
var $TypeError$e = TypeError;
var TO_PRIMITIVE = wellKnownSymbol$n('toPrimitive');
// `ToPrimitive` abstract operation
// https://tc39.es/ecma262/#sec-toprimitive
var toPrimitive$2 = function (input, pref) {
if (!isObject$j(input) || isSymbol$3(input)) return input;
var exoticToPrim = getMethod$4(input, TO_PRIMITIVE);
var result;
if (exoticToPrim) {
if (pref === undefined) pref = 'default';
result = call$l(exoticToPrim, input, pref);
if (!isObject$j(result) || isSymbol$3(result)) return result;
throw $TypeError$e("Can't convert object to primitive value");
}
if (pref === undefined) pref = 'number';
return ordinaryToPrimitive(input, pref);
};
var toPrimitive$1 = toPrimitive$2;
var isSymbol$2 = isSymbol$4;
// `ToPropertyKey` abstract operation
// https://tc39.es/ecma262/#sec-topropertykey
var toPropertyKey$3 = function (argument) {
var key = toPrimitive$1(argument, 'string');
return isSymbol$2(key) ? key : key + '';
};
var global$s = global$y;
var isObject$i = isObject$l;
var document$3 = global$s.document;
// typeof document.createElement is 'object' in old IE
var EXISTS$1 = isObject$i(document$3) && isObject$i(document$3.createElement);
var documentCreateElement$2 = function (it) {
return EXISTS$1 ? document$3.createElement(it) : {};
};
var DESCRIPTORS$o = descriptors;
var fails$D = fails$I;
var createElement$1 = documentCreateElement$2;
// Thanks to IE8 for its funny defineProperty
var ie8DomDefine = !DESCRIPTORS$o && !fails$D(function () {
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
return Object.defineProperty(createElement$1('div'), 'a', {
get: function () { return 7; }
}).a != 7;
});
var DESCRIPTORS$n = descriptors;
var call$k = functionCall;
var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
var createPropertyDescriptor$7 = createPropertyDescriptor$8;
var toIndexedObject$9 = toIndexedObject$a;
var toPropertyKey$2 = toPropertyKey$3;
var hasOwn$k = hasOwnProperty_1;
var IE8_DOM_DEFINE$1 = ie8DomDefine;
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
// `Object.getOwnPropertyDescriptor` method
// https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
objectGetOwnPropertyDescriptor.f = DESCRIPTORS$n ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
O = toIndexedObject$9(O);
P = toPropertyKey$2(P);
if (IE8_DOM_DEFINE$1) try {
return $getOwnPropertyDescriptor$1(O, P);
} catch (error) { /* empty */ }
if (hasOwn$k(O, P)) return createPropertyDescriptor$7(!call$k(propertyIsEnumerableModule$1.f, O, P), O[P]);
};
var objectDefineProperty = {};
var DESCRIPTORS$m = descriptors;
var fails$C = fails$I;
// V8 ~ Chrome 36-
// https://bugs.chromium.org/p/v8/issues/detail?id=3334
var v8PrototypeDefineBug = DESCRIPTORS$m && fails$C(function () {
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
return Object.defineProperty(function () { /* empty */ }, 'prototype', {
value: 42,
writable: false
}).prototype != 42;
});
var isObject$h = isObject$l;
var $String$4 = String;
var $TypeError$d = TypeError;
// `Assert: Type(argument) is Object`
var anObject$l = function (argument) {
if (isObject$h(argument)) return argument;
throw $TypeError$d($String$4(argument) + ' is not an object');
};
var DESCRIPTORS$l = descriptors;
var IE8_DOM_DEFINE = ie8DomDefine;
var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
var anObject$k = anObject$l;
var toPropertyKey$1 = toPropertyKey$3;
var $TypeError$c = 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$1 = 'configurable';
var WRITABLE = 'writable';
// `Object.defineProperty` method
// https://tc39.es/ecma262/#sec-object.defineproperty
objectDefineProperty.f = DESCRIPTORS$l ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
anObject$k(O);
P = toPropertyKey$1(P);
anObject$k(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$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
writable: false
};
}
} return $defineProperty(O, P, Attributes);
} : $defineProperty : function defineProperty(O, P, Attributes) {
anObject$k(O);
P = toPropertyKey$1(P);
anObject$k(Attributes);
if (IE8_DOM_DEFINE) try {
return $defineProperty(O, P, Attributes);
} catch (error) { /* empty */ }
if ('get' in Attributes || 'set' in Attributes) throw $TypeError$c('Accessors not supported');
if ('value' in Attributes) O[P] = Attributes.value;
return O;
};
var DESCRIPTORS$k = descriptors;
var definePropertyModule$4 = objectDefineProperty;
var createPropertyDescriptor$6 = createPropertyDescriptor$8;
var createNonEnumerableProperty$9 = DESCRIPTORS$k ? function (object, key, value) {
return definePropertyModule$4.f(object, key, createPropertyDescriptor$6(1, value));
} : function (object, key, value) {
object[key] = value;
return object;
};
var makeBuiltIn$3 = {exports: {}};
var DESCRIPTORS$j = descriptors;
var hasOwn$j = hasOwnProperty_1;
var FunctionPrototype$2 = Function.prototype;
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var getDescriptor = DESCRIPTORS$j && Object.getOwnPropertyDescriptor;
var EXISTS = hasOwn$j(FunctionPrototype$2, 'name');
// additional protection from minified / mangled / dropped function names
var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
var CONFIGURABLE = EXISTS && (!DESCRIPTORS$j || (DESCRIPTORS$j && getDescriptor(FunctionPrototype$2, 'name').configurable));
var functionName = {
EXISTS: EXISTS,
PROPER: PROPER,
CONFIGURABLE: CONFIGURABLE
};
var uncurryThis$I = functionUncurryThis;
var isCallable$o = isCallable$u;
var store$1 = sharedStore;
var functionToString$1 = uncurryThis$I(Function.toString);
// this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
if (!isCallable$o(store$1.inspectSource)) {
store$1.inspectSource = function (it) {
return functionToString$1(it);
};
}
var inspectSource$3 = store$1.inspectSource;
var global$r = global$y;
var isCallable$n = isCallable$u;
var WeakMap$2 = global$r.WeakMap;
var weakMapBasicDetection = isCallable$n(WeakMap$2) && /native code/.test(String(WeakMap$2));
var shared$2 = sharedExports;
var uid$1 = uid$3;
var keys = shared$2('keys');
var sharedKey$3 = function (key) {
return keys[key] || (keys[key] = uid$1(key));
};
var hiddenKeys$5 = {};
var NATIVE_WEAK_MAP$1 = weakMapBasicDetection;
var global$q = global$y;
var isObject$g = isObject$l;
var createNonEnumerableProperty$8 = createNonEnumerableProperty$9;
var hasOwn$i = hasOwnProperty_1;
var shared$1 = sharedStore;
var sharedKey$2 = sharedKey$3;
var hiddenKeys$4 = hiddenKeys$5;
var OBJECT_ALREADY_INITIALIZED = 'Object already initialized';
var TypeError$5 = global$q.TypeError;
var WeakMap$1 = global$q.WeakMap;
var set$1, get, has;
var enforce = function (it) {
return has(it) ? get(it) : set$1(it, {});
};
var getterFor$1 = function (TYPE) {
return function (it) {
var state;
if (!isObject$g(it) || (state = get(it)).type !== TYPE) {
throw TypeError$5('Incompatible receiver, ' + TYPE + ' required');
} return state;
};
};
if (NATIVE_WEAK_MAP$1 || shared$1.state) {
var store = shared$1.state || (shared$1.state = new WeakMap$1());
/* 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$1 = function (it, metadata) {
if (store.has(it)) throw TypeError$5(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$2('state');
hiddenKeys$4[STATE] = true;
set$1 = function (it, metadata) {
if (hasOwn$i(it, STATE)) throw TypeError$5(OBJECT_ALREADY_INITIALIZED);
metadata.facade = it;
createNonEnumerableProperty$8(it, STATE, metadata);
return metadata;
};
get = function (it) {
return hasOwn$i(it, STATE) ? it[STATE] : {};
};
has = function (it) {
return hasOwn$i(it, STATE);
};
}
var internalState = {
set: set$1,
get: get,
has: has,
enforce: enforce,
getterFor: getterFor$1
};
var uncurryThis$H = functionUncurryThis;
var fails$B = fails$I;
var isCallable$m = isCallable$u;
var hasOwn$h = hasOwnProperty_1;
var DESCRIPTORS$i = descriptors;
var CONFIGURABLE_FUNCTION_NAME$1 = functionName.CONFIGURABLE;
var inspectSource$2 = inspectSource$3;
var InternalStateModule$8 = internalState;
var enforceInternalState$1 = InternalStateModule$8.enforce;
var getInternalState$4 = InternalStateModule$8.get;
var $String$3 = String;
// eslint-disable-next-line es/no-object-defineproperty -- safe
var defineProperty$b = Object.defineProperty;
var stringSlice$9 = uncurryThis$H(''.slice);
var replace$a = uncurryThis$H(''.replace);
var join$4 = uncurryThis$H([].join);
var CONFIGURABLE_LENGTH = DESCRIPTORS$i && !fails$B(function () {
return defineProperty$b(function () { /* empty */ }, 'length', { value: 8 }).length !== 8;
});
var TEMPLATE = String(String).split('String');
var makeBuiltIn$2 = makeBuiltIn$3.exports = function (value, name, options) {
if (stringSlice$9($String$3(name), 0, 7) === 'Symbol(') {
name = '[' + replace$a($String$3(name), /^Symbol\(([^)]*)\)/, '$1') + ']';
}
if (options && options.getter) name = 'get ' + name;
if (options && options.setter) name = 'set ' + name;
if (!hasOwn$h(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
if (DESCRIPTORS$i) defineProperty$b(value, 'name', { value: name, configurable: true });
else value.name = name;
}
if (CONFIGURABLE_LENGTH && options && hasOwn$h(options, 'arity') && value.length !== options.arity) {
defineProperty$b(value, 'length', { value: options.arity });
}
try {
if (options && hasOwn$h(options, 'constructor') && options.constructor) {
if (DESCRIPTORS$i) defineProperty$b(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$1(value);
if (!hasOwn$h(state, 'source')) {
state.source = join$4(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$2(function toString() {
return isCallable$m(this) && getInternalState$4(this).source || inspectSource$2(this);
}, 'toString');
var makeBuiltInExports = makeBuiltIn$3.exports;
var isCallable$l = isCallable$u;
var definePropertyModule$3 = objectDefineProperty;
var makeBuiltIn$1 = makeBuiltInExports;
var defineGlobalProperty$1 = defineGlobalProperty$3;
var defineBuiltIn$g = function (O, key, value, options) {
if (!options) options = {};
var simple = options.enumerable;
var name = options.name !== undefined ? options.name : key;
if (isCallable$l(value)) makeBuiltIn$1(value, name, options);
if (options.global) {
if (simple) O[key] = value;
else defineGlobalProperty$1(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$3.f(O, key, {
value: value,
enumerable: false,
configurable: !options.nonConfigurable,
writable: !options.nonWritable
});
} return O;
};
var objectGetOwnPropertyNames = {};
var ceil$1 = Math.ceil;
var floor$4 = Math.floor;
// `Math.trunc` method
// https://tc39.es/ecma262/#sec-math.trunc
// eslint-disable-next-line es/no-math-trunc -- safe
var mathTrunc = Math.trunc || function trunc(x) {
var n = +x;
return (n > 0 ? floor$4 : ceil$1)(n);
};
var trunc = mathTrunc;
// `ToIntegerOrInfinity` abstract operation
// https://tc39.es/ecma262/#sec-tointegerorinfinity
var toIntegerOrInfinity$7 = function (argument) {
var number = +argument;
// eslint-disable-next-line no-self-compare -- NaN check
return number !== number || number === 0 ? 0 : trunc(number);
};
var toIntegerOrInfinity$6 = toIntegerOrInfinity$7;
var max$4 = Math.max;
var min$5 = 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).
var toAbsoluteIndex$4 = function (index, length) {
var integer = toIntegerOrInfinity$6(index);
return integer < 0 ? max$4(integer + length, 0) : min$5(integer, length);
};
var toIntegerOrInfinity$5 = toIntegerOrInfinity$7;
var min$4 = Math.min;
// `ToLength` abstract operation
// https://tc39.es/ecma262/#sec-tolength
var toLength$5 = function (argument) {
return argument > 0 ? min$4(toIntegerOrInfinity$5(argument), 0x1FFFFFFFFFFFFF) : 0; // 2 ** 53 - 1 == 9007199254740991
};
var toLength$4 = toLength$5;
// `LengthOfArrayLike` abstract operation
// https://tc39.es/ecma262/#sec-lengthofarraylike
var lengthOfArrayLike$b = function (obj) {
return toLength$4(obj.length);
};
var toIndexedObject$8 = toIndexedObject$a;
var toAbsoluteIndex$3 = toAbsoluteIndex$4;
var lengthOfArrayLike$a = lengthOfArrayLike$b;
// `Array.prototype.{ indexOf, includes }` methods implementation
var createMethod$5 = function (IS_INCLUDES) {
return function ($this, el, fromIndex) {
var O = toIndexedObject$8($this);
var length = lengthOfArrayLike$a(O);
var index = toAbsoluteIndex$3(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;
};
};
var arrayIncludes = {
// `Array.prototype.includes` method
// https://tc39.es/ecma262/#sec-array.prototype.includes
includes: createMethod$5(true),
// `Array.prototype.indexOf` method
// https://tc39.es/ecma262/#sec-array.prototype.indexof
indexOf: createMethod$5(false)
};
var uncurryThis$G = functionUncurryThis;
var hasOwn$g = hasOwnProperty_1;
var toIndexedObject$7 = toIndexedObject$a;
var indexOf$1 = arrayIncludes.indexOf;
var hiddenKeys$3 = hiddenKeys$5;
var push$8 = uncurryThis$G([].push);
var objectKeysInternal = function (object, names) {
var O = toIndexedObject$7(object);
var i = 0;
var result = [];
var key;
for (key in O) !hasOwn$g(hiddenKeys$3, key) && hasOwn$g(O, key) && push$8(result, key);
// Don't enum bug & hidden keys
while (names.length > i) if (hasOwn$g(O, key = names[i++])) {
~indexOf$1(result, key) || push$8(result, key);
}
return result;
};
// IE8- don't enum bug keys
var enumBugKeys$3 = [
'constructor',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',
'toLocaleString',
'toString',
'valueOf'
];
var internalObjectKeys$1 = objectKeysInternal;
var enumBugKeys$2 = enumBugKeys$3;
var hiddenKeys$2 = enumBugKeys$2.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$1(O, hiddenKeys$2);
};
var objectGetOwnPropertySymbols = {};
// eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
var getBuiltIn$c = getBuiltIn$e;
var uncurryThis$F = functionUncurryThis;
var getOwnPropertyNamesModule$1 = objectGetOwnPropertyNames;
var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
var anObject$j = anObject$l;
var concat$3 = uncurryThis$F([].concat);
// all object keys, includes non-enumerable and symbols
var ownKeys$1 = getBuiltIn$c('Reflect', 'ownKeys') || function ownKeys(it) {
var keys = getOwnPropertyNamesModule$1.f(anObject$j(it));
var getOwnPropertySymbols = getOwnPropertySymbolsModule$1.f;
return getOwnPropertySymbols ? concat$3(keys, getOwnPropertySymbols(it)) : keys;
};
var hasOwn$f = hasOwnProperty_1;
var ownKeys = ownKeys$1;
var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
var definePropertyModule$2 = objectDefineProperty;
var copyConstructorProperties$3 = function (target, source, exceptions) {
var keys = ownKeys(source);
var defineProperty = definePropertyModule$2.f;
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (!hasOwn$f(target, key) && !(exceptions && hasOwn$f(exceptions, key))) {
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
}
}
};
var fails$A = fails$I;
var isCallable$k = isCallable$u;
var replacement = /#|\.prototype\./;
var isForced$4 = function (feature, detection) {
var value = data[normalize(feature)];
return value == POLYFILL ? true
: value == NATIVE ? false
: isCallable$k(detection) ? fails$A(detection)
: !!detection;
};
var normalize = isForced$4.normalize = function (string) {
return String(string).replace(replacement, '.').toLowerCase();
};
var data = isForced$4.data = {};
var NATIVE = isForced$4.NATIVE = 'N';
var POLYFILL = isForced$4.POLYFILL = 'P';
var isForced_1 = isForced$4;
var global$p = global$y;
var getOwnPropertyDescriptor$5 = objectGetOwnPropertyDescriptor.f;
var createNonEnumerableProperty$7 = createNonEnumerableProperty$9;
var defineBuiltIn$f = defineBuiltIn$g;
var defineGlobalProperty = defineGlobalProperty$3;
var copyConstructorProperties$2 = copyConstructorProperties$3;
var isForced$3 = isForced_1;
/*
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
*/
var _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 = global$p;
} else if (STATIC) {
target = global$p[TARGET] || defineGlobalProperty(TARGET, {});
} else {
target = (global$p[TARGET] || {}).prototype;
}
if (target) for (key in source) {
sourceProperty = source[key];
if (options.dontCallGetSet) {
descriptor = getOwnPropertyDescriptor$5(target, key);
targetProperty = descriptor && descriptor.value;
} else targetProperty = target[key];
FORCED = isForced$3(GLOBAL ? key : TARGET + (STATIC ? '.' : '#') + key, options.forced);
// contained in target
if (!FORCED && targetProperty !== undefined) {
if (typeof sourceProperty == typeof targetProperty) continue;
copyConstructorProperties$2(sourceProperty, targetProperty);
}
// add a flag to not completely full polyfills
if (options.sham || (targetProperty && targetProperty.sham)) {
createNonEnumerableProperty$7(sourceProperty, 'sham', true);
}
defineBuiltIn$f(target, key, sourceProperty, options);
}
};
var classofRaw$1 = classofRaw$2;
var uncurryThis$E = functionUncurryThis;
var functionUncurryThisClause = function (fn) {
// Nashorn bug:
// https://github.com/zloirock/core-js/issues/1128
// https://github.com/zloirock/core-js/issues/1130
if (classofRaw$1(fn) === 'Function') return uncurryThis$E(fn);
};
var uncurryThis$D = functionUncurryThisClause;
var aCallable$8 = aCallable$a;
var NATIVE_BIND$2 = functionBindNative;
var bind$a = uncurryThis$D(uncurryThis$D.bind);
// optional / simple context binding
var functionBindContext = function (fn, that) {
aCallable$8(fn);
return that === undefined ? fn : NATIVE_BIND$2 ? bind$a(fn, that) : function (/* ...args */) {
return fn.apply(that, arguments);
};
};
var classof$c = classofRaw$2;
// `IsArray` abstract operation
// https://tc39.es/ecma262/#sec-isarray
// eslint-disable-next-line es/no-array-isarray -- safe
var isArray$7 = Array.isArray || function isArray(argument) {
return classof$c(argument) == 'Array';
};
var wellKnownSymbol$m = wellKnownSymbol$o;
var TO_STRING_TAG$3 = wellKnownSymbol$m('toStringTag');
var test$1 = {};
test$1[TO_STRING_TAG$3] = 'z';
var toStringTagSupport = String(test$1) === '[object z]';
var TO_STRING_TAG_SUPPORT$2 = toStringTagSupport;
var isCallable$j = isCallable$u;
var classofRaw = classofRaw$2;
var wellKnownSymbol$l = wellKnownSymbol$o;
var TO_STRING_TAG$2 = wellKnownSymbol$l('toStringTag');
var $Object$2 = 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`
var classof$b = TO_STRING_TAG_SUPPORT$2 ? classofRaw : function (it) {
var O, tag, result;
return it === undefined ? 'Undefined' : it === null ? 'Null'
// @@toStringTag case
: typeof (tag = tryGet(O = $Object$2(it), TO_STRING_TAG$2)) == 'string' ? tag
// builtinTag case
: CORRECT_ARGUMENTS ? classofRaw(O)
// ES3 arguments fallback
: (result = classofRaw(O)) == 'Object' && isCallable$j(O.callee) ? 'Arguments' : result;
};
var uncurryThis$C = functionUncurryThis;
var fails$z = fails$I;
var isCallable$i = isCallable$u;
var classof$a = classof$b;
var getBuiltIn$b = getBuiltIn$e;
var inspectSource$1 = inspectSource$3;
var noop = function () { /* empty */ };
var empty = [];
var construct$1 = getBuiltIn$b('Reflect', 'construct');
var constructorRegExp = /^\s*(?:class|function)\b/;
var exec$6 = uncurryThis$C(constructorRegExp.exec);
var INCORRECT_TO_STRING$2 = !constructorRegExp.exec(noop);
var isConstructorModern = function isConstructor(argument) {
if (!isCallable$i(argument)) return false;
try {
construct$1(noop, empty, argument);
return true;
} catch (error) {
return false;
}
};
var isConstructorLegacy = function isConstructor(argument) {
if (!isCallable$i(argument)) return false;
switch (classof$a(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$2 || !!exec$6(constructorRegExp, inspectSource$1(argument));
} catch (error) {
return true;
}
};
isConstructorLegacy.sham = true;
// `IsConstructor` abstract operation
// https://tc39.es/ecma262/#sec-isconstructor
var isConstructor$4 = !construct$1 || fails$z(function () {
var called;
return isConstructorModern(isConstructorModern.call)
|| !isConstructorModern(Object)
|| !isConstructorModern(function () { called = true; })
|| called;
}) ? isConstructorLegacy : isConstructorModern;
var isArray$6 = isArray$7;
var isConstructor$3 = isConstructor$4;
var isObject$f = isObject$l;
var wellKnownSymbol$k = wellKnownSymbol$o;
var SPECIES$6 = wellKnownSymbol$k('species');
var $Array$3 = Array;
// a part of `ArraySpeciesCreate` abstract operation
// https://tc39.es/ecma262/#sec-arrayspeciescreate
var arraySpeciesConstructor$1 = function (originalArray) {
var C;
if (isArray$6(originalArray)) {
C = originalArray.constructor;
// cross-realm fallback
if (isConstructor$3(C) && (C === $Array$3 || isArray$6(C.prototype))) C = undefined;
else if (isObject$f(C)) {
C = C[SPECIES$6];
if (C === null) C = undefined;
}
} return C === undefined ? $Array$3 : C;
};
var arraySpeciesConstructor = arraySpeciesConstructor$1;
// `ArraySpeciesCreate` abstract operation
// https://tc39.es/ecma262/#sec-arrayspeciescreate
var arraySpeciesCreate$3 = function (originalArray, length) {
return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
};
var bind$9 = functionBindContext;
var uncurryThis$B = functionUncurryThis;
var IndexedObject$2 = indexedObject;
var toObject$9 = toObject$b;
var lengthOfArrayLike$9 = lengthOfArrayLike$b;
var arraySpeciesCreate$2 = arraySpeciesCreate$3;
var push$7 = uncurryThis$B([].push);
// `Array.prototype.{ forEach, map, filter, some, every, find, findIndex, filterReject }` methods implementation
var createMethod$4 = function (TYPE) {
var IS_MAP = TYPE == 1;
var IS_FILTER = TYPE == 2;
var IS_SOME = TYPE == 3;
var IS_EVERY = TYPE == 4;
var IS_FIND_INDEX = TYPE == 6;
var IS_FILTER_REJECT = TYPE == 7;
var NO_HOLES = TYPE == 5 || IS_FIND_INDEX;
return function ($this, callbackfn, that, specificCreate) {
var O = toObject$9($this);
var self = IndexedObject$2(O);
var boundFunction = bind$9(callbackfn, that);
var length = lengthOfArrayLike$9(self);
var index = 0;
var create = specificCreate || arraySpeciesCreate$2;
var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : undefined;
var value, result;
for (;length > index; index++) if (NO_HOLES || index in self) {
value = self[index];
result = boundFunction(value, index, O);
if (TYPE) {
if (IS_MAP) target[index] = result; // map
else if (result) switch (TYPE) {
case 3: return true; // some
case 5: return value; // find
case 6: return index; // findIndex
case 2: push$7(target, value); // filter
} else switch (TYPE) {
case 4: return false; // every
case 7: push$7(target, value); // filterReject
}
}
}
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
};
};
var arrayIteration = {
// `Array.prototype.forEach` method
// https://tc39.es/ecma262/#sec-array.prototype.foreach
forEach: createMethod$4(0),
// `Array.prototype.map` method
// https://tc39.es/ecma262/#sec-array.prototype.map
map: createMethod$4(1),
// `Array.prototype.filter` method
// https://tc39.es/ecma262/#sec-array.prototype.filter
filter: createMethod$4(2),
// `Array.prototype.some` method
// https://tc39.es/ecma262/#sec-array.prototype.some
some: createMethod$4(3),
// `Array.prototype.every` method
// https://tc39.es/ecma262/#sec-array.prototype.every
every: createMethod$4(4),
// `Array.prototype.find` method
// https://tc39.es/ecma262/#sec-array.prototype.find
find: createMethod$4(5),
// `Array.prototype.findIndex` method
// https://tc39.es/ecma262/#sec-array.prototype.findIndex
findIndex: createMethod$4(6),
// `Array.prototype.filterReject` method
// https://github.com/tc39/proposal-array-filtering
filterReject: createMethod$4(7)
};
var fails$y = fails$I;
var arrayMethodIsStrict$7 = function (METHOD_NAME, argument) {
var method = [][METHOD_NAME];
return !!method && fails$y(function () {
// eslint-disable-next-line no-useless-call -- required for testing
method.call(null, argument || function () { return 1; }, 1);
});
};
var $forEach = arrayIteration.forEach;
var arrayMethodIsStrict$6 = arrayMethodIsStrict$7;
var STRICT_METHOD$4 = arrayMethodIsStrict$6('forEach');
// `Array.prototype.forEach` method implementation
// https://tc39.es/ecma262/#sec-array.prototype.foreach
var arrayForEach = !STRICT_METHOD$4 ? function forEach(callbackfn /* , thisArg */) {
return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
// eslint-disable-next-line es/no-array-prototype-foreach -- safe
} : [].forEach;
var $$U = _export;
var forEach$1 = arrayForEach;
// `Array.prototype.forEach` method
// https://tc39.es/ecma262/#sec-array.prototype.foreach
// eslint-disable-next-line es/no-array-prototype-foreach -- safe
$$U({ target: 'Array', proto: true, forced: [].forEach != forEach$1 }, {
forEach: forEach$1
});
var TO_STRING_TAG_SUPPORT$1 = toStringTagSupport;
var classof$9 = classof$b;
// `Object.prototype.toString` method implementation
// https://tc39.es/ecma262/#sec-object.prototype.tostring
var objectToString = TO_STRING_TAG_SUPPORT$1 ? {}.toString : function toString() {
return '[object ' + classof$9(this) + ']';
};
var TO_STRING_TAG_SUPPORT = toStringTagSupport;
var defineBuiltIn$e = defineBuiltIn$g;
var toString$j = objectToString;
// `Object.prototype.toString` method
// https://tc39.es/ecma262/#sec-object.prototype.tostring
if (!TO_STRING_TAG_SUPPORT) {
defineBuiltIn$e(Object.prototype, 'toString', toString$j, { unsafe: true });
}
// iterable DOM collections
// flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
var domIterables = {
CSSRuleList: 0,
CSSStyleDeclaration: 0,
CSSValueList: 0,
ClientRectList: 0,
DOMRectList: 0,
DOMStringList: 0,
DOMTokenList: 1,
DataTransferItemList: 0,
FileList: 0,
HTMLAllCollection: 0,
HTMLCollection: 0,
HTMLFormElement: 0,
HTMLSelectElement: 0,
MediaList: 0,
MimeTypeArray: 0,
NamedNodeMap: 0,
NodeList: 1,
PaintRequestList: 0,
Plugin: 0,
PluginArray: 0,
SVGLengthList: 0,
SVGNumberList: 0,
SVGPathSegList: 0,
SVGPointList: 0,
SVGStringList: 0,
SVGTransformList: 0,
SourceBufferList: 0,
StyleSheetList: 0,
TextTrackCueList: 0,
TextTrackList: 0,
TouchList: 0
};
// in old WebKit versions, `element.classList` is not an instance of global `DOMTokenList`
var documentCreateElement$1 = documentCreateElement$2;
var classList = documentCreateElement$1('span').classList;
var DOMTokenListPrototype$2 = classList && classList.constructor && classList.constructor.prototype;
var domTokenListPrototype = DOMTokenListPrototype$2 === Object.prototype ? undefined : DOMTokenListPrototype$2;
var global$o = global$y;
var DOMIterables$1 = domIterables;
var DOMTokenListPrototype$1 = domTokenListPrototype;
var forEach = arrayForEach;
var createNonEnumerableProperty$6 = createNonEnumerableProperty$9;
var handlePrototype$1 = function (CollectionPrototype) {
// some Chrome versions have non-configurable methods on DOMTokenList
if (CollectionPrototype && CollectionPrototype.forEach !== forEach) try {
createNonEnumerableProperty$6(CollectionPrototype, 'forEach', forEach);
} catch (error) {
CollectionPrototype.forEach = forEach;
}
};
for (var COLLECTION_NAME$1 in DOMIterables$1) {
if (DOMIterables$1[COLLECTION_NAME$1]) {
handlePrototype$1(global$o[COLLECTION_NAME$1] && global$o[COLLECTION_NAME$1].prototype);
}
}
handlePrototype$1(DOMTokenListPrototype$1);
var uncurryThis$A = functionUncurryThis;
var arraySlice$7 = uncurryThis$A([].slice);
var uncurryThis$z = functionUncurryThis;
var aCallable$7 = aCallable$a;
var isObject$e = isObject$l;
var hasOwn$e = hasOwnProperty_1;
var arraySlice$6 = arraySlice$7;
var NATIVE_BIND$1 = functionBindNative;
var $Function = Function;
var concat$2 = uncurryThis$z([].concat);
var join$3 = uncurryThis$z([].join);
var factories = {};
var construct = function (C, argsLength, args) {
if (!hasOwn$e(factories, argsLength)) {
for (var list = [], i = 0; i < argsLength; i++) list[i] = 'a[' + i + ']';
factories[argsLength] = $Function('C,a', 'return new C(' + join$3(list, ',') + ')');
} return factories[argsLength](C, args);
};
// `Function.prototype.bind` method implementation
// https://tc39.es/ecma262/#sec-function.prototype.bind
// eslint-disable-next-line es/no-function-prototype-bind -- detection
var functionBind = NATIVE_BIND$1 ? $Function.bind : function bind(that /* , ...args */) {
var F = aCallable$7(this);
var Prototype = F.prototype;
var partArgs = arraySlice$6(arguments, 1);
var boundFunction = function bound(/* args... */) {
var args = concat$2(partArgs, arraySlice$6(arguments));
return this instanceof boundFunction ? construct(F, args.length, args) : F.apply(that, args);
};
if (isObject$e(Prototype)) boundFunction.prototype = Prototype;
return boundFunction;
};
// TODO: Remove from `core-js@4`
var $$T = _export;
var bind$8 = functionBind;
// `Function.prototype.bind` method
// https://tc39.es/ecma262/#sec-function.prototype.bind
// eslint-disable-next-line es/no-function-prototype-bind -- detection
$$T({ target: 'Function', proto: true, forced: Function.bind !== bind$8 }, {
bind: bind$8
});
var classof$8 = classof$b;
var $String$2 = String;
var toString$i = function (argument) {
if (classof$8(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
return $String$2(argument);
};
// a string of all valid unicode whitespaces
var whitespaces$5 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
'\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
var uncurryThis$y = functionUncurryThis;
var requireObjectCoercible$8 = requireObjectCoercible$b;
var toString$h = toString$i;
var whitespaces$4 = whitespaces$5;
var replace$9 = uncurryThis$y(''.replace);
var ltrim = RegExp('^[' + whitespaces$4 + ']+');
var rtrim = RegExp('(^|[^' + whitespaces$4 + '])[' + whitespaces$4 + ']+$');
// `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
var createMethod$3 = function (TYPE) {
return function ($this) {
var string = toString$h(requireObjectCoercible$8($this));
if (TYPE & 1) string = replace$9(string, ltrim, '');
if (TYPE & 2) string = replace$9(string, rtrim, '$1');
return string;
};
};
var stringTrim = {
// `String.prototype.{ trimLeft, trimStart }` methods
// https://tc39.es/ecma262/#sec-string.prototype.trimstart
start: createMethod$3(1),
// `String.prototype.{ trimRight, trimEnd }` methods
// https://tc39.es/ecma262/#sec-string.prototype.trimend
end: createMethod$3(2),
// `String.prototype.trim` method
// https://tc39.es/ecma262/#sec-string.prototype.trim
trim: createMethod$3(3)
};
var global$n = global$y;
var fails$x = fails$I;
var uncurryThis$x = functionUncurryThis;
var toString$g = toString$i;
var trim$2 = stringTrim.trim;
var whitespaces$3 = whitespaces$5;
var $parseInt$1 = global$n.parseInt;
var Symbol$2 = global$n.Symbol;
var ITERATOR$9 = Symbol$2 && Symbol$2.iterator;
var hex = /^[+-]?0x/i;
var exec$5 = uncurryThis$x(hex.exec);
var FORCED$9 = $parseInt$1(whitespaces$3 + '08') !== 8 || $parseInt$1(whitespaces$3 + '0x16') !== 22
// MS Edge 18- broken with boxed symbols
|| (ITERATOR$9 && !fails$x(function () { $parseInt$1(Object(ITERATOR$9)); }));
// `parseInt` method
// https://tc39.es/ecma262/#sec-parseint-string-radix
var numberParseInt = FORCED$9 ? function parseInt(string, radix) {
var S = trim$2(toString$g(string));
return $parseInt$1(S, (radix >>> 0) || (exec$5(hex, S) ? 16 : 10));
} : $parseInt$1;
var $$S = _export;
var $parseInt = numberParseInt;
// `parseInt` method
// https://tc39.es/ecma262/#sec-parseint-string-radix
$$S({ global: true, forced: parseInt != $parseInt }, {
parseInt: $parseInt
});
var fails$w = fails$I;
var wellKnownSymbol$j = wellKnownSymbol$o;
var V8_VERSION$2 = engineV8Version;
var SPECIES$5 = wellKnownSymbol$j('species');
var arrayMethodHasSpeciesSupport$5 = function (METHOD_NAME) {
// We can't use this feature detection in V8 since it causes
// deoptimization and serious performance degradation
// https://github.com/zloirock/core-js/issues/677
return V8_VERSION$2 >= 51 || !fails$w(function () {
var array = [];
var constructor = array.constructor = {};
constructor[SPECIES$5] = function () {
return { foo: 1 };
};
return array[METHOD_NAME](Boolean).foo !== 1;
});
};
var $$R = _export;
var $filter = arrayIteration.filter;
var arrayMethodHasSpeciesSupport$4 = arrayMethodHasSpeciesSupport$5;
var HAS_SPECIES_SUPPORT$3 = arrayMethodHasSpeciesSupport$4('filter');
// `Array.prototype.filter` method
// https://tc39.es/ecma262/#sec-array.prototype.filter
// with adding support of @@species
$$R({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$3 }, {
filter: function filter(callbackfn /* , thisArg */) {
return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
var internalObjectKeys = objectKeysInternal;
var enumBugKeys$1 = enumBugKeys$3;
// `Object.keys` method
// https://tc39.es/ecma262/#sec-object.keys
// eslint-disable-next-line es/no-object-keys -- safe
var objectKeys$3 = Object.keys || function keys(O) {
return internalObjectKeys(O, enumBugKeys$1);
};
var $$Q = _export;
var toObject$8 = toObject$b;
var nativeKeys = objectKeys$3;
var fails$v = fails$I;
var FAILS_ON_PRIMITIVES$1 = fails$v(function () { nativeKeys(1); });
// `Object.keys` method
// https://tc39.es/ecma262/#sec-object.keys
$$Q({ target: 'Object', stat: true, forced: FAILS_ON_PRIMITIVES$1 }, {
keys: function keys(it) {
return nativeKeys(toObject$8(it));
}
});
var global$m = global$y;
var path$1 = global$m;
var uncurryThis$w = functionUncurryThis;
var aCallable$6 = aCallable$a;
var functionUncurryThisAccessor = function (object, key, method) {
try {
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
return uncurryThis$w(aCallable$6(Object.getOwnPropertyDescriptor(object, key)[method]));
} catch (error) { /* empty */ }
};
var isCallable$h = isCallable$u;
var $String$1 = String;
var $TypeError$b = TypeError;
var aPossiblePrototype$1 = function (argument) {
if (typeof argument == 'object' || isCallable$h(argument)) return argument;
throw $TypeError$b("Can't set " + $String$1(argument) + ' as a prototype');
};
/* eslint-disable no-proto -- safe */
var uncurryThisAccessor = functionUncurryThisAccessor;
var anObject$i = anObject$l;
var aPossiblePrototype = aPossiblePrototype$1;
// `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
var 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) {
anObject$i(O);
aPossiblePrototype(proto);
if (CORRECT_SETTER) setter(O, proto);
else O.__proto__ = proto;
return O;
};
}() : undefined);
var isCallable$g = isCallable$u;
var isObject$d = isObject$l;
var setPrototypeOf$3 = objectSetPrototypeOf;
// makes subclassing work correct for wrapped built-ins
var inheritIfRequired$4 = function ($this, dummy, Wrapper) {
var NewTarget, NewTargetPrototype;
if (
// it can work only with native `setPrototypeOf`
setPrototypeOf$3 &&
// we haven't completely correct pre-ES6 way for getting `new.target`, so use this
isCallable$g(NewTarget = dummy.constructor) &&
NewTarget !== Wrapper &&
isObject$d(NewTargetPrototype = NewTarget.prototype) &&
NewTargetPrototype !== Wrapper.prototype
) setPrototypeOf$3($this, NewTargetPrototype);
return $this;
};
var uncurryThis$v = functionUncurryThis;
// `thisNumberValue` abstract operation
// https://tc39.es/ecma262/#sec-thisnumbervalue
var thisNumberValue$1 = uncurryThis$v(1.0.valueOf);
var $$P = _export;
var IS_PURE$1 = isPure;
var DESCRIPTORS$h = descriptors;
var global$l = global$y;
var path = path$1;
var uncurryThis$u = functionUncurryThis;
var isForced$2 = isForced_1;
var hasOwn$d = hasOwnProperty_1;
var inheritIfRequired$3 = inheritIfRequired$4;
var isPrototypeOf$4 = objectIsPrototypeOf;
var isSymbol$1 = isSymbol$4;
var toPrimitive = toPrimitive$2;
var fails$u = fails$I;
var getOwnPropertyNames = objectGetOwnPropertyNames.f;
var getOwnPropertyDescriptor$4 = objectGetOwnPropertyDescriptor.f;
var defineProperty$a = objectDefineProperty.f;
var thisNumberValue = thisNumberValue$1;
var trim$1 = stringTrim.trim;
var NUMBER = 'Number';
var NativeNumber = global$l[NUMBER];
path[NUMBER];
var NumberPrototype = NativeNumber.prototype;
var TypeError$4 = global$l.TypeError;
var stringSlice$8 = uncurryThis$u(''.slice);
var charCodeAt$3 = uncurryThis$u(''.charCodeAt);
// `ToNumeric` abstract operation
// https://tc39.es/ecma262/#sec-tonumeric
var toNumeric = function (value) {
var primValue = toPrimitive(value, 'number');
return typeof primValue == 'bigint' ? primValue : toNumber(primValue);
};
// `ToNumber` abstract operation
// https://tc39.es/ecma262/#sec-tonumber
var toNumber = function (argument) {
var it = toPrimitive(argument, 'number');
var first, third, radix, maxCode, digits, length, index, code;
if (isSymbol$1(it)) throw TypeError$4('Cannot convert a Symbol value to a number');
if (typeof it == 'string' && it.length > 2) {
it = trim$1(it);
first = charCodeAt$3(it, 0);
if (first === 43 || first === 45) {
third = charCodeAt$3(it, 2);
if (third === 88 || third === 120) return NaN; // Number('+0x1') should be NaN, old V8 fix
} else if (first === 48) {
switch (charCodeAt$3(it, 1)) {
case 66: case 98: radix = 2; maxCode = 49; break; // fast equal of /^0b[01]+$/i
case 79: case 111: radix = 8; maxCode = 55; break; // fast equal of /^0o[0-7]+$/i
default: return +it;
}
digits = stringSlice$8(it, 2);
length = digits.length;
for (index = 0; index < length; index++) {
code = charCodeAt$3(digits, index);
// parseInt parses a string to a first unavailable symbol
// but ToNumber should return NaN if a string contains unavailable symbols
if (code < 48 || code > maxCode) return NaN;
} return parseInt(digits, radix);
}
} return +it;
};
var FORCED$8 = isForced$2(NUMBER, !NativeNumber(' 0o1') || !NativeNumber('0b1') || NativeNumber('+0x1'));
var calledWithNew = function (dummy) {
// includes check on 1..constructor(foo) case
return isPrototypeOf$4(NumberPrototype, dummy) && fails$u(function () { thisNumberValue(dummy); });
};
// `Number` constructor
// https://tc39.es/ecma262/#sec-number-constructor
var NumberWrapper = function Number(value) {
var n = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value));
return calledWithNew(this) ? inheritIfRequired$3(Object(n), this, NumberWrapper) : n;
};
NumberWrapper.prototype = NumberPrototype;
if (FORCED$8 && !IS_PURE$1) NumberPrototype.constructor = NumberWrapper;
$$P({ global: true, constructor: true, wrap: true, forced: FORCED$8 }, {
Number: NumberWrapper
});
// Use `internal/copy-constructor-properties` helper in `core-js@4`
var copyConstructorProperties$1 = function (target, source) {
for (var keys = DESCRIPTORS$h ? getOwnPropertyNames(source) : (
// ES3:
'MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,' +
// ES2015 (in case, if modules with ES2015 Number statics required before):
'EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,' +
// ESNext
'fromString,range'
).split(','), j = 0, key; keys.length > j; j++) {
if (hasOwn$d(source, key = keys[j]) && !hasOwn$d(target, key)) {
defineProperty$a(target, key, getOwnPropertyDescriptor$4(source, key));
}
}
};
if (FORCED$8 || IS_PURE$1) copyConstructorProperties$1(path[NUMBER], NativeNumber);
var DESCRIPTORS$g = descriptors;
var isArray$5 = isArray$7;
var $TypeError$a = TypeError;
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var getOwnPropertyDescriptor$3 = Object.getOwnPropertyDescriptor;
// Safari < 13 does not throw an error in this case
var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS$g && !function () {
// makes no sense without proper strict mode support
if (this !== undefined) return true;
try {
// eslint-disable-next-line es/no-object-defineproperty -- safe
Object.defineProperty([], 'length', { writable: false }).length = 1;
} catch (error) {
return error instanceof TypeError;
}
}();
var arraySetLength = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function (O, length) {
if (isArray$5(O) && !getOwnPropertyDescriptor$3(O, 'length').writable) {
throw $TypeError$a('Cannot set read only .length');
} return O.length = length;
} : function (O, length) {
return O.length = length;
};
var $TypeError$9 = TypeError;
var MAX_SAFE_INTEGER = 0x1FFFFFFFFFFFFF; // 2 ** 53 - 1 == 9007199254740991
var doesNotExceedSafeInteger$3 = function (it) {
if (it > MAX_SAFE_INTEGER) throw $TypeError$9('Maximum allowed index exceeded');
return it;
};
var $$O = _export;
var toObject$7 = toObject$b;
var lengthOfArrayLike$8 = lengthOfArrayLike$b;
var setArrayLength$1 = arraySetLength;
var doesNotExceedSafeInteger$2 = doesNotExceedSafeInteger$3;
var fails$t = fails$I;
var INCORRECT_TO_LENGTH = fails$t(function () {
return [].push.call({ length: 0x100000000 }, 1) !== 4294967297;
});
// V8 and Safari <= 15.4, FF < 23 throws InternalError
// https://bugs.chromium.org/p/v8/issues/detail?id=12681
var properErrorOnNonWritableLength = function () {
try {
// eslint-disable-next-line es/no-object-defineproperty -- safe
Object.defineProperty([], 'length', { writable: false }).push();
} catch (error) {
return error instanceof TypeError;
}
};
var FORCED$7 = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
// `Array.prototype.push` method
// https://tc39.es/ecma262/#sec-array.prototype.push
$$O({ target: 'Array', proto: true, arity: 1, forced: FORCED$7 }, {
// eslint-disable-next-line no-unused-vars -- required for `.length`
push: function push(item) {
var O = toObject$7(this);
var len = lengthOfArrayLike$8(O);
var argCount = arguments.length;
doesNotExceedSafeInteger$2(len + argCount);
for (var i = 0; i < argCount; i++) {
O[len] = arguments[i];
len++;
}
setArrayLength$1(O, len);
return len;
}
});
var DESCRIPTORS$f = descriptors;
var uncurryThis$t = functionUncurryThis;
var call$j = functionCall;
var fails$s = fails$I;
var objectKeys$2 = objectKeys$3;
var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
var propertyIsEnumerableModule = objectPropertyIsEnumerable;
var toObject$6 = toObject$b;
var IndexedObject$1 = indexedObject;
// eslint-disable-next-line es/no-object-assign -- safe
var $assign = Object.assign;
// eslint-disable-next-line es/no-object-defineproperty -- required for testing
var defineProperty$9 = Object.defineProperty;
var concat$1 = uncurryThis$t([].concat);
// `Object.assign` method
// https://tc39.es/ecma262/#sec-object.assign
var objectAssign = !$assign || fails$s(function () {
// should have correct order of operations (Edge bug)
if (DESCRIPTORS$f && $assign({ b: 1 }, $assign(defineProperty$9({}, 'a', {
enumerable: true,
get: function () {
defineProperty$9(this, 'b', {
value: 3,
enumerable: false
});
}
}), { b: 2 })).b !== 1) return true;
// should work with symbols and should have deterministic property order (V8 bug)
var A = {};
var B = {};
// eslint-disable-next-line es/no-symbol -- safe
var symbol = Symbol();
var alphabet = 'abcdefghijklmnopqrst';
A[symbol] = 7;
alphabet.split('').forEach(function (chr) { B[chr] = chr; });
return $assign({}, A)[symbol] != 7 || objectKeys$2($assign({}, B)).join('') != alphabet;
}) ? function assign(target, source) { // eslint-disable-line no-unused-vars -- required for `.length`
var T = toObject$6(target);
var argumentsLength = arguments.length;
var index = 1;
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
var propertyIsEnumerable = propertyIsEnumerableModule.f;
while (argumentsLength > index) {
var S = IndexedObject$1(arguments[index++]);
var keys = getOwnPropertySymbols ? concat$1(objectKeys$2(S), getOwnPropertySymbols(S)) : objectKeys$2(S);
var length = keys.length;
var j = 0;
var key;
while (length > j) {
key = keys[j++];
if (!DESCRIPTORS$f || call$j(propertyIsEnumerable, S, key)) T[key] = S[key];
}
} return T;
} : $assign;
var $$N = _export;
var assign$1 = objectAssign;
// `Object.assign` method
// https://tc39.es/ecma262/#sec-object.assign
// eslint-disable-next-line es/no-object-assign -- required for testing
$$N({ target: 'Object', stat: true, arity: 2, forced: Object.assign !== assign$1 }, {
assign: assign$1
});
var anObject$h = anObject$l;
// `RegExp.prototype.flags` getter implementation
// https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
var regexpFlags$1 = function () {
var that = anObject$h(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;
};
var fails$r = fails$I;
var global$k = global$y;
// babel-minify and Closure Compiler transpiles RegExp('a', 'y') -> /a/y and it causes SyntaxError
var $RegExp$2 = global$k.RegExp;
var UNSUPPORTED_Y$1 = fails$r(function () {
var re = $RegExp$2('a', 'y');
re.lastIndex = 2;
return re.exec('abcd') != null;
});
// UC Browser bug
// https://github.com/zloirock/core-js/issues/1008
var MISSED_STICKY = UNSUPPORTED_Y$1 || fails$r(function () {
return !$RegExp$2('a', 'y').sticky;
});
var BROKEN_CARET = UNSUPPORTED_Y$1 || fails$r(function () {
// https://bugzilla.mozilla.org/show_bug.cgi?id=773687
var re = $RegExp$2('^r', 'gy');
re.lastIndex = 2;
return re.exec('str') != null;
});
var regexpStickyHelpers = {
BROKEN_CARET: BROKEN_CARET,
MISSED_STICKY: MISSED_STICKY,
UNSUPPORTED_Y: UNSUPPORTED_Y$1
};
var objectDefineProperties = {};
var DESCRIPTORS$e = descriptors;
var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
var definePropertyModule$1 = objectDefineProperty;
var anObject$g = anObject$l;
var toIndexedObject$6 = toIndexedObject$a;
var objectKeys$1 = objectKeys$3;
// `Object.defineProperties` method
// https://tc39.es/ecma262/#sec-object.defineproperties
// eslint-disable-next-line es/no-object-defineproperties -- safe
objectDefineProperties.f = DESCRIPTORS$e && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
anObject$g(O);
var props = toIndexedObject$6(Properties);
var keys = objectKeys$1(Properties);
var length = keys.length;
var index = 0;
var key;
while (length > index) definePropertyModule$1.f(O, key = keys[index++], props[key]);
return O;
};
var getBuiltIn$a = getBuiltIn$e;
var html$2 = getBuiltIn$a('document', 'documentElement');
/* global ActiveXObject -- old IE, WSH */
var anObject$f = anObject$l;
var definePropertiesModule = objectDefineProperties;
var enumBugKeys = enumBugKeys$3;
var hiddenKeys$1 = hiddenKeys$5;
var html$1 = html$2;
var documentCreateElement = documentCreateElement$2;
var sharedKey$1 = sharedKey$3;
var GT = '>';
var LT = '<';
var PROTOTYPE = 'prototype';
var SCRIPT = 'script';
var IE_PROTO$1 = sharedKey$1('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;
activeXDocument = null; // avoid memory leak
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$1.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$1[IE_PROTO$1] = true;
// `Object.create` method
// https://tc39.es/ecma262/#sec-object.create
// eslint-disable-next-line es/no-object-create -- safe
var objectCreate = Object.create || function create(O, Properties) {
var result;
if (O !== null) {
EmptyConstructor[PROTOTYPE] = anObject$f(O);
result = new EmptyConstructor();
EmptyConstructor[PROTOTYPE] = null;
// add "__proto__" for Object.getPrototypeOf polyfill
result[IE_PROTO$1] = O;
} else result = NullProtoObject();
return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
};
var fails$q = fails$I;
var global$j = global$y;
// babel-minify and Closure Compiler transpiles RegExp('.', 's') -> /./s and it causes SyntaxError
var $RegExp$1 = global$j.RegExp;
var regexpUnsupportedDotAll = fails$q(function () {
var re = $RegExp$1('.', 's');
return !(re.dotAll && re.exec('\n') && re.flags === 's');
});
var fails$p = fails$I;
var global$i = global$y;
// babel-minify and Closure Compiler transpiles RegExp('(?b)', 'g') -> /(?b)/g and it causes SyntaxError
var $RegExp = global$i.RegExp;
var regexpUnsupportedNcg = fails$p(function () {
var re = $RegExp('(?b)', 'g');
return re.exec('b').groups.a !== 'b' ||
'b'.replace(re, '$c') !== 'bc';
});
/* eslint-disable regexp/no-empty-capturing-group, regexp/no-empty-group, regexp/no-lazy-ends -- testing */
/* eslint-disable regexp/no-useless-quantifier -- testing */
var call$i = functionCall;
var uncurryThis$s = functionUncurryThis;
var toString$f = toString$i;
var regexpFlags = regexpFlags$1;
var stickyHelpers = regexpStickyHelpers;
var shared = sharedExports;
var create$7 = objectCreate;
var getInternalState$3 = internalState.get;
var UNSUPPORTED_DOT_ALL = regexpUnsupportedDotAll;
var UNSUPPORTED_NCG = regexpUnsupportedNcg;
var nativeReplace = shared('native-string-replace', String.prototype.replace);
var nativeExec = RegExp.prototype.exec;
var patchedExec = nativeExec;
var charAt$9 = uncurryThis$s(''.charAt);
var indexOf = uncurryThis$s(''.indexOf);
var replace$8 = uncurryThis$s(''.replace);
var stringSlice$7 = uncurryThis$s(''.slice);
var UPDATES_LAST_INDEX_WRONG = (function () {
var re1 = /a/;
var re2 = /b*/g;
call$i(nativeExec, re1, 'a');
call$i(nativeExec, re2, 'a');
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
})();
var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
// nonparticipating capturing group, copied from es5-shim's String#split patch.
var NPCG_INCLUDED = /()??/.exec('')[1] !== undefined;
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
if (PATCH) {
patchedExec = function exec(string) {
var re = this;
var state = getInternalState$3(re);
var str = toString$f(string);
var raw = state.raw;
var result, reCopy, lastIndex, match, i, object, group;
if (raw) {
raw.lastIndex = re.lastIndex;
result = call$i(patchedExec, raw, str);
re.lastIndex = raw.lastIndex;
return result;
}
var groups = state.groups;
var sticky = UNSUPPORTED_Y && re.sticky;
var flags = call$i(regexpFlags, re);
var source = re.source;
var charsAdded = 0;
var strCopy = str;
if (sticky) {
flags = replace$8(flags, 'y', '');
if (indexOf(flags, 'g') === -1) {
flags += 'g';
}
strCopy = stringSlice$7(str, re.lastIndex);
// Support anchored sticky behavior.
if (re.lastIndex > 0 && (!re.multiline || re.multiline && charAt$9(str, re.lastIndex - 1) !== '\n')) {
source = '(?: ' + source + ')';
strCopy = ' ' + strCopy;
charsAdded++;
}
// ^(? + rx + ) is needed, in combination with some str slicing, to
// simulate the 'y' flag.
reCopy = new RegExp('^(?:' + source + ')', flags);
}
if (NPCG_INCLUDED) {
reCopy = new RegExp('^' + source + '$(?!\\s)', flags);
}
if (UPDATES_LAST_INDEX_WRONG) lastIndex = re.lastIndex;
match = call$i(nativeExec, sticky ? reCopy : re, strCopy);
if (sticky) {
if (match) {
match.input = stringSlice$7(match.input, charsAdded);
match[0] = stringSlice$7(match[0], charsAdded);
match.index = re.lastIndex;
re.lastIndex += match[0].length;
} else re.lastIndex = 0;
} else if (UPDATES_LAST_INDEX_WRONG && match) {
re.lastIndex = re.global ? match.index + match[0].length : lastIndex;
}
if (NPCG_INCLUDED && match && match.length > 1) {
// Fix browsers whose `exec` methods don't consistently return `undefined`
// for NPCG, like IE8. NOTE: This doesn't work for /(.?)?/
call$i(nativeReplace, match[0], reCopy, function () {
for (i = 1; i < arguments.length - 2; i++) {
if (arguments[i] === undefined) match[i] = undefined;
}
});
}
if (match && groups) {
match.groups = object = create$7(null);
for (i = 0; i < groups.length; i++) {
group = groups[i];
object[group[0]] = match[group[1]];
}
}
return match;
};
}
var regexpExec$2 = patchedExec;
var $$M = _export;
var exec$4 = regexpExec$2;
// `RegExp.prototype.exec` method
// https://tc39.es/ecma262/#sec-regexp.prototype.exec
$$M({ target: 'RegExp', proto: true, forced: /./.exec !== exec$4 }, {
exec: exec$4
});
// TODO: Remove from `core-js@4` since it's moved to entry points
var $$L = _export;
var call$h = functionCall;
var isCallable$f = isCallable$u;
var anObject$e = anObject$l;
var toString$e = toString$i;
var DELEGATES_TO_EXEC = function () {
var execCalled = false;
var re = /[ac]/;
re.exec = function () {
execCalled = true;
return /./.exec.apply(this, arguments);
};
return re.test('abc') === true && execCalled;
}();
var nativeTest = /./.test;
// `RegExp.prototype.test` method
// https://tc39.es/ecma262/#sec-regexp.prototype.test
$$L({ target: 'RegExp', proto: true, forced: !DELEGATES_TO_EXEC }, {
test: function (S) {
var R = anObject$e(this);
var string = toString$e(S);
var exec = R.exec;
if (!isCallable$f(exec)) return call$h(nativeTest, R, string);
var result = call$h(exec, R, string);
if (result === null) return false;
anObject$e(result);
return true;
}
});
var toPropertyKey = toPropertyKey$3;
var definePropertyModule = objectDefineProperty;
var createPropertyDescriptor$5 = createPropertyDescriptor$8;
var createProperty$5 = function (object, key, value) {
var propertyKey = toPropertyKey(key);
if (propertyKey in object) definePropertyModule.f(object, propertyKey, createPropertyDescriptor$5(0, value));
else object[propertyKey] = value;
};
var $$K = _export;
var isArray$4 = isArray$7;
var isConstructor$2 = isConstructor$4;
var isObject$c = isObject$l;
var toAbsoluteIndex$2 = toAbsoluteIndex$4;
var lengthOfArrayLike$7 = lengthOfArrayLike$b;
var toIndexedObject$5 = toIndexedObject$a;
var createProperty$4 = createProperty$5;
var wellKnownSymbol$i = wellKnownSymbol$o;
var arrayMethodHasSpeciesSupport$3 = arrayMethodHasSpeciesSupport$5;
var nativeSlice = arraySlice$7;
var HAS_SPECIES_SUPPORT$2 = arrayMethodHasSpeciesSupport$3('slice');
var SPECIES$4 = wellKnownSymbol$i('species');
var $Array$2 = Array;
var max$3 = Math.max;
// `Array.prototype.slice` method
// https://tc39.es/ecma262/#sec-array.prototype.slice
// fallback for not array-like ES3 strings and DOM objects
$$K({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$2 }, {
slice: function slice(start, end) {
var O = toIndexedObject$5(this);
var length = lengthOfArrayLike$7(O);
var k = toAbsoluteIndex$2(start, length);
var fin = toAbsoluteIndex$2(end === undefined ? length : end, length);
// inline `ArraySpeciesCreate` for usage native `Array#slice` where it's possible
var Constructor, result, n;
if (isArray$4(O)) {
Constructor = O.constructor;
// cross-realm fallback
if (isConstructor$2(Constructor) && (Constructor === $Array$2 || isArray$4(Constructor.prototype))) {
Constructor = undefined;
} else if (isObject$c(Constructor)) {
Constructor = Constructor[SPECIES$4];
if (Constructor === null) Constructor = undefined;
}
if (Constructor === $Array$2 || Constructor === undefined) {
return nativeSlice(O, k, fin);
}
}
result = new (Constructor === undefined ? $Array$2 : Constructor)(max$3(fin - k, 0));
for (n = 0; k < fin; k++, n++) if (k in O) createProperty$4(result, n, O[k]);
result.length = n;
return result;
}
});
var ViewPort = {
XS: 0,
SM: 540,
MD: 860,
LG: 1084,
XL: 1400
};
var DetectionUtil = {
/* eslint-disable no-useless-escape, unicorn/better-regex */detectMobile: function detectMobile(includeTabletCheck) {
if (includeTabletCheck === void 0) {
includeTabletCheck = false;
}
/**
* detect if mobile and/or tablet device
* returns bool
*/
var check = false;
if (includeTabletCheck) {
(function (a) {
if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.slice(0, 4))) {
check = true;
}
})(navigator.userAgent || navigator.vendor || window.opera);
} else {
(function (a) {
if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.slice(0, 4))) {
check = true;
}
})(navigator.userAgent || navigator.vendor || window.opera);
}
return check;
},
/**
* Gets viewport based on brower's window width.
* @returns {string} viewport
*/
detectViewport: function detectViewport() {
var windowWidth = window.innerWidth;
if (windowWidth >= ViewPort.XS && windowWidth < ViewPort.SM) {
return 'xs';
}
if (windowWidth < ViewPort.MD && windowWidth >= ViewPort.SM) {
return 'sm';
}
if (windowWidth < ViewPort.LG && windowWidth >= ViewPort.MD) {
return 'md';
}
if (windowWidth < ViewPort.XL && windowWidth >= ViewPort.LG) {
return 'lg';
}
if (windowWidth >= ViewPort.XL) {
return 'xl';
}
},
/* eslint-enable no-useless-escape */isBiDirectional: function isBiDirectional(el) {
if (!el) {
el = document.querySelector('html');
}
return el.getAttribute('dir') === 'rtl';
},
/**
* Detects whether a user has enabled the prefers reduced motion setting
* @returns {boolean}
*/
prefersReducedMotion: function prefersReducedMotion() {
var preference = window.matchMedia('(prefers-reduced-motion: reduce)');
return preference.matches;
}
};
function _regeneratorRuntime() {
_regeneratorRuntime = function () {
return exports;
};
var exports = {},
Op = Object.prototype,
hasOwn = Op.hasOwnProperty,
defineProperty = Object.defineProperty || function (obj, key, desc) {
obj[key] = desc.value;
},
$Symbol = "function" == typeof Symbol ? Symbol : {},
iteratorSymbol = $Symbol.iterator || "@@iterator",
asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
function define(obj, key, value) {
return Object.defineProperty(obj, key, {
value: value,
enumerable: !0,
configurable: !0,
writable: !0
}), obj[key];
}
try {
define({}, "");
} catch (err) {
define = function (obj, key, value) {
return obj[key] = value;
};
}
function wrap(innerFn, outerFn, self, tryLocsList) {
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
generator = Object.create(protoGenerator.prototype),
context = new Context(tryLocsList || []);
return defineProperty(generator, "_invoke", {
value: makeInvokeMethod(innerFn, self, context)
}), generator;
}
function tryCatch(fn, obj, arg) {
try {
return {
type: "normal",
arg: fn.call(obj, arg)
};
} catch (err) {
return {
type: "throw",
arg: err
};
}
}
exports.wrap = wrap;
var ContinueSentinel = {};
function Generator() {}
function GeneratorFunction() {}
function GeneratorFunctionPrototype() {}
var IteratorPrototype = {};
define(IteratorPrototype, iteratorSymbol, function () {
return this;
});
var getProto = Object.getPrototypeOf,
NativeIteratorPrototype = getProto && getProto(getProto(values([])));
NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function (method) {
define(prototype, method, function (arg) {
return this._invoke(method, arg);
});
});
}
function AsyncIterator(generator, PromiseImpl) {
function invoke(method, arg, resolve, reject) {
var record = tryCatch(generator[method], generator, arg);
if ("throw" !== record.type) {
var result = record.arg,
value = result.value;
return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
invoke("next", value, resolve, reject);
}, function (err) {
invoke("throw", err, resolve, reject);
}) : PromiseImpl.resolve(value).then(function (unwrapped) {
result.value = unwrapped, resolve(result);
}, function (error) {
return invoke("throw", error, resolve, reject);
});
}
reject(record.arg);
}
var previousPromise;
defineProperty(this, "_invoke", {
value: function (method, arg) {
function callInvokeWithMethodAndArg() {
return new PromiseImpl(function (resolve, reject) {
invoke(method, arg, resolve, reject);
});
}
return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
}
});
}
function makeInvokeMethod(innerFn, self, context) {
var state = "suspendedStart";
return function (method, arg) {
if ("executing" === state) throw new Error("Generator is already running");
if ("completed" === state) {
if ("throw" === method) throw arg;
return doneResult();
}
for (context.method = method, context.arg = arg;;) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel) continue;
return delegateResult;
}
}
if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
if ("suspendedStart" === state) throw state = "completed", context.arg;
context.dispatchException(context.arg);
} else "return" === context.method && context.abrupt("return", context.arg);
state = "executing";
var record = tryCatch(innerFn, self, context);
if ("normal" === record.type) {
if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
return {
value: record.arg,
done: context.done
};
}
"throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
}
};
}
function maybeInvokeDelegate(delegate, context) {
var methodName = context.method,
method = delegate.iterator[methodName];
if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
var record = tryCatch(method, delegate.iterator, context.arg);
if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
var info = record.arg;
return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
}
function pushTryEntry(locs) {
var entry = {
tryLoc: locs[0]
};
1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
}
function resetTryEntry(entry) {
var record = entry.completion || {};
record.type = "normal", delete record.arg, entry.completion = record;
}
function Context(tryLocsList) {
this.tryEntries = [{
tryLoc: "root"
}], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
}
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) return iteratorMethod.call(iterable);
if ("function" == typeof iterable.next) return iterable;
if (!isNaN(iterable.length)) {
var i = -1,
next = function next() {
for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
return next.value = undefined, next.done = !0, next;
};
return next.next = next;
}
}
return {
next: doneResult
};
}
function doneResult() {
return {
value: undefined,
done: !0
};
}
return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
value: GeneratorFunctionPrototype,
configurable: !0
}), defineProperty(GeneratorFunctionPrototype, "constructor", {
value: GeneratorFunction,
configurable: !0
}), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
var ctor = "function" == typeof genFun && genFun.constructor;
return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
}, exports.mark = function (genFun) {
return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
}, exports.awrap = function (arg) {
return {
__await: arg
};
}, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
return this;
}), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
void 0 === PromiseImpl && (PromiseImpl = Promise);
var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
return result.done ? result.value : iter.next();
});
}, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
return this;
}), define(Gp, "toString", function () {
return "[object Generator]";
}), exports.keys = function (val) {
var object = Object(val),
keys = [];
for (var key in object) keys.push(key);
return keys.reverse(), function next() {
for (; keys.length;) {
var key = keys.pop();
if (key in object) return next.value = key, next.done = !1, next;
}
return next.done = !0, next;
};
}, exports.values = values, Context.prototype = {
constructor: Context,
reset: function (skipTempReset) {
if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
},
stop: function () {
this.done = !0;
var rootRecord = this.tryEntries[0].completion;
if ("throw" === rootRecord.type) throw rootRecord.arg;
return this.rval;
},
dispatchException: function (exception) {
if (this.done) throw exception;
var context = this;
function handle(loc, caught) {
return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
}
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i],
record = entry.completion;
if ("root" === entry.tryLoc) return handle("end");
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc"),
hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
} else if (hasCatch) {
if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
} else {
if (!hasFinally) throw new Error("try statement without catch or finally");
if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
}
}
}
},
abrupt: function (type, arg) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
var record = finallyEntry ? finallyEntry.completion : {};
return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
},
complete: function (record, afterLoc) {
if ("throw" === record.type) throw record.arg;
return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
},
finish: function (finallyLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
}
},
catch: function (tryLoc) {
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
var entry = this.tryEntries[i];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if ("throw" === record.type) {
var thrown = record.arg;
resetTryEntry(entry);
}
return thrown;
}
}
throw new Error("illegal catch attempt");
},
delegateYield: function (iterable, resultName, nextLoc) {
return this.delegate = {
iterator: values(iterable),
resultName: resultName,
nextLoc: nextLoc
}, "next" === this.method && (this.arg = undefined), ContinueSentinel;
}
}, exports;
}
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
return;
}
if (info.done) {
resolve(value);
} else {
Promise.resolve(value).then(_next, _throw);
}
}
function _asyncToGenerator(fn) {
return function () {
var self = this,
args = arguments;
return new Promise(function (resolve, reject) {
var gen = fn.apply(self, args);
function _next(value) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
}
function _throw(err) {
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
}
_next(undefined);
});
};
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
Object.defineProperty(Constructor, "prototype", {
writable: false
});
return Constructor;
}
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
_setPrototypeOf(subClass, superClass);
}
function _getPrototypeOf(o) {
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
return o.__proto__ || Object.getPrototypeOf(o);
};
return _getPrototypeOf(o);
}
function _setPrototypeOf(o, p) {
_setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
o.__proto__ = p;
return o;
};
return _setPrototypeOf(o, p);
}
function _isNativeReflectConstruct() {
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
if (Reflect.construct.sham) return false;
if (typeof Proxy === "function") return true;
try {
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
return true;
} catch (e) {
return false;
}
}
function _construct(Parent, args, Class) {
if (_isNativeReflectConstruct()) {
_construct = Reflect.construct.bind();
} else {
_construct = function _construct(Parent, args, Class) {
var a = [null];
a.push.apply(a, args);
var Constructor = Function.bind.apply(Parent, a);
var instance = new Constructor();
if (Class) _setPrototypeOf(instance, Class.prototype);
return instance;
};
}
return _construct.apply(null, arguments);
}
function _isNativeFunction(fn) {
return Function.toString.call(fn).indexOf("[native code]") !== -1;
}
function _wrapNativeSuper(Class) {
var _cache = typeof Map === "function" ? new Map() : undefined;
_wrapNativeSuper = function _wrapNativeSuper(Class) {
if (Class === null || !_isNativeFunction(Class)) return Class;
if (typeof Class !== "function") {
throw new TypeError("Super expression must either be null or a function");
}
if (typeof _cache !== "undefined") {
if (_cache.has(Class)) return _cache.get(Class);
_cache.set(Class, Wrapper);
}
function Wrapper() {
return _construct(Class, arguments, _getPrototypeOf(this).constructor);
}
Wrapper.prototype = Object.create(Class.prototype, {
constructor: {
value: Wrapper,
enumerable: false,
writable: true,
configurable: true
}
});
return _setPrototypeOf(Wrapper, Class);
};
return _wrapNativeSuper(Class);
}
function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
}
return self;
}
function _unsupportedIterableToArray(o, minLen) {
if (!o) return;
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
var n = Object.prototype.toString.call(o).slice(8, -1);
if (n === "Object" && o.constructor) n = o.constructor.name;
if (n === "Map" || n === "Set") return Array.from(o);
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
}
function _arrayLikeToArray(arr, len) {
if (len == null || len > arr.length) len = arr.length;
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
return arr2;
}
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
if (it) return (it = it.call(o)).next.bind(it);
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
if (it) o = it;
var i = 0;
return function () {
if (i >= o.length) return {
done: true
};
return {
done: false,
value: o[i++]
};
};
}
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _toPrimitive(input, hint) {
if (typeof input !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return typeof key === "symbol" ? key : String(key);
}
var id$2 = 0;
function _classPrivateFieldLooseKey(name) {
return "__private_" + id$2++ + "_" + name;
}
function _classPrivateFieldLooseBase(receiver, privateKey) {
if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) {
throw new TypeError("attempted to use private field on non-instance");
}
return receiver;
}
var toString$d = toString$i;
var normalizeStringArgument$4 = function (argument, $default) {
return argument === undefined ? arguments.length < 2 ? '' : $default : toString$d(argument);
};
var DESCRIPTORS$d = descriptors;
var fails$o = fails$I;
var anObject$d = anObject$l;
var create$6 = objectCreate;
var normalizeStringArgument$3 = normalizeStringArgument$4;
var nativeErrorToString = Error.prototype.toString;
var INCORRECT_TO_STRING$1 = fails$o(function () {
if (DESCRIPTORS$d) {
// Chrome 32- incorrectly call accessor
// eslint-disable-next-line es/no-object-defineproperty -- safe
var object = create$6(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';
});
var errorToString$2 = INCORRECT_TO_STRING$1 ? function toString() {
var O = anObject$d(this);
var name = normalizeStringArgument$3(O.name, 'Error');
var message = normalizeStringArgument$3(O.message);
return !name ? message : !message ? name : name + ': ' + message;
} : nativeErrorToString;
var defineBuiltIn$d = defineBuiltIn$g;
var errorToString$1 = errorToString$2;
var ErrorPrototype$1 = Error.prototype;
// `Error.prototype.toString` method fix
// https://tc39.es/ecma262/#sec-error.prototype.tostring
if (ErrorPrototype$1.toString !== errorToString$1) {
defineBuiltIn$d(ErrorPrototype$1, 'toString', errorToString$1);
}
// TODO: Remove from `core-js@4`
var uncurryThis$r = functionUncurryThis;
var defineBuiltIn$c = defineBuiltIn$g;
var DatePrototype$1 = Date.prototype;
var INVALID_DATE = 'Invalid Date';
var TO_STRING$1 = 'toString';
var nativeDateToString = uncurryThis$r(DatePrototype$1[TO_STRING$1]);
var thisTimeValue$2 = uncurryThis$r(DatePrototype$1.getTime);
// `Date.prototype.toString` method
// https://tc39.es/ecma262/#sec-date.prototype.tostring
if (String(new Date(NaN)) != INVALID_DATE) {
defineBuiltIn$c(DatePrototype$1, TO_STRING$1, function toString() {
var value = thisTimeValue$2(this);
// eslint-disable-next-line no-self-compare -- NaN check
return value === value ? nativeDateToString(this) : INVALID_DATE;
});
}
var call$g = functionCall;
var hasOwn$c = hasOwnProperty_1;
var isPrototypeOf$3 = objectIsPrototypeOf;
var regExpFlags = regexpFlags$1;
var RegExpPrototype$2 = RegExp.prototype;
var regexpGetFlags = function (R) {
var flags = R.flags;
return flags === undefined && !('flags' in RegExpPrototype$2) && !hasOwn$c(R, 'flags') && isPrototypeOf$3(RegExpPrototype$2, R)
? call$g(regExpFlags, R) : flags;
};
var PROPER_FUNCTION_NAME$2 = functionName.PROPER;
var defineBuiltIn$b = defineBuiltIn$g;
var anObject$c = anObject$l;
var $toString$2 = toString$i;
var fails$n = fails$I;
var getRegExpFlags = regexpGetFlags;
var TO_STRING = 'toString';
var RegExpPrototype$1 = RegExp.prototype;
var nativeToString = RegExpPrototype$1[TO_STRING];
var NOT_GENERIC = fails$n(function () { return nativeToString.call({ source: 'a', flags: 'b' }) != '/a/b'; });
// FF44- RegExp#toString has a wrong name
var INCORRECT_NAME = PROPER_FUNCTION_NAME$2 && nativeToString.name != TO_STRING;
// `RegExp.prototype.toString` method
// https://tc39.es/ecma262/#sec-regexp.prototype.tostring
if (NOT_GENERIC || INCORRECT_NAME) {
defineBuiltIn$b(RegExp.prototype, TO_STRING, function toString() {
var R = anObject$c(this);
var pattern = $toString$2(R.source);
var flags = $toString$2(getRegExpFlags(R));
return '/' + pattern + '/' + flags;
}, { unsafe: true });
}
var $$J = _export;
var isArray$3 = isArray$7;
// `Array.isArray` method
// https://tc39.es/ecma262/#sec-array.isarray
$$J({ target: 'Array', stat: true }, {
isArray: isArray$3
});
var InitializationUtil = {
/**
* Initialize a component after DOM is loaded
* @param {string} selector - DOM selector for component
* @param {Function} init - Callback function to initialize the component
*/
initializeComponent: function initializeComponent(selector, init) {
document.querySelectorAll(selector).forEach(function (node) {
return init(node);
});
},
/**
* Iterate over list to add event listeners
* @param {Array.<{
* el: Element | Document | Window,
* handler: Function,
* type: String,
* options?: Object
* }>} eventList - List of event maps
*/
addEvents: function addEvents(eventList) {
for (var _iterator = _createForOfIteratorHelperLoose(eventList), _step; !(_step = _iterator()).done;) {
var obj = _step.value;
if (typeof obj.options === 'undefined') {
obj.options = {};
}
if (typeof obj.el.addEventListener === 'function') {
obj.el.addEventListener(obj.type, obj.handler, obj.options);
} else if (obj.el.toString() === '[object MediaQueryList]' && typeof obj.el.addListener === 'function') {
obj.el.addListener(obj.handler); // for Safari <14
}
}
},
/**
* Iterate over list to remove event listeners
* @param {array} eventList - List of event maps
*/
removeEvents: function removeEvents(eventList) {
for (var _iterator2 = _createForOfIteratorHelperLoose(eventList), _step2; !(_step2 = _iterator2()).done;) {
var obj = _step2.value;
if (typeof obj.el.removeEventListener === 'function') {
obj.el.removeEventListener(obj.type, obj.handler);
} else if (obj.el.toString() === '[object MediaQueryList]' && typeof obj.el.removeListener === 'function') {
obj.el.removeListener(obj.handler); // for Safari <14
}
}
},
/**
* Tears down each in a list of mwf component instances
* @param {Array} componentList an array of mwf component instance
*/
tearDownComponentList: function tearDownComponentList(componentList) {
if (Array.isArray(componentList)) {
var component;
while (componentList.length > 0) {
component = componentList.pop();
if (typeof component.remove === 'function') {
component.remove();
}
}
}
}
};
var $$I = _export;
var fails$m = fails$I;
var isArray$2 = isArray$7;
var isObject$b = isObject$l;
var toObject$5 = toObject$b;
var lengthOfArrayLike$6 = lengthOfArrayLike$b;
var doesNotExceedSafeInteger$1 = doesNotExceedSafeInteger$3;
var createProperty$3 = createProperty$5;
var arraySpeciesCreate$1 = arraySpeciesCreate$3;
var arrayMethodHasSpeciesSupport$2 = arrayMethodHasSpeciesSupport$5;
var wellKnownSymbol$h = wellKnownSymbol$o;
var V8_VERSION$1 = engineV8Version;
var IS_CONCAT_SPREADABLE = wellKnownSymbol$h('isConcatSpreadable');
// We can't use this feature detection in V8 since it causes
// deoptimization and serious performance degradation
// https://github.com/zloirock/core-js/issues/679
var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION$1 >= 51 || !fails$m(function () {
var array = [];
array[IS_CONCAT_SPREADABLE] = false;
return array.concat()[0] !== array;
});
var isConcatSpreadable = function (O) {
if (!isObject$b(O)) return false;
var spreadable = O[IS_CONCAT_SPREADABLE];
return spreadable !== undefined ? !!spreadable : isArray$2(O);
};
var FORCED$6 = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport$2('concat');
// `Array.prototype.concat` method
// https://tc39.es/ecma262/#sec-array.prototype.concat
// with adding support of @@isConcatSpreadable and @@species
$$I({ target: 'Array', proto: true, arity: 1, forced: FORCED$6 }, {
// eslint-disable-next-line no-unused-vars -- required for `.length`
concat: function concat(arg) {
var O = toObject$5(this);
var A = arraySpeciesCreate$1(O, 0);
var n = 0;
var i, k, length, len, E;
for (i = -1, length = arguments.length; i < length; i++) {
E = i === -1 ? O : arguments[i];
if (isConcatSpreadable(E)) {
len = lengthOfArrayLike$6(E);
doesNotExceedSafeInteger$1(n + len);
for (k = 0; k < len; k++, n++) if (k in E) createProperty$3(A, n, E[k]);
} else {
doesNotExceedSafeInteger$1(n + 1);
createProperty$3(A, n++, E);
}
}
A.length = n;
return A;
}
});
var call$f = functionCall;
var anObject$b = anObject$l;
var getMethod$3 = getMethod$5;
var iteratorClose$2 = function (iterator, kind, value) {
var innerResult, innerError;
anObject$b(iterator);
try {
innerResult = getMethod$3(iterator, 'return');
if (!innerResult) {
if (kind === 'throw') throw value;
return value;
}
innerResult = call$f(innerResult, iterator);
} catch (error) {
innerError = true;
innerResult = error;
}
if (kind === 'throw') throw value;
if (innerError) throw innerResult;
anObject$b(innerResult);
return value;
};
var anObject$a = anObject$l;
var iteratorClose$1 = iteratorClose$2;
// call something on iterator step with safe closing on error
var callWithSafeIterationClosing$1 = function (iterator, fn, value, ENTRIES) {
try {
return ENTRIES ? fn(anObject$a(value)[0], value[1]) : fn(value);
} catch (error) {
iteratorClose$1(iterator, 'throw', error);
}
};
var iterators = {};
var wellKnownSymbol$g = wellKnownSymbol$o;
var Iterators$4 = iterators;
var ITERATOR$8 = wellKnownSymbol$g('iterator');
var ArrayPrototype$1 = Array.prototype;
// check on default Array iterator
var isArrayIteratorMethod$2 = function (it) {
return it !== undefined && (Iterators$4.Array === it || ArrayPrototype$1[ITERATOR$8] === it);
};
var classof$7 = classof$b;
var getMethod$2 = getMethod$5;
var isNullOrUndefined$6 = isNullOrUndefined$9;
var Iterators$3 = iterators;
var wellKnownSymbol$f = wellKnownSymbol$o;
var ITERATOR$7 = wellKnownSymbol$f('iterator');
var getIteratorMethod$4 = function (it) {
if (!isNullOrUndefined$6(it)) return getMethod$2(it, ITERATOR$7)
|| getMethod$2(it, '@@iterator')
|| Iterators$3[classof$7(it)];
};
var call$e = functionCall;
var aCallable$5 = aCallable$a;
var anObject$9 = anObject$l;
var tryToString$3 = tryToString$5;
var getIteratorMethod$3 = getIteratorMethod$4;
var $TypeError$8 = TypeError;
var getIterator$3 = function (argument, usingIterator) {
var iteratorMethod = arguments.length < 2 ? getIteratorMethod$3(argument) : usingIterator;
if (aCallable$5(iteratorMethod)) return anObject$9(call$e(iteratorMethod, argument));
throw $TypeError$8(tryToString$3(argument) + ' is not iterable');
};
var bind$7 = functionBindContext;
var call$d = functionCall;
var toObject$4 = toObject$b;
var callWithSafeIterationClosing = callWithSafeIterationClosing$1;
var isArrayIteratorMethod$1 = isArrayIteratorMethod$2;
var isConstructor$1 = isConstructor$4;
var lengthOfArrayLike$5 = lengthOfArrayLike$b;
var createProperty$2 = createProperty$5;
var getIterator$2 = getIterator$3;
var getIteratorMethod$2 = getIteratorMethod$4;
var $Array$1 = Array;
// `Array.from` method implementation
// https://tc39.es/ecma262/#sec-array.from
var arrayFrom$1 = function from(arrayLike /* , mapfn = undefined, thisArg = undefined */) {
var O = toObject$4(arrayLike);
var IS_CONSTRUCTOR = isConstructor$1(this);
var argumentsLength = arguments.length;
var mapfn = argumentsLength > 1 ? arguments[1] : undefined;
var mapping = mapfn !== undefined;
if (mapping) mapfn = bind$7(mapfn, argumentsLength > 2 ? arguments[2] : undefined);
var iteratorMethod = getIteratorMethod$2(O);
var index = 0;
var length, result, step, iterator, next, value;
// if the target is not iterable or it's an array with the default iterator - use a simple case
if (iteratorMethod && !(this === $Array$1 && isArrayIteratorMethod$1(iteratorMethod))) {
iterator = getIterator$2(O, iteratorMethod);
next = iterator.next;
result = IS_CONSTRUCTOR ? new this() : [];
for (;!(step = call$d(next, iterator)).done; index++) {
value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index], true) : step.value;
createProperty$2(result, index, value);
}
} else {
length = lengthOfArrayLike$5(O);
result = IS_CONSTRUCTOR ? new this(length) : $Array$1(length);
for (;length > index; index++) {
value = mapping ? mapfn(O[index], index) : O[index];
createProperty$2(result, index, value);
}
}
result.length = index;
return result;
};
var wellKnownSymbol$e = wellKnownSymbol$o;
var ITERATOR$6 = wellKnownSymbol$e('iterator');
var SAFE_CLOSING = false;
try {
var called = 0;
var iteratorWithReturn = {
next: function () {
return { done: !!called++ };
},
'return': function () {
SAFE_CLOSING = true;
}
};
iteratorWithReturn[ITERATOR$6] = 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 */ }
var checkCorrectnessOfIteration$3 = function (exec, SKIP_CLOSING) {
if (!SKIP_CLOSING && !SAFE_CLOSING) return false;
var ITERATION_SUPPORT = false;
try {
var object = {};
object[ITERATOR$6] = function () {
return {
next: function () {
return { done: ITERATION_SUPPORT = true };
}
};
};
exec(object);
} catch (error) { /* empty */ }
return ITERATION_SUPPORT;
};
var $$H = _export;
var from = arrayFrom$1;
var checkCorrectnessOfIteration$2 = checkCorrectnessOfIteration$3;
var INCORRECT_ITERATION = !checkCorrectnessOfIteration$2(function (iterable) {
// eslint-disable-next-line es/no-array-from -- required for testing
Array.from(iterable);
});
// `Array.from` method
// https://tc39.es/ecma262/#sec-array.from
$$H({ target: 'Array', stat: true, forced: INCORRECT_ITERATION }, {
from: from
});
var uncurryThis$q = functionUncurryThis;
var toIntegerOrInfinity$4 = toIntegerOrInfinity$7;
var toString$c = toString$i;
var requireObjectCoercible$7 = requireObjectCoercible$b;
var charAt$8 = uncurryThis$q(''.charAt);
var charCodeAt$2 = uncurryThis$q(''.charCodeAt);
var stringSlice$6 = uncurryThis$q(''.slice);
var createMethod$2 = function (CONVERT_TO_STRING) {
return function ($this, pos) {
var S = toString$c(requireObjectCoercible$7($this));
var position = toIntegerOrInfinity$4(pos);
var size = S.length;
var first, second;
if (position < 0 || position >= size) return CONVERT_TO_STRING ? '' : undefined;
first = charCodeAt$2(S, position);
return first < 0xD800 || first > 0xDBFF || position + 1 === size
|| (second = charCodeAt$2(S, position + 1)) < 0xDC00 || second > 0xDFFF
? CONVERT_TO_STRING
? charAt$8(S, position)
: first
: CONVERT_TO_STRING
? stringSlice$6(S, position, position + 2)
: (first - 0xD800 << 10) + (second - 0xDC00) + 0x10000;
};
};
var stringMultibyte = {
// `String.prototype.codePointAt` method
// https://tc39.es/ecma262/#sec-string.prototype.codepointat
codeAt: createMethod$2(false),
// `String.prototype.at` method
// https://github.com/mathiasbynens/String.prototype.at
charAt: createMethod$2(true)
};
var fails$l = fails$I;
var correctPrototypeGetter = !fails$l(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;
});
var hasOwn$b = hasOwnProperty_1;
var isCallable$e = isCallable$u;
var toObject$3 = toObject$b;
var sharedKey = sharedKey$3;
var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
var IE_PROTO = sharedKey('IE_PROTO');
var $Object$1 = Object;
var ObjectPrototype = $Object$1.prototype;
// `Object.getPrototypeOf` method
// https://tc39.es/ecma262/#sec-object.getprototypeof
// eslint-disable-next-line es/no-object-getprototypeof -- safe
var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? $Object$1.getPrototypeOf : function (O) {
var object = toObject$3(O);
if (hasOwn$b(object, IE_PROTO)) return object[IE_PROTO];
var constructor = object.constructor;
if (isCallable$e(constructor) && object instanceof constructor) {
return constructor.prototype;
} return object instanceof $Object$1 ? ObjectPrototype : null;
};
var fails$k = fails$I;
var isCallable$d = isCallable$u;
var isObject$a = isObject$l;
var getPrototypeOf$1 = objectGetPrototypeOf;
var defineBuiltIn$a = defineBuiltIn$g;
var wellKnownSymbol$d = wellKnownSymbol$o;
var ITERATOR$5 = wellKnownSymbol$d('iterator');
var BUGGY_SAFARI_ITERATORS$1 = false;
// `%IteratorPrototype%` object
// https://tc39.es/ecma262/#sec-%iteratorprototype%-object
var IteratorPrototype$2, 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$1 = true;
else {
PrototypeOfArrayIteratorPrototype = getPrototypeOf$1(getPrototypeOf$1(arrayIterator));
if (PrototypeOfArrayIteratorPrototype !== Object.prototype) IteratorPrototype$2 = PrototypeOfArrayIteratorPrototype;
}
}
var NEW_ITERATOR_PROTOTYPE = !isObject$a(IteratorPrototype$2) || fails$k(function () {
var test = {};
// FF44- legacy iterators case
return IteratorPrototype$2[ITERATOR$5].call(test) !== test;
});
if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
// `%IteratorPrototype%[@@iterator]()` method
// https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
if (!isCallable$d(IteratorPrototype$2[ITERATOR$5])) {
defineBuiltIn$a(IteratorPrototype$2, ITERATOR$5, function () {
return this;
});
}
var iteratorsCore = {
IteratorPrototype: IteratorPrototype$2,
BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
};
var defineProperty$8 = objectDefineProperty.f;
var hasOwn$a = hasOwnProperty_1;
var wellKnownSymbol$c = wellKnownSymbol$o;
var TO_STRING_TAG$1 = wellKnownSymbol$c('toStringTag');
var setToStringTag$7 = function (target, TAG, STATIC) {
if (target && !STATIC) target = target.prototype;
if (target && !hasOwn$a(target, TO_STRING_TAG$1)) {
defineProperty$8(target, TO_STRING_TAG$1, { configurable: true, value: TAG });
}
};
var IteratorPrototype$1 = iteratorsCore.IteratorPrototype;
var create$5 = objectCreate;
var createPropertyDescriptor$4 = createPropertyDescriptor$8;
var setToStringTag$6 = setToStringTag$7;
var Iterators$2 = iterators;
var returnThis$1 = function () { return this; };
var iteratorCreateConstructor = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
var TO_STRING_TAG = NAME + ' Iterator';
IteratorConstructor.prototype = create$5(IteratorPrototype$1, { next: createPropertyDescriptor$4(+!ENUMERABLE_NEXT, next) });
setToStringTag$6(IteratorConstructor, TO_STRING_TAG, false);
Iterators$2[TO_STRING_TAG] = returnThis$1;
return IteratorConstructor;
};
var $$G = _export;
var call$c = functionCall;
var FunctionName = functionName;
var isCallable$c = isCallable$u;
var createIteratorConstructor$1 = iteratorCreateConstructor;
var getPrototypeOf = objectGetPrototypeOf;
var setPrototypeOf$2 = objectSetPrototypeOf;
var setToStringTag$5 = setToStringTag$7;
var createNonEnumerableProperty$5 = createNonEnumerableProperty$9;
var defineBuiltIn$9 = defineBuiltIn$g;
var wellKnownSymbol$b = wellKnownSymbol$o;
var Iterators$1 = iterators;
var IteratorsCore = iteratorsCore;
var PROPER_FUNCTION_NAME$1 = FunctionName.PROPER;
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
var IteratorPrototype = IteratorsCore.IteratorPrototype;
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
var ITERATOR$4 = wellKnownSymbol$b('iterator');
var KEYS$1 = 'keys';
var VALUES = 'values';
var ENTRIES = 'entries';
var returnThis = function () { return this; };
var iteratorDefine = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
createIteratorConstructor$1(IteratorConstructor, NAME, next);
var getIterationMethod = function (KIND) {
if (KIND === DEFAULT && defaultIterator) return defaultIterator;
if (!BUGGY_SAFARI_ITERATORS && KIND in IterablePrototype) return IterablePrototype[KIND];
switch (KIND) {
case KEYS$1: 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$4]
|| 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 (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
if (setPrototypeOf$2) {
setPrototypeOf$2(CurrentIteratorPrototype, IteratorPrototype);
} else if (!isCallable$c(CurrentIteratorPrototype[ITERATOR$4])) {
defineBuiltIn$9(CurrentIteratorPrototype, ITERATOR$4, returnThis);
}
}
// Set @@toStringTag to native iterators
setToStringTag$5(CurrentIteratorPrototype, TO_STRING_TAG, true);
}
}
// fix Array.prototype.{ values, @@iterator }.name in V8 / FF
if (PROPER_FUNCTION_NAME$1 && DEFAULT == VALUES && nativeIterator && nativeIterator.name !== VALUES) {
if (CONFIGURABLE_FUNCTION_NAME) {
createNonEnumerableProperty$5(IterablePrototype, 'name', VALUES);
} else {
INCORRECT_VALUES_NAME = true;
defaultIterator = function values() { return call$c(nativeIterator, this); };
}
}
// export additional methods
if (DEFAULT) {
methods = {
values: getIterationMethod(VALUES),
keys: IS_SET ? defaultIterator : getIterationMethod(KEYS$1),
entries: getIterationMethod(ENTRIES)
};
if (FORCED) for (KEY in methods) {
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
defineBuiltIn$9(IterablePrototype, KEY, methods[KEY]);
}
} else $$G({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
}
// define iterator
if (IterablePrototype[ITERATOR$4] !== defaultIterator) {
defineBuiltIn$9(IterablePrototype, ITERATOR$4, defaultIterator, { name: DEFAULT });
}
Iterators$1[NAME] = defaultIterator;
return methods;
};
// `CreateIterResultObject` abstract operation
// https://tc39.es/ecma262/#sec-createiterresultobject
var createIterResultObject$3 = function (value, done) {
return { value: value, done: done };
};
var charAt$7 = stringMultibyte.charAt;
var toString$b = toString$i;
var InternalStateModule$7 = internalState;
var defineIterator$2 = iteratorDefine;
var createIterResultObject$2 = createIterResultObject$3;
var STRING_ITERATOR = 'String Iterator';
var setInternalState$7 = InternalStateModule$7.set;
var getInternalState$2 = InternalStateModule$7.getterFor(STRING_ITERATOR);
// `String.prototype[@@iterator]` method
// https://tc39.es/ecma262/#sec-string.prototype-@@iterator
defineIterator$2(String, 'String', function (iterated) {
setInternalState$7(this, {
type: STRING_ITERATOR,
string: toString$b(iterated),
index: 0
});
// `%StringIteratorPrototype%.next` method
// https://tc39.es/ecma262/#sec-%stringiteratorprototype%.next
}, function next() {
var state = getInternalState$2(this);
var string = state.string;
var index = state.index;
var point;
if (index >= string.length) return createIterResultObject$2(undefined, true);
point = charAt$7(string, index);
state.index += point.length;
return createIterResultObject$2(point, false);
});
var $$F = _export;
var uncurryThis$p = functionUncurryThis;
var IndexedObject = indexedObject;
var toIndexedObject$4 = toIndexedObject$a;
var arrayMethodIsStrict$5 = arrayMethodIsStrict$7;
var nativeJoin = uncurryThis$p([].join);
var ES3_STRINGS = IndexedObject != Object;
var FORCED$5 = ES3_STRINGS || !arrayMethodIsStrict$5('join', ',');
// `Array.prototype.join` method
// https://tc39.es/ecma262/#sec-array.prototype.join
$$F({ target: 'Array', proto: true, forced: FORCED$5 }, {
join: function join(separator) {
return nativeJoin(toIndexedObject$4(this), separator === undefined ? ',' : separator);
}
});
var wellKnownSymbol$a = wellKnownSymbol$o;
var create$4 = objectCreate;
var defineProperty$7 = objectDefineProperty.f;
var UNSCOPABLES = wellKnownSymbol$a('unscopables');
var ArrayPrototype = Array.prototype;
// Array.prototype[@@unscopables]
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
if (ArrayPrototype[UNSCOPABLES] == undefined) {
defineProperty$7(ArrayPrototype, UNSCOPABLES, {
configurable: true,
value: create$4(null)
});
}
// add a key to Array.prototype[@@unscopables]
var addToUnscopables$4 = function (key) {
ArrayPrototype[UNSCOPABLES][key] = true;
};
var $$E = _export;
var $includes = arrayIncludes.includes;
var fails$j = fails$I;
var addToUnscopables$3 = addToUnscopables$4;
// FF99+ bug
var BROKEN_ON_SPARSE = fails$j(function () {
// eslint-disable-next-line es/no-array-prototype-includes -- detection
return !Array(1).includes();
});
// `Array.prototype.includes` method
// https://tc39.es/ecma262/#sec-array.prototype.includes
$$E({ target: 'Array', proto: true, forced: BROKEN_ON_SPARSE }, {
includes: function includes(el /* , fromIndex = 0 */) {
return $includes(this, el, arguments.length > 1 ? arguments[1] : undefined);
}
});
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables$3('includes');
var isObject$9 = isObject$l;
var classof$6 = classofRaw$2;
var wellKnownSymbol$9 = wellKnownSymbol$o;
var MATCH$1 = wellKnownSymbol$9('match');
// `IsRegExp` abstract operation
// https://tc39.es/ecma262/#sec-isregexp
var isRegexp = function (it) {
var isRegExp;
return isObject$9(it) && ((isRegExp = it[MATCH$1]) !== undefined ? !!isRegExp : classof$6(it) == 'RegExp');
};
var isRegExp = isRegexp;
var $TypeError$7 = TypeError;
var notARegexp = function (it) {
if (isRegExp(it)) {
throw $TypeError$7("The method doesn't accept regular expressions");
} return it;
};
var wellKnownSymbol$8 = wellKnownSymbol$o;
var MATCH = wellKnownSymbol$8('match');
var correctIsRegexpLogic = function (METHOD_NAME) {
var regexp = /./;
try {
'/./'[METHOD_NAME](regexp);
} catch (error1) {
try {
regexp[MATCH] = false;
return '/./'[METHOD_NAME](regexp);
} catch (error2) { /* empty */ }
} return false;
};
var $$D = _export;
var uncurryThis$o = functionUncurryThis;
var notARegExp$1 = notARegexp;
var requireObjectCoercible$6 = requireObjectCoercible$b;
var toString$a = toString$i;
var correctIsRegExpLogic$1 = correctIsRegexpLogic;
var stringIndexOf$1 = uncurryThis$o(''.indexOf);
// `String.prototype.includes` method
// https://tc39.es/ecma262/#sec-string.prototype.includes
$$D({ target: 'String', proto: true, forced: !correctIsRegExpLogic$1('includes') }, {
includes: function includes(searchString /* , position = 0 */) {
return !!~stringIndexOf$1(
toString$a(requireObjectCoercible$6(this)),
toString$a(notARegExp$1(searchString)),
arguments.length > 1 ? arguments[1] : undefined
);
}
});
var toIndexedObject$3 = toIndexedObject$a;
var addToUnscopables$2 = addToUnscopables$4;
var Iterators = iterators;
var InternalStateModule$6 = internalState;
var defineProperty$6 = objectDefineProperty.f;
var defineIterator$1 = iteratorDefine;
var createIterResultObject$1 = createIterResultObject$3;
var DESCRIPTORS$c = descriptors;
var ARRAY_ITERATOR = 'Array Iterator';
var setInternalState$6 = InternalStateModule$6.set;
var getInternalState$1 = InternalStateModule$6.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
var es_array_iterator = defineIterator$1(Array, 'Array', function (iterated, kind) {
setInternalState$6(this, {
type: ARRAY_ITERATOR,
target: toIndexedObject$3(iterated), // target
index: 0, // next index
kind: kind // kind
});
// `%ArrayIteratorPrototype%.next` method
// https://tc39.es/ecma262/#sec-%arrayiteratorprototype%.next
}, function () {
var state = getInternalState$1(this);
var target = state.target;
var kind = state.kind;
var index = state.index++;
if (!target || index >= target.length) {
state.target = undefined;
return createIterResultObject$1(undefined, true);
}
if (kind == 'keys') return createIterResultObject$1(index, false);
if (kind == 'values') return createIterResultObject$1(target[index], false);
return createIterResultObject$1([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$2('keys');
addToUnscopables$2('values');
addToUnscopables$2('entries');
// V8 ~ Chrome 45- bug
if (DESCRIPTORS$c && values.name !== 'values') try {
defineProperty$6(values, 'name', { value: 'values' });
} catch (error) { /* empty */ }
var global$h = global$y;
var DOMIterables = domIterables;
var DOMTokenListPrototype = domTokenListPrototype;
var ArrayIteratorMethods = es_array_iterator;
var createNonEnumerableProperty$4 = createNonEnumerableProperty$9;
var wellKnownSymbol$7 = wellKnownSymbol$o;
var ITERATOR$3 = wellKnownSymbol$7('iterator');
var TO_STRING_TAG = wellKnownSymbol$7('toStringTag');
var ArrayValues = ArrayIteratorMethods.values;
var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
if (CollectionPrototype) {
// some Chrome versions have non-configurable methods on DOMTokenList
if (CollectionPrototype[ITERATOR$3] !== ArrayValues) try {
createNonEnumerableProperty$4(CollectionPrototype, ITERATOR$3, ArrayValues);
} catch (error) {
CollectionPrototype[ITERATOR$3] = ArrayValues;
}
if (!CollectionPrototype[TO_STRING_TAG]) {
createNonEnumerableProperty$4(CollectionPrototype, TO_STRING_TAG, COLLECTION_NAME);
}
if (DOMIterables[COLLECTION_NAME]) for (var METHOD_NAME in ArrayIteratorMethods) {
// some Chrome versions have non-configurable methods on DOMTokenList
if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME]) try {
createNonEnumerableProperty$4(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
} catch (error) {
CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
}
}
}
};
for (var COLLECTION_NAME in DOMIterables) {
handlePrototype(global$h[COLLECTION_NAME] && global$h[COLLECTION_NAME].prototype, COLLECTION_NAME);
}
handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
var PROPER_FUNCTION_NAME = functionName.PROPER;
var fails$i = fails$I;
var whitespaces$2 = whitespaces$5;
var non = '\u200B\u0085\u180E';
// check that a method works with the correct list
// of whitespaces and has a correct name
var stringTrimForced = function (METHOD_NAME) {
return fails$i(function () {
return !!whitespaces$2[METHOD_NAME]()
|| non[METHOD_NAME]() !== non
|| (PROPER_FUNCTION_NAME && whitespaces$2[METHOD_NAME].name !== METHOD_NAME);
});
};
var $$C = _export;
var $trim = stringTrim.trim;
var forcedStringTrimMethod = stringTrimForced;
// `String.prototype.trim` method
// https://tc39.es/ecma262/#sec-string.prototype.trim
$$C({ target: 'String', proto: true, forced: forcedStringTrimMethod('trim') }, {
trim: function trim() {
return $trim(this);
}
});
var selectors = ['input:not([disabled])', 'select:not([disabled])', 'textarea:not([disabled])', 'a[href]', 'button:not([disabled])', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable="false"])'];
var tabSelectors = [].concat(selectors, ['[tabindex]:not([tabindex^="-"]):not([disabled])']);
var focusSelectors = [].concat(selectors, ['[tabindex]:not([disabled])']);
var HelpersUtil = {
/**
* Returns array of tabbable elements
* @param {HTMLElement} node container to search, default is document
* @returns {Array} returns elements that can be tabbed to using the keyboard
*/
getTabbableElements: function getTabbableElements(node) {
if (node === void 0) {
node = document;
}
return Array.from(node.querySelectorAll(tabSelectors.join(', ')));
},
/**
* Checks if a node is a tabbable element
* @param {HTMLElement} node the node to compare
* @returns {boolean} returns true or false depending on whether the node is considered tabbable or not
*/
isElementTabbable: function isElementTabbable(node) {
return node.matches(tabSelectors.join(', '));
},
getUid: function getUid() {
// Convert random number to base 36 (numbers + letters),
// and grab the first 9 characters after the decimal.
return Math.random().toString(36).slice(2, 9);
},
/**
* Returns array of focusable elements
* @param {HTMLElement} node container to search, default is document
* @returns {Array} returns elements that can receive focus
*/
getFocusableElements: function getFocusableElements(node) {
if (node === void 0) {
node = document;
}
return Array.from(node.querySelectorAll(focusSelectors.join(', ')));
},
/**
* Returns outer height of element, includes element offsetHeight
* @param {HTMLElement} node container to search
* @param {object} options
* @param {string[]} options.cssSelectors array of css properties
* @example
* const options = { cssSelectors: ['margin', 'padding'] };
* const options = { cssSelectors: ['marginTop'] };
* @returns {number} returns height value
*/
getElementOuterHeight: function getElementOuterHeight(node, options) {
if (options === void 0) {
options = null;
}
var computedNodeStyles = getComputedStyle(node);
if (!options) {
return computedNodeStyles.offsetHeight;
}
var outerHeight = node.offsetHeight;
options.cssSelectors.forEach(function (selector) {
// if no values are specified, calculate spacing for the top and bottom
if (!selector.toLowerCase().includes('top') && !selector.toLowerCase().includes('bottom')) {
outerHeight += parseInt(computedNodeStyles[selector + 'Top'], 10) + parseInt(computedNodeStyles[selector + 'Bottom'], 10);
} else if (selector.values.length > 0) {
outerHeight += parseInt(computedNodeStyles[selector], 10);
}
});
return outerHeight;
},
/**
* Returns outer width of element, includes element offsetWidth
* @param {HTMLElement} node container to search
* @param {object} options
* @param {string[]} options.cssSelectors array of css properties
* @example
* const options = { cssSelectors: ['margin', 'padding'] };
* const options = { cssSelectors: ['marginLeft'] };
* @returns {number} returns width value
*/
getElementOuterWidth: function getElementOuterWidth(node, options) {
if (options === void 0) {
options = null;
}
var computedNodeStyles = getComputedStyle(node);
if (!options) {
return computedNodeStyles.offsetWidth;
}
var outerWidth = node.offsetWidth;
options.cssSelectors.forEach(function (selector) {
// if no values are specifed, calculate spacing for the left and right
if (!selector.toLowerCase().includes('left') && !selector.toLowerCase().includes('right')) {
outerWidth += parseInt(computedNodeStyles[selector + 'Left'], 10) + parseInt(computedNodeStyles[selector + 'Right'], 10);
} else if (selector.values.length > 0) {
outerWidth += parseInt(computedNodeStyles[selector], 10);
}
});
return outerWidth;
},
/**
* Returns the value of the data-target attribute or null
* @param {HTMLElement} element element with the data-target attribute
* @returns {HTMLElement} returns the value of the data-target attribute or null
*/
getSelectorFromElement: function getSelectorFromElement(element) {
try {
var selector = element.getAttribute('data-target');
if (!selector || selector === '#') {
var hrefAttr = element.getAttribute('href');
selector = hrefAttr && hrefAttr !== '#' ? hrefAttr.trim() : '';
}
return selector;
} catch (_unused) {
return null;
}
},
/**
* Gets the offset height of the element
* @param {HTMLElement} element the element
* @returns {number} returns the offset height
*/
reflow: function reflow(element) {
return element.offsetHeight;
},
/**
* Gets the full height of the document
* May be a little dated but this seems to be an established approach
* https://javascript.info/size-and-scroll-window#width-height-of-the-document
* @returns {number} the full height of the document
*/
getDocumentHeight: function getDocumentHeight() {
return Math.max(document.body.scrollHeight, document.documentElement.scrollHeight, document.body.offsetHeight, document.documentElement.offsetHeight, document.body.clientHeight, document.documentElement.clientHeight);
}
};
// TODO: Remove from `core-js@4` since it's moved to entry points
var uncurryThis$n = functionUncurryThisClause;
var defineBuiltIn$8 = defineBuiltIn$g;
var regexpExec$1 = regexpExec$2;
var fails$h = fails$I;
var wellKnownSymbol$6 = wellKnownSymbol$o;
var createNonEnumerableProperty$3 = createNonEnumerableProperty$9;
var SPECIES$3 = wellKnownSymbol$6('species');
var RegExpPrototype = RegExp.prototype;
var fixRegexpWellKnownSymbolLogic = function (KEY, exec, FORCED, SHAM) {
var SYMBOL = wellKnownSymbol$6(KEY);
var DELEGATES_TO_SYMBOL = !fails$h(function () {
// String methods call symbol-named RegEp methods
var O = {};
O[SYMBOL] = function () { return 7; };
return ''[KEY](O) != 7;
});
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails$h(function () {
// Symbol-named RegExp methods call .exec
var execCalled = false;
var re = /a/;
if (KEY === 'split') {
// We can't use real regex here since it causes deoptimization
// and serious performance degradation in V8
// https://github.com/zloirock/core-js/issues/306
re = {};
// RegExp[@@split] doesn't call the regex's exec method, but first creates
// a new one. We need to return the patched regex when creating the new one.
re.constructor = {};
re.constructor[SPECIES$3] = function () { return re; };
re.flags = '';
re[SYMBOL] = /./[SYMBOL];
}
re.exec = function () { execCalled = true; return null; };
re[SYMBOL]('');
return !execCalled;
});
if (
!DELEGATES_TO_SYMBOL ||
!DELEGATES_TO_EXEC ||
FORCED
) {
var uncurriedNativeRegExpMethod = uncurryThis$n(/./[SYMBOL]);
var methods = exec(SYMBOL, ''[KEY], function (nativeMethod, regexp, str, arg2, forceStringMethod) {
var uncurriedNativeMethod = uncurryThis$n(nativeMethod);
var $exec = regexp.exec;
if ($exec === regexpExec$1 || $exec === RegExpPrototype.exec) {
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
// The native String method already delegates to @@method (this
// polyfilled function), leasing to infinite recursion.
// We avoid it by directly calling the native @@method method.
return { done: true, value: uncurriedNativeRegExpMethod(regexp, str, arg2) };
}
return { done: true, value: uncurriedNativeMethod(str, regexp, arg2) };
}
return { done: false };
});
defineBuiltIn$8(String.prototype, KEY, methods[0]);
defineBuiltIn$8(RegExpPrototype, SYMBOL, methods[1]);
}
if (SHAM) createNonEnumerableProperty$3(RegExpPrototype[SYMBOL], 'sham', true);
};
var charAt$6 = stringMultibyte.charAt;
// `AdvanceStringIndex` abstract operation
// https://tc39.es/ecma262/#sec-advancestringindex
var advanceStringIndex$2 = function (S, index, unicode) {
return index + (unicode ? charAt$6(S, index).length : 1);
};
var call$b = functionCall;
var anObject$8 = anObject$l;
var isCallable$b = isCallable$u;
var classof$5 = classofRaw$2;
var regexpExec = regexpExec$2;
var $TypeError$6 = TypeError;
// `RegExpExec` abstract operation
// https://tc39.es/ecma262/#sec-regexpexec
var regexpExecAbstract = function (R, S) {
var exec = R.exec;
if (isCallable$b(exec)) {
var result = call$b(exec, R, S);
if (result !== null) anObject$8(result);
return result;
}
if (classof$5(R) === 'RegExp') return call$b(regexpExec, R, S);
throw $TypeError$6('RegExp#exec called on incompatible receiver');
};
var call$a = functionCall;
var fixRegExpWellKnownSymbolLogic$1 = fixRegexpWellKnownSymbolLogic;
var anObject$7 = anObject$l;
var isNullOrUndefined$5 = isNullOrUndefined$9;
var toLength$3 = toLength$5;
var toString$9 = toString$i;
var requireObjectCoercible$5 = requireObjectCoercible$b;
var getMethod$1 = getMethod$5;
var advanceStringIndex$1 = advanceStringIndex$2;
var regExpExec$2 = regexpExecAbstract;
// @@match logic
fixRegExpWellKnownSymbolLogic$1('match', function (MATCH, nativeMatch, maybeCallNative) {
return [
// `String.prototype.match` method
// https://tc39.es/ecma262/#sec-string.prototype.match
function match(regexp) {
var O = requireObjectCoercible$5(this);
var matcher = isNullOrUndefined$5(regexp) ? undefined : getMethod$1(regexp, MATCH);
return matcher ? call$a(matcher, regexp, O) : new RegExp(regexp)[MATCH](toString$9(O));
},
// `RegExp.prototype[@@match]` method
// https://tc39.es/ecma262/#sec-regexp.prototype-@@match
function (string) {
var rx = anObject$7(this);
var S = toString$9(string);
var res = maybeCallNative(nativeMatch, rx, S);
if (res.done) return res.value;
if (!rx.global) return regExpExec$2(rx, S);
var fullUnicode = rx.unicode;
rx.lastIndex = 0;
var A = [];
var n = 0;
var result;
while ((result = regExpExec$2(rx, S)) !== null) {
var matchStr = toString$9(result[0]);
A[n] = matchStr;
if (matchStr === '') rx.lastIndex = advanceStringIndex$1(S, toLength$3(rx.lastIndex), fullUnicode);
n++;
}
return n === 0 ? null : A;
}
];
});
var ColorUtil = {
/**
* Calculates the YIQ of the color
* @param {object} rgb The RGB notation of the color
* @returns {number}
*/
getYiq: function getYiq(_ref) {
var r = _ref.r,
g = _ref.g,
b = _ref.b;
return (r * 299 + g * 587 + b * 114) / 1000;
},
/**
* Gets the RGB object notation for a string
* @param {string} str a string representing a css rgb value
* @returns {object} an object for rgb notation
*/
getRGB: function getRGB(str) {
var match = str.match(/rgba?\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\)?(?:, ?(\d\.\d?)\))?/);
return match ? {
r: match[1],
g: match[2],
b: match[3]
} : {};
}
};
// https://keycode.info/table-of-all-keycodes
var KeyboardUtil = {
keyCodes: {
ARROW_DOWN: 40,
ARROW_LEFT: 37,
ARROW_RIGHT: 39,
ARROW_UP: 38,
BACKSPACE: 8,
CLEAR: 12,
END: 35,
ENTER: 13,
ESC: 27,
HOME: 36,
PAGE_DOWN: 34,
PAGE_UP: 33,
SPACE: 32,
TAB: 9
},
// https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values
keys: {
ARROW_DOWN: 'ArrowDown',
ARROW_LEFT: 'ArrowLeft',
ARROW_RIGHT: 'ArrowRight',
ARROW_UP: 'ArrowUp',
BACKSPACE: 'Backspace',
CLEAR: 'Clear',
END: 'End',
ENTER: 'Enter',
ESC: 'Escape',
HOME: 'Home',
PAGE_DOWN: 'PageDown',
PAGE_UP: 'PageUp',
SPACE: ' ',
TAB: 'Tab'
},
getKeyCode: function getKeyCode(e) {
return e.which || e.keyCode || 0;
}
};
var NATIVE_BIND = functionBindNative;
var FunctionPrototype$1 = Function.prototype;
var apply$6 = FunctionPrototype$1.apply;
var call$9 = FunctionPrototype$1.call;
// eslint-disable-next-line es/no-reflect -- safe
var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call$9.bind(apply$6) : function () {
return call$9.apply(apply$6, arguments);
});
var uncurryThis$m = functionUncurryThis;
var toObject$2 = toObject$b;
var floor$3 = Math.floor;
var charAt$5 = uncurryThis$m(''.charAt);
var replace$7 = uncurryThis$m(''.replace);
var stringSlice$5 = uncurryThis$m(''.slice);
// eslint-disable-next-line redos/no-vulnerable -- safe
var SUBSTITUTION_SYMBOLS = /$([$&'`]|\d{1,2}|<[^>]*>)/g;
var SUBSTITUTION_SYMBOLS_NO_NAMED = /$([$&'`]|\d{1,2})/g;
// `GetSubstitution` abstract operation
// https://tc39.es/ecma262/#sec-getsubstitution
var getSubstitution$1 = function (matched, str, position, captures, namedCaptures, replacement) {
var tailPos = position + matched.length;
var m = captures.length;
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
if (namedCaptures !== undefined) {
namedCaptures = toObject$2(namedCaptures);
symbols = SUBSTITUTION_SYMBOLS;
}
return replace$7(replacement, symbols, function (match, ch) {
var capture;
switch (charAt$5(ch, 0)) {
case '$': return '$';
case '&': return matched;
case '`': return stringSlice$5(str, 0, position);
case "'": return stringSlice$5(str, tailPos);
case '<':
capture = namedCaptures[stringSlice$5(ch, 1, -1)];
break;
default: // \d\d?
var n = +ch;
if (n === 0) return match;
if (n > m) {
var f = floor$3(n / 10);
if (f === 0) return match;
if (f <= m) return captures[f - 1] === undefined ? charAt$5(ch, 1) : captures[f - 1] + charAt$5(ch, 1);
return match;
}
capture = captures[n - 1];
}
return capture === undefined ? '' : capture;
});
};
var apply$5 = functionApply;
var call$8 = functionCall;
var uncurryThis$l = functionUncurryThis;
var fixRegExpWellKnownSymbolLogic = fixRegexpWellKnownSymbolLogic;
var fails$g = fails$I;
var anObject$6 = anObject$l;
var isCallable$a = isCallable$u;
var isNullOrUndefined$4 = isNullOrUndefined$9;
var toIntegerOrInfinity$3 = toIntegerOrInfinity$7;
var toLength$2 = toLength$5;
var toString$8 = toString$i;
var requireObjectCoercible$4 = requireObjectCoercible$b;
var advanceStringIndex = advanceStringIndex$2;
var getMethod = getMethod$5;
var getSubstitution = getSubstitution$1;
var regExpExec$1 = regexpExecAbstract;
var wellKnownSymbol$5 = wellKnownSymbol$o;
var REPLACE = wellKnownSymbol$5('replace');
var max$2 = Math.max;
var min$3 = Math.min;
var concat = uncurryThis$l([].concat);
var push$6 = uncurryThis$l([].push);
var stringIndexOf = uncurryThis$l(''.indexOf);
var stringSlice$4 = uncurryThis$l(''.slice);
var maybeToString = function (it) {
return it === undefined ? it : String(it);
};
// IE <= 11 replaces $0 with the whole match, as if it was $&
// https://stackoverflow.com/questions/6024666/getting-ie-to-replace-a-regex-with-the-literal-string-0
var REPLACE_KEEPS_$0 = (function () {
// eslint-disable-next-line regexp/prefer-escape-replacement-dollar-char -- required for testing
return 'a'.replace(/./, '$0') === '$0';
})();
// Safari <= 13.0.3(?) substitutes nth capture where n>m with an empty string
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = (function () {
if (/./[REPLACE]) {
return /./[REPLACE]('a', '$0') === '';
}
return false;
})();
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails$g(function () {
var re = /./;
re.exec = function () {
var result = [];
result.groups = { a: '7' };
return result;
};
// eslint-disable-next-line regexp/no-useless-dollar-replacements -- false positive
return ''.replace(re, '$') !== '7';
});
// @@replace logic
fixRegExpWellKnownSymbolLogic('replace', function (_, nativeReplace, maybeCallNative) {
var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? '$' : '$0';
return [
// `String.prototype.replace` method
// https://tc39.es/ecma262/#sec-string.prototype.replace
function replace(searchValue, replaceValue) {
var O = requireObjectCoercible$4(this);
var replacer = isNullOrUndefined$4(searchValue) ? undefined : getMethod(searchValue, REPLACE);
return replacer
? call$8(replacer, searchValue, O, replaceValue)
: call$8(nativeReplace, toString$8(O), searchValue, replaceValue);
},
// `RegExp.prototype[@@replace]` method
// https://tc39.es/ecma262/#sec-regexp.prototype-@@replace
function (string, replaceValue) {
var rx = anObject$6(this);
var S = toString$8(string);
if (
typeof replaceValue == 'string' &&
stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 &&
stringIndexOf(replaceValue, '$<') === -1
) {
var res = maybeCallNative(nativeReplace, rx, S, replaceValue);
if (res.done) return res.value;
}
var functionalReplace = isCallable$a(replaceValue);
if (!functionalReplace) replaceValue = toString$8(replaceValue);
var global = rx.global;
if (global) {
var fullUnicode = rx.unicode;
rx.lastIndex = 0;
}
var results = [];
while (true) {
var result = regExpExec$1(rx, S);
if (result === null) break;
push$6(results, result);
if (!global) break;
var matchStr = toString$8(result[0]);
if (matchStr === '') rx.lastIndex = advanceStringIndex(S, toLength$2(rx.lastIndex), fullUnicode);
}
var accumulatedResult = '';
var nextSourcePosition = 0;
for (var i = 0; i < results.length; i++) {
result = results[i];
var matched = toString$8(result[0]);
var position = max$2(min$3(toIntegerOrInfinity$3(result.index), S.length), 0);
var captures = [];
// NOTE: This is equivalent to
// captures = result.slice(1).map(maybeToString)
// but for some reason `nativeSlice.call(result, 1, result.length)` (called in
// the slice polyfill when slicing native arrays) "doesn't work" in safari 9 and
// causes a crash (https://pastebin.com/N21QzeQA) when trying to debug it.
for (var j = 1; j < result.length; j++) push$6(captures, maybeToString(result[j]));
var namedCaptures = result.groups;
if (functionalReplace) {
var replacerArgs = concat([matched], captures, position, S);
if (namedCaptures !== undefined) push$6(replacerArgs, namedCaptures);
var replacement = toString$8(apply$5(replaceValue, undefined, replacerArgs));
} else {
replacement = getSubstitution(matched, S, position, captures, namedCaptures, replaceValue);
}
if (position >= nextSourcePosition) {
accumulatedResult += stringSlice$4(S, nextSourcePosition, position) + replacement;
nextSourcePosition = position + matched.length;
}
}
return accumulatedResult + stringSlice$4(S, nextSourcePosition);
}
];
}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
var StringUtil = {
/**
* Interpolate a string.
* @param {string} template - The template string to interpolate, with keys in the format %{key}.
* @param {object} data - An object containing the keys and values to replace in the template.
* @returns {string} - The interpolated string.
*/
interpolateString: function interpolateString(template, data) {
return template.replace(/%{(\w+)}/g, function (match, key) {
if (Object.prototype.hasOwnProperty.call(data, key)) {
return data[key];
}
// %{key} not found, show a warning in the console and return an empty string
// eslint-disable-next-line no-console
console.warn("Template error, %{" + key + "} not found:", template);
return '';
});
}
};
/* eslint-disable es/no-array-prototype-indexof -- required for testing */
var $$B = _export;
var uncurryThis$k = functionUncurryThisClause;
var $indexOf = arrayIncludes.indexOf;
var arrayMethodIsStrict$4 = arrayMethodIsStrict$7;
var nativeIndexOf = uncurryThis$k([].indexOf);
var NEGATIVE_ZERO$1 = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
var FORCED$4 = NEGATIVE_ZERO$1 || !arrayMethodIsStrict$4('indexOf');
// `Array.prototype.indexOf` method
// https://tc39.es/ecma262/#sec-array.prototype.indexof
$$B({ target: 'Array', proto: true, forced: FORCED$4 }, {
indexOf: function indexOf(searchElement /* , fromIndex = 0 */) {
var fromIndex = arguments.length > 1 ? arguments[1] : undefined;
return NEGATIVE_ZERO$1
// convert -0 to +0
? nativeIndexOf(this, searchElement, fromIndex) || 0
: $indexOf(this, searchElement, fromIndex);
}
});
var tryToString$2 = tryToString$5;
var $TypeError$5 = TypeError;
var deletePropertyOrThrow$2 = function (O, P) {
if (!delete O[P]) throw $TypeError$5('Cannot delete property ' + tryToString$2(P) + ' of ' + tryToString$2(O));
};
var $$A = _export;
var toObject$1 = toObject$b;
var toAbsoluteIndex$1 = toAbsoluteIndex$4;
var toIntegerOrInfinity$2 = toIntegerOrInfinity$7;
var lengthOfArrayLike$4 = lengthOfArrayLike$b;
var setArrayLength = arraySetLength;
var doesNotExceedSafeInteger = doesNotExceedSafeInteger$3;
var arraySpeciesCreate = arraySpeciesCreate$3;
var createProperty$1 = createProperty$5;
var deletePropertyOrThrow$1 = deletePropertyOrThrow$2;
var arrayMethodHasSpeciesSupport$1 = arrayMethodHasSpeciesSupport$5;
var HAS_SPECIES_SUPPORT$1 = arrayMethodHasSpeciesSupport$1('splice');
var max$1 = Math.max;
var min$2 = Math.min;
// `Array.prototype.splice` method
// https://tc39.es/ecma262/#sec-array.prototype.splice
// with adding support of @@species
$$A({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT$1 }, {
splice: function splice(start, deleteCount /* , ...items */) {
var O = toObject$1(this);
var len = lengthOfArrayLike$4(O);
var actualStart = toAbsoluteIndex$1(start, len);
var argumentsLength = arguments.length;
var insertCount, actualDeleteCount, A, k, from, to;
if (argumentsLength === 0) {
insertCount = actualDeleteCount = 0;
} else if (argumentsLength === 1) {
insertCount = 0;
actualDeleteCount = len - actualStart;
} else {
insertCount = argumentsLength - 2;
actualDeleteCount = min$2(max$1(toIntegerOrInfinity$2(deleteCount), 0), len - actualStart);
}
doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
A = arraySpeciesCreate(O, actualDeleteCount);
for (k = 0; k < actualDeleteCount; k++) {
from = actualStart + k;
if (from in O) createProperty$1(A, k, O[from]);
}
A.length = actualDeleteCount;
if (insertCount < actualDeleteCount) {
for (k = actualStart; k < len - actualDeleteCount; k++) {
from = k + actualDeleteCount;
to = k + insertCount;
if (from in O) O[to] = O[from];
else deletePropertyOrThrow$1(O, to);
}
for (k = len; k > len - actualDeleteCount + insertCount; k--) deletePropertyOrThrow$1(O, k - 1);
} else if (insertCount > actualDeleteCount) {
for (k = len - actualDeleteCount; k > actualStart; k--) {
from = k + actualDeleteCount - 1;
to = k + insertCount - 1;
if (from in O) O[to] = O[from];
else deletePropertyOrThrow$1(O, to);
}
}
for (k = 0; k < insertCount; k++) {
O[k + actualStart] = arguments[k + 2];
}
setArrayLength(O, len - actualDeleteCount + insertCount);
return A;
}
});
var EventName$N = {
ON_REMOVE: 'onRemove'
};
var focusControls = [];
/**
* Class representing Focus Controls.
* Solve for Firefox bug where following on-page anchor links loses focus:
* https://bugzilla.mozilla.org/show_bug.cgi?id=308064
* https://bugzilla.mozilla.org/show_bug.cgi?id=277178
*/
var FocusControls = /*#__PURE__*/function () {
/**
* Create a FocusControls instance
* @param {Object} opts - The focus control options.
* @param {HTMLElement} opts.el - The anchor element node, must have href attribute with fragment identifier.
*/
function FocusControls(opts) {
var _this = this;
this.el = opts.el;
this.target = document.querySelector(this.el.getAttribute('href'));
this.events = [{
el: this.el,
type: 'click',
handler: function handler(e) {
_this.onClick(e);
}
}];
// Add event handlers.
InitializationUtil.addEvents(this.events);
focusControls.push(this);
}
/**
* Click event.
* @param {Event} e - The event object.
*/
var _proto = FocusControls.prototype;
_proto.onClick = function onClick(e) {
e.preventDefault();
// removes focus if target element is already focused (for voiceover on mobile)
if (document.activeElement === this.target) {
document.activeElement.blur();
}
this.target.focus();
this.target.scrollIntoView();
}
/**
* Remove the focus controls and events.
*/;
_proto.remove = function remove() {
// Remove event handlers
InitializationUtil.removeEvents(this.events);
// Remove this focus controls reference from array of instances
var index = focusControls.indexOf(this);
focusControls.splice(index, 1);
// Create and dispatch custom event
this[EventName$N.ON_REMOVE] = new CustomEvent(EventName$N.ON_REMOVE, {
bubbles: true
});
this.el.dispatchEvent(this[EventName$N.ON_REMOVE]);
}
/**
* Get an array of focus controls instances.
* @returns {Object[]} Array of focus controls instances.
*/;
FocusControls.getInstances = function getInstances() {
return focusControls;
};
return FocusControls;
}();
var global$g = global$y;
var fails$f = fails$I;
var uncurryThis$j = functionUncurryThis;
var toString$7 = toString$i;
var trim = stringTrim.trim;
var whitespaces$1 = whitespaces$5;
var charAt$4 = uncurryThis$j(''.charAt);
var $parseFloat$1 = global$g.parseFloat;
var Symbol$1 = global$g.Symbol;
var ITERATOR$2 = Symbol$1 && Symbol$1.iterator;
var FORCED$3 = 1 / $parseFloat$1(whitespaces$1 + '-0') !== -Infinity
// MS Edge 18- broken with boxed symbols
|| (ITERATOR$2 && !fails$f(function () { $parseFloat$1(Object(ITERATOR$2)); }));
// `parseFloat` method
// https://tc39.es/ecma262/#sec-parsefloat-string
var numberParseFloat = FORCED$3 ? function parseFloat(string) {
var trimmedString = trim(toString$7(string));
var result = $parseFloat$1(trimmedString);
return result === 0 && charAt$4(trimmedString, 0) == '-' ? -0 : result;
} : $parseFloat$1;
var $$z = _export;
var $parseFloat = numberParseFloat;
// `parseFloat` method
// https://tc39.es/ecma262/#sec-parsefloat-string
$$z({ global: true, forced: parseFloat != $parseFloat }, {
parseFloat: $parseFloat
});
/* global Bun -- Deno case */
var engineIsBun = typeof Bun == 'function' && Bun && typeof Bun.version == 'string';
var $TypeError$4 = TypeError;
var validateArgumentsLength$5 = function (passed, required) {
if (passed < required) throw $TypeError$4('Not enough arguments');
return passed;
};
var global$f = global$y;
var apply$4 = functionApply;
var isCallable$9 = isCallable$u;
var ENGINE_IS_BUN = engineIsBun;
var USER_AGENT = engineUserAgent;
var arraySlice$5 = arraySlice$7;
var validateArgumentsLength$4 = validateArgumentsLength$5;
var Function$2 = global$f.Function;
// dirty IE9- and Bun 0.3.0- checks
var WRAP = /MSIE .\./.test(USER_AGENT) || ENGINE_IS_BUN && (function () {
var version = global$f.Bun.version.split('.');
return version.length < 3 || version[0] == 0 && (version[1] < 3 || version[1] == 3 && version[2] == 0);
})();
// IE9- / Bun 0.3.0- setTimeout / setInterval / setImmediate additional parameters fix
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#timers
// https://github.com/oven-sh/bun/issues/1633
var schedulersFix$2 = function (scheduler, hasTimeArg) {
var firstParamIndex = hasTimeArg ? 2 : 1;
return WRAP ? function (handler, timeout /* , ...arguments */) {
var boundArgs = validateArgumentsLength$4(arguments.length, 1) > firstParamIndex;
var fn = isCallable$9(handler) ? handler : Function$2(handler);
var params = boundArgs ? arraySlice$5(arguments, firstParamIndex) : [];
var callback = boundArgs ? function () {
apply$4(fn, this, params);
} : fn;
return hasTimeArg ? scheduler(callback, timeout) : scheduler(callback);
} : scheduler;
};
var $$y = _export;
var global$e = global$y;
var schedulersFix$1 = schedulersFix$2;
var setInterval = schedulersFix$1(global$e.setInterval, true);
// Bun / IE9- setInterval additional parameters fix
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-setinterval
$$y({ global: true, bind: true, forced: global$e.setInterval !== setInterval }, {
setInterval: setInterval
});
var $$x = _export;
var global$d = global$y;
var schedulersFix = schedulersFix$2;
var setTimeout$1 = schedulersFix(global$d.setTimeout, true);
// Bun / IE9- setTimeout additional parameters fix
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-settimeout
$$x({ global: true, bind: true, forced: global$d.setTimeout !== setTimeout$1 }, {
setTimeout: setTimeout$1
});
var TRANSITION_END = 'transitionend';
/**
* Gets the transition duration from an element's styles
* @param {HTMLElement} element - element
* @returns {number} - transition duration in milliseconds
*/
var getTransitionDurationFromElement = function getTransitionDurationFromElement(element) {
var MILLISECONDS_MULTIPLIER = 1000;
if (!element) {
return 0;
}
// Get transition-duration of the element
var transitionDuration = getComputedStyle(element)['transition-duration'];
var transitionDelay = getComputedStyle(element)['transition-delay'];
var floatTransitionDuration = parseFloat(transitionDuration);
var floatTransitionDelay = parseFloat(transitionDelay);
// Return 0 if element or transition duration is not found
if (!floatTransitionDuration && !floatTransitionDelay) {
return 0;
}
// If multiple durations are defined, take the first
transitionDuration = transitionDuration.split(',')[0];
transitionDelay = transitionDelay.split(',')[0];
return (parseFloat(transitionDuration) + parseFloat(transitionDelay)) * MILLISECONDS_MULTIPLIER;
};
/**
* Dispatches a transition-end event.
* @param {HTMLElement} element - element on which to dispatch event
*/
var triggerTransitionEnd = function triggerTransitionEnd(element) {
element.dispatchEvent(new Event(TRANSITION_END));
};
/**
* Ensures transition-end is triggered on an element.
* @param {HTMLElement} element - element on which transition occurs
* @param {number} duration - transition duration in milliseconds
*/
var emulateTransitionEnd = function emulateTransitionEnd(element, duration) {
if (duration === void 0) {
duration = 0;
}
var called = false;
var durationPadding = 5;
var emulatedDuration = duration + durationPadding;
function listener() {
called = true;
element.removeEventListener(TRANSITION_END, listener);
}
element.addEventListener(TRANSITION_END, listener);
setTimeout(function () {
if (!called) {
triggerTransitionEnd(element);
}
}, emulatedDuration);
};
var TransitionUtil = {
TRANSITION_END: TRANSITION_END,
getTransitionDurationFromElement: getTransitionDurationFromElement,
triggerTransitionEnd: triggerTransitionEnd,
emulateTransitionEnd: emulateTransitionEnd
};
var Util$1 = Object.assign({}, DetectionUtil, HelpersUtil, InitializationUtil, ColorUtil, KeyboardUtil, StringUtil, {
FocusControls: FocusControls
}, TransitionUtil);
// TODO: Remove from `core-js@4`
var $$w = _export;
var uncurryThis$i = functionUncurryThis;
var $Date = Date;
var thisTimeValue$1 = uncurryThis$i($Date.prototype.getTime);
// `Date.now` method
// https://tc39.es/ecma262/#sec-date.now
$$w({ target: 'Date', stat: true }, {
now: function now() {
return thisTimeValue$1(new $Date());
}
});
/* eslint-disable no-undefined,no-param-reassign,no-shadow */
/**
* Throttle execution of a function. Especially useful for rate limiting
* execution of handlers on events like resize and scroll.
*
* @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher)
* are most useful.
* @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through,
* as-is, to `callback` when the throttled-function is executed.
* @param {object} [options] - An object to configure options.
* @param {boolean} [options.noTrailing] - Optional, defaults to false. If noTrailing is true, callback will only execute every `delay` milliseconds
* while the throttled-function is being called. If noTrailing is false or unspecified, callback will be executed
* one final time after the last throttled-function call. (After the throttled-function has not been called for
* `delay` milliseconds, the internal counter is reset).
* @param {boolean} [options.noLeading] - Optional, defaults to false. If noLeading is false, the first throttled-function call will execute callback
* immediately. If noLeading is true, the first the callback execution will be skipped. It should be noted that
* callback will never executed if both noLeading = true and noTrailing = true.
* @param {boolean} [options.debounceMode] - If `debounceMode` is true (at begin), schedule `clear` to execute after `delay` ms. If `debounceMode` is
* false (at end), schedule `callback` to execute after `delay` ms.
*
* @returns {Function} A new, throttled, function.
*/
function throttle(delay, callback, options) {
var _ref = options || {},
_ref$noTrailing = _ref.noTrailing,
noTrailing = _ref$noTrailing === void 0 ? false : _ref$noTrailing,
_ref$noLeading = _ref.noLeading,
noLeading = _ref$noLeading === void 0 ? false : _ref$noLeading,
_ref$debounceMode = _ref.debounceMode,
debounceMode = _ref$debounceMode === void 0 ? undefined : _ref$debounceMode;
/*
* After wrapper has stopped being called, this timeout ensures that
* `callback` is executed at the proper times in `throttle` and `end`
* debounce modes.
*/
var timeoutID;
var cancelled = false; // Keep track of the last time `callback` was executed.
var lastExec = 0; // Function to clear existing timeout
function clearExistingTimeout() {
if (timeoutID) {
clearTimeout(timeoutID);
}
} // Function to cancel next exec
function cancel(options) {
var _ref2 = options || {},
_ref2$upcomingOnly = _ref2.upcomingOnly,
upcomingOnly = _ref2$upcomingOnly === void 0 ? false : _ref2$upcomingOnly;
clearExistingTimeout();
cancelled = !upcomingOnly;
}
/*
* The `wrapper` function encapsulates all of the throttling / debouncing
* functionality and when executed will limit the rate at which `callback`
* is executed.
*/
function wrapper() {
for (var _len = arguments.length, arguments_ = new Array(_len), _key = 0; _key < _len; _key++) {
arguments_[_key] = arguments[_key];
}
var self = this;
var elapsed = Date.now() - lastExec;
if (cancelled) {
return;
} // Execute `callback` and update the `lastExec` timestamp.
function exec() {
lastExec = Date.now();
callback.apply(self, arguments_);
}
/*
* If `debounceMode` is true (at begin) this is used to clear the flag
* to allow future `callback` executions.
*/
function clear() {
timeoutID = undefined;
}
if (!noLeading && debounceMode && !timeoutID) {
/*
* Since `wrapper` is being called for the first time and
* `debounceMode` is true (at begin), execute `callback`
* and noLeading != true.
*/
exec();
}
clearExistingTimeout();
if (debounceMode === undefined && elapsed > delay) {
if (noLeading) {
/*
* In throttle mode with noLeading, if `delay` time has
* been exceeded, update `lastExec` and schedule `callback`
* to execute after `delay` ms.
*/
lastExec = Date.now();
if (!noTrailing) {
timeoutID = setTimeout(debounceMode ? clear : exec, delay);
}
} else {
/*
* In throttle mode without noLeading, if `delay` time has been exceeded, execute
* `callback`.
*/
exec();
}
} else if (noTrailing !== true) {
/*
* In trailing throttle mode, since `delay` time has not been
* exceeded, schedule `callback` to execute `delay` ms after most
* recent execution.
*
* If `debounceMode` is true (at begin), schedule `clear` to execute
* after `delay` ms.
*
* If `debounceMode` is false (at end), schedule `callback` to
* execute after `delay` ms.
*/
timeoutID = setTimeout(debounceMode ? clear : exec, debounceMode === undefined ? delay - elapsed : delay);
}
}
wrapper.cancel = cancel; // Return the wrapper function.
return wrapper;
}
/* eslint-disable no-undefined */
/**
* Debounce execution of a function. Debouncing, unlike throttling,
* guarantees that a function is only executed a single time, either at the
* very beginning of a series of calls, or at the very end.
*
* @param {number} delay - A zero-or-greater delay in milliseconds. For event callbacks, values around 100 or 250 (or even higher) are most useful.
* @param {Function} callback - A function to be executed after delay milliseconds. The `this` context and all arguments are passed through, as-is,
* to `callback` when the debounced-function is executed.
* @param {object} [options] - An object to configure options.
* @param {boolean} [options.atBegin] - Optional, defaults to false. If atBegin is false or unspecified, callback will only be executed `delay` milliseconds
* after the last debounced-function call. If atBegin is true, callback will be executed only at the first debounced-function call.
* (After the throttled-function has not been called for `delay` milliseconds, the internal counter is reset).
*
* @returns {Function} A new, debounced function.
*/
function debounce(delay, callback, options) {
var _ref = options || {},
_ref$atBegin = _ref.atBegin,
atBegin = _ref$atBegin === void 0 ? false : _ref$atBegin;
return throttle(delay, callback, {
debounceMode: atBegin !== false
});
}
var Selector$N = {
MEDIA_CONTROL: 'media-control',
M365_VIDEO_CONTROL: 'm365-video__control',
PAUSE_GLYPH_CLASS: 'glyph-prepend-pause',
PLAY_GLYPH_CLASS: 'glyph-prepend-play-solid',
PAUSE_ALT_TEXT_PREFIX: 'data-aria-label-pause-prefix',
PLAY_ALT_TEXT_PREFIX: 'data-aria-label-play-prefix',
ARIA_LABEL_SUFFIX: 'data-aria-label-suffix',
DATA_MOUNT: '[data-mount="m365-video"]',
CONTENT_SCROLL_VIEW: 'ContentScrollView'
};
/**
* Swaps out videos to serve specific video sources for certain min-widths.
*/
var AdaptiveVideo = /*#__PURE__*/function () {
/**
* Adds responsiveness to a video by taking different sources specified for min-widths and swapping them out on window resize.
* @param {HTMLElement} videoElement Video element to add responsiveness to
*/
function AdaptiveVideo(videoElement, onViewportChange) {
var _this = this;
this.resizeTimeout = 100;
this.options = {
breakpoints: {
"default": {
src: videoElement.dataset.src
}
},
onViewportChange: onViewportChange
};
this.setVideo(videoElement);
// get a list of video switching points and links to the videos themselves
videoElement.querySelectorAll('[data-src]').forEach(function (element) {
_this.options.breakpoints[element.dataset.minWidth] = {
src: element.dataset.src,
type: element.getAttribute('type')
};
});
videoElement.innerHTML = ''; // we clean up so that there is nothing superfluous
// run the handler and track the change in screen width
this.responseVideo(this.options, videoElement.autoplay);
this.resizer();
this.onViewportChange();
}
/**
* Changes the video element this object applies viewport changes to.
* @param {HTMLElement} videoElement Video element to assign to this class
*/
var _proto = AdaptiveVideo.prototype;
_proto.setVideo = function setVideo(videoElement) {
this.options.videoElement = videoElement;
}
/**
* Binds a function to be called when the video is changed due to a viewport change.
* @param {Function} callback Function to call on video viewport change
*/;
_proto.bindViewportChange = function bindViewportChange(callback) {
this.options.onViewportChange = callback;
}
/**
* Event for when the video changes due to viewport changes
*/;
_proto.onViewportChange = function onViewportChange() {
this.options.onViewportChange(this.options.videoElement);
}
/** Function runs on resize */;
_proto.resizer = function resizer() {
window.addEventListener('resize', throttle(this.resizeTimeout, this.responseVideo.bind(this, this.options)));
}
/**
* Tests a value to see if it is NaN.
* @param {Number} number value to test
* @returns True if NaN or null, false otherwise.
*/;
_proto.numberIsNaN = function numberIsNaN(number) {
return !number || isNaN(number) || !isFinite(number);
}
/**
* Gets the last recorded min width used for the video
* @param {HTMLElement} videoElement Video element
* @returns The last recorded min width for the video
*/;
_proto.getWidthNow = function getWidthNow(videoElement) {
var ret = videoElement.dataset.widthNow;
var numberValue = parseInt(ret, 10);
if (!this.numberIsNaN(numberValue)) {
ret = numberValue;
} else if (ret !== 'default') {
ret = null;
}
return ret;
};
_proto.onCanPlayThrough = function onCanPlayThrough(time, videoElement, playOnLoad, paused, ended) {
if (!this.numberIsNaN(time)) {
videoElement.currentTime = time; // set the time on the video to the current time of the last video
}
// play or pause the video based on the state of the old video element
if (!playOnLoad) {
if (!paused && !ended) {
videoElement.play();
} else {
videoElement.pause();
}
}
}
/**
* Change src value of video link to fit screen width
*
* @param {Object} options object with options
*/;
_proto.responseVideo = function responseVideo(options, playOnLoad) {
var _this2 = this;
if (playOnLoad === void 0) {
playOnLoad = false;
}
var videoElement = options.videoElement,
breakpoints = options.breakpoints; // get options
var currentTime = videoElement.currentTime,
paused = videoElement.paused,
ended = videoElement.ended,
parentElement = videoElement.parentElement; // get video info
var videoElementClone = videoElement.cloneNode(true); // create new video element for viewport
var videoSource = document.createElement('source');
var widthNow = this.getWidthNow(videoElement); // get the last video min width
var minBreakpoint = Math.max.apply(null, Object.keys(breakpoints).filter(function (key) {
return Number(key) <= document.body.clientWidth;
}));
// find maximum width from breakpoints that doesn't go over the width of the window
var nowBreakpoint = this.numberIsNaN(minBreakpoint) ? 'default' : minBreakpoint; // choose either the maximum value, if not, then the default
// call back for function needed as a const so that it can be removed later.
var canPlayThroughCallback = function canPlayThroughCallback() {
_this2.onCanPlayThrough(currentTime, videoElementClone, playOnLoad, paused, ended);
videoElementClone.removeEventListener('canplaythrough', canPlayThroughCallback);
};
if (widthNow && widthNow === nowBreakpoint) {
return;
} // check if the video needs to be changed
videoElementClone.innerHTML = ''; // we clean up so that there is nothing superfluous
videoElementClone.dataset.widthNow = nowBreakpoint; // flag the new viewport
videoElementClone.addEventListener('canplaythrough', canPlayThroughCallback); // add callback to seek video to previous time once loaded to that point
videoSource.src = breakpoints[nowBreakpoint].src; // set the source for the new viewport video
videoSource.type = breakpoints[nowBreakpoint].type;
videoElementClone.append(videoSource); // add the source to the new video element
parentElement.append(videoElementClone); // append the new video element
videoElement.remove(); // remove the old video element
this.setVideo(videoElementClone); // save new video element
this.onViewportChange(); // inform other objects of the new video element
};
return AdaptiveVideo;
}();
/**
* Used to determine when a video is visible and ready to be loaded.
*/
var VideoLazyLoader = /*#__PURE__*/function () {
/**
* Constructor
* @param {Object} opts Options for the lazy loader
*/
function VideoLazyLoader(opts) {
var _window$top$document;
this.scrollTimeout = 100;
this.shown = false;
var video = opts.video,
onShown = opts.onShown;
this.video = video;
this.onShown = onShown;
this.contentScrollViewEle = (_window$top$document = window.top.document) == null ? void 0 : _window$top$document.getElementById(Selector$N.CONTENT_SCROLL_VIEW);
this.viewportThreshold = this.video.dataset.videoInviewport ? 0.5 : 0;
if (this.isScrolledIntoView(this.viewportThreshold)) {
this.onShown();
} else {
this.bindEvents();
}
}
/**
* Determines if video is scrolled into view
* @param {Number} options number with options, threshold value is between 0 and 1.
* @returns true if visible
*/
var _proto2 = VideoLazyLoader.prototype;
_proto2.isScrolledIntoView = function isScrolledIntoView(viewportThreshold) {
if (viewportThreshold === void 0) {
viewportThreshold = 0;
}
var _this$video$getBoundi = this.video.getBoundingClientRect(),
top = _this$video$getBoundi.top,
height = _this$video$getBoundi.height;
var browserHeight = window.innerHeight;
// If the window's document is not the root of the HTML (usually in edit/preview mode), then
// window.innerHeight will not contain the necessary scroll element
// and the ContentScrollView needs to be used instead.
if (window !== window.top && this.contentScrollViewEle) {
// ContentScrollView's client height is the equivalent to the window.innerHeight
browserHeight = this.contentScrollViewEle.clientHeight;
// ContentScrollView's scrollTop is the equivalent to the amount scrolled
browserHeight += this.contentScrollViewEle.scrollTop;
}
return viewportThreshold ? top + height * viewportThreshold <= browserHeight : top <= browserHeight;
}
/**
* Determines if the video is visible. If it is, it fires the onShown event
* videoInViewport determines fires the onShown event when the half of video visible in viewport.
*/;
_proto2.scrollThrottleFunction = function scrollThrottleFunction() {
if (!this.shown && this.isScrolledIntoView(this.viewportThreshold)) {
this.shown = true;
this.onShown();
}
}
/**
* Binds the window events needed to determine if video should be loaded
*/;
_proto2.bindEvents = function bindEvents() {
var scrolledThrottleFunction = throttle(this.scrollTimeout, this.scrollThrottleFunction.bind(this));
// If the window's document is not the root of the HTML (usually in edit/preview mode), then
// window will not contain any elements that actually scroll, so
// the scroll event listener is attached to the document's element that actually scrolls
if (window !== window.top && this.contentScrollViewEle) {
this.contentScrollViewEle.addEventListener('scroll', scrolledThrottleFunction);
} else {
window.addEventListener('scroll', scrolledThrottleFunction);
}
window.addEventListener('resize', scrolledThrottleFunction);
};
return VideoLazyLoader;
}();
var VideoExtension = /*#__PURE__*/function () {
var _proto3 = VideoExtension.prototype;
_proto3._playVideo = function _playVideo() {
if (this.video.paused) {
this._toggleMediaControlGlyph('pause');
this._setAriaLabelPrefix('pause');
this.video.play();
// reset video timer if it has ended
if (this.isEnded(this.video)) {
this.video.currentTime = 0;
}
}
};
_proto3._pauseVideo = function _pauseVideo() {
if (!this.video.paused) {
this._toggleMediaControlGlyph('play');
this._setAriaLabelPrefix('play');
this.video.pause();
}
};
_proto3._setAriaLabelPrefix = function _setAriaLabelPrefix(controlType) {
if (this.mediaControlEl) {
var ariaLabelSuffix = this.mediaControlEl.getAttribute(Selector$N.ARIA_LABEL_SUFFIX);
var ariaLabelPrefix = controlType === 'pause' ? this.mediaControlEl.getAttribute(Selector$N.PAUSE_ALT_TEXT_PREFIX) : this.mediaControlEl.getAttribute(Selector$N.PLAY_ALT_TEXT_PREFIX);
this.mediaControlEl.setAttribute('aria-label', "" + (ariaLabelPrefix != null ? ariaLabelPrefix : '') + (ariaLabelSuffix != null ? ariaLabelSuffix : ''));
}
}
/**
* Toggles the video button from play to pause or visa versa
*/;
_proto3._toggleVideoButton = function _toggleVideoButton() {
if (this.video.paused) {
this._playVideo();
} else {
this._pauseVideo();
}
};
_proto3._toggleMediaControlGlyph = function _toggleMediaControlGlyph(setGlyph) {
if (this.mediaControlSpanEl) {
var pauseGlyphClass = this.mediaControlEl.dataset.pauseGlyphClass || Selector$N.PAUSE_GLYPH_CLASS;
var playGlyphClass = this.mediaControlEl.dataset.playGlyphClass || Selector$N.PLAY_GLYPH_CLASS;
if (setGlyph === 'play') {
this.mediaControlSpanEl.classList.remove(pauseGlyphClass);
this.mediaControlSpanEl.classList.add(playGlyphClass);
} else {
this.mediaControlSpanEl.classList.remove(playGlyphClass);
this.mediaControlSpanEl.classList.add(pauseGlyphClass);
}
}
}
/**
* Determines if a video is done playing
* @param {HTMLElement} video Video to test
* @returns True if the video is ended or has reached the end of its duration
*/;
_proto3.isEnded = function isEnded(video) {
return video.isEnded || video.currentTime === video.duration;
}
/**
* Attaches needed events
*/;
_proto3.attachEventsToVideo = function attachEventsToVideo() {
var _this3 = this;
// On video ended, update play/pause glyph
this.video.addEventListener('ended', function () {
if (_this3.isEnded(_this3.video)) {
_this3._toggleMediaControlGlyph('play');
_this3._setAriaLabelPrefix('play');
}
});
}
/**
* Loads video
*/;
_proto3.loadVideo = function loadVideo() {
var _this4 = this;
this.video.preload = 'auto';
this.video.autoplay = this.video.dataset.autoplay;
this.responser = new AdaptiveVideo(this.video, function (videoElement) {
_this4.video = videoElement;
_this4.attachEventsToVideo();
// If auto playing, change play glyph to pause glyph
if (_this4.video.autoplay && _this4.video.paused) {
_this4._toggleMediaControlGlyph('pause');
_this4._setAriaLabelPrefix('pause');
}
});
};
function VideoExtension(opts) {
var el = opts.el,
mediaControlSpanEl = opts.mediaControlSpanEl,
toggleVideoButton = opts.toggleVideoButton;
this.video = el.querySelector('video');
this.mediaControlEl = el.querySelector("." + Selector$N.M365_VIDEO_CONTROL) || el.querySelector("." + Selector$N.MEDIA_CONTROL);
this.events = [];
if (this.mediaControlEl) {
this.mediaControlSpanEl = mediaControlSpanEl || this.mediaControlEl.querySelector("span");
this.toggleVideoButton = toggleVideoButton || this._toggleVideoButton.bind(this);
this.events.push({
el: this.mediaControlEl,
type: 'click',
handler: this.toggleVideoButton.bind(this)
});
// initially set aria-label for media control button
this._setAriaLabelPrefix('play');
}
if (this.video.dataset.lazyload) {
this.lazyLoader = new VideoLazyLoader({
video: this.video,
onShown: this.loadVideo.bind(this)
});
} else {
this.loadVideo();
}
if (this.events.length > 0) {
Util$1.addEvents(this.events);
}
}
return VideoExtension;
}();
var $$v = _export;
var $find = arrayIteration.find;
var addToUnscopables$1 = addToUnscopables$4;
var FIND = 'find';
var SKIPS_HOLES$1 = true;
// Shouldn't skip holes
// eslint-disable-next-line es/no-array-prototype-find -- testing
if (FIND in []) Array(1)[FIND](function () { SKIPS_HOLES$1 = false; });
// `Array.prototype.find` method
// https://tc39.es/ecma262/#sec-array.prototype.find
$$v({ target: 'Array', proto: true, forced: SKIPS_HOLES$1 }, {
find: function find(callbackfn /* , that = undefined */) {
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
// https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
addToUnscopables$1(FIND);
var $$u = _export;
var uncurryThis$h = functionUncurryThisClause;
var getOwnPropertyDescriptor$2 = objectGetOwnPropertyDescriptor.f;
var toLength$1 = toLength$5;
var toString$6 = toString$i;
var notARegExp = notARegexp;
var requireObjectCoercible$3 = requireObjectCoercible$b;
var correctIsRegExpLogic = correctIsRegexpLogic;
// eslint-disable-next-line es/no-string-prototype-startswith -- safe
var nativeStartsWith = uncurryThis$h(''.startsWith);
var stringSlice$3 = uncurryThis$h(''.slice);
var min$1 = Math.min;
var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic('startsWith');
// https://github.com/zloirock/core-js/pull/702
var MDN_POLYFILL_BUG = !CORRECT_IS_REGEXP_LOGIC && !!function () {
var descriptor = getOwnPropertyDescriptor$2(String.prototype, 'startsWith');
return descriptor && !descriptor.writable;
}();
// `String.prototype.startsWith` method
// https://tc39.es/ecma262/#sec-string.prototype.startswith
$$u({ target: 'String', proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
startsWith: function startsWith(searchString /* , position = 0 */) {
var that = toString$6(requireObjectCoercible$3(this));
notARegExp(searchString);
var index = toLength$1(min$1(arguments.length > 1 ? arguments[1] : undefined, that.length));
var search = toString$6(searchString);
return nativeStartsWith
? nativeStartsWith(that, search, index)
: stringSlice$3(that, index, index + search.length) === search;
}
});
var biDirectional = Util$1.isBiDirectional();
var ClassName$u = {
SHOW: 'show',
FADE: 'fade',
FADING_OUT: 'fading-out',
ACTIVE: 'active',
FLYOUT: 'flyout'
};
var Default$5 = {
START: biDirectional ? 'right' : 'left',
END: biDirectional ? 'left' : 'right',
ALIGNMENT: 'start'
};
var DefaultReflow = {
left: ['left', 'bottom', 'top', 'right'],
right: ['right', 'bottom', 'top', 'left'],
top: ['top', 'right', 'bottom', 'left'],
bottom: ['bottom', 'right', 'top', 'left']
};
/**
* Private functions
*/
function _hasReflow(node) {
if (node.hasAttribute('data-disable-reflow') && node.getAttribute('data-disable-reflow') !== 'false') {
return false;
}
return true;
}
/**
* Get the placement of a flyout.
* @param {string?} str - The string to parse.
* @param {string} [defaultValue=start] - The default value to fallback to.
* @returns {string} The placement of the flyout.
*/
function _getPlacement(str, defaultValue) {
if (defaultValue === void 0) {
defaultValue = Default$5.END;
}
switch (str) {
case 'top':
case 'bottom':
return str;
case 'left':
case 'start':
return Default$5.START;
case 'right':
case 'end':
return Default$5.END;
default:
return defaultValue;
}
}
/**
* Get the alignment of a flyout.
* @param {string?} str - The string to parse.
* @param {string} [defaultValue=start] - The default value to fallback to.
* @returns {string} The alignment enum of the flyout.
*/
function _getAlignment(str, defaultValue) {
if (defaultValue === void 0) {
defaultValue = Default$5.ALIGNMENT;
}
switch (str) {
case 'center':
case 'start':
case 'end':
return str;
default:
return defaultValue;
}
}
/**
* Get the related menu for an element.
* @param {HTMLElement} node - The element to find a related menu for, typically the flyout instance target.
* @returns {HTMLElement?} The menu element.
*/
function _getRelatedMenu(node) {
if (node.attributes['aria-controls']) {
return document.querySelector("#" + node.attributes['aria-controls'].value);
}
}
/**
* Get the X distance for menu positioning.
* @param {string} textAlignment - The text alignment of the flyout's parent. Affects the left/right CSS positioning, therefore changes the translate coordinates.
* @param {string} placement - Menu's placement in relation to the flyout trigger: 'left', 'right', 'top', or 'bottom'.
* @param {string} alignment - Menu's alignment with the flyout trigger, correlates to read order: 'center', 'start', 'end'.
* @returns {number} The X distance to translate the menu.
* @this Flyout
*/
function _getTranslateX(textAlignment, placement, alignment) {
var translateX = 0;
var overflowOffset = 0;
/* eslint-disable no-lonely-if */
// If text is aligned left
if (textAlignment === 'left') {
if (placement === 'right') {
// Place menu right of trigger
translateX += this.boundingRect.el.width + this.offset;
} else if (placement === 'left') {
// Place menu left of trigger
translateX -= this.boundingRect.menu.width + this.offset;
} else {
// Adjust alignment for top and bottom menus
if (alignment === 'center') {
translateX -= (this.boundingRect.menu.width - this.boundingRect.el.width) / 2;
} else if (alignment === 'end' && !biDirectional || alignment === 'start' && biDirectional) {
translateX -= this.boundingRect.menu.width - this.boundingRect.el.width;
// Shift menu left if needed to fit menu in tiny window sizes, record offset for future use
overflowOffset = _shiftLeftToFitWindow.call(this, translateX);
translateX += overflowOffset;
} else {
// Shift menu right if needed to fit menu in tiny window sizes, record offset for future use
overflowOffset = _shiftRightToFitWindow.call(this, translateX);
translateX += overflowOffset;
}
}
// If text is aligned right
} else {
if (placement === 'right') {
translateX += this.boundingRect.menu.width + this.offset;
} else if (placement === 'left') {
translateX -= this.boundingRect.el.width + this.offset;
} else {
if (alignment === 'center') {
translateX += (this.boundingRect.menu.width - this.boundingRect.el.width) / 2;
} else if (alignment === 'start' && !biDirectional || alignment === 'end' && biDirectional) {
translateX += this.boundingRect.menu.width - this.boundingRect.el.width;
// Shift menu right if needed to fit menu in tiny window sizes, record offset for future use
overflowOffset = _shiftRightToFitWindow.call(this, translateX);
translateX += overflowOffset;
} else {
// Shift menu left if needed to fit menu in tiny window sizes, record offset for future use
overflowOffset = _shiftLeftToFitWindow.call(this, translateX);
translateX += overflowOffset;
}
}
}
/* eslint-enable no-lonely-if */
// Save any overflowOffset (rounded) to the instance for later use
this.overflowOffset = Math.round(overflowOffset);
return translateX;
}
/**
* Returns distance in pixels needed to prevent overflow on the right side of the window.
* @returns {number} The distance in pixels to shift the menu left.
*/
function _shiftLeftToFitWindow() {
var xOverflow = this.boundingRect.window.width - (this.boundingRect.el.x + this.boundingRect.el.width) + this.boundingRect.menu.width;
return xOverflow > this.boundingRect.window.width ? xOverflow - this.boundingRect.window.width : 0;
}
/**
* Returns distance in pixels needed to prevent overflow on the left side of the window.
* @returns {number} The distance in pixels to shift the menu right.
*/
function _shiftRightToFitWindow() {
var xOverflow = this.boundingRect.el.x + this.boundingRect.menu.width;
return xOverflow > this.boundingRect.window.width ? -(xOverflow - this.boundingRect.window.width) : 0;
}
/**
* Get the Y distance for menu positioning.
* @param {string} placement - Menu's placement in relation to the flyout trigger: 'left', 'right', 'top', or 'bottom'.
* @param {string} alignment - Menu's alignment with the flyout trigger, correlates to read order: 'center', 'start', 'end'.
* @returns {number} The Y distance to translate the menu.
* @this Flyout
*/
function _getTranslateY(placement, alignment) {
var translateY = 0;
// Place menu above trigger
if (placement === 'top') {
translateY -= this.boundingRect.menu.height + this.offset;
// Place menu below trigger
} else if (placement === 'bottom') {
translateY += this.boundingRect.el.height + this.offset;
} else {
// Adjust alignment for left and right menus
/* eslint-disable no-lonely-if */
if (alignment === 'center') {
translateY -= (this.boundingRect.menu.height - this.boundingRect.el.height) / 2;
} else if (alignment === 'end') {
translateY -= this.boundingRect.menu.height - this.boundingRect.el.height;
}
/* eslint-enable no-lonely-if */
}
return translateY;
}
var Flyout = /*#__PURE__*/function () {
/**
* Create a Flyout instance
* @param {Object} opts - The flyout options
* @param {HTMLElement} opts.el - The element that toggles the flyout
* @param {HTMLElement} [opts.menu] - The element that defines the flyout menu
* @param {string} [opts.placement=right] - A string that defines the placement of the menu
* @param {string} [opts.alignment=start] - A string that defines the alignment of the menu
* @param {number} [opts.offset=0] - The number of pixels the menu should be offset from the trigger
* @param {boolean} [opts.enableReflow=true] - Whether the menu should reflow to fit within the window as best as possible
* @param {boolean} [opts.enableFade=true] - Whether the menu should fade in and out
*/
function Flyout(opts) {
this.el = opts.el; // the toggle
this.menu = opts.menu || _getRelatedMenu(this.el); // the flyout menu
this.parent = this.el.offsetParent || this.el.parentElement;
this.placement = _getPlacement(opts.placement || this.el.getAttribute('data-placement'));
this.alignment = _getAlignment(opts.alignment || this.el.getAttribute('data-alignment'));
this.offset = opts.offset ? parseInt(opts.offset, 10) : 0;
this.translateX = 0;
this.translateY = 0;
this.overflowOffset = 0;
this.enableReflow = typeof opts.enableReflow === 'boolean' ? opts.enableReflow : _hasReflow(this.el);
this.enableFade = typeof opts.enableFade === 'boolean' ? opts.enableFade : this.menu.classList.contains(ClassName$u.FADE);
this.shown = false;
// Ensure position is set on parent element, needed for absolute positioning of menu
var parentPositionProperty = window.getComputedStyle(this.parent).position;
if (parentPositionProperty !== 'relative' && parentPositionProperty !== 'absolute') {
this.parent.style.position = 'relative';
}
// Setup fade animation based on options supplied
if (opts.enableFade === true) {
this.menu.classList.add(ClassName$u.FADE);
} else if (opts.enableFade === false) {
this.menu.classList.remove(ClassName$u.FADE);
}
if (!this.menu.hasAttribute('tabindex')) {
this.menu.setAttribute('tabindex', '-1');
}
}
/**
* Get the current position of the menu based on enableReflow setting
* @returns {object} The instance's position object
*/
var _proto = Flyout.prototype;
/**
* Calculates and sets the reflow position value (placement and alignment)
*/
_proto.calcReflowPosition = function calcReflowPosition() {
// Calculate the distance of the trigger from each side of the window
var distFrom = {
top: this.boundingRect.el.top,
bottom: window.innerHeight - this.boundingRect.el.bottom,
left: this.boundingRect.el.left,
right: document.body.clientWidth - this.boundingRect.el.right
};
// Add the menu offset spacing to the width and height of the menu
var menuWidth = this.boundingRect.menu.width + this.offset;
var menuHeight = this.boundingRect.menu.height + this.offset;
var placements = DefaultReflow[this.placement].slice();
// Calculate the distance needed for the menu to fit inside the window
var distX = menuWidth - this.boundingRect.el.width;
var distY = menuHeight - this.boundingRect.el.height;
if (this.alignment === 'center') {
distX /= 2;
distY /= 2;
}
// Copy values so we don't override original instance property
var placement = this.placement,
alignment = this.alignment;
// Eliminate the placements that won't fit
if (distFrom.left < menuWidth) {
placements.splice(placements.indexOf('left'), 1);
}
if (distFrom.right < menuWidth) {
placements.splice(placements.indexOf('right'), 1);
}
if (distFrom.top < menuHeight) {
placements.splice(placements.indexOf('top'), 1);
}
if (distFrom.bottom < menuHeight) {
placements.splice(placements.indexOf('bottom'), 1);
}
placement = placements.length ? placements.shift() : 'bottom'; // fallback placement is always bottom
// Adjust the alignment of the chosen placement
// NOTE: Keep this logic as is for readability and sanity
if (placement === 'bottom' || placement === 'top') {
// If neither side is ideal
if (distFrom.left < distX && distFrom.right < distX) {
// Align to the Read order
alignment = 'start';
// LTR: If distFrom.left < distX
} else if (distFrom[Default$5.START] < distX) {
alignment = 'start';
} else if (distFrom[Default$5.END] <= distX) {
alignment = 'end';
}
} else {
// If placement is 'left' or 'right'
// If neither above nor below is ideal
/* eslint-disable no-lonely-if */
if (distFrom.top < distY && distFrom.bottom < distY) {
// Force the beginning of the menu content to be in view,
// which should force window to grow, enabling user to scroll to view entire menu
alignment = 'start';
} else if (distFrom.top < distY) {
alignment = 'start';
} else if (distFrom.bottom <= distY) {
alignment = 'end';
}
/* eslint-enable no-lonely-if */
}
this.reflowPosition = {
placement: placement,
alignment: alignment
};
}
/**
* Position the flyout menu
*/;
_proto.positionMenu = function positionMenu() {
if (this.enableReflow) {
this.calcReflowPosition();
}
var position = this.currentPosition;
// Get the direction of text flow (affected by cascade of text-align css property and/or RTL)
var textAlignProperty = window.getComputedStyle(this.parent).textAlign;
var textAlignment = Default$5.START;
if (textAlignProperty === 'left' || textAlignProperty === 'right') {
textAlignment = textAlignProperty;
} else if (textAlignProperty === 'end') {
textAlignment = Default$5.END;
}
// Set the transformation's "origin" based on text alignment
this.menu.style.top = Math.round(this.boundingRect.el.top - this.boundingRect.parent.top) + 'px';
if (textAlignment === 'left') {
this.menu.style.left = Math.round(this.boundingRect.el.left - this.boundingRect.parent.left) + 'px';
this.menu.style.right = 'auto';
} else {
this.menu.style.left = 'auto';
this.menu.style.right = -Math.round(this.boundingRect.el.right - this.boundingRect.parent.right) + 'px';
}
// Allow the menu to define its own width according to the needed width of its contents
this.menu.style.minWidth = Math.round(this.boundingRect.menu.width) + 'px';
// Calculate the x and y distances needed to push the menu to the correct position.
this.translateX = Math.round(_getTranslateX.call(this, textAlignment, position.placement, position.alignment));
this.translateY = Math.round(_getTranslateY.call(this, position.placement, position.alignment));
// Set the transform style
this.menu.style.transform = "translate(" + this.translateX + "px, " + this.translateY + "px)";
// Reset menu classes associated with position
this.menu.classList.remove(ClassName$u.FLYOUT + "-left", ClassName$u.FLYOUT + "-right", ClassName$u.FLYOUT + "-top", ClassName$u.FLYOUT + "-bottom", ClassName$u.FLYOUT + "-align-start", ClassName$u.FLYOUT + "-align-end", ClassName$u.FLYOUT + "-align-center");
// Set the menu classes associated with position
this.menu.classList.add(ClassName$u.FLYOUT + "-" + position.placement, ClassName$u.FLYOUT + "-align-" + position.alignment);
}
/**
* Show the menu
*/;
_proto.show = function show() {
// Record window width prior to showing the menu,
// otherwise the menu will effect the window width
var windowWidth = window.innerWidth;
this.shown = true;
this.el.classList.add(ClassName$u.ACTIVE);
this.menu.classList.add(ClassName$u.SHOW);
// Store the coordinates of the associated elements for ease of reuse now that the menu has layout
this.boundingRect = {
el: this.el.getBoundingClientRect(),
menu: this.menu.getBoundingClientRect(),
parent: this.parent.getBoundingClientRect(),
window: {
width: windowWidth
}
};
this.positionMenu();
}
/**
* Hide the menu
* @param {Object} [opts={}] - Options for hiding the menu
* @param {boolean} [opts.setFocus=true] - Whether or not the focus should be set on the toggling element; defaults to true
*/;
_proto.hide = function hide(opts) {
var _this = this;
if (opts === void 0) {
opts = {};
}
// Default behavior should be to set focus on toggling element
var setFocus = typeof opts.setFocus === 'boolean' ? opts.setFocus : true;
this.shown = false;
this.el.classList.remove(ClassName$u.ACTIVE);
this.menu.classList.remove(ClassName$u.SHOW);
// 1. Add a class that triggers a CSS animation
// 2. Create an event listener that removes the class once it's animation is complete
if (this.enableFade) {
this.menu.addEventListener('animationend', function () {
_this.menu.classList.remove(ClassName$u.FADING_OUT);
}, {
once: true
}); // 2.
this.menu.classList.add(ClassName$u.FADING_OUT); // 1.
}
if (setFocus) {
// Set focus on the toggle
this.el.focus();
}
}
/**
* Toggle the menu state
*/;
_proto.toggle = function toggle() {
if (this.shown) {
this.hide();
} else {
this.show();
}
}
/**
* Update the flyout instance
* @param {Object} [opts={}] - Options for updating the flyout instance
*/;
_proto.update = function update(opts) {
if (opts === void 0) {
opts = {};
}
// Change the placement of the menu
if (opts.placement) {
this.placement = _getPlacement(opts.placement);
}
// Change the alignment of the menu
if (opts.alignment) {
this.alignment = _getAlignment(opts.alignment);
}
// Change the offset of the menu
if (typeof opts.offset !== 'undefined') {
var offset = parseInt(opts.offset, 10);
if (!isNaN(offset)) {
this.offset = offset;
}
}
// Change whether the menu should reflow
if (typeof opts.enableReflow === 'boolean') {
this.enableReflow = opts.enableReflow;
}
// Change whether the menu should enable a fade animation
if (typeof opts.enableFade === 'boolean' && opts.enableFade !== this.enableFade) {
this.enableFade = opts.enableFade;
this.menu.classList.toggle(ClassName$u.FADE);
}
// Update the menu position if its open
if (this.shown) {
this.positionMenu();
}
};
_createClass(Flyout, [{
key: "currentPosition",
get: function get() {
var position = {
placement: this.placement,
alignment: this.alignment
};
if (this.enableReflow) {
return this.reflowPosition || position; // fallback to original position, if undefined
}
return position;
}
}]);
return Flyout;
}();
var EventName$M = {
ON_HIDE: 'onHide',
ON_SHOW: 'onShow',
ON_UPDATE: 'onUpdate',
ON_REMOVE: 'onRemove'
};
var ClassName$t = {
SHOW: 'show',
ACTIVE: 'active',
BOTTOM: 'dropdown',
TOP: 'dropup',
RIGHT: 'dropright',
LEFT: 'dropleft',
MENU_RIGHT: 'dropdown-menu-right',
MENU_LEFT: 'dropdown-menu-left'
};
var Default$4 = Object.assign({}, Default$5, {
PLACEMENT: 'bottom'
});
var dropdowns = [];
/**
* The event handler for when the target element is clicked.
* @param {MouseEvent} event - The event object.
*/
function _elOnClick(event) {
// Prevent page from trying to scroll to a page anchor.
event.preventDefault();
this.toggle();
}
/**
* The event handler for when a key is pressed on the target element.
* @param {KeyboardEvent} event - The event object.
*/
function _elOnKeydown(event) {
// Override keyboard functionality if element is an anchor.
if (event.keyCode === Util$1.keyCodes.SPACE || event.keyCode === Util$1.keyCodes.ENTER) {
// Trigger the same event as a click for consistency.
event.preventDefault();
_elOnClick.bind(this)(event);
}
// Events for when the menu is open.
if (this.shown) {
// Menu should close with the Esc key.
if (event.keyCode === Util$1.keyCodes.ESC) {
event.stopPropagation();
this.hide();
}
if (this.arrowableItems && event.keyCode === Util$1.keyCodes.ARROW_DOWN) {
// Prevent scrolling page on down arrow.
event.preventDefault();
// Set focus to first focusable element in menu.
this.arrowableItems[0].focus();
}
}
}
/**
* The event handler for when a key is pressed on the menu
* @param {KeyboardEvent} event - The event object
*/
function _menuOnKeydown$1(event) {
if (event.keyCode === Util$1.keyCodes.ESC) {
this.hide();
}
if (this.arrowableItems && (event.keyCode === Util$1.keyCodes.ARROW_DOWN || event.keyCode === Util$1.keyCodes.ARROW_UP)) {
// Prevent scrolling page on down arrow.
event.preventDefault();
if (event.keyCode === Util$1.keyCodes.ARROW_DOWN && document.activeElement !== this.arrowableItems[this.arrowableItems.length - 1]) {
// If the down key is pressed and its NOT on the last item in the list
this.arrowableItems[this.arrowableItems.indexOf(document.activeElement) + 1].focus();
} else if (event.keyCode === Util$1.keyCodes.ARROW_UP && document.activeElement !== this.arrowableItems[0]) {
// If the up key is pressed and its NOT on the first item in the list
this.arrowableItems[this.arrowableItems.indexOf(document.activeElement) - 1].focus();
} else {
this.hide();
}
}
}
/**
* The event handler for when mousedown is triggered on the document.
* Happens before mouseup, click, and focusin to control closing of the menu without conflicting with other events.
* @param {Event} event - The event object
*/
function _documentOnMousedown(event) {
if (this.shown && !this.menu.contains(event.target) && !this.el.contains(event.target)) {
this.hide({
setFocus: false
});
}
}
/**
* The event handler for when the document receives focus
* @param {Event} event - The event object
*/
function _documentOnFocusin(event) {
if (this.shown && !this.menu.contains(event.target)) {
this.hide();
}
}
/**
* Get the placement of a dropdown from the parent node class
* @param {HTMLElement} node - The element to check for a placement class
* @returns {string?} The placement of the dropdown
*/
function _getPlacementFromClass(node) {
for (var i = 0; i < node.classList.length; i++) {
switch (node.classList[i]) {
case ClassName$t.BOTTOM:
return 'bottom';
case ClassName$t.TOP:
return 'top';
case ClassName$t.LEFT:
return 'start';
case ClassName$t.RIGHT:
return 'end';
}
}
}
/**
* Apply the correct `drop{direction}` class according to the placement
* @param {HTMLElement} node - The element to apply the class to
*/
function _updatePlacementClass(node, placement) {
var className = ClassName$t[placement.toUpperCase()];
node.classList.remove(ClassName$t.BOTTOM, ClassName$t.TOP, ClassName$t.RIGHT, ClassName$t.LEFT);
node.classList.add(className);
}
var Dropdown = /*#__PURE__*/function (_Flyout) {
_inheritsLoose(Dropdown, _Flyout);
/**
* Create a Dropdown instance (inheriting Flyout)
* @param {Object} opts - The flyout options
* @param {HTMLElement} opts.el - The element that toggles the flyout
* @param {HTMLElement} [opts.menu] - The element that defines the flyout menu
* @param {string} [opts.placement=bottom] - A string that defines the placement of the menu
* @param {string} [opts.alignment=start] - A string that defines the alignment of the menu
* @param {number} [opts.offset=0] - The number of pixels the menu should be offset from the trigger
* @param {boolean} [opts.enableReflow=true] - Whether the menu should reflow to fit within the window as best as possible
*/
function Dropdown(opts) {
var _this;
// Set super options
var flyoutOpts = Object.assign({}, opts);
var parent = flyoutOpts.el.offsetParent || flyoutOpts.el.parentElement;
var placementFromClass = _getPlacementFromClass(parent);
flyoutOpts.placement = opts.placement || placementFromClass || flyoutOpts.el.getAttribute('data-placement') || Default$4.PLACEMENT;
flyoutOpts.enableFade = false;
_this = _Flyout.call(this, flyoutOpts) || this;
// Dropdown-specific setup
// Ensure `drop` class matches the placement of the menu
// Invert
var invertedPlacement = _getPlacement(_this.placement, Default$4.PLACEMENT);
_updatePlacementClass(_this.parent, invertedPlacement);
if (_this.menu.nodeName.toLowerCase() === 'ul' || _this.menu.nodeName.toLowerCase() === 'ol') {
_this.arrowableItems = Util$1.getTabbableElements(_this.menu);
}
// Add event handlers.
_this.events = [{
el: _this.el,
type: 'click',
handler: _elOnClick.bind(_assertThisInitialized(_this))
}, {
el: _this.el,
type: 'keydown',
handler: _elOnKeydown.bind(_assertThisInitialized(_this))
}, {
el: _this.menu,
type: 'keydown',
handler: _menuOnKeydown$1.bind(_assertThisInitialized(_this))
}, {
el: document,
type: 'mousedown',
handler: _documentOnMousedown.bind(_assertThisInitialized(_this))
}, {
el: document,
type: 'focusin',
handler: _documentOnFocusin.bind(_assertThisInitialized(_this))
}];
Util$1.addEvents(_this.events);
// Add mutation observers.
_this.menuObserver = new MutationObserver(_this.update.bind(_assertThisInitialized(_this)));
_this.menuObserver.observe(_this.menu, {
childList: true,
subtree: true
});
dropdowns.push(_assertThisInitialized(_this));
return _this;
}
/**
* Show the menu
*/
var _proto = Dropdown.prototype;
_proto.show = function show() {
// Create and dispatch custom event
this[EventName$M.ON_SHOW] = new CustomEvent(EventName$M.ON_SHOW, {
bubbles: true,
cancelable: true
});
this.el.dispatchEvent(this[EventName$M.ON_SHOW]);
if (this[EventName$M.ON_SHOW].defaultPrevented) {
return;
}
_Flyout.prototype.show.call(this);
this.el.setAttribute('aria-expanded', this.shown);
}
/**
* Hide the menu
* @param {Object} [opts={}] - Options for hiding the menu
* @param {boolean} [opts.setFocus=true] - Whether or not the focus should be set on the toggling element; defaults to true
*/;
_proto.hide = function hide(opts) {
if (opts === void 0) {
opts = {};
}
// Create and dispatch custom event
this[EventName$M.ON_HIDE] = new CustomEvent(EventName$M.ON_HIDE, {
bubbles: true,
cancelable: true
});
this.el.dispatchEvent(this[EventName$M.ON_HIDE]);
if (this[EventName$M.ON_HIDE].defaultPrevented) {
return;
}
_Flyout.prototype.hide.call(this, opts);
this.el.setAttribute('aria-expanded', this.shown);
}
/**
* Update the dropdown instance
* @param {Object} [opts={}] - Options for updating the instance
*/;
_proto.update = function update(opts) {
if (opts === void 0) {
opts = {};
}
var flyoutOpts = Object.assign({}, opts);
flyoutOpts.enableFade = false; // disable flyout fade feature
if (typeof this.arrowableItems !== 'undefined') {
// Update the list of known focusable items within the menu.
this.arrowableItems = Util$1.getTabbableElements(this.menu);
}
if (opts.placement) {
flyoutOpts.placement = _getPlacement(opts.placement, Default$4.PLACEMENT);
}
_Flyout.prototype.update.call(this, flyoutOpts);
// Invert dropleft/dropright classes that switch orientation in RTL
var invertedPlacement = _getPlacement(this.placement, Default$4.PLACEMENT);
_updatePlacementClass(this.parent, invertedPlacement);
// Create and dispatch custom event
this[EventName$M.ON_UPDATE] = new CustomEvent(EventName$M.ON_UPDATE, {
bubbles: true
});
this.el.dispatchEvent(this[EventName$M.ON_UPDATE]);
}
/**
* Remove the dropdown instance
*/;
_proto.remove = function remove() {
// Remove event handlers, observers, etc.
Util$1.removeEvents(this.events);
// Remove this reference from the array of instances
var index = dropdowns.indexOf(this);
dropdowns.splice(index, 1);
// Create and dispatch custom event
this[EventName$M.ON_REMOVE] = new CustomEvent(EventName$M.ON_REMOVE, {
bubbles: true
});
this.el.dispatchEvent(this[EventName$M.ON_REMOVE]);
}
/**
* Get an array of dropdown instances
* @returns {Object[]} Array of dropdown instances
*/;
Dropdown.getInstances = function getInstances() {
return dropdowns;
};
return Dropdown;
}(Flyout);
var $$t = _export;
var DESCRIPTORS$b = descriptors;
var defineProperty$5 = objectDefineProperty.f;
// `Object.defineProperty` method
// https://tc39.es/ecma262/#sec-object.defineproperty
// eslint-disable-next-line es/no-object-defineproperty -- safe
$$t({ target: 'Object', stat: true, forced: Object.defineProperty !== defineProperty$5, sham: !DESCRIPTORS$b }, {
defineProperty: defineProperty$5
});
var internalMetadata = {exports: {}};
var objectGetOwnPropertyNamesExternal = {};
var toAbsoluteIndex = toAbsoluteIndex$4;
var lengthOfArrayLike$3 = lengthOfArrayLike$b;
var createProperty = createProperty$5;
var $Array = Array;
var max = Math.max;
var arraySliceSimple = function (O, start, end) {
var length = lengthOfArrayLike$3(O);
var k = toAbsoluteIndex(start, length);
var fin = toAbsoluteIndex(end === undefined ? length : end, length);
var result = $Array(max(fin - k, 0));
for (var n = 0; k < fin; k++, n++) createProperty(result, n, O[k]);
result.length = n;
return result;
};
/* eslint-disable es/no-object-getownpropertynames -- safe */
var classof$4 = classofRaw$2;
var toIndexedObject$2 = toIndexedObject$a;
var $getOwnPropertyNames = objectGetOwnPropertyNames.f;
var arraySlice$4 = arraySliceSimple;
var windowNames = typeof window == 'object' && window && Object.getOwnPropertyNames
? Object.getOwnPropertyNames(window) : [];
var getWindowNames = function (it) {
try {
return $getOwnPropertyNames(it);
} catch (error) {
return arraySlice$4(windowNames);
}
};
// fallback for IE11 buggy Object.getOwnPropertyNames with iframe and window
objectGetOwnPropertyNamesExternal.f = function getOwnPropertyNames(it) {
return windowNames && classof$4(it) == 'Window'
? getWindowNames(it)
: $getOwnPropertyNames(toIndexedObject$2(it));
};
// FF26- bug: ArrayBuffers are non-extensible, but Object.isExtensible does not report it
var fails$e = fails$I;
var arrayBufferNonExtensible = fails$e(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 });
}
});
var fails$d = fails$I;
var isObject$8 = isObject$l;
var classof$3 = classofRaw$2;
var ARRAY_BUFFER_NON_EXTENSIBLE = arrayBufferNonExtensible;
// eslint-disable-next-line es/no-object-isextensible -- safe
var $isExtensible = Object.isExtensible;
var FAILS_ON_PRIMITIVES = fails$d(function () { $isExtensible(1); });
// `Object.isExtensible` method
// https://tc39.es/ecma262/#sec-object.isextensible
var objectIsExtensible = (FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE) ? function isExtensible(it) {
if (!isObject$8(it)) return false;
if (ARRAY_BUFFER_NON_EXTENSIBLE && classof$3(it) == 'ArrayBuffer') return false;
return $isExtensible ? $isExtensible(it) : true;
} : $isExtensible;
var fails$c = fails$I;
var freezing = !fails$c(function () {
// eslint-disable-next-line es/no-object-isextensible, es/no-object-preventextensions -- required for testing
return Object.isExtensible(Object.preventExtensions({}));
});
var $$s = _export;
var uncurryThis$g = functionUncurryThis;
var hiddenKeys = hiddenKeys$5;
var isObject$7 = isObject$l;
var hasOwn$9 = hasOwnProperty_1;
var defineProperty$4 = objectDefineProperty.f;
var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
var getOwnPropertyNamesExternalModule = objectGetOwnPropertyNamesExternal;
var isExtensible$1 = objectIsExtensible;
var uid = uid$3;
var FREEZING$1 = freezing;
var REQUIRED = false;
var METADATA = uid('meta');
var id$1 = 0;
var setMetadata = function (it) {
defineProperty$4(it, METADATA, { value: {
objectID: 'O' + id$1++, // object ID
weakData: {} // weak collections IDs
} });
};
var fastKey$1 = function (it, create) {
// return a primitive with prefix
if (!isObject$7(it)) return typeof it == 'symbol' ? it : (typeof it == 'string' ? 'S' : 'P') + it;
if (!hasOwn$9(it, METADATA)) {
// can't set metadata to uncaught frozen object
if (!isExtensible$1(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$1 = function (it, create) {
if (!hasOwn$9(it, METADATA)) {
// can't set metadata to uncaught frozen object
if (!isExtensible$1(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$1 && REQUIRED && isExtensible$1(it) && !hasOwn$9(it, METADATA)) setMetadata(it);
return it;
};
var enable = function () {
meta.enable = function () { /* empty */ };
REQUIRED = true;
var getOwnPropertyNames = getOwnPropertyNamesModule.f;
var splice = uncurryThis$g([].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;
};
$$s({ target: 'Object', stat: true, forced: true }, {
getOwnPropertyNames: getOwnPropertyNamesExternalModule.f
});
}
};
var meta = internalMetadata.exports = {
enable: enable,
fastKey: fastKey$1,
getWeakData: getWeakData$1,
onFreeze: onFreeze
};
hiddenKeys[METADATA] = true;
var internalMetadataExports = internalMetadata.exports;
var bind$6 = functionBindContext;
var call$7 = functionCall;
var anObject$5 = anObject$l;
var tryToString$1 = tryToString$5;
var isArrayIteratorMethod = isArrayIteratorMethod$2;
var lengthOfArrayLike$2 = lengthOfArrayLike$b;
var isPrototypeOf$2 = objectIsPrototypeOf;
var getIterator$1 = getIterator$3;
var getIteratorMethod$1 = getIteratorMethod$4;
var iteratorClose = iteratorClose$2;
var $TypeError$3 = TypeError;
var Result = function (stopped, result) {
this.stopped = stopped;
this.result = result;
};
var ResultPrototype = Result.prototype;
var iterate$5 = 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$6(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$5(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$1(iterable);
if (!iterFn) throw $TypeError$3(tryToString$1(iterable) + ' is not iterable');
// optimisation for array iterators
if (isArrayIteratorMethod(iterFn)) {
for (index = 0, length = lengthOfArrayLike$2(iterable); length > index; index++) {
result = callFn(iterable[index]);
if (result && isPrototypeOf$2(ResultPrototype, result)) return result;
} return new Result(false);
}
iterator = getIterator$1(iterable, iterFn);
}
next = IS_RECORD ? iterable.next : iterator.next;
while (!(step = call$7(next, iterator)).done) {
try {
result = callFn(step.value);
} catch (error) {
iteratorClose(iterator, 'throw', error);
}
if (typeof result == 'object' && result && isPrototypeOf$2(ResultPrototype, result)) return result;
} return new Result(false);
};
var isPrototypeOf$1 = objectIsPrototypeOf;
var $TypeError$2 = TypeError;
var anInstance$8 = function (it, Prototype) {
if (isPrototypeOf$1(Prototype, it)) return it;
throw $TypeError$2('Incorrect invocation');
};
var $$r = _export;
var global$c = global$y;
var uncurryThis$f = functionUncurryThis;
var isForced$1 = isForced_1;
var defineBuiltIn$7 = defineBuiltIn$g;
var InternalMetadataModule$1 = internalMetadataExports;
var iterate$4 = iterate$5;
var anInstance$7 = anInstance$8;
var isCallable$8 = isCallable$u;
var isNullOrUndefined$3 = isNullOrUndefined$9;
var isObject$6 = isObject$l;
var fails$b = fails$I;
var checkCorrectnessOfIteration$1 = checkCorrectnessOfIteration$3;
var setToStringTag$4 = setToStringTag$7;
var inheritIfRequired$2 = inheritIfRequired$4;
var collection$3 = 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 = global$c[CONSTRUCTOR_NAME];
var NativePrototype = NativeConstructor && NativeConstructor.prototype;
var Constructor = NativeConstructor;
var exported = {};
var fixMethod = function (KEY) {
var uncurriedNativeMethod = uncurryThis$f(NativePrototype[KEY]);
defineBuiltIn$7(NativePrototype, KEY,
KEY == 'add' ? function add(value) {
uncurriedNativeMethod(this, value === 0 ? 0 : value);
return this;
} : KEY == 'delete' ? function (key) {
return IS_WEAK && !isObject$6(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
} : KEY == 'get' ? function get(key) {
return IS_WEAK && !isObject$6(key) ? undefined : uncurriedNativeMethod(this, key === 0 ? 0 : key);
} : KEY == 'has' ? function has(key) {
return IS_WEAK && !isObject$6(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
} : function set(key, value) {
uncurriedNativeMethod(this, key === 0 ? 0 : key, value);
return this;
}
);
};
var REPLACE = isForced$1(
CONSTRUCTOR_NAME,
!isCallable$8(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails$b(function () {
new NativeConstructor().entries().next();
}))
);
if (REPLACE) {
// create collection constructor
Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
InternalMetadataModule$1.enable();
} else if (isForced$1(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$b(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$1(function (iterable) { new NativeConstructor(iterable); });
// for early implementations -0 and +0 not the same
var BUGGY_ZERO = !IS_WEAK && fails$b(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$7(dummy, NativePrototype);
var that = inheritIfRequired$2(new NativeConstructor(), dummy, Constructor);
if (!isNullOrUndefined$3(iterable)) iterate$4(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;
$$r({ global: true, constructor: true, forced: Constructor != NativeConstructor }, exported);
setToStringTag$4(Constructor, CONSTRUCTOR_NAME);
if (!IS_WEAK) common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
return Constructor;
};
var makeBuiltIn = makeBuiltInExports;
var defineProperty$3 = objectDefineProperty;
var defineBuiltInAccessor$6 = function (target, name, descriptor) {
if (descriptor.get) makeBuiltIn(descriptor.get, name, { getter: true });
if (descriptor.set) makeBuiltIn(descriptor.set, name, { setter: true });
return defineProperty$3.f(target, name, descriptor);
};
var defineBuiltIn$6 = defineBuiltIn$g;
var defineBuiltIns$4 = function (target, src, options) {
for (var key in src) defineBuiltIn$6(target, key, src[key], options);
return target;
};
var getBuiltIn$9 = getBuiltIn$e;
var defineBuiltInAccessor$5 = defineBuiltInAccessor$6;
var wellKnownSymbol$4 = wellKnownSymbol$o;
var DESCRIPTORS$a = descriptors;
var SPECIES$2 = wellKnownSymbol$4('species');
var setSpecies$2 = function (CONSTRUCTOR_NAME) {
var Constructor = getBuiltIn$9(CONSTRUCTOR_NAME);
if (DESCRIPTORS$a && Constructor && !Constructor[SPECIES$2]) {
defineBuiltInAccessor$5(Constructor, SPECIES$2, {
configurable: true,
get: function () { return this; }
});
}
};
var create$3 = objectCreate;
var defineBuiltInAccessor$4 = defineBuiltInAccessor$6;
var defineBuiltIns$3 = defineBuiltIns$4;
var bind$5 = functionBindContext;
var anInstance$6 = anInstance$8;
var isNullOrUndefined$2 = isNullOrUndefined$9;
var iterate$3 = iterate$5;
var defineIterator = iteratorDefine;
var createIterResultObject = createIterResultObject$3;
var setSpecies$1 = setSpecies$2;
var DESCRIPTORS$9 = descriptors;
var fastKey = internalMetadataExports.fastKey;
var InternalStateModule$5 = internalState;
var setInternalState$5 = InternalStateModule$5.set;
var internalStateGetterFor$1 = InternalStateModule$5.getterFor;
var collectionStrong$2 = {
getConstructor: function (wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
var Constructor = wrapper(function (that, iterable) {
anInstance$6(that, Prototype);
setInternalState$5(that, {
type: CONSTRUCTOR_NAME,
index: create$3(null),
first: undefined,
last: undefined,
size: 0
});
if (!DESCRIPTORS$9) that.size = 0;
if (!isNullOrUndefined$2(iterable)) iterate$3(iterable, that[ADDER], { that: that, AS_ENTRIES: IS_MAP });
});
var Prototype = Constructor.prototype;
var getInternalState = internalStateGetterFor$1(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: undefined,
removed: false
};
if (!state.first) state.first = entry;
if (previous) previous.next = entry;
if (DESCRIPTORS$9) 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$3(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 data = state.index;
var entry = state.first;
while (entry) {
entry.removed = true;
if (entry.previous) entry.previous = entry.previous.next = undefined;
delete data[entry.index];
entry = entry.next;
}
state.first = state.last = undefined;
if (DESCRIPTORS$9) 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$9) 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$5(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$3(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$9) defineBuiltInAccessor$4(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$1(CONSTRUCTOR_NAME);
var getInternalIteratorState = internalStateGetterFor$1(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$5(this, {
type: ITERATOR_NAME,
target: iterated,
state: getInternalCollectionState(iterated),
kind: kind,
last: undefined
});
}, 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 = undefined;
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$1(CONSTRUCTOR_NAME);
}
};
var collection$2 = collection$3;
var collectionStrong$1 = collectionStrong$2;
// `Map` constructor
// https://tc39.es/ecma262/#sec-map-objects
collection$2('Map', function (init) {
return function Map() { return init(this, arguments.length ? arguments[0] : undefined); };
}, collectionStrong$1);
var arraySlice$3 = arraySliceSimple;
var floor$2 = Math.floor;
var mergeSort = function (array, comparefn) {
var length = array.length;
var middle = floor$2(length / 2);
return length < 8 ? insertionSort(array, comparefn) : merge(
array,
mergeSort(arraySlice$3(array, 0, middle), comparefn),
mergeSort(arraySlice$3(array, middle), comparefn),
comparefn
);
};
var insertionSort = function (array, comparefn) {
var length = array.length;
var i = 1;
var element, j;
while (i < length) {
j = i;
element = array[i];
while (j && comparefn(array[j - 1], element) > 0) {
array[j] = array[--j];
}
if (j !== i++) array[j] = element;
} return array;
};
var merge = function (array, left, right, comparefn) {
var llength = left.length;
var rlength = right.length;
var lindex = 0;
var rindex = 0;
while (lindex < llength || rindex < rlength) {
array[lindex + rindex] = (lindex < llength && rindex < rlength)
? comparefn(left[lindex], right[rindex]) <= 0 ? left[lindex++] : right[rindex++]
: lindex < llength ? left[lindex++] : right[rindex++];
} return array;
};
var arraySort$1 = mergeSort;
var userAgent$5 = engineUserAgent;
var firefox = userAgent$5.match(/firefox\/(\d+)/i);
var engineFfVersion = !!firefox && +firefox[1];
var UA = engineUserAgent;
var engineIsIeOrEdge = /MSIE|Trident/.test(UA);
var userAgent$4 = engineUserAgent;
var webkit = userAgent$4.match(/AppleWebKit\/(\d+)\./);
var engineWebkitVersion = !!webkit && +webkit[1];
var $$q = _export;
var uncurryThis$e = functionUncurryThis;
var aCallable$4 = aCallable$a;
var toObject = toObject$b;
var lengthOfArrayLike$1 = lengthOfArrayLike$b;
var deletePropertyOrThrow = deletePropertyOrThrow$2;
var toString$5 = toString$i;
var fails$a = fails$I;
var internalSort = arraySort$1;
var arrayMethodIsStrict$3 = arrayMethodIsStrict$7;
var FF = engineFfVersion;
var IE_OR_EDGE = engineIsIeOrEdge;
var V8 = engineV8Version;
var WEBKIT = engineWebkitVersion;
var test = [];
var nativeSort = uncurryThis$e(test.sort);
var push$5 = uncurryThis$e(test.push);
// IE8-
var FAILS_ON_UNDEFINED = fails$a(function () {
test.sort(undefined);
});
// V8 bug
var FAILS_ON_NULL = fails$a(function () {
test.sort(null);
});
// Old WebKit
var STRICT_METHOD$3 = arrayMethodIsStrict$3('sort');
var STABLE_SORT = !fails$a(function () {
// feature detection can be too slow, so check engines versions
if (V8) return V8 < 70;
if (FF && FF > 3) return;
if (IE_OR_EDGE) return true;
if (WEBKIT) return WEBKIT < 603;
var result = '';
var code, chr, value, index;
// generate an array with more 512 elements (Chakra and old V8 fails only in this case)
for (code = 65; code < 76; code++) {
chr = String.fromCharCode(code);
switch (code) {
case 66: case 69: case 70: case 72: value = 3; break;
case 68: case 71: value = 4; break;
default: value = 2;
}
for (index = 0; index < 47; index++) {
test.push({ k: chr + index, v: value });
}
}
test.sort(function (a, b) { return b.v - a.v; });
for (index = 0; index < test.length; index++) {
chr = test[index].k.charAt(0);
if (result.charAt(result.length - 1) !== chr) result += chr;
}
return result !== 'DGBEFHACIJK';
});
var FORCED$2 = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD$3 || !STABLE_SORT;
var getSortCompare = function (comparefn) {
return function (x, y) {
if (y === undefined) return -1;
if (x === undefined) return 1;
if (comparefn !== undefined) return +comparefn(x, y) || 0;
return toString$5(x) > toString$5(y) ? 1 : -1;
};
};
// `Array.prototype.sort` method
// https://tc39.es/ecma262/#sec-array.prototype.sort
$$q({ target: 'Array', proto: true, forced: FORCED$2 }, {
sort: function sort(comparefn) {
if (comparefn !== undefined) aCallable$4(comparefn);
var array = toObject(this);
if (STABLE_SORT) return comparefn === undefined ? nativeSort(array) : nativeSort(array, comparefn);
var items = [];
var arrayLength = lengthOfArrayLike$1(array);
var itemsLength, index;
for (index = 0; index < arrayLength; index++) {
if (index in array) push$5(items, array[index]);
}
internalSort(items, getSortCompare(comparefn));
itemsLength = lengthOfArrayLike$1(items);
index = 0;
while (index < itemsLength) array[index] = items[index++];
while (index < arrayLength) deletePropertyOrThrow(array, index++);
return array;
}
});
var $$p = _export;
var $map = arrayIteration.map;
var arrayMethodHasSpeciesSupport = arrayMethodHasSpeciesSupport$5;
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport('map');
// `Array.prototype.map` method
// https://tc39.es/ecma262/#sec-array.prototype.map
// with adding support of @@species
$$p({ target: 'Array', proto: true, forced: !HAS_SPECIES_SUPPORT }, {
map: function map(callbackfn /* , thisArg */) {
return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
var uncurryThis$d = functionUncurryThis;
var isArray$1 = isArray$7;
var isCallable$7 = isCallable$u;
var classof$2 = classofRaw$2;
var toString$4 = toString$i;
var push$4 = uncurryThis$d([].push);
var getJsonReplacerFunction = function (replacer) {
if (isCallable$7(replacer)) return replacer;
if (!isArray$1(replacer)) return;
var rawLength = replacer.length;
var keys = [];
for (var i = 0; i < rawLength; i++) {
var element = replacer[i];
if (typeof element == 'string') push$4(keys, element);
else if (typeof element == 'number' || classof$2(element) == 'Number' || classof$2(element) == 'String') push$4(keys, toString$4(element));
}
var keysLength = keys.length;
var root = true;
return function (key, value) {
if (root) {
root = false;
return value;
}
if (isArray$1(this)) return value;
for (var j = 0; j < keysLength; j++) if (keys[j] === key) return value;
};
};
var $$o = _export;
var getBuiltIn$8 = getBuiltIn$e;
var apply$3 = functionApply;
var call$6 = functionCall;
var uncurryThis$c = functionUncurryThis;
var fails$9 = fails$I;
var isCallable$6 = isCallable$u;
var isSymbol = isSymbol$4;
var arraySlice$2 = arraySlice$7;
var getReplacerFunction = getJsonReplacerFunction;
var NATIVE_SYMBOL = symbolConstructorDetection;
var $String = String;
var $stringify = getBuiltIn$8('JSON', 'stringify');
var exec$3 = uncurryThis$c(/./.exec);
var charAt$3 = uncurryThis$c(''.charAt);
var charCodeAt$1 = uncurryThis$c(''.charCodeAt);
var replace$6 = uncurryThis$c(''.replace);
var numberToString$1 = uncurryThis$c(1.0.toString);
var tester = /[\uD800-\uDFFF]/g;
var low = /^[\uD800-\uDBFF]$/;
var hi = /^[\uDC00-\uDFFF]$/;
var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails$9(function () {
var symbol = getBuiltIn$8('Symbol')();
// MS Edge converts symbol values to JSON as {}
return $stringify([symbol]) != '[null]'
// WebKit converts symbol values to JSON as null
|| $stringify({ a: symbol }) != '{}'
// V8 throws on boxed symbols
|| $stringify(Object(symbol)) != '{}';
});
// https://github.com/tc39/proposal-well-formed-stringify
var ILL_FORMED_UNICODE = fails$9(function () {
return $stringify('\uDF06\uD834') !== '"\\udf06\\ud834"'
|| $stringify('\uDEAD') !== '"\\udead"';
});
var stringifyWithSymbolsFix = function (it, replacer) {
var args = arraySlice$2(arguments);
var $replacer = getReplacerFunction(replacer);
if (!isCallable$6($replacer) && (it === undefined || isSymbol(it))) return; // IE8 returns string on undefined
args[1] = function (key, value) {
// some old implementations (like WebKit) could pass numbers as keys
if (isCallable$6($replacer)) value = call$6($replacer, this, $String(key), value);
if (!isSymbol(value)) return value;
};
return apply$3($stringify, null, args);
};
var fixIllFormed = function (match, offset, string) {
var prev = charAt$3(string, offset - 1);
var next = charAt$3(string, offset + 1);
if ((exec$3(low, match) && !exec$3(hi, next)) || (exec$3(hi, match) && !exec$3(low, prev))) {
return '\\u' + numberToString$1(charCodeAt$1(match, 0), 16);
} return match;
};
if ($stringify) {
// `JSON.stringify` method
// https://tc39.es/ecma262/#sec-json.stringify
$$o({ target: 'JSON', stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
// eslint-disable-next-line no-unused-vars -- required for `.length`
stringify: function stringify(it, replacer, space) {
var args = arraySlice$2(arguments);
var result = apply$3(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
return ILL_FORMED_UNICODE && typeof result == 'string' ? replace$6(result, tester, fixIllFormed) : result;
}
});
}
var DESCRIPTORS$8 = descriptors;
var uncurryThis$b = functionUncurryThis;
var objectKeys = objectKeys$3;
var toIndexedObject$1 = toIndexedObject$a;
var $propertyIsEnumerable = objectPropertyIsEnumerable.f;
var propertyIsEnumerable = uncurryThis$b($propertyIsEnumerable);
var push$3 = uncurryThis$b([].push);
// `Object.{ entries, values }` methods implementation
var createMethod$1 = function (TO_ENTRIES) {
return function (it) {
var O = toIndexedObject$1(it);
var keys = objectKeys(O);
var length = keys.length;
var i = 0;
var result = [];
var key;
while (length > i) {
key = keys[i++];
if (!DESCRIPTORS$8 || propertyIsEnumerable(O, key)) {
push$3(result, TO_ENTRIES ? [key, O[key]] : O[key]);
}
}
return result;
};
};
var objectToArray = {
// `Object.entries` method
// https://tc39.es/ecma262/#sec-object.entries
entries: createMethod$1(true),
// `Object.values` method
// https://tc39.es/ecma262/#sec-object.values
values: createMethod$1(false)
};
var $$n = _export;
var $values = objectToArray.values;
// `Object.values` method
// https://tc39.es/ecma262/#sec-object.values
$$n({ target: 'Object', stat: true }, {
values: function values(O) {
return $values(O);
}
});
var Selector$M = {
DATA_MOUNT: '[data-mount="sticky"]',
SHOW_STUCK: '.sticky-show-stuck',
HIDE_STUCK: '.sticky-hide-stuck'
};
var ClassName$s = {
STICKY: 'sticky',
STUCK: 'stuck',
GET_HEIGHT: 'get-height',
STICKY_TOP: 'sticky-direction-top',
STICKY_BOTTOM: 'sticky-direction-bottom'
};
var Direction$4 = {
TOP: 'top',
BOTTOM: 'bottom'
};
var EventName$L = {
ON_STUCK: 'onSticky',
ON_UNSTUCK: 'onStatic',
ON_UPDATE: 'onUpdate',
ON_REMOVE: 'onRemove',
RESIZE: 'resize'
};
var Default$3 = {
DIRECTION: 'top',
EXTRA_SCROLL_PADDING: 12
};
/**
* @enum {string}
*/
var ObserverBehavior$2 = {
ALWAYS: 'always',
OFF: 'off',
SIZE_AWARE: 'size-aware'
};
var stickies$2 = [];
/**
* Private functions.
*/
/**
* Get the direction of the sticky.
* @param {string} str - The string to parse.
* @param {string} [defaultValue="top"] - The default value to fallback to.
* @returns {string} The direction of the sticky.
*/
function _getDirection$2(str, defaultValue) {
if (defaultValue === void 0) {
defaultValue = Default$3.DIRECTION;
}
switch (str) {
case 'top':
case 'bottom':
return str;
default:
return defaultValue;
}
}
/**
* Class representing a Sticky element.
*/
var _init$1 = /*#__PURE__*/_classPrivateFieldLooseKey("init");
var _setUp = /*#__PURE__*/_classPrivateFieldLooseKey("setUp");
var _getObserverBehavior$2 = /*#__PURE__*/_classPrivateFieldLooseKey("getObserverBehavior");
var _setDirectionalProps$2 = /*#__PURE__*/_classPrivateFieldLooseKey("setDirectionalProps");
var _calculateHeights$2 = /*#__PURE__*/_classPrivateFieldLooseKey("calculateHeights");
var _calculateLooseWidth = /*#__PURE__*/_classPrivateFieldLooseKey("calculateLooseWidth");
var _onStickyChange$2 = /*#__PURE__*/_classPrivateFieldLooseKey("onStickyChange");
var _createObserver$3 = /*#__PURE__*/_classPrivateFieldLooseKey("createObserver");
var _setStickyHeight = /*#__PURE__*/_classPrivateFieldLooseKey("setStickyHeight");
var _setVw = /*#__PURE__*/_classPrivateFieldLooseKey("setVw");
var _setIsStuck = /*#__PURE__*/_classPrivateFieldLooseKey("setIsStuck");
var _onResize$1 = /*#__PURE__*/_classPrivateFieldLooseKey("onResize");
var _updateScrollPadding$2 = /*#__PURE__*/_classPrivateFieldLooseKey("updateScrollPadding");
var _stickyExceedsAcceptedHeight$2 = /*#__PURE__*/_classPrivateFieldLooseKey("stickyExceedsAcceptedHeight");
var _setObserverStatus = /*#__PURE__*/_classPrivateFieldLooseKey("setObserverStatus");
var Sticky = /*#__PURE__*/function () {
/**
* Create a Sticky instance
* @param {Object} opts - The Sticky element options.
* @param {HTMLElement} opts.el - The Sticky element DOM node.
* @param {string} [opts.direction] - Whether the Sticky element sticks to the top when scrolled below a certain point (TOP) or sticks to the bottom when scrolled above a certain point (BOTTOM). If not defined, will attempt to read `data-direction` attribute, then defaults TOP
* @param {ObserverBehavior} opts.observerBehavior - the behavior of the intersection observer to toggle stuck/unstuck states
* @param {number} [opts.extraScrollPaddingPx] - Extra scroll padding to reduce crowding into sticky bars, defaults to 12px, same as minimal gutters
*/
function Sticky(opts) {
var _this = this;
/**
* Set the status (enabled/disabled) of the intersection observer and update the isStuck property
* @param {boolean} status The status to set
*/
Object.defineProperty(this, _setObserverStatus, {
value: _setObserverStatus2
});
/**
* Calculate whether the height of the sticky has exceeded 33% of the viewport height based on height of the sticky's hidden elements and the height of the sticky's visible elements.
* @returns {boolean} Whether the height of the sticky has exceeded 33% of the viewport height.
*/
Object.defineProperty(this, _stickyExceedsAcceptedHeight$2, {
value: _stickyExceedsAcceptedHeight2
});
/**
* Updates scroll padding CSS property on HTML element
*/
Object.defineProperty(this, _updateScrollPadding$2, {
value: _updateScrollPadding2
});
/**
* Handler for resize event
*/
Object.defineProperty(this, _onResize$1, {
value: _onResize2
});
/**
* Checks if Sticky is stuck and if it is sets isStuck property to true
*/
Object.defineProperty(this, _setIsStuck, {
value: _setIsStuck2
});
/**
* Set document clientWidth in CSS variable
*/
Object.defineProperty(this, _setVw, {
value: _setVw2
});
/**
* Set height of Sticky element to the stuck height and apply the difference to margin-top
* @param {boolean} [removeStyles=false] - Whether to set Sticky element height and margin-top to null
*/
Object.defineProperty(this, _setStickyHeight, {
value: _setStickyHeight2
});
/**
* Create a new observer instance member, disconnecting the old one if present.
*/
Object.defineProperty(this, _createObserver$3, {
value: _createObserver2
});
/**
* Handle intersection observer
*/
Object.defineProperty(this, _onStickyChange$2, {
value: _onStickyChange2
});
/**
* Calculate width with not stuck.
* @returns {number} - Width of el when not stuck
*/
Object.defineProperty(this, _calculateLooseWidth, {
value: _calculateLooseWidth2
});
/**
* Calculate and set heights.
* @returns {boolean} Whether the height of the Sticky el has changed.
*/
Object.defineProperty(this, _calculateHeights$2, {
value: _calculateHeights2
});
/**
* Set value of instances members and DOM node properties depending on the direction instance member
*/
Object.defineProperty(this, _setDirectionalProps$2, {
value: _setDirectionalProps2
});
/**
* Validate observer behavior or fall back to default
* @param {string} [option] - configuration for observerBehavior
* @returns {ObserverBehavior}
*/
Object.defineProperty(this, _getObserverBehavior$2, {
value: _getObserverBehavior2
});
/**
* Set styles and configure observer
* @param {boolean} keepObserverStatus - maintain current observer status.
*/
Object.defineProperty(this, _setUp, {
value: _setUp2
});
Object.defineProperty(this, _init$1, {
value: _init2$1
});
this.el = opts.el;
this.direction = _getDirection$2(opts.direction || this.el.dataset.direction);
this.extraScrollPaddingPx = typeof opts.extraScrollPaddingPx === 'number' ? opts.extraScrollPaddingPx : Default$3.EXTRA_SCROLL_PADDING;
this.enableObserver = true;
this.observerBehavior = _classPrivateFieldLooseBase(this, _getObserverBehavior$2)[_getObserverBehavior$2](opts.observerBehavior);
this.isStuck = false;
this.observer = null;
this.windowScrollY = window.scrollY; // remove in v3 - deprecated as of v2.1.0
this.observedWindowDimensions = {
width: window.innerWidth,
height: window.innerHeight
};
this.looseWidth = _classPrivateFieldLooseBase(this, _calculateLooseWidth)[_calculateLooseWidth]();
// Add "sticky" class only while initialized to attach style and functionality provided by CSS
// Set prior to all height calculations so that styles are applied first
this.el.classList.add(ClassName$s.STICKY);
_classPrivateFieldLooseBase(this, _setVw)[_setVw]();
this.resizeObserver = new ResizeObserver(function () {
requestAnimationFrame(function () {
var windowDimensions = {
width: window.innerWidth,
height: window.innerHeight
};
_this.looseWidth = _classPrivateFieldLooseBase(_this, _calculateLooseWidth)[_calculateLooseWidth]();
// Sticky should maintain "sticky-ness" (observer status) if resize change is not from the window changing size
_classPrivateFieldLooseBase(_this, _setUp)[_setUp](JSON.stringify(windowDimensions) === JSON.stringify(_this.observedWindowDimensions));
_this.observedWindowDimensions = windowDimensions;
});
});
Array.from(this.el.children).forEach(function (child) {
_this.resizeObserver.observe(child);
});
_classPrivateFieldLooseBase(this, _init$1)[_init$1]();
stickies$2.push(this);
}
var _proto = Sticky.prototype;
/**
* Set the status of the sticky observer,
* dependent on configuration and/or height condition
*/
_proto.setObserver = function setObserver() {
switch (this.observerBehavior) {
case ObserverBehavior$2.OFF:
_classPrivateFieldLooseBase(this, _setObserverStatus)[_setObserverStatus](false);
break;
case ObserverBehavior$2.ALWAYS:
_classPrivateFieldLooseBase(this, _setObserverStatus)[_setObserverStatus](true);
break;
default:
if (_classPrivateFieldLooseBase(this, _stickyExceedsAcceptedHeight$2)[_stickyExceedsAcceptedHeight$2]()) {
_classPrivateFieldLooseBase(this, _setObserverStatus)[_setObserverStatus](false);
} else {
_classPrivateFieldLooseBase(this, _setObserverStatus)[_setObserverStatus](true);
}
}
};
/**
* Get the height of the sticky element when stuck
* @returns {number} Stuck height in pixels
*/
_proto.getStuckHeight = function getStuckHeight() {
return this.stuckHeight;
}
/**
* Updates key aspects the instance
* @param {Object} opts - The Sticky options.
* @param {string} [opts.direction] - Whether the Sticky element sticks to the top when scrolled below a certain point (TOP) or sticks to the bottom when scrolled above a certain point (BOTTOM). If not defined, will maintain current setting
* @param {number} [opts.extraScrollPaddingPx] - Extra scroll padding to reduce crowding into sticky bars. If not define, will maintain current setting
* @param {ObserverBehavior} [opts.observerBehavior] - the behavior of the intersection observer to toggle stuck/unstuck states
*/;
_proto.update = function update(opts) {
if (opts === void 0) {
opts = {};
}
Util$1.removeEvents(this.events);
if (opts.direction) {
this.direction = _getDirection$2(opts.direction);
}
if (opts.extraScrollPaddingPx && typeof opts.extraScrollPaddingPx === 'number') {
this.extraScrollPaddingPx = opts.extraScrollPaddingPx;
}
if (opts.observerBehavior) {
this.observerBehavior = _classPrivateFieldLooseBase(this, _getObserverBehavior$2)[_getObserverBehavior$2](opts.observerBehavior);
}
_classPrivateFieldLooseBase(this, _init$1)[_init$1]();
// Create and dispatch custom event
this[EventName$L.ON_UPDATE] = new CustomEvent(EventName$L.ON_UPDATE, {
bubbles: true
});
this.el.dispatchEvent(this[EventName$L.ON_UPDATE]);
}
/**
* Remove the sticky.
*/;
_proto.remove = function remove() {
Util$1.removeEvents(this.events);
this.resizeObserver.disconnect();
// remove the attribute from the element
this.el.classList.remove(ClassName$s.STICKY);
_classPrivateFieldLooseBase(this, _updateScrollPadding$2)[_updateScrollPadding$2](true);
_classPrivateFieldLooseBase(this, _setStickyHeight)[_setStickyHeight](true);
// disconnect observer
this.observer.disconnect();
// remove this sticky reference from array of instances
var index = stickies$2.indexOf(this);
stickies$2.splice(index, 1);
// Create and dispatch custom event
this[EventName$L.ON_REMOVE] = new CustomEvent(EventName$L.ON_REMOVE, {
bubbles: true
});
this.el.dispatchEvent(this[EventName$L.ON_REMOVE]);
}
/**
* Get an array of sticky instances.
* @returns {Object[]} Array of sticky instances.
*/;
Sticky.getInstances = function getInstances() {
return stickies$2;
};
return Sticky;
}();
function _init2$1() {
_classPrivateFieldLooseBase(this, _setDirectionalProps$2)[_setDirectionalProps$2]();
_classPrivateFieldLooseBase(this, _setUp)[_setUp]();
// Add event handlers
this.events = [{
el: window,
type: EventName$L.RESIZE,
handler: throttle(200, _classPrivateFieldLooseBase(this, _onResize$1)[_onResize$1].bind(this))
}];
Util$1.addEvents(this.events);
}
function _setUp2(keepObserverStatus) {
var hasHeightChange = _classPrivateFieldLooseBase(this, _calculateHeights$2)[_calculateHeights$2]();
// A change in Sticky height requires a new IntersectionObserver
// Otherwise, only check IntersectionObserver status and update if needed
if (hasHeightChange) {
_classPrivateFieldLooseBase(this, _createObserver$3)[_createObserver$3]();
if (keepObserverStatus) {
_classPrivateFieldLooseBase(this, _setObserverStatus)[_setObserverStatus](this.enableObserver);
} else {
this.setObserver();
}
} else if (keepObserverStatus) {
_classPrivateFieldLooseBase(this, _setObserverStatus)[_setObserverStatus](this.enableObserver);
} else {
this.setObserver();
}
}
function _getObserverBehavior2(option) {
var isValid = function isValid(behavior) {
return Object.values(ObserverBehavior$2).includes(behavior);
};
if (option && isValid(option)) {
return option;
}
if (isValid(this.el.dataset.observerBehavior)) {
return this.el.dataset.observerBehavior;
}
return ObserverBehavior$2.SIZE_AWARE;
}
function _setDirectionalProps2() {
if (this.direction === Direction$4.BOTTOM) {
this.el.classList.add(ClassName$s.STICKY_BOTTOM);
this.el.classList.remove(ClassName$s.STICKY_TOP);
} else {
// Assume direction is Direction.TOP
this.el.classList.add(ClassName$s.STICKY_TOP);
this.el.classList.remove(ClassName$s.STICKY_BOTTOM);
}
}
function _calculateHeights2() {
var currentStuckHeight = this.stuckHeight;
var currentLooseHeight = this.looseHeight;
var heightOps = {
cssSelectors: ['margin']
};
_classPrivateFieldLooseBase(this, _setStickyHeight)[_setStickyHeight](true);
if (this.el.classList.contains(ClassName$s.STUCK)) {
this.stuckHeight = Util$1.getElementOuterHeight(this.el, heightOps);
this.el.classList.remove(ClassName$s.STUCK);
this.looseHeight = Util$1.getElementOuterHeight(this.el, heightOps);
this.el.classList.add(ClassName$s.STUCK);
} else {
this.looseHeight = Util$1.getElementOuterHeight(this.el, heightOps);
this.el.classList.add(ClassName$s.GET_HEIGHT);
this.el.classList.add(ClassName$s.STUCK);
this.stuckHeight = Util$1.getElementOuterHeight(this.el, heightOps);
this.el.classList.remove(ClassName$s.STUCK);
this.el.classList.remove(ClassName$s.GET_HEIGHT);
}
this.heightDif = this.looseHeight - this.stuckHeight;
_classPrivateFieldLooseBase(this, _setStickyHeight)[_setStickyHeight]();
return currentStuckHeight !== this.stuckHeight || currentLooseHeight !== this.looseHeight;
}
function _calculateLooseWidth2() {
var elWidth = this.el.getBoundingClientRect().width;
if (this.el.classList.contains(ClassName$s.STUCK)) {
this.el.classList.remove(ClassName$s.STUCK);
elWidth = this.el.getBoundingClientRect().width;
this.el.classList.add(ClassName$s.STUCK);
}
return elWidth;
}
function _onStickyChange2() {
this.el.classList.toggle(ClassName$s.STUCK, this.isStuck);
_classPrivateFieldLooseBase(this, _updateScrollPadding$2)[_updateScrollPadding$2]();
}
function _createObserver2() {
var _this2 = this;
if (this.observer) {
this.observer.disconnect();
}
var rootMarginX = (document.documentElement.clientWidth - this.looseWidth) / 2;
var rootMarginY = -1;
/*
We need to check for the presence of a sibling because of how position: sticky works in the
browser. Position: sticky automatically defines the element's immediate parent as its sticky
container. The item can't get out of its sticky container.
https://elad.medium.com/css-position-sticky-how-it-really-works-54cd01dc2d46
When the sticky element has a previous sibling (or next sibling if it is at the bottom),
we use a common trick to detect when it becomes sticky by setting the top and bottom root
margin to -1 pixel and waiting for that 1 pixel of the sticky element to leave the viewport.
Because there is an element before (or after) it, the sticky element can move within its
sticky container to meet this criteria.
However, if the sticky element doesn't have a sibling, the browser may cause it to become
sticky without it moving 1 pixel outside of the viewport (for example, when moving around
the page by tabbing). The top (or bottom) of the sticky element is the exact same as the top
(or bottom) of the sticky container. Because of this, we can modify the trick we used before
by instead checking for when the 1 pixel of the sticky moves to the edge of its sticky container.
*/
var hasSibling = this.direction === Direction$4.BOTTOM ? this.el.nextElementSibling : this.el.previousElementSibling;
var root = hasSibling ? document : this.el.parentElement;
var observerOptions = {
root: root,
rootMargin: rootMarginY + "px " + rootMarginX + "px " + rootMarginY + "px " + rootMarginX + "px",
threshold: [1]
};
this.observer = new IntersectionObserver(function (_ref) {
var entry = _ref[0];
if (_this2.enableObserver) {
var prevState = _this2.isStuck;
if (root === document) {
var isIntersecting = entry.intersectionRect.top === -rootMarginY;
if (_this2.direction === Direction$4.BOTTOM) {
isIntersecting = entry.intersectionRect.bottom === document.documentElement.clientHeight + rootMarginY;
}
_this2.isStuck = entry.intersectionRatio < 1 && isIntersecting;
} else {
_this2.isStuck = entry.isIntersecting;
}
if (typeof prevState !== 'undefined' && prevState !== _this2.isStuck) {
_classPrivateFieldLooseBase(_this2, _onStickyChange$2)[_onStickyChange$2]();
if (_this2.isStuck) {
_this2[EventName$L.ON_STUCK] = new CustomEvent(EventName$L.ON_STUCK, {
bubbles: true
});
_this2.el.dispatchEvent(_this2[EventName$L.ON_STUCK]);
} else {
_this2[EventName$L.ON_UNSTUCK] = new CustomEvent(EventName$L.ON_UNSTUCK, {
bubbles: true
});
_this2.el.dispatchEvent(_this2[EventName$L.ON_UNSTUCK]);
}
}
}
}, observerOptions);
this.observer.observe(this.el);
}
function _setStickyHeight2(removeStyles) {
if (removeStyles === void 0) {
removeStyles = false;
}
var height = null;
var marginTop = null;
this.el.style.setProperty('margin-top', marginTop); // clear any margin-top styles previously set
if (!removeStyles) {
height = this.stuckHeight + "px";
var _getComputedStyle = getComputedStyle(this.el),
defaultMarginTop = _getComputedStyle.marginTop;
marginTop = this.heightDif + parseInt(defaultMarginTop, 10) + "px";
}
this.el.style.setProperty('height', height);
if (marginTop) {
this.el.style.setProperty('margin-top', marginTop);
}
}
function _setVw2() {
var vw = document.documentElement.clientWidth;
this.el.style.setProperty('--vw', vw + "px");
}
function _setIsStuck2() {
if (this.enableObserver) {
var stuckBottom = this.direction === Direction$4.BOTTOM && this.el.getBoundingClientRect().bottom === window.innerHeight;
var stuckTop = this.direction === Direction$4.TOP && this.el.getBoundingClientRect().top === 0;
if (stuckBottom || stuckTop) {
this.isStuck = true;
}
}
}
function _onResize2() {
_classPrivateFieldLooseBase(this, _setVw)[_setVw]();
// Only update Sticky if window height changes, resize observer handles width change
if (window.innerHeight !== this.observedWindowDimensions.height) {
_classPrivateFieldLooseBase(this, _setUp)[_setUp]();
}
}
function _updateScrollPadding2(removeScrollPadding) {
var htmlElement = document.querySelector('html');
this.currentHeight = this.el.getBoundingClientRect().height;
if (removeScrollPadding) {
htmlElement.style.scrollPaddingTop = 0;
htmlElement.style.scrollPaddingBottom = 0;
}
if (this.direction === Direction$4.TOP) {
htmlElement.style.scrollPaddingTop = this.currentHeight + this.extraScrollPaddingPx + 'px';
} else if (this.direction === Direction$4.BOTTOM) {
htmlElement.style.scrollPaddingBottom = this.currentHeight + this.extraScrollPaddingPx + 'px';
}
}
function _stickyExceedsAcceptedHeight2() {
return this.stuckHeight > window.innerHeight / 3;
}
function _setObserverStatus2(status) {
this.enableObserver = status;
var position = null;
if (!status) {
position = 'initial';
this.isStuck = false;
}
this.el.style.setProperty('position', position);
_classPrivateFieldLooseBase(this, _setIsStuck)[_setIsStuck]();
_classPrivateFieldLooseBase(this, _onStickyChange$2)[_onStickyChange$2]();
}
var $$m = _export;
var $every = arrayIteration.every;
var arrayMethodIsStrict$2 = arrayMethodIsStrict$7;
var STRICT_METHOD$2 = arrayMethodIsStrict$2('every');
// `Array.prototype.every` method
// https://tc39.es/ecma262/#sec-array.prototype.every
$$m({ target: 'Array', proto: true, forced: !STRICT_METHOD$2 }, {
every: function every(callbackfn /* , thisArg */) {
return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : undefined);
}
});
var Selector$L = {
DATA_MOUNT: '[data-mount="combobox-select"]',
ROLE_COMBOBOX: '[role=combobox]',
ROLE_LISTBOX: '[role=listbox]',
ROLE_OPTION: '[role=option]'
};
var EventName$K = {
BLUR: 'blur',
CLICK: 'click',
KEYDOWN: 'keydown',
MOUSEDOWN: 'mousedown',
ON_CHANGE: 'onChange',
ON_REMOVE: 'onRemove',
ON_UPDATE: 'onUpdate'
};
var ClassName$r = {
ITEM: 'combobox-item',
CURRENT_ITEM: 'current-item'
};
// option count for PageUp/PageDown keys
var PAGE_SIZE = 10;
// duration to reset type search timeout
var TIMEOUT_MS = 500;
/**
* Save a list of named combobox actions for readability
* @enum {number}
*/
var SelectAction = {
Close: 0,
CloseSelect: 1,
First: 2,
Last: 3,
Next: 4,
Open: 5,
PageDown: 6,
PageUp: 7,
Previous: 8,
// Select: 9,
Type: 10
};
var _Util$keys$1 = Util$1.keys,
ARROW_DOWN$1 = _Util$keys$1.ARROW_DOWN,
ARROW_UP$1 = _Util$keys$1.ARROW_UP,
BACKSPACE = _Util$keys$1.BACKSPACE,
CLEAR = _Util$keys$1.CLEAR,
ENTER = _Util$keys$1.ENTER,
END = _Util$keys$1.END,
ESC$1 = _Util$keys$1.ESC,
HOME = _Util$keys$1.HOME,
PAGE_DOWN = _Util$keys$1.PAGE_DOWN,
PAGE_UP = _Util$keys$1.PAGE_UP,
SPACE = _Util$keys$1.SPACE;
var instances$D = [];
/**
* Get filtered array of options given an input string
* @param {string} filter - string against which to compare options
* @param {string[]} options - array of options to filter
* @param {string[]} exclude - array of options to exclude from filter/search
* @returns {string[]} - array of options that begin with the filter string, case-independent
*/
function getFilteredOptions(filter, options, exclude) {
if (options === void 0) {
options = [];
}
if (exclude === void 0) {
exclude = [];
}
return options.filter(function (option) {
var matches = option.toLowerCase().indexOf(filter.toLowerCase()) === 0;
return matches && exclude.indexOf(option) < 0;
});
}
/**
* Map a key press to an action
* @param {KeyboardEvent} event - the key press event
* @param {boolean} menuOpen – whether the listbox menu is open
* @returns {SelectAction}
*/
// eslint-disable-next-line complexity
function getActionFromKey(event, menuOpen) {
var key = event.key,
altKey = event.altKey,
ctrlKey = event.ctrlKey,
metaKey = event.metaKey;
var openKeys = [ARROW_DOWN$1, ARROW_UP$1, ENTER, SPACE]; // keys that perform "Open" action
switch (true) {
// handle opening when closed
case !menuOpen && openKeys.includes(key):
return SelectAction.Open;
// home and end move the selected option when open or closed
case key === HOME:
return SelectAction.First;
case key === END:
return SelectAction.Last;
// handle typing characters when open or closed
case key === BACKSPACE:
case key === CLEAR:
case key.length === 1 && key !== SPACE && !altKey && !ctrlKey && !metaKey:
return SelectAction.Type;
default:
// handle keys when open
if (menuOpen) {
switch (true) {
case key === ARROW_UP$1 && altKey:
return SelectAction.CloseSelect;
case key === ARROW_DOWN$1 && !altKey:
return SelectAction.Next;
case key === ARROW_UP$1:
return SelectAction.Previous;
case key === PAGE_UP:
return SelectAction.PageUp;
case key === PAGE_DOWN:
return SelectAction.PageDown;
case key === ESC$1:
return SelectAction.Close;
case key === ENTER:
case key === SPACE:
return SelectAction.CloseSelect;
}
}
}
}
/**
* Get the index of an option from an array of options, based on a search string.
* If the filter is multiple iterations of the same letter (e.g "aaa"), cycle through first-letter matches
* @param {string[]} options - list of menu options (text content)
* @param {string} filter - typed key input
* @param {number} [startIndex=0]
* @returns {number} option index
*/
function getIndexByLetter(options, filter, startIndex) {
if (startIndex === void 0) {
startIndex = 0;
}
var orderedOptions = [].concat(options.slice(startIndex), options.slice(0, startIndex));
var firstMatch = getFilteredOptions(filter, orderedOptions)[0];
var allSameLetter = function allSameLetter(array) {
return array.every(function (letter) {
return letter === array[0];
});
}; // eslint-disable-line unicorn/consistent-function-scoping
// first check if there is an exact match for the typed string
if (firstMatch) {
return options.indexOf(firstMatch);
}
// if the same letter is being repeated, cycle through first-letter matches
if (allSameLetter(filter.split(''))) {
var matches = getFilteredOptions(filter[0], orderedOptions);
return options.indexOf(matches[0]);
}
// if no matches, return -1
return -1;
}
/**
* Get an updated option index after performing an action
* @param {number} currentIndex
* @param {number} maxIndex - index to set max range to change key input
* @param {SelectAction} action - a SelectAction
* @returns {number} new option index
*/
function getUpdatedIndex(currentIndex, maxIndex, action) {
switch (action) {
case SelectAction.First:
return 0;
case SelectAction.Last:
return maxIndex;
case SelectAction.Previous:
return Math.max(0, currentIndex - 1);
case SelectAction.Next:
return Math.min(maxIndex, currentIndex + 1);
case SelectAction.PageUp:
return Math.max(0, currentIndex - PAGE_SIZE);
case SelectAction.PageDown:
return Math.min(maxIndex, currentIndex + PAGE_SIZE);
default:
return currentIndex;
}
}
/**
* Check if element is visible in browser view port
* @param {HTMLElement} element - given element
* @returns {boolean}
*/
function isElementInView(element) {
var bounding = element.getBoundingClientRect();
return bounding.top >= 0 && bounding.left >= 0 && bounding.bottom <= (window.innerHeight || document.documentElement.clientHeight) && bounding.right <= (window.innerWidth || document.documentElement.clientWidth);
}
/**
* Check if an element is currently scrollable (vertically overflowing)
* @param {HTMLElement} element - given element
* @returns {boolean}
*/
function isScrollable(element) {
return element && element.clientHeight < element.scrollHeight;
}
/**
* Ensure a given child element is within the parent's visible scroll area
* If the child is not visible, scroll the parent
* @param {HTMLElement} activeElement - current element
* @param {HTMLElement} scrollParent - element's parent
*/
function maintainScrollVisibility(activeElement, scrollParent) {
var offsetHeight = activeElement.offsetHeight,
offsetTop = activeElement.offsetTop;
var parentOffsetHeight = scrollParent.offsetHeight,
scrollTop = scrollParent.scrollTop;
var isAbove = offsetTop < scrollTop;
var isBelow = offsetTop + offsetHeight > scrollTop + parentOffsetHeight;
if (isAbove) {
scrollParent.scrollTo(0, offsetTop);
} else if (isBelow) {
scrollParent.scrollTo(0, offsetTop - parentOffsetHeight + offsetHeight);
}
}
var _init = /*#__PURE__*/_classPrivateFieldLooseKey("init");
var _setupOption = /*#__PURE__*/_classPrivateFieldLooseKey("setupOption");
var _getSearchString = /*#__PURE__*/_classPrivateFieldLooseKey("getSearchString");
var _onComboBlur = /*#__PURE__*/_classPrivateFieldLooseKey("onComboBlur");
var _onComboClick = /*#__PURE__*/_classPrivateFieldLooseKey("onComboClick");
var _onComboKeyDown = /*#__PURE__*/_classPrivateFieldLooseKey("onComboKeyDown");
var _onComboType = /*#__PURE__*/_classPrivateFieldLooseKey("onComboType");
var _onOptionChange = /*#__PURE__*/_classPrivateFieldLooseKey("onOptionChange");
var _onOptionClick = /*#__PURE__*/_classPrivateFieldLooseKey("onOptionClick");
var _onOptionMouseDown = /*#__PURE__*/_classPrivateFieldLooseKey("onOptionMouseDown");
var _updateMenuState = /*#__PURE__*/_classPrivateFieldLooseKey("updateMenuState");
var ComboboxSelect = /*#__PURE__*/function () {
/**
* Create a ComboboxSelect instance
* @param {Object} opts - the ComboboxSelect options
* @param {HTMLElement} opts.el - the ComboboxSelect container element
* @param {Boolean} [opts.manageFocusOnClick=true] - whether to send focus back to the Combobox on click
*/
function ComboboxSelect(_ref) {
var _this$comboEl;
var el = _ref.el,
_ref$manageFocusOnCli = _ref.manageFocusOnClick,
manageFocusOnClick = _ref$manageFocusOnCli === void 0 ? true : _ref$manageFocusOnCli;
/**
* Change state of the listbox menu
* @param {boolean} open – whether the menu is open
* @param {boolean} callFocus – whether to return focus to the combobox
*/
Object.defineProperty(this, _updateMenuState, {
value: _updateMenuState2
});
/**
* Handler for option mousedown event
*/
Object.defineProperty(this, _onOptionMouseDown, {
value: _onOptionMouseDown2
});
/**
* Handler for option click
* @param {number} index - the index of the clicked option
*/
Object.defineProperty(this, _onOptionClick, {
value: _onOptionClick2
});
/**
* Handler for option change
* @param {number} index – the index of the option to select
*/
Object.defineProperty(this, _onOptionChange, {
value: _onOptionChange2
});
/**
* Handler for combobox typing action
* @param {string} letter - single letter
*/
Object.defineProperty(this, _onComboType, {
value: _onComboType2
});
/**
* Handler for combobox keydown event
* @param {KeyboardEvent} event
*/
Object.defineProperty(this, _onComboKeyDown, {
value: _onComboKeyDown2
});
/**
* Handler for combobox click event
*/
Object.defineProperty(this, _onComboClick, {
value: _onComboClick2
});
/**
* Handler for combobox blur event
*/
Object.defineProperty(this, _onComboBlur, {
value: _onComboBlur2
});
/**
* Get string per typed keystroke, and handle timeout
* @param {string} character - typed character
* @returns {string} - the string to search options
*/
Object.defineProperty(this, _getSearchString, {
value: _getSearchString2
});
/**
* Setup event handlers and ensure HTML attributes for listbox options
* @param {Element} option - the option element
* @param {number} index - the index of this option
*/
Object.defineProperty(this, _setupOption, {
value: _setupOption2
});
/**
* Initialize JS for combobox event handlers and listbox options
*/
Object.defineProperty(this, _init, {
value: _init2
});
// element refs
this.el = el;
this.manageFocusOnClick = manageFocusOnClick;
this.comboEl = el.querySelector(Selector$L.ROLE_COMBOBOX);
this.listboxEl = el.querySelector(Selector$L.ROLE_LISTBOX);
this.optionEls = el.querySelectorAll(Selector$L.ROLE_OPTION);
// data
this.idBase = ((_this$comboEl = this.comboEl) == null ? void 0 : _this$comboEl.id) || "combobox_" + Util$1.getUid();
// state
this.activeIndex = 0;
this.open = false;
this.searchString = '';
this.searchTimeout = null;
this.events = [];
// init
if (el && this.comboEl && this.listboxEl && Boolean(this.optionEls.length)) {
_classPrivateFieldLooseBase(this, _init)[_init]();
}
instances$D.push(this);
}
ComboboxSelect.getInstances = function getInstances() {
return instances$D;
}
/**
* Perform an option selection
* @param {number} index – the index of the option to select
*/;
var _proto = ComboboxSelect.prototype;
_proto.selectOption = function selectOption(index, event) {
// update state
this.activeIndex = index;
// update displayed value
var selected = this.optionEls[index];
this.comboEl.innerHTML = selected.textContent;
// update aria-selected
Array.from(this.optionEls).forEach(function (optionEl, i) {
optionEl.setAttribute('aria-selected', "" + (i === index));
});
// create and dispatch custom event on selection/change
this[EventName$K.ON_CHANGE] = new CustomEvent(EventName$K.ON_CHANGE, {
bubbles: true,
detail: {
value: selected.textContent,
event: event
}
});
this.comboEl.dispatchEvent(this[EventName$K.ON_CHANGE]);
}
/**
* Re-initialize the instance to update DOM elements and handlers
* @param {Object} [opts] - The Combobox options
* @param {Boolean} [opts.manageFocusOnClick] - whether to send focus back to the Combobox on click
*/;
_proto.update = function update(opts) {
if (opts === void 0) {
opts = {};
}
this.comboEl = this.el.querySelector(Selector$L.ROLE_COMBOBOX);
this.listboxEl = this.el.querySelector(Selector$L.ROLE_LISTBOX);
this.optionEls = this.el.querySelectorAll(Selector$L.ROLE_OPTION);
if (typeof opts.manageFocusOnClick === 'boolean') {
this.manageFocusOnClick = opts.manageFocusOnClick;
}
if (this.el && this.comboEl && this.listboxEl && Boolean(this.optionEls.length)) {
// reset event handlers in case element refs have changed
Util$1.removeEvents(this.events);
_classPrivateFieldLooseBase(this, _init)[_init]();
}
this[EventName$K.ON_UPDATE] = new CustomEvent(EventName$K.ON_UPDATE, {
bubbles: true
});
this.el.dispatchEvent(this[EventName$K.ON_UPDATE]);
}
/**
* Remove the ComboboxSelect instance
*/;
_proto.remove = function remove() {
Util$1.removeEvents(this.events);
var index = instances$D.indexOf(this);
instances$D.splice(index, 1);
this[EventName$K.ON_REMOVE] = new CustomEvent(EventName$K.ON_REMOVE, {
bubbles: true
});
this.el.dispatchEvent(this[EventName$K.ON_REMOVE]);
};
return ComboboxSelect;
}();
function _init2() {
var _this$events;
// display first option by default
this.comboEl.innerHTML = this.optionEls[0].textContent;
// add combobox event listeners
var comboboxEventHandlers = [{
el: this.comboEl,
type: EventName$K.BLUR,
handler: _classPrivateFieldLooseBase(this, _onComboBlur)[_onComboBlur].bind(this)
}, {
el: this.comboEl,
type: EventName$K.CLICK,
handler: _classPrivateFieldLooseBase(this, _onComboClick)[_onComboClick].bind(this)
}, {
el: this.comboEl,
type: EventName$K.KEYDOWN,
handler: _classPrivateFieldLooseBase(this, _onComboKeyDown)[_onComboKeyDown].bind(this)
}];
(_this$events = this.events).push.apply(_this$events, comboboxEventHandlers);
Util$1.addEvents(comboboxEventHandlers);
Array.from(this.optionEls).forEach(_classPrivateFieldLooseBase(this, _setupOption)[_setupOption].bind(this));
}
function _setupOption2(option, index) {
var _this = this,
_this$events2;
// ensuring proper HTML attributes
option.setAttribute('aria-selected', "" + (index === 0));
if (index === 0) {
option.classList.add(ClassName$r.CURRENT_ITEM);
} else {
option.classList.remove(ClassName$r.CURRENT_ITEM);
}
option.id = this.idBase + "-" + index;
// add option event listeners
var optionEventHandlers = [{
el: option,
type: EventName$K.CLICK,
handler: function handler(event) {
event.stopPropagation();
_classPrivateFieldLooseBase(_this, _onOptionClick)[_onOptionClick](index);
}
}, {
el: option,
type: EventName$K.MOUSEDOWN,
handler: _classPrivateFieldLooseBase(this, _onOptionMouseDown)[_onOptionMouseDown].bind(this)
}];
(_this$events2 = this.events).push.apply(_this$events2, optionEventHandlers);
Util$1.addEvents(optionEventHandlers);
}
function _getSearchString2(character) {
var _this2 = this;
// reset typing timeout and start new timeout
// this allows multiple-letter matches, like a native