(() => {
var __create = Object.create;
var __defProp = Object.defineProperty;
var __defProps = Object.defineProperties;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __propIsEnum = Object.prototype.propertyIsEnumerable;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __spreadValues = (a5, b4) => {
for (var prop in b4 || (b4 = {}))
if (__hasOwnProp.call(b4, prop))
__defNormalProp(a5, prop, b4[prop]);
if (__getOwnPropSymbols)
for (var prop of __getOwnPropSymbols(b4)) {
if (__propIsEnum.call(b4, prop))
__defNormalProp(a5, prop, b4[prop]);
}
return a5;
};
var __spreadProps = (a5, b4) => __defProps(a5, __getOwnPropDescs(b4));
var __require = /* @__PURE__ */ ((x4) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x4, {
get: (a5, b4) => (typeof require !== "undefined" ? require : a5)[b4]
}) : x4)(function(x4) {
if (typeof require !== "undefined")
return require.apply(this, arguments);
throw new Error('Dynamic require of "' + x4 + '" is not supported');
});
var __esm = (fn3, res) => function __init() {
return fn3 && (res = (0, fn3[__getOwnPropNames(fn3)[0]])(fn3 = 0)), res;
};
var __commonJS = (cb, mod) => function __require2() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
var __publicField = (obj, key, value) => {
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
return value;
};
var __accessCheck = (obj, member, msg) => {
if (!member.has(obj))
throw TypeError("Cannot " + msg);
};
var __privateAdd = (obj, member, value) => {
if (member.has(obj))
throw TypeError("Cannot add the same private member more than once");
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
};
var __privateMethod = (obj, member, method) => {
__accessCheck(obj, member, "access private method");
return method;
};
var __async = (__this, __arguments, generator) => {
return new Promise((resolve3, reject) => {
var fulfilled = (value) => {
try {
step(generator.next(value));
} catch (e5) {
reject(e5);
}
};
var rejected = (value) => {
try {
step(generator.throw(value));
} catch (e5) {
reject(e5);
}
};
var step = (x4) => x4.done ? resolve3(x4.value) : Promise.resolve(x4.value).then(fulfilled, rejected);
step((generator = generator.apply(__this, __arguments)).next());
});
};
// node_modules/core-js/internals/global-this.js
var require_global_this = __commonJS({
"node_modules/core-js/internals/global-this.js"(exports2, module2) {
"use strict";
var check = function(it2) {
return it2 && it2.Math === Math && it2;
};
module2.exports = check(typeof globalThis == "object" && globalThis) || check(typeof window == "object" && window) || check(typeof self == "object" && self) || check(typeof global == "object" && global) || check(typeof exports2 == "object" && exports2) || function() {
return this;
}() || Function("return this")();
}
});
// node_modules/core-js/internals/fails.js
var require_fails = __commonJS({
"node_modules/core-js/internals/fails.js"(exports2, module2) {
"use strict";
module2.exports = function(exec) {
try {
return !!exec();
} catch (error2) {
return true;
}
};
}
});
// node_modules/core-js/internals/descriptors.js
var require_descriptors = __commonJS({
"node_modules/core-js/internals/descriptors.js"(exports2, module2) {
"use strict";
var fails = require_fails();
module2.exports = !fails(function() {
return Object.defineProperty({}, 1, { get: function() {
return 7;
} })[1] !== 7;
});
}
});
// node_modules/core-js/internals/function-bind-native.js
var require_function_bind_native = __commonJS({
"node_modules/core-js/internals/function-bind-native.js"(exports2, module2) {
"use strict";
var fails = require_fails();
module2.exports = !fails(function() {
var test = function() {
}.bind();
return typeof test != "function" || test.hasOwnProperty("prototype");
});
}
});
// node_modules/core-js/internals/function-call.js
var require_function_call = __commonJS({
"node_modules/core-js/internals/function-call.js"(exports2, module2) {
"use strict";
var NATIVE_BIND = require_function_bind_native();
var call = Function.prototype.call;
module2.exports = NATIVE_BIND ? call.bind(call) : function() {
return call.apply(call, arguments);
};
}
});
// node_modules/core-js/internals/object-property-is-enumerable.js
var require_object_property_is_enumerable = __commonJS({
"node_modules/core-js/internals/object-property-is-enumerable.js"(exports2) {
"use strict";
var $propertyIsEnumerable = {}.propertyIsEnumerable;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var NASHORN_BUG = getOwnPropertyDescriptor && !$propertyIsEnumerable.call({ 1: 2 }, 1);
exports2.f = NASHORN_BUG ? function propertyIsEnumerable(V3) {
var descriptor = getOwnPropertyDescriptor(this, V3);
return !!descriptor && descriptor.enumerable;
} : $propertyIsEnumerable;
}
});
// node_modules/core-js/internals/create-property-descriptor.js
var require_create_property_descriptor = __commonJS({
"node_modules/core-js/internals/create-property-descriptor.js"(exports2, module2) {
"use strict";
module2.exports = function(bitmap, value) {
return {
enumerable: !(bitmap & 1),
configurable: !(bitmap & 2),
writable: !(bitmap & 4),
value
};
};
}
});
// node_modules/core-js/internals/function-uncurry-this.js
var require_function_uncurry_this = __commonJS({
"node_modules/core-js/internals/function-uncurry-this.js"(exports2, module2) {
"use strict";
var NATIVE_BIND = require_function_bind_native();
var FunctionPrototype = Function.prototype;
var call = FunctionPrototype.call;
var uncurryThisWithBind = NATIVE_BIND && FunctionPrototype.bind.bind(call, call);
module2.exports = NATIVE_BIND ? uncurryThisWithBind : function(fn3) {
return function() {
return call.apply(fn3, arguments);
};
};
}
});
// node_modules/core-js/internals/classof-raw.js
var require_classof_raw = __commonJS({
"node_modules/core-js/internals/classof-raw.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var toString = uncurryThis({}.toString);
var stringSlice = uncurryThis("".slice);
module2.exports = function(it2) {
return stringSlice(toString(it2), 8, -1);
};
}
});
// node_modules/core-js/internals/indexed-object.js
var require_indexed_object = __commonJS({
"node_modules/core-js/internals/indexed-object.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var classof = require_classof_raw();
var $Object = Object;
var split3 = uncurryThis("".split);
module2.exports = fails(function() {
return !$Object("z").propertyIsEnumerable(0);
}) ? function(it2) {
return classof(it2) === "String" ? split3(it2, "") : $Object(it2);
} : $Object;
}
});
// node_modules/core-js/internals/is-null-or-undefined.js
var require_is_null_or_undefined = __commonJS({
"node_modules/core-js/internals/is-null-or-undefined.js"(exports2, module2) {
"use strict";
module2.exports = function(it2) {
return it2 === null || it2 === void 0;
};
}
});
// node_modules/core-js/internals/require-object-coercible.js
var require_require_object_coercible = __commonJS({
"node_modules/core-js/internals/require-object-coercible.js"(exports2, module2) {
"use strict";
var isNullOrUndefined = require_is_null_or_undefined();
var $TypeError = TypeError;
module2.exports = function(it2) {
if (isNullOrUndefined(it2))
throw new $TypeError("Can't call method on " + it2);
return it2;
};
}
});
// node_modules/core-js/internals/to-indexed-object.js
var require_to_indexed_object = __commonJS({
"node_modules/core-js/internals/to-indexed-object.js"(exports2, module2) {
"use strict";
var IndexedObject = require_indexed_object();
var requireObjectCoercible = require_require_object_coercible();
module2.exports = function(it2) {
return IndexedObject(requireObjectCoercible(it2));
};
}
});
// node_modules/core-js/internals/is-callable.js
var require_is_callable = __commonJS({
"node_modules/core-js/internals/is-callable.js"(exports2, module2) {
"use strict";
var documentAll = typeof document == "object" && document.all;
module2.exports = typeof documentAll == "undefined" && documentAll !== void 0 ? function(argument) {
return typeof argument == "function" || argument === documentAll;
} : function(argument) {
return typeof argument == "function";
};
}
});
// node_modules/core-js/internals/is-object.js
var require_is_object = __commonJS({
"node_modules/core-js/internals/is-object.js"(exports2, module2) {
"use strict";
var isCallable = require_is_callable();
module2.exports = function(it2) {
return typeof it2 == "object" ? it2 !== null : isCallable(it2);
};
}
});
// node_modules/core-js/internals/get-built-in.js
var require_get_built_in = __commonJS({
"node_modules/core-js/internals/get-built-in.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var isCallable = require_is_callable();
var aFunction = function(argument) {
return isCallable(argument) ? argument : void 0;
};
module2.exports = function(namespace, method) {
return arguments.length < 2 ? aFunction(globalThis2[namespace]) : globalThis2[namespace] && globalThis2[namespace][method];
};
}
});
// node_modules/core-js/internals/object-is-prototype-of.js
var require_object_is_prototype_of = __commonJS({
"node_modules/core-js/internals/object-is-prototype-of.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
module2.exports = uncurryThis({}.isPrototypeOf);
}
});
// node_modules/core-js/internals/environment-user-agent.js
var require_environment_user_agent = __commonJS({
"node_modules/core-js/internals/environment-user-agent.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var navigator2 = globalThis2.navigator;
var userAgent2 = navigator2 && navigator2.userAgent;
module2.exports = userAgent2 ? String(userAgent2) : "";
}
});
// node_modules/core-js/internals/environment-v8-version.js
var require_environment_v8_version = __commonJS({
"node_modules/core-js/internals/environment-v8-version.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var userAgent2 = require_environment_user_agent();
var process2 = globalThis2.process;
var Deno2 = globalThis2.Deno;
var versions = process2 && process2.versions || Deno2 && Deno2.version;
var v8 = versions && versions.v8;
var match3;
var version4;
if (v8) {
match3 = v8.split(".");
version4 = match3[0] > 0 && match3[0] < 4 ? 1 : +(match3[0] + match3[1]);
}
if (!version4 && userAgent2) {
match3 = userAgent2.match(/Edge\/(\d+)/);
if (!match3 || match3[1] >= 74) {
match3 = userAgent2.match(/Chrome\/(\d+)/);
if (match3)
version4 = +match3[1];
}
}
module2.exports = version4;
}
});
// node_modules/core-js/internals/symbol-constructor-detection.js
var require_symbol_constructor_detection = __commonJS({
"node_modules/core-js/internals/symbol-constructor-detection.js"(exports2, module2) {
"use strict";
var V8_VERSION = require_environment_v8_version();
var fails = require_fails();
var globalThis2 = require_global_this();
var $String = globalThis2.String;
module2.exports = !!Object.getOwnPropertySymbols && !fails(function() {
var symbol = Symbol("symbol detection");
return !$String(symbol) || !(Object(symbol) instanceof Symbol) || !Symbol.sham && V8_VERSION && V8_VERSION < 41;
});
}
});
// node_modules/core-js/internals/use-symbol-as-uid.js
var require_use_symbol_as_uid = __commonJS({
"node_modules/core-js/internals/use-symbol-as-uid.js"(exports2, module2) {
"use strict";
var NATIVE_SYMBOL = require_symbol_constructor_detection();
module2.exports = NATIVE_SYMBOL && !Symbol.sham && typeof Symbol.iterator == "symbol";
}
});
// node_modules/core-js/internals/is-symbol.js
var require_is_symbol = __commonJS({
"node_modules/core-js/internals/is-symbol.js"(exports2, module2) {
"use strict";
var getBuiltIn = require_get_built_in();
var isCallable = require_is_callable();
var isPrototypeOf = require_object_is_prototype_of();
var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
var $Object = Object;
module2.exports = USE_SYMBOL_AS_UID ? function(it2) {
return typeof it2 == "symbol";
} : function(it2) {
var $Symbol = getBuiltIn("Symbol");
return isCallable($Symbol) && isPrototypeOf($Symbol.prototype, $Object(it2));
};
}
});
// node_modules/core-js/internals/try-to-string.js
var require_try_to_string = __commonJS({
"node_modules/core-js/internals/try-to-string.js"(exports2, module2) {
"use strict";
var $String = String;
module2.exports = function(argument) {
try {
return $String(argument);
} catch (error2) {
return "Object";
}
};
}
});
// node_modules/core-js/internals/a-callable.js
var require_a_callable = __commonJS({
"node_modules/core-js/internals/a-callable.js"(exports2, module2) {
"use strict";
var isCallable = require_is_callable();
var tryToString = require_try_to_string();
var $TypeError = TypeError;
module2.exports = function(argument) {
if (isCallable(argument))
return argument;
throw new $TypeError(tryToString(argument) + " is not a function");
};
}
});
// node_modules/core-js/internals/get-method.js
var require_get_method = __commonJS({
"node_modules/core-js/internals/get-method.js"(exports2, module2) {
"use strict";
var aCallable = require_a_callable();
var isNullOrUndefined = require_is_null_or_undefined();
module2.exports = function(V3, P4) {
var func = V3[P4];
return isNullOrUndefined(func) ? void 0 : aCallable(func);
};
}
});
// node_modules/core-js/internals/ordinary-to-primitive.js
var require_ordinary_to_primitive = __commonJS({
"node_modules/core-js/internals/ordinary-to-primitive.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var isCallable = require_is_callable();
var isObject3 = require_is_object();
var $TypeError = TypeError;
module2.exports = function(input, pref) {
var fn3, val;
if (pref === "string" && isCallable(fn3 = input.toString) && !isObject3(val = call(fn3, input)))
return val;
if (isCallable(fn3 = input.valueOf) && !isObject3(val = call(fn3, input)))
return val;
if (pref !== "string" && isCallable(fn3 = input.toString) && !isObject3(val = call(fn3, input)))
return val;
throw new $TypeError("Can't convert object to primitive value");
};
}
});
// node_modules/core-js/internals/is-pure.js
var require_is_pure = __commonJS({
"node_modules/core-js/internals/is-pure.js"(exports2, module2) {
"use strict";
module2.exports = false;
}
});
// node_modules/core-js/internals/define-global-property.js
var require_define_global_property = __commonJS({
"node_modules/core-js/internals/define-global-property.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var defineProperty = Object.defineProperty;
module2.exports = function(key, value) {
try {
defineProperty(globalThis2, key, { value, configurable: true, writable: true });
} catch (error2) {
globalThis2[key] = value;
}
return value;
};
}
});
// node_modules/core-js/internals/shared-store.js
var require_shared_store = __commonJS({
"node_modules/core-js/internals/shared-store.js"(exports2, module2) {
"use strict";
var IS_PURE = require_is_pure();
var globalThis2 = require_global_this();
var defineGlobalProperty = require_define_global_property();
var SHARED = "__core-js_shared__";
var store = module2.exports = globalThis2[SHARED] || defineGlobalProperty(SHARED, {});
(store.versions || (store.versions = [])).push({
version: "3.39.0",
mode: IS_PURE ? "pure" : "global",
copyright: "\xA9 2014-2024 Denis Pushkarev (zloirock.ru)",
license: "https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",
source: "https://github.com/zloirock/core-js"
});
}
});
// node_modules/core-js/internals/shared.js
var require_shared = __commonJS({
"node_modules/core-js/internals/shared.js"(exports2, module2) {
"use strict";
var store = require_shared_store();
module2.exports = function(key, value) {
return store[key] || (store[key] = value || {});
};
}
});
// node_modules/core-js/internals/to-object.js
var require_to_object = __commonJS({
"node_modules/core-js/internals/to-object.js"(exports2, module2) {
"use strict";
var requireObjectCoercible = require_require_object_coercible();
var $Object = Object;
module2.exports = function(argument) {
return $Object(requireObjectCoercible(argument));
};
}
});
// node_modules/core-js/internals/has-own-property.js
var require_has_own_property = __commonJS({
"node_modules/core-js/internals/has-own-property.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var toObject = require_to_object();
var hasOwnProperty3 = uncurryThis({}.hasOwnProperty);
module2.exports = Object.hasOwn || function hasOwn(it2, key) {
return hasOwnProperty3(toObject(it2), key);
};
}
});
// node_modules/core-js/internals/uid.js
var require_uid = __commonJS({
"node_modules/core-js/internals/uid.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var id = 0;
var postfix = Math.random();
var toString = uncurryThis(1 .toString);
module2.exports = function(key) {
return "Symbol(" + (key === void 0 ? "" : key) + ")_" + toString(++id + postfix, 36);
};
}
});
// node_modules/core-js/internals/well-known-symbol.js
var require_well_known_symbol = __commonJS({
"node_modules/core-js/internals/well-known-symbol.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var shared = require_shared();
var hasOwn = require_has_own_property();
var uid2 = require_uid();
var NATIVE_SYMBOL = require_symbol_constructor_detection();
var USE_SYMBOL_AS_UID = require_use_symbol_as_uid();
var Symbol2 = globalThis2.Symbol;
var WellKnownSymbolsStore = shared("wks");
var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol2["for"] || Symbol2 : Symbol2 && Symbol2.withoutSetter || uid2;
module2.exports = function(name) {
if (!hasOwn(WellKnownSymbolsStore, name)) {
WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn(Symbol2, name) ? Symbol2[name] : createWellKnownSymbol("Symbol." + name);
}
return WellKnownSymbolsStore[name];
};
}
});
// node_modules/core-js/internals/to-primitive.js
var require_to_primitive = __commonJS({
"node_modules/core-js/internals/to-primitive.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var isObject3 = require_is_object();
var isSymbol = require_is_symbol();
var getMethod2 = require_get_method();
var ordinaryToPrimitive = require_ordinary_to_primitive();
var wellKnownSymbol = require_well_known_symbol();
var $TypeError = TypeError;
var TO_PRIMITIVE = wellKnownSymbol("toPrimitive");
module2.exports = function(input, pref) {
if (!isObject3(input) || isSymbol(input))
return input;
var exoticToPrim = getMethod2(input, TO_PRIMITIVE);
var result;
if (exoticToPrim) {
if (pref === void 0)
pref = "default";
result = call(exoticToPrim, input, pref);
if (!isObject3(result) || isSymbol(result))
return result;
throw new $TypeError("Can't convert object to primitive value");
}
if (pref === void 0)
pref = "number";
return ordinaryToPrimitive(input, pref);
};
}
});
// node_modules/core-js/internals/to-property-key.js
var require_to_property_key = __commonJS({
"node_modules/core-js/internals/to-property-key.js"(exports2, module2) {
"use strict";
var toPrimitive = require_to_primitive();
var isSymbol = require_is_symbol();
module2.exports = function(argument) {
var key = toPrimitive(argument, "string");
return isSymbol(key) ? key : key + "";
};
}
});
// node_modules/core-js/internals/document-create-element.js
var require_document_create_element = __commonJS({
"node_modules/core-js/internals/document-create-element.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var isObject3 = require_is_object();
var document2 = globalThis2.document;
var EXISTS = isObject3(document2) && isObject3(document2.createElement);
module2.exports = function(it2) {
return EXISTS ? document2.createElement(it2) : {};
};
}
});
// node_modules/core-js/internals/ie8-dom-define.js
var require_ie8_dom_define = __commonJS({
"node_modules/core-js/internals/ie8-dom-define.js"(exports2, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var fails = require_fails();
var createElement2 = require_document_create_element();
module2.exports = !DESCRIPTORS && !fails(function() {
return Object.defineProperty(createElement2("div"), "a", {
get: function() {
return 7;
}
}).a !== 7;
});
}
});
// node_modules/core-js/internals/object-get-own-property-descriptor.js
var require_object_get_own_property_descriptor = __commonJS({
"node_modules/core-js/internals/object-get-own-property-descriptor.js"(exports2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var call = require_function_call();
var propertyIsEnumerableModule = require_object_property_is_enumerable();
var createPropertyDescriptor = require_create_property_descriptor();
var toIndexedObject = require_to_indexed_object();
var toPropertyKey = require_to_property_key();
var hasOwn = require_has_own_property();
var IE8_DOM_DEFINE = require_ie8_dom_define();
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
exports2.f = DESCRIPTORS ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O4, P4) {
O4 = toIndexedObject(O4);
P4 = toPropertyKey(P4);
if (IE8_DOM_DEFINE)
try {
return $getOwnPropertyDescriptor(O4, P4);
} catch (error2) {
}
if (hasOwn(O4, P4))
return createPropertyDescriptor(!call(propertyIsEnumerableModule.f, O4, P4), O4[P4]);
};
}
});
// node_modules/core-js/internals/v8-prototype-define-bug.js
var require_v8_prototype_define_bug = __commonJS({
"node_modules/core-js/internals/v8-prototype-define-bug.js"(exports2, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var fails = require_fails();
module2.exports = DESCRIPTORS && fails(function() {
return Object.defineProperty(function() {
}, "prototype", {
value: 42,
writable: false
}).prototype !== 42;
});
}
});
// node_modules/core-js/internals/an-object.js
var require_an_object = __commonJS({
"node_modules/core-js/internals/an-object.js"(exports2, module2) {
"use strict";
var isObject3 = require_is_object();
var $String = String;
var $TypeError = TypeError;
module2.exports = function(argument) {
if (isObject3(argument))
return argument;
throw new $TypeError($String(argument) + " is not an object");
};
}
});
// node_modules/core-js/internals/object-define-property.js
var require_object_define_property = __commonJS({
"node_modules/core-js/internals/object-define-property.js"(exports2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var IE8_DOM_DEFINE = require_ie8_dom_define();
var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug();
var anObject = require_an_object();
var toPropertyKey = require_to_property_key();
var $TypeError = TypeError;
var $defineProperty = Object.defineProperty;
var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var ENUMERABLE = "enumerable";
var CONFIGURABLE = "configurable";
var WRITABLE = "writable";
exports2.f = DESCRIPTORS ? V8_PROTOTYPE_DEFINE_BUG ? function defineProperty(O4, P4, Attributes) {
anObject(O4);
P4 = toPropertyKey(P4);
anObject(Attributes);
if (typeof O4 === "function" && P4 === "prototype" && "value" in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
var current = $getOwnPropertyDescriptor(O4, P4);
if (current && current[WRITABLE]) {
O4[P4] = Attributes.value;
Attributes = {
configurable: CONFIGURABLE in Attributes ? Attributes[CONFIGURABLE] : current[CONFIGURABLE],
enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
writable: false
};
}
}
return $defineProperty(O4, P4, Attributes);
} : $defineProperty : function defineProperty(O4, P4, Attributes) {
anObject(O4);
P4 = toPropertyKey(P4);
anObject(Attributes);
if (IE8_DOM_DEFINE)
try {
return $defineProperty(O4, P4, Attributes);
} catch (error2) {
}
if ("get" in Attributes || "set" in Attributes)
throw new $TypeError("Accessors not supported");
if ("value" in Attributes)
O4[P4] = Attributes.value;
return O4;
};
}
});
// node_modules/core-js/internals/create-non-enumerable-property.js
var require_create_non_enumerable_property = __commonJS({
"node_modules/core-js/internals/create-non-enumerable-property.js"(exports2, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var definePropertyModule = require_object_define_property();
var createPropertyDescriptor = require_create_property_descriptor();
module2.exports = DESCRIPTORS ? function(object, key, value) {
return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
} : function(object, key, value) {
object[key] = value;
return object;
};
}
});
// node_modules/core-js/internals/function-name.js
var require_function_name = __commonJS({
"node_modules/core-js/internals/function-name.js"(exports2, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var hasOwn = require_has_own_property();
var FunctionPrototype = Function.prototype;
var getDescriptor = DESCRIPTORS && Object.getOwnPropertyDescriptor;
var EXISTS = hasOwn(FunctionPrototype, "name");
var PROPER = EXISTS && function something() {
}.name === "something";
var CONFIGURABLE = EXISTS && (!DESCRIPTORS || DESCRIPTORS && getDescriptor(FunctionPrototype, "name").configurable);
module2.exports = {
EXISTS,
PROPER,
CONFIGURABLE
};
}
});
// node_modules/core-js/internals/inspect-source.js
var require_inspect_source = __commonJS({
"node_modules/core-js/internals/inspect-source.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var isCallable = require_is_callable();
var store = require_shared_store();
var functionToString = uncurryThis(Function.toString);
if (!isCallable(store.inspectSource)) {
store.inspectSource = function(it2) {
return functionToString(it2);
};
}
module2.exports = store.inspectSource;
}
});
// node_modules/core-js/internals/weak-map-basic-detection.js
var require_weak_map_basic_detection = __commonJS({
"node_modules/core-js/internals/weak-map-basic-detection.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var isCallable = require_is_callable();
var WeakMap2 = globalThis2.WeakMap;
module2.exports = isCallable(WeakMap2) && /native code/.test(String(WeakMap2));
}
});
// node_modules/core-js/internals/shared-key.js
var require_shared_key = __commonJS({
"node_modules/core-js/internals/shared-key.js"(exports2, module2) {
"use strict";
var shared = require_shared();
var uid2 = require_uid();
var keys2 = shared("keys");
module2.exports = function(key) {
return keys2[key] || (keys2[key] = uid2(key));
};
}
});
// node_modules/core-js/internals/hidden-keys.js
var require_hidden_keys = __commonJS({
"node_modules/core-js/internals/hidden-keys.js"(exports2, module2) {
"use strict";
module2.exports = {};
}
});
// node_modules/core-js/internals/internal-state.js
var require_internal_state = __commonJS({
"node_modules/core-js/internals/internal-state.js"(exports2, module2) {
"use strict";
var NATIVE_WEAK_MAP = require_weak_map_basic_detection();
var globalThis2 = require_global_this();
var isObject3 = require_is_object();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var hasOwn = require_has_own_property();
var shared = require_shared_store();
var sharedKey = require_shared_key();
var hiddenKeys = require_hidden_keys();
var OBJECT_ALREADY_INITIALIZED = "Object already initialized";
var TypeError2 = globalThis2.TypeError;
var WeakMap2 = globalThis2.WeakMap;
var set2;
var get;
var has;
var enforce = function(it2) {
return has(it2) ? get(it2) : set2(it2, {});
};
var getterFor = function(TYPE) {
return function(it2) {
var state;
if (!isObject3(it2) || (state = get(it2)).type !== TYPE) {
throw new TypeError2("Incompatible receiver, " + TYPE + " required");
}
return state;
};
};
if (NATIVE_WEAK_MAP || shared.state) {
store = shared.state || (shared.state = new WeakMap2());
store.get = store.get;
store.has = store.has;
store.set = store.set;
set2 = function(it2, metadata) {
if (store.has(it2))
throw new TypeError2(OBJECT_ALREADY_INITIALIZED);
metadata.facade = it2;
store.set(it2, metadata);
return metadata;
};
get = function(it2) {
return store.get(it2) || {};
};
has = function(it2) {
return store.has(it2);
};
} else {
STATE = sharedKey("state");
hiddenKeys[STATE] = true;
set2 = function(it2, metadata) {
if (hasOwn(it2, STATE))
throw new TypeError2(OBJECT_ALREADY_INITIALIZED);
metadata.facade = it2;
createNonEnumerableProperty(it2, STATE, metadata);
return metadata;
};
get = function(it2) {
return hasOwn(it2, STATE) ? it2[STATE] : {};
};
has = function(it2) {
return hasOwn(it2, STATE);
};
}
var store;
var STATE;
module2.exports = {
set: set2,
get,
has,
enforce,
getterFor
};
}
});
// node_modules/core-js/internals/make-built-in.js
var require_make_built_in = __commonJS({
"node_modules/core-js/internals/make-built-in.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var isCallable = require_is_callable();
var hasOwn = require_has_own_property();
var DESCRIPTORS = require_descriptors();
var CONFIGURABLE_FUNCTION_NAME = require_function_name().CONFIGURABLE;
var inspectSource = require_inspect_source();
var InternalStateModule = require_internal_state();
var enforceInternalState = InternalStateModule.enforce;
var getInternalState = InternalStateModule.get;
var $String = String;
var defineProperty = Object.defineProperty;
var stringSlice = uncurryThis("".slice);
var replace2 = uncurryThis("".replace);
var join3 = uncurryThis([].join);
var CONFIGURABLE_LENGTH = DESCRIPTORS && !fails(function() {
return defineProperty(function() {
}, "length", { value: 8 }).length !== 8;
});
var TEMPLATE = String(String).split("String");
var makeBuiltIn = module2.exports = function(value, name, options) {
if (stringSlice($String(name), 0, 7) === "Symbol(") {
name = "[" + replace2($String(name), /^Symbol\(([^)]*)\).*$/, "$1") + "]";
}
if (options && options.getter)
name = "get " + name;
if (options && options.setter)
name = "set " + name;
if (!hasOwn(value, "name") || CONFIGURABLE_FUNCTION_NAME && value.name !== name) {
if (DESCRIPTORS)
defineProperty(value, "name", { value: name, configurable: true });
else
value.name = name;
}
if (CONFIGURABLE_LENGTH && options && hasOwn(options, "arity") && value.length !== options.arity) {
defineProperty(value, "length", { value: options.arity });
}
try {
if (options && hasOwn(options, "constructor") && options.constructor) {
if (DESCRIPTORS)
defineProperty(value, "prototype", { writable: false });
} else if (value.prototype)
value.prototype = void 0;
} catch (error2) {
}
var state = enforceInternalState(value);
if (!hasOwn(state, "source")) {
state.source = join3(TEMPLATE, typeof name == "string" ? name : "");
}
return value;
};
Function.prototype.toString = makeBuiltIn(function toString() {
return isCallable(this) && getInternalState(this).source || inspectSource(this);
}, "toString");
}
});
// node_modules/core-js/internals/define-built-in.js
var require_define_built_in = __commonJS({
"node_modules/core-js/internals/define-built-in.js"(exports2, module2) {
"use strict";
var isCallable = require_is_callable();
var definePropertyModule = require_object_define_property();
var makeBuiltIn = require_make_built_in();
var defineGlobalProperty = require_define_global_property();
module2.exports = function(O4, key, value, options) {
if (!options)
options = {};
var simple2 = options.enumerable;
var name = options.name !== void 0 ? options.name : key;
if (isCallable(value))
makeBuiltIn(value, name, options);
if (options.global) {
if (simple2)
O4[key] = value;
else
defineGlobalProperty(key, value);
} else {
try {
if (!options.unsafe)
delete O4[key];
else if (O4[key])
simple2 = true;
} catch (error2) {
}
if (simple2)
O4[key] = value;
else
definePropertyModule.f(O4, key, {
value,
enumerable: false,
configurable: !options.nonConfigurable,
writable: !options.nonWritable
});
}
return O4;
};
}
});
// node_modules/core-js/internals/math-trunc.js
var require_math_trunc = __commonJS({
"node_modules/core-js/internals/math-trunc.js"(exports2, module2) {
"use strict";
var ceil = Math.ceil;
var floor = Math.floor;
module2.exports = Math.trunc || function trunc(x4) {
var n7 = +x4;
return (n7 > 0 ? floor : ceil)(n7);
};
}
});
// node_modules/core-js/internals/to-integer-or-infinity.js
var require_to_integer_or_infinity = __commonJS({
"node_modules/core-js/internals/to-integer-or-infinity.js"(exports2, module2) {
"use strict";
var trunc = require_math_trunc();
module2.exports = function(argument) {
var number = +argument;
return number !== number || number === 0 ? 0 : trunc(number);
};
}
});
// node_modules/core-js/internals/to-absolute-index.js
var require_to_absolute_index = __commonJS({
"node_modules/core-js/internals/to-absolute-index.js"(exports2, module2) {
"use strict";
var toIntegerOrInfinity = require_to_integer_or_infinity();
var max2 = Math.max;
var min2 = Math.min;
module2.exports = function(index3, length) {
var integer = toIntegerOrInfinity(index3);
return integer < 0 ? max2(integer + length, 0) : min2(integer, length);
};
}
});
// node_modules/core-js/internals/to-length.js
var require_to_length = __commonJS({
"node_modules/core-js/internals/to-length.js"(exports2, module2) {
"use strict";
var toIntegerOrInfinity = require_to_integer_or_infinity();
var min2 = Math.min;
module2.exports = function(argument) {
var len = toIntegerOrInfinity(argument);
return len > 0 ? min2(len, 9007199254740991) : 0;
};
}
});
// node_modules/core-js/internals/length-of-array-like.js
var require_length_of_array_like = __commonJS({
"node_modules/core-js/internals/length-of-array-like.js"(exports2, module2) {
"use strict";
var toLength = require_to_length();
module2.exports = function(obj) {
return toLength(obj.length);
};
}
});
// node_modules/core-js/internals/array-includes.js
var require_array_includes = __commonJS({
"node_modules/core-js/internals/array-includes.js"(exports2, module2) {
"use strict";
var toIndexedObject = require_to_indexed_object();
var toAbsoluteIndex = require_to_absolute_index();
var lengthOfArrayLike = require_length_of_array_like();
var createMethod = function(IS_INCLUDES) {
return function($this, el, fromIndex) {
var O4 = toIndexedObject($this);
var length = lengthOfArrayLike(O4);
if (length === 0)
return !IS_INCLUDES && -1;
var index3 = toAbsoluteIndex(fromIndex, length);
var value;
if (IS_INCLUDES && el !== el)
while (length > index3) {
value = O4[index3++];
if (value !== value)
return true;
}
else
for (; length > index3; index3++) {
if ((IS_INCLUDES || index3 in O4) && O4[index3] === el)
return IS_INCLUDES || index3 || 0;
}
return !IS_INCLUDES && -1;
};
};
module2.exports = {
includes: createMethod(true),
indexOf: createMethod(false)
};
}
});
// node_modules/core-js/internals/object-keys-internal.js
var require_object_keys_internal = __commonJS({
"node_modules/core-js/internals/object-keys-internal.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var hasOwn = require_has_own_property();
var toIndexedObject = require_to_indexed_object();
var indexOf2 = require_array_includes().indexOf;
var hiddenKeys = require_hidden_keys();
var push = uncurryThis([].push);
module2.exports = function(object, names2) {
var O4 = toIndexedObject(object);
var i5 = 0;
var result = [];
var key;
for (key in O4)
!hasOwn(hiddenKeys, key) && hasOwn(O4, key) && push(result, key);
while (names2.length > i5)
if (hasOwn(O4, key = names2[i5++])) {
~indexOf2(result, key) || push(result, key);
}
return result;
};
}
});
// node_modules/core-js/internals/enum-bug-keys.js
var require_enum_bug_keys = __commonJS({
"node_modules/core-js/internals/enum-bug-keys.js"(exports2, module2) {
"use strict";
module2.exports = [
"constructor",
"hasOwnProperty",
"isPrototypeOf",
"propertyIsEnumerable",
"toLocaleString",
"toString",
"valueOf"
];
}
});
// node_modules/core-js/internals/object-get-own-property-names.js
var require_object_get_own_property_names = __commonJS({
"node_modules/core-js/internals/object-get-own-property-names.js"(exports2) {
"use strict";
var internalObjectKeys = require_object_keys_internal();
var enumBugKeys = require_enum_bug_keys();
var hiddenKeys = enumBugKeys.concat("length", "prototype");
exports2.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O4) {
return internalObjectKeys(O4, hiddenKeys);
};
}
});
// node_modules/core-js/internals/object-get-own-property-symbols.js
var require_object_get_own_property_symbols = __commonJS({
"node_modules/core-js/internals/object-get-own-property-symbols.js"(exports2) {
"use strict";
exports2.f = Object.getOwnPropertySymbols;
}
});
// node_modules/core-js/internals/own-keys.js
var require_own_keys = __commonJS({
"node_modules/core-js/internals/own-keys.js"(exports2, module2) {
"use strict";
var getBuiltIn = require_get_built_in();
var uncurryThis = require_function_uncurry_this();
var getOwnPropertyNamesModule = require_object_get_own_property_names();
var getOwnPropertySymbolsModule = require_object_get_own_property_symbols();
var anObject = require_an_object();
var concat = uncurryThis([].concat);
module2.exports = getBuiltIn("Reflect", "ownKeys") || function ownKeys26(it2) {
var keys2 = getOwnPropertyNamesModule.f(anObject(it2));
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
return getOwnPropertySymbols ? concat(keys2, getOwnPropertySymbols(it2)) : keys2;
};
}
});
// node_modules/core-js/internals/copy-constructor-properties.js
var require_copy_constructor_properties = __commonJS({
"node_modules/core-js/internals/copy-constructor-properties.js"(exports2, module2) {
"use strict";
var hasOwn = require_has_own_property();
var ownKeys26 = require_own_keys();
var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
var definePropertyModule = require_object_define_property();
module2.exports = function(target, source, exceptions) {
var keys2 = ownKeys26(source);
var defineProperty = definePropertyModule.f;
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
for (var i5 = 0; i5 < keys2.length; i5++) {
var key = keys2[i5];
if (!hasOwn(target, key) && !(exceptions && hasOwn(exceptions, key))) {
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
}
}
};
}
});
// node_modules/core-js/internals/is-forced.js
var require_is_forced = __commonJS({
"node_modules/core-js/internals/is-forced.js"(exports2, module2) {
"use strict";
var fails = require_fails();
var isCallable = require_is_callable();
var replacement = /#|\.prototype\./;
var isForced = function(feature, detection) {
var value = data[normalize2(feature)];
return value === POLYFILL ? true : value === NATIVE ? false : isCallable(detection) ? fails(detection) : !!detection;
};
var normalize2 = isForced.normalize = function(string) {
return String(string).replace(replacement, ".").toLowerCase();
};
var data = isForced.data = {};
var NATIVE = isForced.NATIVE = "N";
var POLYFILL = isForced.POLYFILL = "P";
module2.exports = isForced;
}
});
// node_modules/core-js/internals/export.js
var require_export = __commonJS({
"node_modules/core-js/internals/export.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
var createNonEnumerableProperty = require_create_non_enumerable_property();
var defineBuiltIn = require_define_built_in();
var defineGlobalProperty = require_define_global_property();
var copyConstructorProperties = require_copy_constructor_properties();
var isForced = require_is_forced();
module2.exports = function(options, source) {
var TARGET = options.target;
var GLOBAL = options.global;
var STATIC = options.stat;
var FORCED, target, key, targetProperty, sourceProperty, descriptor;
if (GLOBAL) {
target = globalThis2;
} else if (STATIC) {
target = globalThis2[TARGET] || defineGlobalProperty(TARGET, {});
} else {
target = globalThis2[TARGET] && globalThis2[TARGET].prototype;
}
if (target)
for (key in source) {
sourceProperty = source[key];
if (options.dontCallGetSet) {
descriptor = getOwnPropertyDescriptor(target, key);
targetProperty = descriptor && descriptor.value;
} else
targetProperty = target[key];
FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced);
if (!FORCED && targetProperty !== void 0) {
if (typeof sourceProperty == typeof targetProperty)
continue;
copyConstructorProperties(sourceProperty, targetProperty);
}
if (options.sham || targetProperty && targetProperty.sham) {
createNonEnumerableProperty(sourceProperty, "sham", true);
}
defineBuiltIn(target, key, sourceProperty, options);
}
};
}
});
// node_modules/core-js/internals/to-string-tag-support.js
var require_to_string_tag_support = __commonJS({
"node_modules/core-js/internals/to-string-tag-support.js"(exports2, module2) {
"use strict";
var wellKnownSymbol = require_well_known_symbol();
var TO_STRING_TAG = wellKnownSymbol("toStringTag");
var test = {};
test[TO_STRING_TAG] = "z";
module2.exports = String(test) === "[object z]";
}
});
// node_modules/core-js/internals/classof.js
var require_classof = __commonJS({
"node_modules/core-js/internals/classof.js"(exports2, module2) {
"use strict";
var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
var isCallable = require_is_callable();
var classofRaw = require_classof_raw();
var wellKnownSymbol = require_well_known_symbol();
var TO_STRING_TAG = wellKnownSymbol("toStringTag");
var $Object = Object;
var CORRECT_ARGUMENTS = classofRaw(function() {
return arguments;
}()) === "Arguments";
var tryGet = function(it2, key) {
try {
return it2[key];
} catch (error2) {
}
};
module2.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function(it2) {
var O4, tag, result;
return it2 === void 0 ? "Undefined" : it2 === null ? "Null" : typeof (tag = tryGet(O4 = $Object(it2), TO_STRING_TAG)) == "string" ? tag : CORRECT_ARGUMENTS ? classofRaw(O4) : (result = classofRaw(O4)) === "Object" && isCallable(O4.callee) ? "Arguments" : result;
};
}
});
// node_modules/core-js/internals/to-string.js
var require_to_string = __commonJS({
"node_modules/core-js/internals/to-string.js"(exports2, module2) {
"use strict";
var classof = require_classof();
var $String = String;
module2.exports = function(argument) {
if (classof(argument) === "Symbol")
throw new TypeError("Cannot convert a Symbol value to a string");
return $String(argument);
};
}
});
// node_modules/core-js/internals/object-keys.js
var require_object_keys = __commonJS({
"node_modules/core-js/internals/object-keys.js"(exports2, module2) {
"use strict";
var internalObjectKeys = require_object_keys_internal();
var enumBugKeys = require_enum_bug_keys();
module2.exports = Object.keys || function keys2(O4) {
return internalObjectKeys(O4, enumBugKeys);
};
}
});
// node_modules/core-js/internals/object-define-properties.js
var require_object_define_properties = __commonJS({
"node_modules/core-js/internals/object-define-properties.js"(exports2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var V8_PROTOTYPE_DEFINE_BUG = require_v8_prototype_define_bug();
var definePropertyModule = require_object_define_property();
var anObject = require_an_object();
var toIndexedObject = require_to_indexed_object();
var objectKeys = require_object_keys();
exports2.f = DESCRIPTORS && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O4, Properties) {
anObject(O4);
var props = toIndexedObject(Properties);
var keys2 = objectKeys(Properties);
var length = keys2.length;
var index3 = 0;
var key;
while (length > index3)
definePropertyModule.f(O4, key = keys2[index3++], props[key]);
return O4;
};
}
});
// node_modules/core-js/internals/html.js
var require_html = __commonJS({
"node_modules/core-js/internals/html.js"(exports2, module2) {
"use strict";
var getBuiltIn = require_get_built_in();
module2.exports = getBuiltIn("document", "documentElement");
}
});
// node_modules/core-js/internals/object-create.js
var require_object_create = __commonJS({
"node_modules/core-js/internals/object-create.js"(exports2, module2) {
"use strict";
var anObject = require_an_object();
var definePropertiesModule = require_object_define_properties();
var enumBugKeys = require_enum_bug_keys();
var hiddenKeys = require_hidden_keys();
var html = require_html();
var documentCreateElement = require_document_create_element();
var sharedKey = require_shared_key();
var GT = ">";
var LT = "<";
var PROTOTYPE = "prototype";
var SCRIPT = "script";
var IE_PROTO = sharedKey("IE_PROTO");
var EmptyConstructor = function() {
};
var scriptTag = function(content) {
return LT + SCRIPT + GT + content + LT + "/" + SCRIPT + GT;
};
var NullProtoObjectViaActiveX = function(activeXDocument2) {
activeXDocument2.write(scriptTag(""));
activeXDocument2.close();
var temp = activeXDocument2.parentWindow.Object;
activeXDocument2 = null;
return temp;
};
var NullProtoObjectViaIFrame = function() {
var iframe = documentCreateElement("iframe");
var JS = "java" + SCRIPT + ":";
var iframeDocument;
iframe.style.display = "none";
html.appendChild(iframe);
iframe.src = String(JS);
iframeDocument = iframe.contentWindow.document;
iframeDocument.open();
iframeDocument.write(scriptTag("document.F=Object"));
iframeDocument.close();
return iframeDocument.F;
};
var activeXDocument;
var NullProtoObject = function() {
try {
activeXDocument = new ActiveXObject("htmlfile");
} catch (error2) {
}
NullProtoObject = typeof document != "undefined" ? document.domain && activeXDocument ? NullProtoObjectViaActiveX(activeXDocument) : NullProtoObjectViaIFrame() : NullProtoObjectViaActiveX(activeXDocument);
var length = enumBugKeys.length;
while (length--)
delete NullProtoObject[PROTOTYPE][enumBugKeys[length]];
return NullProtoObject();
};
hiddenKeys[IE_PROTO] = true;
module2.exports = Object.create || function create(O4, Properties) {
var result;
if (O4 !== null) {
EmptyConstructor[PROTOTYPE] = anObject(O4);
result = new EmptyConstructor();
EmptyConstructor[PROTOTYPE] = null;
result[IE_PROTO] = O4;
} else
result = NullProtoObject();
return Properties === void 0 ? result : definePropertiesModule.f(result, Properties);
};
}
});
// node_modules/core-js/internals/array-slice.js
var require_array_slice = __commonJS({
"node_modules/core-js/internals/array-slice.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
module2.exports = uncurryThis([].slice);
}
});
// node_modules/core-js/internals/object-get-own-property-names-external.js
var require_object_get_own_property_names_external = __commonJS({
"node_modules/core-js/internals/object-get-own-property-names-external.js"(exports2, module2) {
"use strict";
var classof = require_classof_raw();
var toIndexedObject = require_to_indexed_object();
var $getOwnPropertyNames = require_object_get_own_property_names().f;
var arraySlice = require_array_slice();
var windowNames = typeof window == "object" && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
var getWindowNames = function(it2) {
try {
return $getOwnPropertyNames(it2);
} catch (error2) {
return arraySlice(windowNames);
}
};
module2.exports.f = function getOwnPropertyNames(it2) {
return windowNames && classof(it2) === "Window" ? getWindowNames(it2) : $getOwnPropertyNames(toIndexedObject(it2));
};
}
});
// node_modules/core-js/internals/define-built-in-accessor.js
var require_define_built_in_accessor = __commonJS({
"node_modules/core-js/internals/define-built-in-accessor.js"(exports2, module2) {
"use strict";
var makeBuiltIn = require_make_built_in();
var defineProperty = require_object_define_property();
module2.exports = function(target, name, descriptor) {
if (descriptor.get)
makeBuiltIn(descriptor.get, name, { getter: true });
if (descriptor.set)
makeBuiltIn(descriptor.set, name, { setter: true });
return defineProperty.f(target, name, descriptor);
};
}
});
// node_modules/core-js/internals/well-known-symbol-wrapped.js
var require_well_known_symbol_wrapped = __commonJS({
"node_modules/core-js/internals/well-known-symbol-wrapped.js"(exports2) {
"use strict";
var wellKnownSymbol = require_well_known_symbol();
exports2.f = wellKnownSymbol;
}
});
// node_modules/core-js/internals/path.js
var require_path = __commonJS({
"node_modules/core-js/internals/path.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
module2.exports = globalThis2;
}
});
// node_modules/core-js/internals/well-known-symbol-define.js
var require_well_known_symbol_define = __commonJS({
"node_modules/core-js/internals/well-known-symbol-define.js"(exports2, module2) {
"use strict";
var path = require_path();
var hasOwn = require_has_own_property();
var wrappedWellKnownSymbolModule = require_well_known_symbol_wrapped();
var defineProperty = require_object_define_property().f;
module2.exports = function(NAME) {
var Symbol2 = path.Symbol || (path.Symbol = {});
if (!hasOwn(Symbol2, NAME))
defineProperty(Symbol2, NAME, {
value: wrappedWellKnownSymbolModule.f(NAME)
});
};
}
});
// node_modules/core-js/internals/symbol-define-to-primitive.js
var require_symbol_define_to_primitive = __commonJS({
"node_modules/core-js/internals/symbol-define-to-primitive.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var getBuiltIn = require_get_built_in();
var wellKnownSymbol = require_well_known_symbol();
var defineBuiltIn = require_define_built_in();
module2.exports = function() {
var Symbol2 = getBuiltIn("Symbol");
var SymbolPrototype = Symbol2 && Symbol2.prototype;
var valueOf = SymbolPrototype && SymbolPrototype.valueOf;
var TO_PRIMITIVE = wellKnownSymbol("toPrimitive");
if (SymbolPrototype && !SymbolPrototype[TO_PRIMITIVE]) {
defineBuiltIn(SymbolPrototype, TO_PRIMITIVE, function(hint) {
return call(valueOf, this);
}, { arity: 1 });
}
};
}
});
// node_modules/core-js/internals/set-to-string-tag.js
var require_set_to_string_tag = __commonJS({
"node_modules/core-js/internals/set-to-string-tag.js"(exports2, module2) {
"use strict";
var defineProperty = require_object_define_property().f;
var hasOwn = require_has_own_property();
var wellKnownSymbol = require_well_known_symbol();
var TO_STRING_TAG = wellKnownSymbol("toStringTag");
module2.exports = function(target, TAG, STATIC) {
if (target && !STATIC)
target = target.prototype;
if (target && !hasOwn(target, TO_STRING_TAG)) {
defineProperty(target, TO_STRING_TAG, { configurable: true, value: TAG });
}
};
}
});
// node_modules/core-js/internals/function-uncurry-this-clause.js
var require_function_uncurry_this_clause = __commonJS({
"node_modules/core-js/internals/function-uncurry-this-clause.js"(exports2, module2) {
"use strict";
var classofRaw = require_classof_raw();
var uncurryThis = require_function_uncurry_this();
module2.exports = function(fn3) {
if (classofRaw(fn3) === "Function")
return uncurryThis(fn3);
};
}
});
// node_modules/core-js/internals/function-bind-context.js
var require_function_bind_context = __commonJS({
"node_modules/core-js/internals/function-bind-context.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this_clause();
var aCallable = require_a_callable();
var NATIVE_BIND = require_function_bind_native();
var bind3 = uncurryThis(uncurryThis.bind);
module2.exports = function(fn3, that) {
aCallable(fn3);
return that === void 0 ? fn3 : NATIVE_BIND ? bind3(fn3, that) : function() {
return fn3.apply(that, arguments);
};
};
}
});
// node_modules/core-js/internals/is-array.js
var require_is_array = __commonJS({
"node_modules/core-js/internals/is-array.js"(exports2, module2) {
"use strict";
var classof = require_classof_raw();
module2.exports = Array.isArray || function isArray2(argument) {
return classof(argument) === "Array";
};
}
});
// node_modules/core-js/internals/is-constructor.js
var require_is_constructor = __commonJS({
"node_modules/core-js/internals/is-constructor.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var isCallable = require_is_callable();
var classof = require_classof();
var getBuiltIn = require_get_built_in();
var inspectSource = require_inspect_source();
var noop6 = function() {
};
var construct = getBuiltIn("Reflect", "construct");
var constructorRegExp = /^\s*(?:class|function)\b/;
var exec = uncurryThis(constructorRegExp.exec);
var INCORRECT_TO_STRING = !constructorRegExp.test(noop6);
var isConstructorModern = function isConstructor(argument) {
if (!isCallable(argument))
return false;
try {
construct(noop6, [], argument);
return true;
} catch (error2) {
return false;
}
};
var isConstructorLegacy = function isConstructor(argument) {
if (!isCallable(argument))
return false;
switch (classof(argument)) {
case "AsyncFunction":
case "GeneratorFunction":
case "AsyncGeneratorFunction":
return false;
}
try {
return INCORRECT_TO_STRING || !!exec(constructorRegExp, inspectSource(argument));
} catch (error2) {
return true;
}
};
isConstructorLegacy.sham = true;
module2.exports = !construct || fails(function() {
var called;
return isConstructorModern(isConstructorModern.call) || !isConstructorModern(Object) || !isConstructorModern(function() {
called = true;
}) || called;
}) ? isConstructorLegacy : isConstructorModern;
}
});
// node_modules/core-js/internals/array-species-constructor.js
var require_array_species_constructor = __commonJS({
"node_modules/core-js/internals/array-species-constructor.js"(exports2, module2) {
"use strict";
var isArray2 = require_is_array();
var isConstructor = require_is_constructor();
var isObject3 = require_is_object();
var wellKnownSymbol = require_well_known_symbol();
var SPECIES = wellKnownSymbol("species");
var $Array = Array;
module2.exports = function(originalArray) {
var C4;
if (isArray2(originalArray)) {
C4 = originalArray.constructor;
if (isConstructor(C4) && (C4 === $Array || isArray2(C4.prototype)))
C4 = void 0;
else if (isObject3(C4)) {
C4 = C4[SPECIES];
if (C4 === null)
C4 = void 0;
}
}
return C4 === void 0 ? $Array : C4;
};
}
});
// node_modules/core-js/internals/array-species-create.js
var require_array_species_create = __commonJS({
"node_modules/core-js/internals/array-species-create.js"(exports2, module2) {
"use strict";
var arraySpeciesConstructor = require_array_species_constructor();
module2.exports = function(originalArray, length) {
return new (arraySpeciesConstructor(originalArray))(length === 0 ? 0 : length);
};
}
});
// node_modules/core-js/internals/array-iteration.js
var require_array_iteration = __commonJS({
"node_modules/core-js/internals/array-iteration.js"(exports2, module2) {
"use strict";
var bind3 = require_function_bind_context();
var uncurryThis = require_function_uncurry_this();
var IndexedObject = require_indexed_object();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var arraySpeciesCreate = require_array_species_create();
var push = uncurryThis([].push);
var createMethod = function(TYPE) {
var IS_MAP = TYPE === 1;
var IS_FILTER = TYPE === 2;
var IS_SOME = TYPE === 3;
var IS_EVERY = TYPE === 4;
var IS_FIND_INDEX = TYPE === 6;
var IS_FILTER_REJECT = TYPE === 7;
var NO_HOLES = TYPE === 5 || IS_FIND_INDEX;
return function($this, callbackfn, that, specificCreate) {
var O4 = toObject($this);
var self2 = IndexedObject(O4);
var length = lengthOfArrayLike(self2);
var boundFunction = bind3(callbackfn, that);
var index3 = 0;
var create = specificCreate || arraySpeciesCreate;
var target = IS_MAP ? create($this, length) : IS_FILTER || IS_FILTER_REJECT ? create($this, 0) : void 0;
var value, result;
for (; length > index3; index3++)
if (NO_HOLES || index3 in self2) {
value = self2[index3];
result = boundFunction(value, index3, O4);
if (TYPE) {
if (IS_MAP)
target[index3] = result;
else if (result)
switch (TYPE) {
case 3:
return true;
case 5:
return value;
case 6:
return index3;
case 2:
push(target, value);
}
else
switch (TYPE) {
case 4:
return false;
case 7:
push(target, value);
}
}
}
return IS_FIND_INDEX ? -1 : IS_SOME || IS_EVERY ? IS_EVERY : target;
};
};
module2.exports = {
forEach: createMethod(0),
map: createMethod(1),
filter: createMethod(2),
some: createMethod(3),
every: createMethod(4),
find: createMethod(5),
findIndex: createMethod(6),
filterReject: createMethod(7)
};
}
});
// node_modules/core-js/modules/es.symbol.constructor.js
var require_es_symbol_constructor = __commonJS({
"node_modules/core-js/modules/es.symbol.constructor.js"() {
"use strict";
var $3 = require_export();
var globalThis2 = require_global_this();
var call = require_function_call();
var uncurryThis = require_function_uncurry_this();
var IS_PURE = require_is_pure();
var DESCRIPTORS = require_descriptors();
var NATIVE_SYMBOL = require_symbol_constructor_detection();
var fails = require_fails();
var hasOwn = require_has_own_property();
var isPrototypeOf = require_object_is_prototype_of();
var anObject = require_an_object();
var toIndexedObject = require_to_indexed_object();
var toPropertyKey = require_to_property_key();
var $toString = require_to_string();
var createPropertyDescriptor = require_create_property_descriptor();
var nativeObjectCreate = require_object_create();
var objectKeys = require_object_keys();
var getOwnPropertyNamesModule = require_object_get_own_property_names();
var getOwnPropertyNamesExternal = require_object_get_own_property_names_external();
var getOwnPropertySymbolsModule = require_object_get_own_property_symbols();
var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
var definePropertyModule = require_object_define_property();
var definePropertiesModule = require_object_define_properties();
var propertyIsEnumerableModule = require_object_property_is_enumerable();
var defineBuiltIn = require_define_built_in();
var defineBuiltInAccessor = require_define_built_in_accessor();
var shared = require_shared();
var sharedKey = require_shared_key();
var hiddenKeys = require_hidden_keys();
var uid2 = require_uid();
var wellKnownSymbol = require_well_known_symbol();
var wrappedWellKnownSymbolModule = require_well_known_symbol_wrapped();
var defineWellKnownSymbol = require_well_known_symbol_define();
var defineSymbolToPrimitive = require_symbol_define_to_primitive();
var setToStringTag = require_set_to_string_tag();
var InternalStateModule = require_internal_state();
var $forEach = require_array_iteration().forEach;
var HIDDEN = sharedKey("hidden");
var SYMBOL = "Symbol";
var PROTOTYPE = "prototype";
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(SYMBOL);
var ObjectPrototype = Object[PROTOTYPE];
var $Symbol = globalThis2.Symbol;
var SymbolPrototype = $Symbol && $Symbol[PROTOTYPE];
var RangeError2 = globalThis2.RangeError;
var TypeError2 = globalThis2.TypeError;
var QObject = globalThis2.QObject;
var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
var nativeDefineProperty = definePropertyModule.f;
var nativeGetOwnPropertyNames = getOwnPropertyNamesExternal.f;
var nativePropertyIsEnumerable = propertyIsEnumerableModule.f;
var push = uncurryThis([].push);
var AllSymbols = shared("symbols");
var ObjectPrototypeSymbols = shared("op-symbols");
var WellKnownSymbolsStore = shared("wks");
var USE_SETTER = !QObject || !QObject[PROTOTYPE] || !QObject[PROTOTYPE].findChild;
var fallbackDefineProperty = function(O4, P4, Attributes) {
var ObjectPrototypeDescriptor = nativeGetOwnPropertyDescriptor(ObjectPrototype, P4);
if (ObjectPrototypeDescriptor)
delete ObjectPrototype[P4];
nativeDefineProperty(O4, P4, Attributes);
if (ObjectPrototypeDescriptor && O4 !== ObjectPrototype) {
nativeDefineProperty(ObjectPrototype, P4, ObjectPrototypeDescriptor);
}
};
var setSymbolDescriptor = DESCRIPTORS && fails(function() {
return nativeObjectCreate(nativeDefineProperty({}, "a", {
get: function() {
return nativeDefineProperty(this, "a", { value: 7 }).a;
}
})).a !== 7;
}) ? fallbackDefineProperty : nativeDefineProperty;
var wrap3 = function(tag, description) {
var symbol = AllSymbols[tag] = nativeObjectCreate(SymbolPrototype);
setInternalState(symbol, {
type: SYMBOL,
tag,
description
});
if (!DESCRIPTORS)
symbol.description = description;
return symbol;
};
var $defineProperty = function defineProperty(O4, P4, Attributes) {
if (O4 === ObjectPrototype)
$defineProperty(ObjectPrototypeSymbols, P4, Attributes);
anObject(O4);
var key = toPropertyKey(P4);
anObject(Attributes);
if (hasOwn(AllSymbols, key)) {
if (!Attributes.enumerable) {
if (!hasOwn(O4, HIDDEN))
nativeDefineProperty(O4, HIDDEN, createPropertyDescriptor(1, nativeObjectCreate(null)));
O4[HIDDEN][key] = true;
} else {
if (hasOwn(O4, HIDDEN) && O4[HIDDEN][key])
O4[HIDDEN][key] = false;
Attributes = nativeObjectCreate(Attributes, { enumerable: createPropertyDescriptor(0, false) });
}
return setSymbolDescriptor(O4, key, Attributes);
}
return nativeDefineProperty(O4, key, Attributes);
};
var $defineProperties = function defineProperties(O4, Properties) {
anObject(O4);
var properties = toIndexedObject(Properties);
var keys2 = objectKeys(properties).concat($getOwnPropertySymbols(properties));
$forEach(keys2, function(key) {
if (!DESCRIPTORS || call($propertyIsEnumerable, properties, key))
$defineProperty(O4, key, properties[key]);
});
return O4;
};
var $create = function create(O4, Properties) {
return Properties === void 0 ? nativeObjectCreate(O4) : $defineProperties(nativeObjectCreate(O4), Properties);
};
var $propertyIsEnumerable = function propertyIsEnumerable(V3) {
var P4 = toPropertyKey(V3);
var enumerable2 = call(nativePropertyIsEnumerable, this, P4);
if (this === ObjectPrototype && hasOwn(AllSymbols, P4) && !hasOwn(ObjectPrototypeSymbols, P4))
return false;
return enumerable2 || !hasOwn(this, P4) || !hasOwn(AllSymbols, P4) || hasOwn(this, HIDDEN) && this[HIDDEN][P4] ? enumerable2 : true;
};
var $getOwnPropertyDescriptor = function getOwnPropertyDescriptor(O4, P4) {
var it2 = toIndexedObject(O4);
var key = toPropertyKey(P4);
if (it2 === ObjectPrototype && hasOwn(AllSymbols, key) && !hasOwn(ObjectPrototypeSymbols, key))
return;
var descriptor = nativeGetOwnPropertyDescriptor(it2, key);
if (descriptor && hasOwn(AllSymbols, key) && !(hasOwn(it2, HIDDEN) && it2[HIDDEN][key])) {
descriptor.enumerable = true;
}
return descriptor;
};
var $getOwnPropertyNames = function getOwnPropertyNames(O4) {
var names2 = nativeGetOwnPropertyNames(toIndexedObject(O4));
var result = [];
$forEach(names2, function(key) {
if (!hasOwn(AllSymbols, key) && !hasOwn(hiddenKeys, key))
push(result, key);
});
return result;
};
var $getOwnPropertySymbols = function(O4) {
var IS_OBJECT_PROTOTYPE = O4 === ObjectPrototype;
var names2 = nativeGetOwnPropertyNames(IS_OBJECT_PROTOTYPE ? ObjectPrototypeSymbols : toIndexedObject(O4));
var result = [];
$forEach(names2, function(key) {
if (hasOwn(AllSymbols, key) && (!IS_OBJECT_PROTOTYPE || hasOwn(ObjectPrototype, key))) {
push(result, AllSymbols[key]);
}
});
return result;
};
if (!NATIVE_SYMBOL) {
$Symbol = function Symbol2() {
if (isPrototypeOf(SymbolPrototype, this))
throw new TypeError2("Symbol is not a constructor");
var description = !arguments.length || arguments[0] === void 0 ? void 0 : $toString(arguments[0]);
var tag = uid2(description);
var setter = function(value) {
var $this = this === void 0 ? globalThis2 : this;
if ($this === ObjectPrototype)
call(setter, ObjectPrototypeSymbols, value);
if (hasOwn($this, HIDDEN) && hasOwn($this[HIDDEN], tag))
$this[HIDDEN][tag] = false;
var descriptor = createPropertyDescriptor(1, value);
try {
setSymbolDescriptor($this, tag, descriptor);
} catch (error2) {
if (!(error2 instanceof RangeError2))
throw error2;
fallbackDefineProperty($this, tag, descriptor);
}
};
if (DESCRIPTORS && USE_SETTER)
setSymbolDescriptor(ObjectPrototype, tag, { configurable: true, set: setter });
return wrap3(tag, description);
};
SymbolPrototype = $Symbol[PROTOTYPE];
defineBuiltIn(SymbolPrototype, "toString", function toString() {
return getInternalState(this).tag;
});
defineBuiltIn($Symbol, "withoutSetter", function(description) {
return wrap3(uid2(description), description);
});
propertyIsEnumerableModule.f = $propertyIsEnumerable;
definePropertyModule.f = $defineProperty;
definePropertiesModule.f = $defineProperties;
getOwnPropertyDescriptorModule.f = $getOwnPropertyDescriptor;
getOwnPropertyNamesModule.f = getOwnPropertyNamesExternal.f = $getOwnPropertyNames;
getOwnPropertySymbolsModule.f = $getOwnPropertySymbols;
wrappedWellKnownSymbolModule.f = function(name) {
return wrap3(wellKnownSymbol(name), name);
};
if (DESCRIPTORS) {
defineBuiltInAccessor(SymbolPrototype, "description", {
configurable: true,
get: function description() {
return getInternalState(this).description;
}
});
if (!IS_PURE) {
defineBuiltIn(ObjectPrototype, "propertyIsEnumerable", $propertyIsEnumerable, { unsafe: true });
}
}
}
$3({ global: true, constructor: true, wrap: true, forced: !NATIVE_SYMBOL, sham: !NATIVE_SYMBOL }, {
Symbol: $Symbol
});
$forEach(objectKeys(WellKnownSymbolsStore), function(name) {
defineWellKnownSymbol(name);
});
$3({ target: SYMBOL, stat: true, forced: !NATIVE_SYMBOL }, {
useSetter: function() {
USE_SETTER = true;
},
useSimple: function() {
USE_SETTER = false;
}
});
$3({ target: "Object", stat: true, forced: !NATIVE_SYMBOL, sham: !DESCRIPTORS }, {
create: $create,
defineProperty: $defineProperty,
defineProperties: $defineProperties,
getOwnPropertyDescriptor: $getOwnPropertyDescriptor
});
$3({ target: "Object", stat: true, forced: !NATIVE_SYMBOL }, {
getOwnPropertyNames: $getOwnPropertyNames
});
defineSymbolToPrimitive();
setToStringTag($Symbol, SYMBOL);
hiddenKeys[HIDDEN] = true;
}
});
// node_modules/core-js/internals/symbol-registry-detection.js
var require_symbol_registry_detection = __commonJS({
"node_modules/core-js/internals/symbol-registry-detection.js"(exports2, module2) {
"use strict";
var NATIVE_SYMBOL = require_symbol_constructor_detection();
module2.exports = NATIVE_SYMBOL && !!Symbol["for"] && !!Symbol.keyFor;
}
});
// node_modules/core-js/modules/es.symbol.for.js
var require_es_symbol_for = __commonJS({
"node_modules/core-js/modules/es.symbol.for.js"() {
"use strict";
var $3 = require_export();
var getBuiltIn = require_get_built_in();
var hasOwn = require_has_own_property();
var toString = require_to_string();
var shared = require_shared();
var NATIVE_SYMBOL_REGISTRY = require_symbol_registry_detection();
var StringToSymbolRegistry = shared("string-to-symbol-registry");
var SymbolToStringRegistry = shared("symbol-to-string-registry");
$3({ target: "Symbol", stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
"for": function(key) {
var string = toString(key);
if (hasOwn(StringToSymbolRegistry, string))
return StringToSymbolRegistry[string];
var symbol = getBuiltIn("Symbol")(string);
StringToSymbolRegistry[string] = symbol;
SymbolToStringRegistry[symbol] = string;
return symbol;
}
});
}
});
// node_modules/core-js/modules/es.symbol.key-for.js
var require_es_symbol_key_for = __commonJS({
"node_modules/core-js/modules/es.symbol.key-for.js"() {
"use strict";
var $3 = require_export();
var hasOwn = require_has_own_property();
var isSymbol = require_is_symbol();
var tryToString = require_try_to_string();
var shared = require_shared();
var NATIVE_SYMBOL_REGISTRY = require_symbol_registry_detection();
var SymbolToStringRegistry = shared("symbol-to-string-registry");
$3({ target: "Symbol", stat: true, forced: !NATIVE_SYMBOL_REGISTRY }, {
keyFor: function keyFor(sym) {
if (!isSymbol(sym))
throw new TypeError(tryToString(sym) + " is not a symbol");
if (hasOwn(SymbolToStringRegistry, sym))
return SymbolToStringRegistry[sym];
}
});
}
});
// node_modules/core-js/internals/function-apply.js
var require_function_apply = __commonJS({
"node_modules/core-js/internals/function-apply.js"(exports2, module2) {
"use strict";
var NATIVE_BIND = require_function_bind_native();
var FunctionPrototype = Function.prototype;
var apply2 = FunctionPrototype.apply;
var call = FunctionPrototype.call;
module2.exports = typeof Reflect == "object" && Reflect.apply || (NATIVE_BIND ? call.bind(apply2) : function() {
return call.apply(apply2, arguments);
});
}
});
// node_modules/core-js/internals/get-json-replacer-function.js
var require_get_json_replacer_function = __commonJS({
"node_modules/core-js/internals/get-json-replacer-function.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var isArray2 = require_is_array();
var isCallable = require_is_callable();
var classof = require_classof_raw();
var toString = require_to_string();
var push = uncurryThis([].push);
module2.exports = function(replacer) {
if (isCallable(replacer))
return replacer;
if (!isArray2(replacer))
return;
var rawLength = replacer.length;
var keys2 = [];
for (var i5 = 0; i5 < rawLength; i5++) {
var element = replacer[i5];
if (typeof element == "string")
push(keys2, element);
else if (typeof element == "number" || classof(element) === "Number" || classof(element) === "String")
push(keys2, toString(element));
}
var keysLength = keys2.length;
var root = true;
return function(key, value) {
if (root) {
root = false;
return value;
}
if (isArray2(this))
return value;
for (var j4 = 0; j4 < keysLength; j4++)
if (keys2[j4] === key)
return value;
};
};
}
});
// node_modules/core-js/modules/es.json.stringify.js
var require_es_json_stringify = __commonJS({
"node_modules/core-js/modules/es.json.stringify.js"() {
"use strict";
var $3 = require_export();
var getBuiltIn = require_get_built_in();
var apply2 = require_function_apply();
var call = require_function_call();
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var isCallable = require_is_callable();
var isSymbol = require_is_symbol();
var arraySlice = require_array_slice();
var getReplacerFunction = require_get_json_replacer_function();
var NATIVE_SYMBOL = require_symbol_constructor_detection();
var $String = String;
var $stringify = getBuiltIn("JSON", "stringify");
var exec = uncurryThis(/./.exec);
var charAt = uncurryThis("".charAt);
var charCodeAt = uncurryThis("".charCodeAt);
var replace2 = uncurryThis("".replace);
var numberToString = uncurryThis(1 .toString);
var tester = /[\uD800-\uDFFF]/g;
var low = /^[\uD800-\uDBFF]$/;
var hi2 = /^[\uDC00-\uDFFF]$/;
var WRONG_SYMBOLS_CONVERSION = !NATIVE_SYMBOL || fails(function() {
var symbol = getBuiltIn("Symbol")("stringify detection");
return $stringify([symbol]) !== "[null]" || $stringify({ a: symbol }) !== "{}" || $stringify(Object(symbol)) !== "{}";
});
var ILL_FORMED_UNICODE = fails(function() {
return $stringify("\uDF06\uD834") !== '"\\udf06\\ud834"' || $stringify("\uDEAD") !== '"\\udead"';
});
var stringifyWithSymbolsFix = function(it2, replacer) {
var args = arraySlice(arguments);
var $replacer = getReplacerFunction(replacer);
if (!isCallable($replacer) && (it2 === void 0 || isSymbol(it2)))
return;
args[1] = function(key, value) {
if (isCallable($replacer))
value = call($replacer, this, $String(key), value);
if (!isSymbol(value))
return value;
};
return apply2($stringify, null, args);
};
var fixIllFormed = function(match3, offset3, string) {
var prev = charAt(string, offset3 - 1);
var next = charAt(string, offset3 + 1);
if (exec(low, match3) && !exec(hi2, next) || exec(hi2, match3) && !exec(low, prev)) {
return "\\u" + numberToString(charCodeAt(match3, 0), 16);
}
return match3;
};
if ($stringify) {
$3({ target: "JSON", stat: true, arity: 3, forced: WRONG_SYMBOLS_CONVERSION || ILL_FORMED_UNICODE }, {
stringify: function stringify(it2, replacer, space) {
var args = arraySlice(arguments);
var result = apply2(WRONG_SYMBOLS_CONVERSION ? stringifyWithSymbolsFix : $stringify, null, args);
return ILL_FORMED_UNICODE && typeof result == "string" ? replace2(result, tester, fixIllFormed) : result;
}
});
}
}
});
// node_modules/core-js/modules/es.object.get-own-property-symbols.js
var require_es_object_get_own_property_symbols = __commonJS({
"node_modules/core-js/modules/es.object.get-own-property-symbols.js"() {
"use strict";
var $3 = require_export();
var NATIVE_SYMBOL = require_symbol_constructor_detection();
var fails = require_fails();
var getOwnPropertySymbolsModule = require_object_get_own_property_symbols();
var toObject = require_to_object();
var FORCED = !NATIVE_SYMBOL || fails(function() {
getOwnPropertySymbolsModule.f(1);
});
$3({ target: "Object", stat: true, forced: FORCED }, {
getOwnPropertySymbols: function getOwnPropertySymbols(it2) {
var $getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
return $getOwnPropertySymbols ? $getOwnPropertySymbols(toObject(it2)) : [];
}
});
}
});
// node_modules/core-js/modules/es.symbol.js
var require_es_symbol = __commonJS({
"node_modules/core-js/modules/es.symbol.js"() {
"use strict";
require_es_symbol_constructor();
require_es_symbol_for();
require_es_symbol_key_for();
require_es_json_stringify();
require_es_object_get_own_property_symbols();
}
});
// node_modules/core-js/modules/es.symbol.description.js
var require_es_symbol_description = __commonJS({
"node_modules/core-js/modules/es.symbol.description.js"() {
"use strict";
var $3 = require_export();
var DESCRIPTORS = require_descriptors();
var globalThis2 = require_global_this();
var uncurryThis = require_function_uncurry_this();
var hasOwn = require_has_own_property();
var isCallable = require_is_callable();
var isPrototypeOf = require_object_is_prototype_of();
var toString = require_to_string();
var defineBuiltInAccessor = require_define_built_in_accessor();
var copyConstructorProperties = require_copy_constructor_properties();
var NativeSymbol = globalThis2.Symbol;
var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
if (DESCRIPTORS && isCallable(NativeSymbol) && (!("description" in SymbolPrototype) || NativeSymbol().description !== void 0)) {
EmptyStringDescriptionStore = {};
SymbolWrapper = function Symbol2() {
var description = arguments.length < 1 || arguments[0] === void 0 ? void 0 : toString(arguments[0]);
var result = isPrototypeOf(SymbolPrototype, this) ? new NativeSymbol(description) : description === void 0 ? NativeSymbol() : NativeSymbol(description);
if (description === "")
EmptyStringDescriptionStore[result] = true;
return result;
};
copyConstructorProperties(SymbolWrapper, NativeSymbol);
SymbolWrapper.prototype = SymbolPrototype;
SymbolPrototype.constructor = SymbolWrapper;
NATIVE_SYMBOL = String(NativeSymbol("description detection")) === "Symbol(description detection)";
thisSymbolValue = uncurryThis(SymbolPrototype.valueOf);
symbolDescriptiveString = uncurryThis(SymbolPrototype.toString);
regexp = /^Symbol\((.*)\)[^)]+$/;
replace2 = uncurryThis("".replace);
stringSlice = uncurryThis("".slice);
defineBuiltInAccessor(SymbolPrototype, "description", {
configurable: true,
get: function description() {
var symbol = thisSymbolValue(this);
if (hasOwn(EmptyStringDescriptionStore, symbol))
return "";
var string = symbolDescriptiveString(symbol);
var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace2(string, regexp, "$1");
return desc === "" ? void 0 : desc;
}
});
$3({ global: true, constructor: true, forced: true }, {
Symbol: SymbolWrapper
});
}
var EmptyStringDescriptionStore;
var SymbolWrapper;
var NATIVE_SYMBOL;
var thisSymbolValue;
var symbolDescriptiveString;
var regexp;
var replace2;
var stringSlice;
}
});
// node_modules/core-js/modules/es.symbol.async-iterator.js
var require_es_symbol_async_iterator = __commonJS({
"node_modules/core-js/modules/es.symbol.async-iterator.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("asyncIterator");
}
});
// node_modules/core-js/modules/es.symbol.has-instance.js
var require_es_symbol_has_instance = __commonJS({
"node_modules/core-js/modules/es.symbol.has-instance.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("hasInstance");
}
});
// node_modules/core-js/modules/es.symbol.is-concat-spreadable.js
var require_es_symbol_is_concat_spreadable = __commonJS({
"node_modules/core-js/modules/es.symbol.is-concat-spreadable.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("isConcatSpreadable");
}
});
// node_modules/core-js/modules/es.symbol.iterator.js
var require_es_symbol_iterator = __commonJS({
"node_modules/core-js/modules/es.symbol.iterator.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("iterator");
}
});
// node_modules/core-js/modules/es.symbol.match.js
var require_es_symbol_match = __commonJS({
"node_modules/core-js/modules/es.symbol.match.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("match");
}
});
// node_modules/core-js/modules/es.symbol.match-all.js
var require_es_symbol_match_all = __commonJS({
"node_modules/core-js/modules/es.symbol.match-all.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("matchAll");
}
});
// node_modules/core-js/modules/es.symbol.replace.js
var require_es_symbol_replace = __commonJS({
"node_modules/core-js/modules/es.symbol.replace.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("replace");
}
});
// node_modules/core-js/modules/es.symbol.search.js
var require_es_symbol_search = __commonJS({
"node_modules/core-js/modules/es.symbol.search.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("search");
}
});
// node_modules/core-js/modules/es.symbol.species.js
var require_es_symbol_species = __commonJS({
"node_modules/core-js/modules/es.symbol.species.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("species");
}
});
// node_modules/core-js/modules/es.symbol.split.js
var require_es_symbol_split = __commonJS({
"node_modules/core-js/modules/es.symbol.split.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("split");
}
});
// node_modules/core-js/modules/es.symbol.to-primitive.js
var require_es_symbol_to_primitive = __commonJS({
"node_modules/core-js/modules/es.symbol.to-primitive.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
var defineSymbolToPrimitive = require_symbol_define_to_primitive();
defineWellKnownSymbol("toPrimitive");
defineSymbolToPrimitive();
}
});
// node_modules/core-js/modules/es.symbol.to-string-tag.js
var require_es_symbol_to_string_tag = __commonJS({
"node_modules/core-js/modules/es.symbol.to-string-tag.js"() {
"use strict";
var getBuiltIn = require_get_built_in();
var defineWellKnownSymbol = require_well_known_symbol_define();
var setToStringTag = require_set_to_string_tag();
defineWellKnownSymbol("toStringTag");
setToStringTag(getBuiltIn("Symbol"), "Symbol");
}
});
// node_modules/core-js/modules/es.symbol.unscopables.js
var require_es_symbol_unscopables = __commonJS({
"node_modules/core-js/modules/es.symbol.unscopables.js"() {
"use strict";
var defineWellKnownSymbol = require_well_known_symbol_define();
defineWellKnownSymbol("unscopables");
}
});
// node_modules/core-js/internals/function-uncurry-this-accessor.js
var require_function_uncurry_this_accessor = __commonJS({
"node_modules/core-js/internals/function-uncurry-this-accessor.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var aCallable = require_a_callable();
module2.exports = function(object, key, method) {
try {
return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));
} catch (error2) {
}
};
}
});
// node_modules/core-js/internals/is-possible-prototype.js
var require_is_possible_prototype = __commonJS({
"node_modules/core-js/internals/is-possible-prototype.js"(exports2, module2) {
"use strict";
var isObject3 = require_is_object();
module2.exports = function(argument) {
return isObject3(argument) || argument === null;
};
}
});
// node_modules/core-js/internals/a-possible-prototype.js
var require_a_possible_prototype = __commonJS({
"node_modules/core-js/internals/a-possible-prototype.js"(exports2, module2) {
"use strict";
var isPossiblePrototype = require_is_possible_prototype();
var $String = String;
var $TypeError = TypeError;
module2.exports = function(argument) {
if (isPossiblePrototype(argument))
return argument;
throw new $TypeError("Can't set " + $String(argument) + " as a prototype");
};
}
});
// node_modules/core-js/internals/object-set-prototype-of.js
var require_object_set_prototype_of = __commonJS({
"node_modules/core-js/internals/object-set-prototype-of.js"(exports2, module2) {
"use strict";
var uncurryThisAccessor = require_function_uncurry_this_accessor();
var isObject3 = require_is_object();
var requireObjectCoercible = require_require_object_coercible();
var aPossiblePrototype = require_a_possible_prototype();
module2.exports = Object.setPrototypeOf || ("__proto__" in {} ? function() {
var CORRECT_SETTER = false;
var test = {};
var setter;
try {
setter = uncurryThisAccessor(Object.prototype, "__proto__", "set");
setter(test, []);
CORRECT_SETTER = test instanceof Array;
} catch (error2) {
}
return function setPrototypeOf(O4, proto) {
requireObjectCoercible(O4);
aPossiblePrototype(proto);
if (!isObject3(O4))
return O4;
if (CORRECT_SETTER)
setter(O4, proto);
else
O4.__proto__ = proto;
return O4;
};
}() : void 0);
}
});
// node_modules/core-js/internals/proxy-accessor.js
var require_proxy_accessor = __commonJS({
"node_modules/core-js/internals/proxy-accessor.js"(exports2, module2) {
"use strict";
var defineProperty = require_object_define_property().f;
module2.exports = function(Target, Source, key) {
key in Target || defineProperty(Target, key, {
configurable: true,
get: function() {
return Source[key];
},
set: function(it2) {
Source[key] = it2;
}
});
};
}
});
// node_modules/core-js/internals/inherit-if-required.js
var require_inherit_if_required = __commonJS({
"node_modules/core-js/internals/inherit-if-required.js"(exports2, module2) {
"use strict";
var isCallable = require_is_callable();
var isObject3 = require_is_object();
var setPrototypeOf = require_object_set_prototype_of();
module2.exports = function($this, dummy, Wrapper) {
var NewTarget, NewTargetPrototype;
if (setPrototypeOf && isCallable(NewTarget = dummy.constructor) && NewTarget !== Wrapper && isObject3(NewTargetPrototype = NewTarget.prototype) && NewTargetPrototype !== Wrapper.prototype)
setPrototypeOf($this, NewTargetPrototype);
return $this;
};
}
});
// node_modules/core-js/internals/normalize-string-argument.js
var require_normalize_string_argument = __commonJS({
"node_modules/core-js/internals/normalize-string-argument.js"(exports2, module2) {
"use strict";
var toString = require_to_string();
module2.exports = function(argument, $default) {
return argument === void 0 ? arguments.length < 2 ? "" : $default : toString(argument);
};
}
});
// node_modules/core-js/internals/install-error-cause.js
var require_install_error_cause = __commonJS({
"node_modules/core-js/internals/install-error-cause.js"(exports2, module2) {
"use strict";
var isObject3 = require_is_object();
var createNonEnumerableProperty = require_create_non_enumerable_property();
module2.exports = function(O4, options) {
if (isObject3(options) && "cause" in options) {
createNonEnumerableProperty(O4, "cause", options.cause);
}
};
}
});
// node_modules/core-js/internals/error-stack-clear.js
var require_error_stack_clear = __commonJS({
"node_modules/core-js/internals/error-stack-clear.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var $Error = Error;
var replace2 = uncurryThis("".replace);
var TEST = function(arg) {
return String(new $Error(arg).stack);
}("zxcasd");
var V8_OR_CHAKRA_STACK_ENTRY = /\n\s*at [^:]*:[^\n]*/;
var IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);
module2.exports = function(stack, dropEntries) {
if (IS_V8_OR_CHAKRA_STACK && typeof stack == "string" && !$Error.prepareStackTrace) {
while (dropEntries--)
stack = replace2(stack, V8_OR_CHAKRA_STACK_ENTRY, "");
}
return stack;
};
}
});
// node_modules/core-js/internals/error-stack-installable.js
var require_error_stack_installable = __commonJS({
"node_modules/core-js/internals/error-stack-installable.js"(exports2, module2) {
"use strict";
var fails = require_fails();
var createPropertyDescriptor = require_create_property_descriptor();
module2.exports = !fails(function() {
var error2 = new Error("a");
if (!("stack" in error2))
return true;
Object.defineProperty(error2, "stack", createPropertyDescriptor(1, 7));
return error2.stack !== 7;
});
}
});
// node_modules/core-js/internals/error-stack-install.js
var require_error_stack_install = __commonJS({
"node_modules/core-js/internals/error-stack-install.js"(exports2, module2) {
"use strict";
var createNonEnumerableProperty = require_create_non_enumerable_property();
var clearErrorStack = require_error_stack_clear();
var ERROR_STACK_INSTALLABLE = require_error_stack_installable();
var captureStackTrace = Error.captureStackTrace;
module2.exports = function(error2, C4, stack, dropEntries) {
if (ERROR_STACK_INSTALLABLE) {
if (captureStackTrace)
captureStackTrace(error2, C4);
else
createNonEnumerableProperty(error2, "stack", clearErrorStack(stack, dropEntries));
}
};
}
});
// node_modules/core-js/internals/wrap-error-constructor-with-cause.js
var require_wrap_error_constructor_with_cause = __commonJS({
"node_modules/core-js/internals/wrap-error-constructor-with-cause.js"(exports2, module2) {
"use strict";
var getBuiltIn = require_get_built_in();
var hasOwn = require_has_own_property();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var isPrototypeOf = require_object_is_prototype_of();
var setPrototypeOf = require_object_set_prototype_of();
var copyConstructorProperties = require_copy_constructor_properties();
var proxyAccessor = require_proxy_accessor();
var inheritIfRequired = require_inherit_if_required();
var normalizeStringArgument = require_normalize_string_argument();
var installErrorCause = require_install_error_cause();
var installErrorStack = require_error_stack_install();
var DESCRIPTORS = require_descriptors();
var IS_PURE = require_is_pure();
module2.exports = function(FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {
var STACK_TRACE_LIMIT = "stackTraceLimit";
var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;
var path = FULL_NAME.split(".");
var ERROR_NAME = path[path.length - 1];
var OriginalError = getBuiltIn.apply(null, path);
if (!OriginalError)
return;
var OriginalErrorPrototype = OriginalError.prototype;
if (!IS_PURE && hasOwn(OriginalErrorPrototype, "cause"))
delete OriginalErrorPrototype.cause;
if (!FORCED)
return OriginalError;
var BaseError = getBuiltIn("Error");
var WrappedError = wrapper(function(a5, b4) {
var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b4 : a5, void 0);
var result = IS_AGGREGATE_ERROR ? new OriginalError(a5) : new OriginalError();
if (message !== void 0)
createNonEnumerableProperty(result, "message", message);
installErrorStack(result, WrappedError, result.stack, 2);
if (this && isPrototypeOf(OriginalErrorPrototype, this))
inheritIfRequired(result, this, WrappedError);
if (arguments.length > OPTIONS_POSITION)
installErrorCause(result, arguments[OPTIONS_POSITION]);
return result;
});
WrappedError.prototype = OriginalErrorPrototype;
if (ERROR_NAME !== "Error") {
if (setPrototypeOf)
setPrototypeOf(WrappedError, BaseError);
else
copyConstructorProperties(WrappedError, BaseError, { name: true });
} else if (DESCRIPTORS && STACK_TRACE_LIMIT in OriginalError) {
proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);
proxyAccessor(WrappedError, OriginalError, "prepareStackTrace");
}
copyConstructorProperties(WrappedError, OriginalError);
if (!IS_PURE)
try {
if (OriginalErrorPrototype.name !== ERROR_NAME) {
createNonEnumerableProperty(OriginalErrorPrototype, "name", ERROR_NAME);
}
OriginalErrorPrototype.constructor = WrappedError;
} catch (error2) {
}
return WrappedError;
};
}
});
// node_modules/core-js/modules/es.error.cause.js
var require_es_error_cause = __commonJS({
"node_modules/core-js/modules/es.error.cause.js"() {
"use strict";
var $3 = require_export();
var globalThis2 = require_global_this();
var apply2 = require_function_apply();
var wrapErrorConstructorWithCause = require_wrap_error_constructor_with_cause();
var WEB_ASSEMBLY = "WebAssembly";
var WebAssembly = globalThis2[WEB_ASSEMBLY];
var FORCED = new Error("e", { cause: 7 }).cause !== 7;
var exportGlobalErrorCauseWrapper = function(ERROR_NAME, wrapper) {
var O4 = {};
O4[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED);
$3({ global: true, constructor: true, arity: 1, forced: FORCED }, O4);
};
var exportWebAssemblyErrorCauseWrapper = function(ERROR_NAME, wrapper) {
if (WebAssembly && WebAssembly[ERROR_NAME]) {
var O4 = {};
O4[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + "." + ERROR_NAME, wrapper, FORCED);
$3({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O4);
}
};
exportGlobalErrorCauseWrapper("Error", function(init3) {
return function Error2(message) {
return apply2(init3, this, arguments);
};
});
exportGlobalErrorCauseWrapper("EvalError", function(init3) {
return function EvalError(message) {
return apply2(init3, this, arguments);
};
});
exportGlobalErrorCauseWrapper("RangeError", function(init3) {
return function RangeError2(message) {
return apply2(init3, this, arguments);
};
});
exportGlobalErrorCauseWrapper("ReferenceError", function(init3) {
return function ReferenceError2(message) {
return apply2(init3, this, arguments);
};
});
exportGlobalErrorCauseWrapper("SyntaxError", function(init3) {
return function SyntaxError2(message) {
return apply2(init3, this, arguments);
};
});
exportGlobalErrorCauseWrapper("TypeError", function(init3) {
return function TypeError2(message) {
return apply2(init3, this, arguments);
};
});
exportGlobalErrorCauseWrapper("URIError", function(init3) {
return function URIError(message) {
return apply2(init3, this, arguments);
};
});
exportWebAssemblyErrorCauseWrapper("CompileError", function(init3) {
return function CompileError(message) {
return apply2(init3, this, arguments);
};
});
exportWebAssemblyErrorCauseWrapper("LinkError", function(init3) {
return function LinkError(message) {
return apply2(init3, this, arguments);
};
});
exportWebAssemblyErrorCauseWrapper("RuntimeError", function(init3) {
return function RuntimeError(message) {
return apply2(init3, this, arguments);
};
});
}
});
// node_modules/core-js/internals/error-to-string.js
var require_error_to_string = __commonJS({
"node_modules/core-js/internals/error-to-string.js"(exports2, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var fails = require_fails();
var anObject = require_an_object();
var normalizeStringArgument = require_normalize_string_argument();
var nativeErrorToString = Error.prototype.toString;
var INCORRECT_TO_STRING = fails(function() {
if (DESCRIPTORS) {
var object = Object.create(Object.defineProperty({}, "name", { get: function() {
return this === object;
} }));
if (nativeErrorToString.call(object) !== "true")
return true;
}
return nativeErrorToString.call({ message: 1, name: 2 }) !== "2: 1" || nativeErrorToString.call({}) !== "Error";
});
module2.exports = INCORRECT_TO_STRING ? function toString() {
var O4 = anObject(this);
var name = normalizeStringArgument(O4.name, "Error");
var message = normalizeStringArgument(O4.message);
return !name ? message : !message ? name : name + ": " + message;
} : nativeErrorToString;
}
});
// node_modules/core-js/modules/es.error.to-string.js
var require_es_error_to_string = __commonJS({
"node_modules/core-js/modules/es.error.to-string.js"() {
"use strict";
var defineBuiltIn = require_define_built_in();
var errorToString = require_error_to_string();
var ErrorPrototype = Error.prototype;
if (ErrorPrototype.toString !== errorToString) {
defineBuiltIn(ErrorPrototype, "toString", errorToString);
}
}
});
// node_modules/core-js/internals/correct-prototype-getter.js
var require_correct_prototype_getter = __commonJS({
"node_modules/core-js/internals/correct-prototype-getter.js"(exports2, module2) {
"use strict";
var fails = require_fails();
module2.exports = !fails(function() {
function F3() {
}
F3.prototype.constructor = null;
return Object.getPrototypeOf(new F3()) !== F3.prototype;
});
}
});
// node_modules/core-js/internals/object-get-prototype-of.js
var require_object_get_prototype_of = __commonJS({
"node_modules/core-js/internals/object-get-prototype-of.js"(exports2, module2) {
"use strict";
var hasOwn = require_has_own_property();
var isCallable = require_is_callable();
var toObject = require_to_object();
var sharedKey = require_shared_key();
var CORRECT_PROTOTYPE_GETTER = require_correct_prototype_getter();
var IE_PROTO = sharedKey("IE_PROTO");
var $Object = Object;
var ObjectPrototype = $Object.prototype;
module2.exports = CORRECT_PROTOTYPE_GETTER ? $Object.getPrototypeOf : function(O4) {
var object = toObject(O4);
if (hasOwn(object, IE_PROTO))
return object[IE_PROTO];
var constructor = object.constructor;
if (isCallable(constructor) && object instanceof constructor) {
return constructor.prototype;
}
return object instanceof $Object ? ObjectPrototype : null;
};
}
});
// node_modules/core-js/internals/iterators.js
var require_iterators = __commonJS({
"node_modules/core-js/internals/iterators.js"(exports2, module2) {
"use strict";
module2.exports = {};
}
});
// node_modules/core-js/internals/is-array-iterator-method.js
var require_is_array_iterator_method = __commonJS({
"node_modules/core-js/internals/is-array-iterator-method.js"(exports2, module2) {
"use strict";
var wellKnownSymbol = require_well_known_symbol();
var Iterators = require_iterators();
var ITERATOR = wellKnownSymbol("iterator");
var ArrayPrototype = Array.prototype;
module2.exports = function(it2) {
return it2 !== void 0 && (Iterators.Array === it2 || ArrayPrototype[ITERATOR] === it2);
};
}
});
// node_modules/core-js/internals/get-iterator-method.js
var require_get_iterator_method = __commonJS({
"node_modules/core-js/internals/get-iterator-method.js"(exports2, module2) {
"use strict";
var classof = require_classof();
var getMethod2 = require_get_method();
var isNullOrUndefined = require_is_null_or_undefined();
var Iterators = require_iterators();
var wellKnownSymbol = require_well_known_symbol();
var ITERATOR = wellKnownSymbol("iterator");
module2.exports = function(it2) {
if (!isNullOrUndefined(it2))
return getMethod2(it2, ITERATOR) || getMethod2(it2, "@@iterator") || Iterators[classof(it2)];
};
}
});
// node_modules/core-js/internals/get-iterator.js
var require_get_iterator = __commonJS({
"node_modules/core-js/internals/get-iterator.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var aCallable = require_a_callable();
var anObject = require_an_object();
var tryToString = require_try_to_string();
var getIteratorMethod = require_get_iterator_method();
var $TypeError = TypeError;
module2.exports = function(argument, usingIterator) {
var iteratorMethod = arguments.length < 2 ? getIteratorMethod(argument) : usingIterator;
if (aCallable(iteratorMethod))
return anObject(call(iteratorMethod, argument));
throw new $TypeError(tryToString(argument) + " is not iterable");
};
}
});
// node_modules/core-js/internals/iterator-close.js
var require_iterator_close = __commonJS({
"node_modules/core-js/internals/iterator-close.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var anObject = require_an_object();
var getMethod2 = require_get_method();
module2.exports = function(iterator, kind, value) {
var innerResult, innerError;
anObject(iterator);
try {
innerResult = getMethod2(iterator, "return");
if (!innerResult) {
if (kind === "throw")
throw value;
return value;
}
innerResult = call(innerResult, iterator);
} catch (error2) {
innerError = true;
innerResult = error2;
}
if (kind === "throw")
throw value;
if (innerError)
throw innerResult;
anObject(innerResult);
return value;
};
}
});
// node_modules/core-js/internals/iterate.js
var require_iterate = __commonJS({
"node_modules/core-js/internals/iterate.js"(exports2, module2) {
"use strict";
var bind3 = require_function_bind_context();
var call = require_function_call();
var anObject = require_an_object();
var tryToString = require_try_to_string();
var isArrayIteratorMethod = require_is_array_iterator_method();
var lengthOfArrayLike = require_length_of_array_like();
var isPrototypeOf = require_object_is_prototype_of();
var getIterator = require_get_iterator();
var getIteratorMethod = require_get_iterator_method();
var iteratorClose = require_iterator_close();
var $TypeError = TypeError;
var Result = function(stopped, result) {
this.stopped = stopped;
this.result = result;
};
var ResultPrototype = Result.prototype;
module2.exports = function(iterable, unboundFunction, options) {
var that = options && options.that;
var AS_ENTRIES = !!(options && options.AS_ENTRIES);
var IS_RECORD = !!(options && options.IS_RECORD);
var IS_ITERATOR = !!(options && options.IS_ITERATOR);
var INTERRUPTED = !!(options && options.INTERRUPTED);
var fn3 = bind3(unboundFunction, that);
var iterator, iterFn, index3, length, result, next, step;
var stop = function(condition) {
if (iterator)
iteratorClose(iterator, "normal", condition);
return new Result(true, condition);
};
var callFn = function(value) {
if (AS_ENTRIES) {
anObject(value);
return INTERRUPTED ? fn3(value[0], value[1], stop) : fn3(value[0], value[1]);
}
return INTERRUPTED ? fn3(value, stop) : fn3(value);
};
if (IS_RECORD) {
iterator = iterable.iterator;
} else if (IS_ITERATOR) {
iterator = iterable;
} else {
iterFn = getIteratorMethod(iterable);
if (!iterFn)
throw new $TypeError(tryToString(iterable) + " is not iterable");
if (isArrayIteratorMethod(iterFn)) {
for (index3 = 0, length = lengthOfArrayLike(iterable); length > index3; index3++) {
result = callFn(iterable[index3]);
if (result && isPrototypeOf(ResultPrototype, result))
return result;
}
return new Result(false);
}
iterator = getIterator(iterable, iterFn);
}
next = IS_RECORD ? iterable.next : iterator.next;
while (!(step = call(next, iterator)).done) {
try {
result = callFn(step.value);
} catch (error2) {
iteratorClose(iterator, "throw", error2);
}
if (typeof result == "object" && result && isPrototypeOf(ResultPrototype, result))
return result;
}
return new Result(false);
};
}
});
// node_modules/core-js/modules/es.aggregate-error.constructor.js
var require_es_aggregate_error_constructor = __commonJS({
"node_modules/core-js/modules/es.aggregate-error.constructor.js"() {
"use strict";
var $3 = require_export();
var isPrototypeOf = require_object_is_prototype_of();
var getPrototypeOf = require_object_get_prototype_of();
var setPrototypeOf = require_object_set_prototype_of();
var copyConstructorProperties = require_copy_constructor_properties();
var create = require_object_create();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var createPropertyDescriptor = require_create_property_descriptor();
var installErrorCause = require_install_error_cause();
var installErrorStack = require_error_stack_install();
var iterate = require_iterate();
var normalizeStringArgument = require_normalize_string_argument();
var wellKnownSymbol = require_well_known_symbol();
var TO_STRING_TAG = wellKnownSymbol("toStringTag");
var $Error = Error;
var push = [].push;
var $AggregateError = function AggregateError(errors, message) {
var isInstance = isPrototypeOf(AggregateErrorPrototype, this);
var that;
if (setPrototypeOf) {
that = setPrototypeOf(new $Error(), isInstance ? getPrototypeOf(this) : AggregateErrorPrototype);
} else {
that = isInstance ? this : create(AggregateErrorPrototype);
createNonEnumerableProperty(that, TO_STRING_TAG, "Error");
}
if (message !== void 0)
createNonEnumerableProperty(that, "message", normalizeStringArgument(message));
installErrorStack(that, $AggregateError, that.stack, 1);
if (arguments.length > 2)
installErrorCause(that, arguments[2]);
var errorsArray = [];
iterate(errors, push, { that: errorsArray });
createNonEnumerableProperty(that, "errors", errorsArray);
return that;
};
if (setPrototypeOf)
setPrototypeOf($AggregateError, $Error);
else
copyConstructorProperties($AggregateError, $Error, { name: true });
var AggregateErrorPrototype = $AggregateError.prototype = create($Error.prototype, {
constructor: createPropertyDescriptor(1, $AggregateError),
message: createPropertyDescriptor(1, ""),
name: createPropertyDescriptor(1, "AggregateError")
});
$3({ global: true, constructor: true, arity: 2 }, {
AggregateError: $AggregateError
});
}
});
// node_modules/core-js/modules/es.aggregate-error.js
var require_es_aggregate_error = __commonJS({
"node_modules/core-js/modules/es.aggregate-error.js"() {
"use strict";
require_es_aggregate_error_constructor();
}
});
// node_modules/core-js/modules/es.aggregate-error.cause.js
var require_es_aggregate_error_cause = __commonJS({
"node_modules/core-js/modules/es.aggregate-error.cause.js"() {
"use strict";
var $3 = require_export();
var getBuiltIn = require_get_built_in();
var apply2 = require_function_apply();
var fails = require_fails();
var wrapErrorConstructorWithCause = require_wrap_error_constructor_with_cause();
var AGGREGATE_ERROR = "AggregateError";
var $AggregateError = getBuiltIn(AGGREGATE_ERROR);
var FORCED = !fails(function() {
return $AggregateError([1]).errors[0] !== 1;
}) && fails(function() {
return $AggregateError([1], AGGREGATE_ERROR, { cause: 7 }).cause !== 7;
});
$3({ global: true, constructor: true, arity: 2, forced: FORCED }, {
AggregateError: wrapErrorConstructorWithCause(AGGREGATE_ERROR, function(init3) {
return function AggregateError(errors, message) {
return apply2(init3, this, arguments);
};
}, FORCED, true)
});
}
});
// node_modules/core-js/internals/add-to-unscopables.js
var require_add_to_unscopables = __commonJS({
"node_modules/core-js/internals/add-to-unscopables.js"(exports2, module2) {
"use strict";
var wellKnownSymbol = require_well_known_symbol();
var create = require_object_create();
var defineProperty = require_object_define_property().f;
var UNSCOPABLES = wellKnownSymbol("unscopables");
var ArrayPrototype = Array.prototype;
if (ArrayPrototype[UNSCOPABLES] === void 0) {
defineProperty(ArrayPrototype, UNSCOPABLES, {
configurable: true,
value: create(null)
});
}
module2.exports = function(key) {
ArrayPrototype[UNSCOPABLES][key] = true;
};
}
});
// node_modules/core-js/modules/es.array.at.js
var require_es_array_at = __commonJS({
"node_modules/core-js/modules/es.array.at.js"() {
"use strict";
var $3 = require_export();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var addToUnscopables = require_add_to_unscopables();
$3({ target: "Array", proto: true }, {
at: function at2(index3) {
var O4 = toObject(this);
var len = lengthOfArrayLike(O4);
var relativeIndex = toIntegerOrInfinity(index3);
var k4 = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
return k4 < 0 || k4 >= len ? void 0 : O4[k4];
}
});
addToUnscopables("at");
}
});
// node_modules/core-js/internals/does-not-exceed-safe-integer.js
var require_does_not_exceed_safe_integer = __commonJS({
"node_modules/core-js/internals/does-not-exceed-safe-integer.js"(exports2, module2) {
"use strict";
var $TypeError = TypeError;
var MAX_SAFE_INTEGER = 9007199254740991;
module2.exports = function(it2) {
if (it2 > MAX_SAFE_INTEGER)
throw $TypeError("Maximum allowed index exceeded");
return it2;
};
}
});
// node_modules/core-js/internals/create-property.js
var require_create_property = __commonJS({
"node_modules/core-js/internals/create-property.js"(exports2, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var definePropertyModule = require_object_define_property();
var createPropertyDescriptor = require_create_property_descriptor();
module2.exports = function(object, key, value) {
if (DESCRIPTORS)
definePropertyModule.f(object, key, createPropertyDescriptor(0, value));
else
object[key] = value;
};
}
});
// node_modules/core-js/internals/array-method-has-species-support.js
var require_array_method_has_species_support = __commonJS({
"node_modules/core-js/internals/array-method-has-species-support.js"(exports2, module2) {
"use strict";
var fails = require_fails();
var wellKnownSymbol = require_well_known_symbol();
var V8_VERSION = require_environment_v8_version();
var SPECIES = wellKnownSymbol("species");
module2.exports = function(METHOD_NAME) {
return V8_VERSION >= 51 || !fails(function() {
var array = [];
var constructor = array.constructor = {};
constructor[SPECIES] = function() {
return { foo: 1 };
};
return array[METHOD_NAME](Boolean).foo !== 1;
});
};
}
});
// node_modules/core-js/modules/es.array.concat.js
var require_es_array_concat = __commonJS({
"node_modules/core-js/modules/es.array.concat.js"() {
"use strict";
var $3 = require_export();
var fails = require_fails();
var isArray2 = require_is_array();
var isObject3 = require_is_object();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var doesNotExceedSafeInteger = require_does_not_exceed_safe_integer();
var createProperty = require_create_property();
var arraySpeciesCreate = require_array_species_create();
var arrayMethodHasSpeciesSupport = require_array_method_has_species_support();
var wellKnownSymbol = require_well_known_symbol();
var V8_VERSION = require_environment_v8_version();
var IS_CONCAT_SPREADABLE = wellKnownSymbol("isConcatSpreadable");
var IS_CONCAT_SPREADABLE_SUPPORT = V8_VERSION >= 51 || !fails(function() {
var array = [];
array[IS_CONCAT_SPREADABLE] = false;
return array.concat()[0] !== array;
});
var isConcatSpreadable = function(O4) {
if (!isObject3(O4))
return false;
var spreadable = O4[IS_CONCAT_SPREADABLE];
return spreadable !== void 0 ? !!spreadable : isArray2(O4);
};
var FORCED = !IS_CONCAT_SPREADABLE_SUPPORT || !arrayMethodHasSpeciesSupport("concat");
$3({ target: "Array", proto: true, arity: 1, forced: FORCED }, {
concat: function concat(arg) {
var O4 = toObject(this);
var A4 = arraySpeciesCreate(O4, 0);
var n7 = 0;
var i5, k4, length, len, E3;
for (i5 = -1, length = arguments.length; i5 < length; i5++) {
E3 = i5 === -1 ? O4 : arguments[i5];
if (isConcatSpreadable(E3)) {
len = lengthOfArrayLike(E3);
doesNotExceedSafeInteger(n7 + len);
for (k4 = 0; k4 < len; k4++, n7++)
if (k4 in E3)
createProperty(A4, n7, E3[k4]);
} else {
doesNotExceedSafeInteger(n7 + 1);
createProperty(A4, n7++, E3);
}
}
A4.length = n7;
return A4;
}
});
}
});
// node_modules/core-js/internals/delete-property-or-throw.js
var require_delete_property_or_throw = __commonJS({
"node_modules/core-js/internals/delete-property-or-throw.js"(exports2, module2) {
"use strict";
var tryToString = require_try_to_string();
var $TypeError = TypeError;
module2.exports = function(O4, P4) {
if (!delete O4[P4])
throw new $TypeError("Cannot delete property " + tryToString(P4) + " of " + tryToString(O4));
};
}
});
// node_modules/core-js/internals/array-copy-within.js
var require_array_copy_within = __commonJS({
"node_modules/core-js/internals/array-copy-within.js"(exports2, module2) {
"use strict";
var toObject = require_to_object();
var toAbsoluteIndex = require_to_absolute_index();
var lengthOfArrayLike = require_length_of_array_like();
var deletePropertyOrThrow = require_delete_property_or_throw();
var min2 = Math.min;
module2.exports = [].copyWithin || function copyWithin(target, start3) {
var O4 = toObject(this);
var len = lengthOfArrayLike(O4);
var to = toAbsoluteIndex(target, len);
var from = toAbsoluteIndex(start3, len);
var end2 = arguments.length > 2 ? arguments[2] : void 0;
var count = min2((end2 === void 0 ? len : toAbsoluteIndex(end2, len)) - from, len - to);
var inc = 1;
if (from < to && to < from + count) {
inc = -1;
from += count - 1;
to += count - 1;
}
while (count-- > 0) {
if (from in O4)
O4[to] = O4[from];
else
deletePropertyOrThrow(O4, to);
to += inc;
from += inc;
}
return O4;
};
}
});
// node_modules/core-js/modules/es.array.copy-within.js
var require_es_array_copy_within = __commonJS({
"node_modules/core-js/modules/es.array.copy-within.js"() {
"use strict";
var $3 = require_export();
var copyWithin = require_array_copy_within();
var addToUnscopables = require_add_to_unscopables();
$3({ target: "Array", proto: true }, {
copyWithin
});
addToUnscopables("copyWithin");
}
});
// node_modules/core-js/internals/array-method-is-strict.js
var require_array_method_is_strict = __commonJS({
"node_modules/core-js/internals/array-method-is-strict.js"(exports2, module2) {
"use strict";
var fails = require_fails();
module2.exports = function(METHOD_NAME, argument) {
var method = [][METHOD_NAME];
return !!method && fails(function() {
method.call(null, argument || function() {
return 1;
}, 1);
});
};
}
});
// node_modules/core-js/modules/es.array.every.js
var require_es_array_every = __commonJS({
"node_modules/core-js/modules/es.array.every.js"() {
"use strict";
var $3 = require_export();
var $every = require_array_iteration().every;
var arrayMethodIsStrict = require_array_method_is_strict();
var STRICT_METHOD = arrayMethodIsStrict("every");
$3({ target: "Array", proto: true, forced: !STRICT_METHOD }, {
every: function every(callbackfn) {
return $every(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
}
});
}
});
// node_modules/core-js/internals/array-fill.js
var require_array_fill = __commonJS({
"node_modules/core-js/internals/array-fill.js"(exports2, module2) {
"use strict";
var toObject = require_to_object();
var toAbsoluteIndex = require_to_absolute_index();
var lengthOfArrayLike = require_length_of_array_like();
module2.exports = function fill(value) {
var O4 = toObject(this);
var length = lengthOfArrayLike(O4);
var argumentsLength = arguments.length;
var index3 = toAbsoluteIndex(argumentsLength > 1 ? arguments[1] : void 0, length);
var end2 = argumentsLength > 2 ? arguments[2] : void 0;
var endPos = end2 === void 0 ? length : toAbsoluteIndex(end2, length);
while (endPos > index3)
O4[index3++] = value;
return O4;
};
}
});
// node_modules/core-js/modules/es.array.fill.js
var require_es_array_fill = __commonJS({
"node_modules/core-js/modules/es.array.fill.js"() {
"use strict";
var $3 = require_export();
var fill = require_array_fill();
var addToUnscopables = require_add_to_unscopables();
$3({ target: "Array", proto: true }, {
fill
});
addToUnscopables("fill");
}
});
// node_modules/core-js/modules/es.array.filter.js
var require_es_array_filter = __commonJS({
"node_modules/core-js/modules/es.array.filter.js"() {
"use strict";
var $3 = require_export();
var $filter = require_array_iteration().filter;
var arrayMethodHasSpeciesSupport = require_array_method_has_species_support();
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("filter");
$3({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, {
filter: function filter2(callbackfn) {
return $filter(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
}
});
}
});
// node_modules/core-js/modules/es.array.find.js
var require_es_array_find = __commonJS({
"node_modules/core-js/modules/es.array.find.js"() {
"use strict";
var $3 = require_export();
var $find = require_array_iteration().find;
var addToUnscopables = require_add_to_unscopables();
var FIND = "find";
var SKIPS_HOLES = true;
if (FIND in [])
Array(1)[FIND](function() {
SKIPS_HOLES = false;
});
$3({ target: "Array", proto: true, forced: SKIPS_HOLES }, {
find: function find3(callbackfn) {
return $find(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
}
});
addToUnscopables(FIND);
}
});
// node_modules/core-js/modules/es.array.find-index.js
var require_es_array_find_index = __commonJS({
"node_modules/core-js/modules/es.array.find-index.js"() {
"use strict";
var $3 = require_export();
var $findIndex = require_array_iteration().findIndex;
var addToUnscopables = require_add_to_unscopables();
var FIND_INDEX = "findIndex";
var SKIPS_HOLES = true;
if (FIND_INDEX in [])
Array(1)[FIND_INDEX](function() {
SKIPS_HOLES = false;
});
$3({ target: "Array", proto: true, forced: SKIPS_HOLES }, {
findIndex: function findIndex2(callbackfn) {
return $findIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
}
});
addToUnscopables(FIND_INDEX);
}
});
// node_modules/core-js/internals/array-iteration-from-last.js
var require_array_iteration_from_last = __commonJS({
"node_modules/core-js/internals/array-iteration-from-last.js"(exports2, module2) {
"use strict";
var bind3 = require_function_bind_context();
var IndexedObject = require_indexed_object();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var createMethod = function(TYPE) {
var IS_FIND_LAST_INDEX = TYPE === 1;
return function($this, callbackfn, that) {
var O4 = toObject($this);
var self2 = IndexedObject(O4);
var index3 = lengthOfArrayLike(self2);
var boundFunction = bind3(callbackfn, that);
var value, result;
while (index3-- > 0) {
value = self2[index3];
result = boundFunction(value, index3, O4);
if (result)
switch (TYPE) {
case 0:
return value;
case 1:
return index3;
}
}
return IS_FIND_LAST_INDEX ? -1 : void 0;
};
};
module2.exports = {
findLast: createMethod(0),
findLastIndex: createMethod(1)
};
}
});
// node_modules/core-js/modules/es.array.find-last.js
var require_es_array_find_last = __commonJS({
"node_modules/core-js/modules/es.array.find-last.js"() {
"use strict";
var $3 = require_export();
var $findLast = require_array_iteration_from_last().findLast;
var addToUnscopables = require_add_to_unscopables();
$3({ target: "Array", proto: true }, {
findLast: function findLast(callbackfn) {
return $findLast(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
}
});
addToUnscopables("findLast");
}
});
// node_modules/core-js/modules/es.array.find-last-index.js
var require_es_array_find_last_index = __commonJS({
"node_modules/core-js/modules/es.array.find-last-index.js"() {
"use strict";
var $3 = require_export();
var $findLastIndex = require_array_iteration_from_last().findLastIndex;
var addToUnscopables = require_add_to_unscopables();
$3({ target: "Array", proto: true }, {
findLastIndex: function findLastIndex(callbackfn) {
return $findLastIndex(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
}
});
addToUnscopables("findLastIndex");
}
});
// node_modules/core-js/internals/flatten-into-array.js
var require_flatten_into_array = __commonJS({
"node_modules/core-js/internals/flatten-into-array.js"(exports2, module2) {
"use strict";
var isArray2 = require_is_array();
var lengthOfArrayLike = require_length_of_array_like();
var doesNotExceedSafeInteger = require_does_not_exceed_safe_integer();
var bind3 = require_function_bind_context();
var flattenIntoArray = function(target, original, source, sourceLen, start3, depth, mapper, thisArg) {
var targetIndex = start3;
var sourceIndex = 0;
var mapFn = mapper ? bind3(mapper, thisArg) : false;
var element, elementLen;
while (sourceIndex < sourceLen) {
if (sourceIndex in source) {
element = mapFn ? mapFn(source[sourceIndex], sourceIndex, original) : source[sourceIndex];
if (depth > 0 && isArray2(element)) {
elementLen = lengthOfArrayLike(element);
targetIndex = flattenIntoArray(target, original, element, elementLen, targetIndex, depth - 1) - 1;
} else {
doesNotExceedSafeInteger(targetIndex + 1);
target[targetIndex] = element;
}
targetIndex++;
}
sourceIndex++;
}
return targetIndex;
};
module2.exports = flattenIntoArray;
}
});
// node_modules/core-js/modules/es.array.flat.js
var require_es_array_flat = __commonJS({
"node_modules/core-js/modules/es.array.flat.js"() {
"use strict";
var $3 = require_export();
var flattenIntoArray = require_flatten_into_array();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var arraySpeciesCreate = require_array_species_create();
$3({ target: "Array", proto: true }, {
flat: function flat() {
var depthArg = arguments.length ? arguments[0] : void 0;
var O4 = toObject(this);
var sourceLen = lengthOfArrayLike(O4);
var A4 = arraySpeciesCreate(O4, 0);
A4.length = flattenIntoArray(A4, O4, O4, sourceLen, 0, depthArg === void 0 ? 1 : toIntegerOrInfinity(depthArg));
return A4;
}
});
}
});
// node_modules/core-js/modules/es.array.flat-map.js
var require_es_array_flat_map = __commonJS({
"node_modules/core-js/modules/es.array.flat-map.js"() {
"use strict";
var $3 = require_export();
var flattenIntoArray = require_flatten_into_array();
var aCallable = require_a_callable();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var arraySpeciesCreate = require_array_species_create();
$3({ target: "Array", proto: true }, {
flatMap: function flatMap(callbackfn) {
var O4 = toObject(this);
var sourceLen = lengthOfArrayLike(O4);
var A4;
aCallable(callbackfn);
A4 = arraySpeciesCreate(O4, 0);
A4.length = flattenIntoArray(A4, O4, O4, sourceLen, 0, 1, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
return A4;
}
});
}
});
// node_modules/core-js/internals/array-for-each.js
var require_array_for_each = __commonJS({
"node_modules/core-js/internals/array-for-each.js"(exports2, module2) {
"use strict";
var $forEach = require_array_iteration().forEach;
var arrayMethodIsStrict = require_array_method_is_strict();
var STRICT_METHOD = arrayMethodIsStrict("forEach");
module2.exports = !STRICT_METHOD ? function forEach2(callbackfn) {
return $forEach(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
} : [].forEach;
}
});
// node_modules/core-js/modules/es.array.for-each.js
var require_es_array_for_each = __commonJS({
"node_modules/core-js/modules/es.array.for-each.js"() {
"use strict";
var $3 = require_export();
var forEach2 = require_array_for_each();
$3({ target: "Array", proto: true, forced: [].forEach !== forEach2 }, {
forEach: forEach2
});
}
});
// node_modules/core-js/internals/call-with-safe-iteration-closing.js
var require_call_with_safe_iteration_closing = __commonJS({
"node_modules/core-js/internals/call-with-safe-iteration-closing.js"(exports2, module2) {
"use strict";
var anObject = require_an_object();
var iteratorClose = require_iterator_close();
module2.exports = function(iterator, fn3, value, ENTRIES) {
try {
return ENTRIES ? fn3(anObject(value)[0], value[1]) : fn3(value);
} catch (error2) {
iteratorClose(iterator, "throw", error2);
}
};
}
});
// node_modules/core-js/internals/array-from.js
var require_array_from = __commonJS({
"node_modules/core-js/internals/array-from.js"(exports2, module2) {
"use strict";
var bind3 = require_function_bind_context();
var call = require_function_call();
var toObject = require_to_object();
var callWithSafeIterationClosing = require_call_with_safe_iteration_closing();
var isArrayIteratorMethod = require_is_array_iterator_method();
var isConstructor = require_is_constructor();
var lengthOfArrayLike = require_length_of_array_like();
var createProperty = require_create_property();
var getIterator = require_get_iterator();
var getIteratorMethod = require_get_iterator_method();
var $Array = Array;
module2.exports = function from(arrayLike) {
var O4 = toObject(arrayLike);
var IS_CONSTRUCTOR = isConstructor(this);
var argumentsLength = arguments.length;
var mapfn = argumentsLength > 1 ? arguments[1] : void 0;
var mapping = mapfn !== void 0;
if (mapping)
mapfn = bind3(mapfn, argumentsLength > 2 ? arguments[2] : void 0);
var iteratorMethod = getIteratorMethod(O4);
var index3 = 0;
var length, result, step, iterator, next, value;
if (iteratorMethod && !(this === $Array && isArrayIteratorMethod(iteratorMethod))) {
result = IS_CONSTRUCTOR ? new this() : [];
iterator = getIterator(O4, iteratorMethod);
next = iterator.next;
for (; !(step = call(next, iterator)).done; index3++) {
value = mapping ? callWithSafeIterationClosing(iterator, mapfn, [step.value, index3], true) : step.value;
createProperty(result, index3, value);
}
} else {
length = lengthOfArrayLike(O4);
result = IS_CONSTRUCTOR ? new this(length) : $Array(length);
for (; length > index3; index3++) {
value = mapping ? mapfn(O4[index3], index3) : O4[index3];
createProperty(result, index3, value);
}
}
result.length = index3;
return result;
};
}
});
// node_modules/core-js/internals/check-correctness-of-iteration.js
var require_check_correctness_of_iteration = __commonJS({
"node_modules/core-js/internals/check-correctness-of-iteration.js"(exports2, module2) {
"use strict";
var wellKnownSymbol = require_well_known_symbol();
var ITERATOR = wellKnownSymbol("iterator");
var SAFE_CLOSING = false;
try {
called = 0;
iteratorWithReturn = {
next: function() {
return { done: !!called++ };
},
"return": function() {
SAFE_CLOSING = true;
}
};
iteratorWithReturn[ITERATOR] = function() {
return this;
};
Array.from(iteratorWithReturn, function() {
throw 2;
});
} catch (error2) {
}
var called;
var iteratorWithReturn;
module2.exports = function(exec, SKIP_CLOSING) {
try {
if (!SKIP_CLOSING && !SAFE_CLOSING)
return false;
} catch (error2) {
return false;
}
var ITERATION_SUPPORT = false;
try {
var object = {};
object[ITERATOR] = function() {
return {
next: function() {
return { done: ITERATION_SUPPORT = true };
}
};
};
exec(object);
} catch (error2) {
}
return ITERATION_SUPPORT;
};
}
});
// node_modules/core-js/modules/es.array.from.js
var require_es_array_from = __commonJS({
"node_modules/core-js/modules/es.array.from.js"() {
"use strict";
var $3 = require_export();
var from = require_array_from();
var checkCorrectnessOfIteration = require_check_correctness_of_iteration();
var INCORRECT_ITERATION = !checkCorrectnessOfIteration(function(iterable) {
Array.from(iterable);
});
$3({ target: "Array", stat: true, forced: INCORRECT_ITERATION }, {
from
});
}
});
// node_modules/core-js/modules/es.array.includes.js
var require_es_array_includes = __commonJS({
"node_modules/core-js/modules/es.array.includes.js"() {
"use strict";
var $3 = require_export();
var $includes = require_array_includes().includes;
var fails = require_fails();
var addToUnscopables = require_add_to_unscopables();
var BROKEN_ON_SPARSE = fails(function() {
return !Array(1).includes();
});
$3({ target: "Array", proto: true, forced: BROKEN_ON_SPARSE }, {
includes: function includes(el) {
return $includes(this, el, arguments.length > 1 ? arguments[1] : void 0);
}
});
addToUnscopables("includes");
}
});
// node_modules/core-js/modules/es.array.index-of.js
var require_es_array_index_of = __commonJS({
"node_modules/core-js/modules/es.array.index-of.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this_clause();
var $indexOf = require_array_includes().indexOf;
var arrayMethodIsStrict = require_array_method_is_strict();
var nativeIndexOf = uncurryThis([].indexOf);
var NEGATIVE_ZERO = !!nativeIndexOf && 1 / nativeIndexOf([1], 1, -0) < 0;
var FORCED = NEGATIVE_ZERO || !arrayMethodIsStrict("indexOf");
$3({ target: "Array", proto: true, forced: FORCED }, {
indexOf: function indexOf2(searchElement) {
var fromIndex = arguments.length > 1 ? arguments[1] : void 0;
return NEGATIVE_ZERO ? nativeIndexOf(this, searchElement, fromIndex) || 0 : $indexOf(this, searchElement, fromIndex);
}
});
}
});
// node_modules/core-js/modules/es.array.is-array.js
var require_es_array_is_array = __commonJS({
"node_modules/core-js/modules/es.array.is-array.js"() {
"use strict";
var $3 = require_export();
var isArray2 = require_is_array();
$3({ target: "Array", stat: true }, {
isArray: isArray2
});
}
});
// node_modules/core-js/internals/iterators-core.js
var require_iterators_core = __commonJS({
"node_modules/core-js/internals/iterators-core.js"(exports2, module2) {
"use strict";
var fails = require_fails();
var isCallable = require_is_callable();
var isObject3 = require_is_object();
var create = require_object_create();
var getPrototypeOf = require_object_get_prototype_of();
var defineBuiltIn = require_define_built_in();
var wellKnownSymbol = require_well_known_symbol();
var IS_PURE = require_is_pure();
var ITERATOR = wellKnownSymbol("iterator");
var BUGGY_SAFARI_ITERATORS = false;
var IteratorPrototype;
var PrototypeOfArrayIteratorPrototype;
var arrayIterator;
if ([].keys) {
arrayIterator = [].keys();
if (!("next" in arrayIterator))
BUGGY_SAFARI_ITERATORS = true;
else {
PrototypeOfArrayIteratorPrototype = getPrototypeOf(getPrototypeOf(arrayIterator));
if (PrototypeOfArrayIteratorPrototype !== Object.prototype)
IteratorPrototype = PrototypeOfArrayIteratorPrototype;
}
}
var NEW_ITERATOR_PROTOTYPE = !isObject3(IteratorPrototype) || fails(function() {
var test = {};
return IteratorPrototype[ITERATOR].call(test) !== test;
});
if (NEW_ITERATOR_PROTOTYPE)
IteratorPrototype = {};
else if (IS_PURE)
IteratorPrototype = create(IteratorPrototype);
if (!isCallable(IteratorPrototype[ITERATOR])) {
defineBuiltIn(IteratorPrototype, ITERATOR, function() {
return this;
});
}
module2.exports = {
IteratorPrototype,
BUGGY_SAFARI_ITERATORS
};
}
});
// node_modules/core-js/internals/iterator-create-constructor.js
var require_iterator_create_constructor = __commonJS({
"node_modules/core-js/internals/iterator-create-constructor.js"(exports2, module2) {
"use strict";
var IteratorPrototype = require_iterators_core().IteratorPrototype;
var create = require_object_create();
var createPropertyDescriptor = require_create_property_descriptor();
var setToStringTag = require_set_to_string_tag();
var Iterators = require_iterators();
var returnThis = function() {
return this;
};
module2.exports = function(IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
var TO_STRING_TAG = NAME + " Iterator";
IteratorConstructor.prototype = create(IteratorPrototype, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
setToStringTag(IteratorConstructor, TO_STRING_TAG, false, true);
Iterators[TO_STRING_TAG] = returnThis;
return IteratorConstructor;
};
}
});
// node_modules/core-js/internals/iterator-define.js
var require_iterator_define = __commonJS({
"node_modules/core-js/internals/iterator-define.js"(exports2, module2) {
"use strict";
var $3 = require_export();
var call = require_function_call();
var IS_PURE = require_is_pure();
var FunctionName = require_function_name();
var isCallable = require_is_callable();
var createIteratorConstructor = require_iterator_create_constructor();
var getPrototypeOf = require_object_get_prototype_of();
var setPrototypeOf = require_object_set_prototype_of();
var setToStringTag = require_set_to_string_tag();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var defineBuiltIn = require_define_built_in();
var wellKnownSymbol = require_well_known_symbol();
var Iterators = require_iterators();
var IteratorsCore = require_iterators_core();
var PROPER_FUNCTION_NAME = FunctionName.PROPER;
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
var IteratorPrototype = IteratorsCore.IteratorPrototype;
var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
var ITERATOR = wellKnownSymbol("iterator");
var KEYS = "keys";
var VALUES = "values";
var ENTRIES = "entries";
var returnThis = function() {
return this;
};
module2.exports = function(Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
createIteratorConstructor(IteratorConstructor, NAME, next);
var getIterationMethod = function(KIND) {
if (KIND === DEFAULT && defaultIterator)
return defaultIterator;
if (!BUGGY_SAFARI_ITERATORS && KIND && KIND in IterablePrototype)
return IterablePrototype[KIND];
switch (KIND) {
case KEYS:
return function keys2() {
return new IteratorConstructor(this, KIND);
};
case VALUES:
return function values() {
return new IteratorConstructor(this, KIND);
};
case ENTRIES:
return function entries() {
return new IteratorConstructor(this, KIND);
};
}
return function() {
return new IteratorConstructor(this);
};
};
var TO_STRING_TAG = NAME + " Iterator";
var INCORRECT_VALUES_NAME = false;
var IterablePrototype = Iterable.prototype;
var nativeIterator = IterablePrototype[ITERATOR] || IterablePrototype["@@iterator"] || DEFAULT && IterablePrototype[DEFAULT];
var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
var anyNativeIterator = NAME === "Array" ? IterablePrototype.entries || nativeIterator : nativeIterator;
var CurrentIteratorPrototype, methods, KEY;
if (anyNativeIterator) {
CurrentIteratorPrototype = getPrototypeOf(anyNativeIterator.call(new Iterable()));
if (CurrentIteratorPrototype !== Object.prototype && CurrentIteratorPrototype.next) {
if (!IS_PURE && getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
if (setPrototypeOf) {
setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
} else if (!isCallable(CurrentIteratorPrototype[ITERATOR])) {
defineBuiltIn(CurrentIteratorPrototype, ITERATOR, returnThis);
}
}
setToStringTag(CurrentIteratorPrototype, TO_STRING_TAG, true, true);
if (IS_PURE)
Iterators[TO_STRING_TAG] = returnThis;
}
}
if (PROPER_FUNCTION_NAME && DEFAULT === VALUES && nativeIterator && nativeIterator.name !== VALUES) {
if (!IS_PURE && CONFIGURABLE_FUNCTION_NAME) {
createNonEnumerableProperty(IterablePrototype, "name", VALUES);
} else {
INCORRECT_VALUES_NAME = true;
defaultIterator = function values() {
return call(nativeIterator, this);
};
}
}
if (DEFAULT) {
methods = {
values: getIterationMethod(VALUES),
keys: IS_SET ? defaultIterator : getIterationMethod(KEYS),
entries: getIterationMethod(ENTRIES)
};
if (FORCED)
for (KEY in methods) {
if (BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME || !(KEY in IterablePrototype)) {
defineBuiltIn(IterablePrototype, KEY, methods[KEY]);
}
}
else
$3({ target: NAME, proto: true, forced: BUGGY_SAFARI_ITERATORS || INCORRECT_VALUES_NAME }, methods);
}
if ((!IS_PURE || FORCED) && IterablePrototype[ITERATOR] !== defaultIterator) {
defineBuiltIn(IterablePrototype, ITERATOR, defaultIterator, { name: DEFAULT });
}
Iterators[NAME] = defaultIterator;
return methods;
};
}
});
// node_modules/core-js/internals/create-iter-result-object.js
var require_create_iter_result_object = __commonJS({
"node_modules/core-js/internals/create-iter-result-object.js"(exports2, module2) {
"use strict";
module2.exports = function(value, done) {
return { value, done };
};
}
});
// node_modules/core-js/modules/es.array.iterator.js
var require_es_array_iterator = __commonJS({
"node_modules/core-js/modules/es.array.iterator.js"(exports2, module2) {
"use strict";
var toIndexedObject = require_to_indexed_object();
var addToUnscopables = require_add_to_unscopables();
var Iterators = require_iterators();
var InternalStateModule = require_internal_state();
var defineProperty = require_object_define_property().f;
var defineIterator = require_iterator_define();
var createIterResultObject = require_create_iter_result_object();
var IS_PURE = require_is_pure();
var DESCRIPTORS = require_descriptors();
var ARRAY_ITERATOR = "Array Iterator";
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(ARRAY_ITERATOR);
module2.exports = defineIterator(Array, "Array", function(iterated, kind) {
setInternalState(this, {
type: ARRAY_ITERATOR,
target: toIndexedObject(iterated),
index: 0,
kind
});
}, function() {
var state = getInternalState(this);
var target = state.target;
var index3 = state.index++;
if (!target || index3 >= target.length) {
state.target = null;
return createIterResultObject(void 0, true);
}
switch (state.kind) {
case "keys":
return createIterResultObject(index3, false);
case "values":
return createIterResultObject(target[index3], false);
}
return createIterResultObject([index3, target[index3]], false);
}, "values");
var values = Iterators.Arguments = Iterators.Array;
addToUnscopables("keys");
addToUnscopables("values");
addToUnscopables("entries");
if (!IS_PURE && DESCRIPTORS && values.name !== "values")
try {
defineProperty(values, "name", { value: "values" });
} catch (error2) {
}
}
});
// node_modules/core-js/modules/es.array.join.js
var require_es_array_join = __commonJS({
"node_modules/core-js/modules/es.array.join.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var IndexedObject = require_indexed_object();
var toIndexedObject = require_to_indexed_object();
var arrayMethodIsStrict = require_array_method_is_strict();
var nativeJoin = uncurryThis([].join);
var ES3_STRINGS = IndexedObject !== Object;
var FORCED = ES3_STRINGS || !arrayMethodIsStrict("join", ",");
$3({ target: "Array", proto: true, forced: FORCED }, {
join: function join3(separator) {
return nativeJoin(toIndexedObject(this), separator === void 0 ? "," : separator);
}
});
}
});
// node_modules/core-js/internals/array-last-index-of.js
var require_array_last_index_of = __commonJS({
"node_modules/core-js/internals/array-last-index-of.js"(exports2, module2) {
"use strict";
var apply2 = require_function_apply();
var toIndexedObject = require_to_indexed_object();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var lengthOfArrayLike = require_length_of_array_like();
var arrayMethodIsStrict = require_array_method_is_strict();
var min2 = Math.min;
var $lastIndexOf = [].lastIndexOf;
var NEGATIVE_ZERO = !!$lastIndexOf && 1 / [1].lastIndexOf(1, -0) < 0;
var STRICT_METHOD = arrayMethodIsStrict("lastIndexOf");
var FORCED = NEGATIVE_ZERO || !STRICT_METHOD;
module2.exports = FORCED ? function lastIndexOf(searchElement) {
if (NEGATIVE_ZERO)
return apply2($lastIndexOf, this, arguments) || 0;
var O4 = toIndexedObject(this);
var length = lengthOfArrayLike(O4);
if (length === 0)
return -1;
var index3 = length - 1;
if (arguments.length > 1)
index3 = min2(index3, toIntegerOrInfinity(arguments[1]));
if (index3 < 0)
index3 = length + index3;
for (; index3 >= 0; index3--)
if (index3 in O4 && O4[index3] === searchElement)
return index3 || 0;
return -1;
} : $lastIndexOf;
}
});
// node_modules/core-js/modules/es.array.last-index-of.js
var require_es_array_last_index_of = __commonJS({
"node_modules/core-js/modules/es.array.last-index-of.js"() {
"use strict";
var $3 = require_export();
var lastIndexOf = require_array_last_index_of();
$3({ target: "Array", proto: true, forced: lastIndexOf !== [].lastIndexOf }, {
lastIndexOf
});
}
});
// node_modules/core-js/modules/es.array.map.js
var require_es_array_map = __commonJS({
"node_modules/core-js/modules/es.array.map.js"() {
"use strict";
var $3 = require_export();
var $map = require_array_iteration().map;
var arrayMethodHasSpeciesSupport = require_array_method_has_species_support();
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("map");
$3({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, {
map: function map3(callbackfn) {
return $map(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
}
});
}
});
// node_modules/core-js/modules/es.array.of.js
var require_es_array_of = __commonJS({
"node_modules/core-js/modules/es.array.of.js"() {
"use strict";
var $3 = require_export();
var fails = require_fails();
var isConstructor = require_is_constructor();
var createProperty = require_create_property();
var $Array = Array;
var ISNT_GENERIC = fails(function() {
function F3() {
}
return !($Array.of.call(F3) instanceof F3);
});
$3({ target: "Array", stat: true, forced: ISNT_GENERIC }, {
of: function of() {
var index3 = 0;
var argumentsLength = arguments.length;
var result = new (isConstructor(this) ? this : $Array)(argumentsLength);
while (argumentsLength > index3)
createProperty(result, index3, arguments[index3++]);
result.length = argumentsLength;
return result;
}
});
}
});
// node_modules/core-js/internals/array-set-length.js
var require_array_set_length = __commonJS({
"node_modules/core-js/internals/array-set-length.js"(exports2, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var isArray2 = require_is_array();
var $TypeError = TypeError;
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
var SILENT_ON_NON_WRITABLE_LENGTH_SET = DESCRIPTORS && !function() {
if (this !== void 0)
return true;
try {
Object.defineProperty([], "length", { writable: false }).length = 1;
} catch (error2) {
return error2 instanceof TypeError;
}
}();
module2.exports = SILENT_ON_NON_WRITABLE_LENGTH_SET ? function(O4, length) {
if (isArray2(O4) && !getOwnPropertyDescriptor(O4, "length").writable) {
throw new $TypeError("Cannot set read only .length");
}
return O4.length = length;
} : function(O4, length) {
return O4.length = length;
};
}
});
// node_modules/core-js/modules/es.array.push.js
var require_es_array_push = __commonJS({
"node_modules/core-js/modules/es.array.push.js"() {
"use strict";
var $3 = require_export();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var setArrayLength = require_array_set_length();
var doesNotExceedSafeInteger = require_does_not_exceed_safe_integer();
var fails = require_fails();
var INCORRECT_TO_LENGTH = fails(function() {
return [].push.call({ length: 4294967296 }, 1) !== 4294967297;
});
var properErrorOnNonWritableLength = function() {
try {
Object.defineProperty([], "length", { writable: false }).push();
} catch (error2) {
return error2 instanceof TypeError;
}
};
var FORCED = INCORRECT_TO_LENGTH || !properErrorOnNonWritableLength();
$3({ target: "Array", proto: true, arity: 1, forced: FORCED }, {
push: function push(item) {
var O4 = toObject(this);
var len = lengthOfArrayLike(O4);
var argCount = arguments.length;
doesNotExceedSafeInteger(len + argCount);
for (var i5 = 0; i5 < argCount; i5++) {
O4[len] = arguments[i5];
len++;
}
setArrayLength(O4, len);
return len;
}
});
}
});
// node_modules/core-js/internals/array-reduce.js
var require_array_reduce = __commonJS({
"node_modules/core-js/internals/array-reduce.js"(exports2, module2) {
"use strict";
var aCallable = require_a_callable();
var toObject = require_to_object();
var IndexedObject = require_indexed_object();
var lengthOfArrayLike = require_length_of_array_like();
var $TypeError = TypeError;
var REDUCE_EMPTY = "Reduce of empty array with no initial value";
var createMethod = function(IS_RIGHT) {
return function(that, callbackfn, argumentsLength, memo) {
var O4 = toObject(that);
var self2 = IndexedObject(O4);
var length = lengthOfArrayLike(O4);
aCallable(callbackfn);
if (length === 0 && argumentsLength < 2)
throw new $TypeError(REDUCE_EMPTY);
var index3 = IS_RIGHT ? length - 1 : 0;
var i5 = IS_RIGHT ? -1 : 1;
if (argumentsLength < 2)
while (true) {
if (index3 in self2) {
memo = self2[index3];
index3 += i5;
break;
}
index3 += i5;
if (IS_RIGHT ? index3 < 0 : length <= index3) {
throw new $TypeError(REDUCE_EMPTY);
}
}
for (; IS_RIGHT ? index3 >= 0 : length > index3; index3 += i5)
if (index3 in self2) {
memo = callbackfn(memo, self2[index3], index3, O4);
}
return memo;
};
};
module2.exports = {
left: createMethod(false),
right: createMethod(true)
};
}
});
// node_modules/core-js/internals/environment.js
var require_environment = __commonJS({
"node_modules/core-js/internals/environment.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var userAgent2 = require_environment_user_agent();
var classof = require_classof_raw();
var userAgentStartsWith = function(string) {
return userAgent2.slice(0, string.length) === string;
};
module2.exports = function() {
if (userAgentStartsWith("Bun/"))
return "BUN";
if (userAgentStartsWith("Cloudflare-Workers"))
return "CLOUDFLARE";
if (userAgentStartsWith("Deno/"))
return "DENO";
if (userAgentStartsWith("Node.js/"))
return "NODE";
if (globalThis2.Bun && typeof Bun.version == "string")
return "BUN";
if (globalThis2.Deno && typeof Deno.version == "object")
return "DENO";
if (classof(globalThis2.process) === "process")
return "NODE";
if (globalThis2.window && globalThis2.document)
return "BROWSER";
return "REST";
}();
}
});
// node_modules/core-js/internals/environment-is-node.js
var require_environment_is_node = __commonJS({
"node_modules/core-js/internals/environment-is-node.js"(exports2, module2) {
"use strict";
var ENVIRONMENT = require_environment();
module2.exports = ENVIRONMENT === "NODE";
}
});
// node_modules/core-js/modules/es.array.reduce.js
var require_es_array_reduce = __commonJS({
"node_modules/core-js/modules/es.array.reduce.js"() {
"use strict";
var $3 = require_export();
var $reduce = require_array_reduce().left;
var arrayMethodIsStrict = require_array_method_is_strict();
var CHROME_VERSION = require_environment_v8_version();
var IS_NODE = require_environment_is_node();
var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
var FORCED = CHROME_BUG || !arrayMethodIsStrict("reduce");
$3({ target: "Array", proto: true, forced: FORCED }, {
reduce: function reduce(callbackfn) {
var length = arguments.length;
return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : void 0);
}
});
}
});
// node_modules/core-js/modules/es.array.reduce-right.js
var require_es_array_reduce_right = __commonJS({
"node_modules/core-js/modules/es.array.reduce-right.js"() {
"use strict";
var $3 = require_export();
var $reduceRight = require_array_reduce().right;
var arrayMethodIsStrict = require_array_method_is_strict();
var CHROME_VERSION = require_environment_v8_version();
var IS_NODE = require_environment_is_node();
var CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;
var FORCED = CHROME_BUG || !arrayMethodIsStrict("reduceRight");
$3({ target: "Array", proto: true, forced: FORCED }, {
reduceRight: function reduceRight(callbackfn) {
return $reduceRight(this, callbackfn, arguments.length, arguments.length > 1 ? arguments[1] : void 0);
}
});
}
});
// node_modules/core-js/modules/es.array.reverse.js
var require_es_array_reverse = __commonJS({
"node_modules/core-js/modules/es.array.reverse.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var isArray2 = require_is_array();
var nativeReverse = uncurryThis([].reverse);
var test = [1, 2];
$3({ target: "Array", proto: true, forced: String(test) === String(test.reverse()) }, {
reverse: function reverse() {
if (isArray2(this))
this.length = this.length;
return nativeReverse(this);
}
});
}
});
// node_modules/core-js/modules/es.array.slice.js
var require_es_array_slice = __commonJS({
"node_modules/core-js/modules/es.array.slice.js"() {
"use strict";
var $3 = require_export();
var isArray2 = require_is_array();
var isConstructor = require_is_constructor();
var isObject3 = require_is_object();
var toAbsoluteIndex = require_to_absolute_index();
var lengthOfArrayLike = require_length_of_array_like();
var toIndexedObject = require_to_indexed_object();
var createProperty = require_create_property();
var wellKnownSymbol = require_well_known_symbol();
var arrayMethodHasSpeciesSupport = require_array_method_has_species_support();
var nativeSlice = require_array_slice();
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("slice");
var SPECIES = wellKnownSymbol("species");
var $Array = Array;
var max2 = Math.max;
$3({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, {
slice: function slice(start3, end2) {
var O4 = toIndexedObject(this);
var length = lengthOfArrayLike(O4);
var k4 = toAbsoluteIndex(start3, length);
var fin = toAbsoluteIndex(end2 === void 0 ? length : end2, length);
var Constructor, result, n7;
if (isArray2(O4)) {
Constructor = O4.constructor;
if (isConstructor(Constructor) && (Constructor === $Array || isArray2(Constructor.prototype))) {
Constructor = void 0;
} else if (isObject3(Constructor)) {
Constructor = Constructor[SPECIES];
if (Constructor === null)
Constructor = void 0;
}
if (Constructor === $Array || Constructor === void 0) {
return nativeSlice(O4, k4, fin);
}
}
result = new (Constructor === void 0 ? $Array : Constructor)(max2(fin - k4, 0));
for (n7 = 0; k4 < fin; k4++, n7++)
if (k4 in O4)
createProperty(result, n7, O4[k4]);
result.length = n7;
return result;
}
});
}
});
// node_modules/core-js/modules/es.array.some.js
var require_es_array_some = __commonJS({
"node_modules/core-js/modules/es.array.some.js"() {
"use strict";
var $3 = require_export();
var $some = require_array_iteration().some;
var arrayMethodIsStrict = require_array_method_is_strict();
var STRICT_METHOD = arrayMethodIsStrict("some");
$3({ target: "Array", proto: true, forced: !STRICT_METHOD }, {
some: function some(callbackfn) {
return $some(this, callbackfn, arguments.length > 1 ? arguments[1] : void 0);
}
});
}
});
// node_modules/core-js/internals/array-sort.js
var require_array_sort = __commonJS({
"node_modules/core-js/internals/array-sort.js"(exports2, module2) {
"use strict";
var arraySlice = require_array_slice();
var floor = Math.floor;
var sort2 = function(array, comparefn) {
var length = array.length;
if (length < 8) {
var i5 = 1;
var element, j4;
while (i5 < length) {
j4 = i5;
element = array[i5];
while (j4 && comparefn(array[j4 - 1], element) > 0) {
array[j4] = array[--j4];
}
if (j4 !== i5++)
array[j4] = element;
}
} else {
var middle = floor(length / 2);
var left2 = sort2(arraySlice(array, 0, middle), comparefn);
var right2 = sort2(arraySlice(array, middle), comparefn);
var llength = left2.length;
var rlength = right2.length;
var lindex = 0;
var rindex = 0;
while (lindex < llength || rindex < rlength) {
array[lindex + rindex] = lindex < llength && rindex < rlength ? comparefn(left2[lindex], right2[rindex]) <= 0 ? left2[lindex++] : right2[rindex++] : lindex < llength ? left2[lindex++] : right2[rindex++];
}
}
return array;
};
module2.exports = sort2;
}
});
// node_modules/core-js/internals/environment-ff-version.js
var require_environment_ff_version = __commonJS({
"node_modules/core-js/internals/environment-ff-version.js"(exports2, module2) {
"use strict";
var userAgent2 = require_environment_user_agent();
var firefox = userAgent2.match(/firefox\/(\d+)/i);
module2.exports = !!firefox && +firefox[1];
}
});
// node_modules/core-js/internals/environment-is-ie-or-edge.js
var require_environment_is_ie_or_edge = __commonJS({
"node_modules/core-js/internals/environment-is-ie-or-edge.js"(exports2, module2) {
"use strict";
var UA = require_environment_user_agent();
module2.exports = /MSIE|Trident/.test(UA);
}
});
// node_modules/core-js/internals/environment-webkit-version.js
var require_environment_webkit_version = __commonJS({
"node_modules/core-js/internals/environment-webkit-version.js"(exports2, module2) {
"use strict";
var userAgent2 = require_environment_user_agent();
var webkit2 = userAgent2.match(/AppleWebKit\/(\d+)\./);
module2.exports = !!webkit2 && +webkit2[1];
}
});
// node_modules/core-js/modules/es.array.sort.js
var require_es_array_sort = __commonJS({
"node_modules/core-js/modules/es.array.sort.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var aCallable = require_a_callable();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var deletePropertyOrThrow = require_delete_property_or_throw();
var toString = require_to_string();
var fails = require_fails();
var internalSort = require_array_sort();
var arrayMethodIsStrict = require_array_method_is_strict();
var FF = require_environment_ff_version();
var IE_OR_EDGE = require_environment_is_ie_or_edge();
var V8 = require_environment_v8_version();
var WEBKIT = require_environment_webkit_version();
var test = [];
var nativeSort = uncurryThis(test.sort);
var push = uncurryThis(test.push);
var FAILS_ON_UNDEFINED = fails(function() {
test.sort(void 0);
});
var FAILS_ON_NULL = fails(function() {
test.sort(null);
});
var STRICT_METHOD = arrayMethodIsStrict("sort");
var STABLE_SORT = !fails(function() {
if (V8)
return V8 < 70;
if (FF && FF > 3)
return;
if (IE_OR_EDGE)
return true;
if (WEBKIT)
return WEBKIT < 603;
var result = "";
var code3, chr, value, index3;
for (code3 = 65; code3 < 76; code3++) {
chr = String.fromCharCode(code3);
switch (code3) {
case 66:
case 69:
case 70:
case 72:
value = 3;
break;
case 68:
case 71:
value = 4;
break;
default:
value = 2;
}
for (index3 = 0; index3 < 47; index3++) {
test.push({ k: chr + index3, v: value });
}
}
test.sort(function(a5, b4) {
return b4.v - a5.v;
});
for (index3 = 0; index3 < test.length; index3++) {
chr = test[index3].k.charAt(0);
if (result.charAt(result.length - 1) !== chr)
result += chr;
}
return result !== "DGBEFHACIJK";
});
var FORCED = FAILS_ON_UNDEFINED || !FAILS_ON_NULL || !STRICT_METHOD || !STABLE_SORT;
var getSortCompare = function(comparefn) {
return function(x4, y4) {
if (y4 === void 0)
return -1;
if (x4 === void 0)
return 1;
if (comparefn !== void 0)
return +comparefn(x4, y4) || 0;
return toString(x4) > toString(y4) ? 1 : -1;
};
};
$3({ target: "Array", proto: true, forced: FORCED }, {
sort: function sort2(comparefn) {
if (comparefn !== void 0)
aCallable(comparefn);
var array = toObject(this);
if (STABLE_SORT)
return comparefn === void 0 ? nativeSort(array) : nativeSort(array, comparefn);
var items = [];
var arrayLength = lengthOfArrayLike(array);
var itemsLength, index3;
for (index3 = 0; index3 < arrayLength; index3++) {
if (index3 in array)
push(items, array[index3]);
}
internalSort(items, getSortCompare(comparefn));
itemsLength = lengthOfArrayLike(items);
index3 = 0;
while (index3 < itemsLength)
array[index3] = items[index3++];
while (index3 < arrayLength)
deletePropertyOrThrow(array, index3++);
return array;
}
});
}
});
// node_modules/core-js/internals/set-species.js
var require_set_species = __commonJS({
"node_modules/core-js/internals/set-species.js"(exports2, module2) {
"use strict";
var getBuiltIn = require_get_built_in();
var defineBuiltInAccessor = require_define_built_in_accessor();
var wellKnownSymbol = require_well_known_symbol();
var DESCRIPTORS = require_descriptors();
var SPECIES = wellKnownSymbol("species");
module2.exports = function(CONSTRUCTOR_NAME) {
var Constructor = getBuiltIn(CONSTRUCTOR_NAME);
if (DESCRIPTORS && Constructor && !Constructor[SPECIES]) {
defineBuiltInAccessor(Constructor, SPECIES, {
configurable: true,
get: function() {
return this;
}
});
}
};
}
});
// node_modules/core-js/modules/es.array.species.js
var require_es_array_species = __commonJS({
"node_modules/core-js/modules/es.array.species.js"() {
"use strict";
var setSpecies = require_set_species();
setSpecies("Array");
}
});
// node_modules/core-js/modules/es.array.splice.js
var require_es_array_splice = __commonJS({
"node_modules/core-js/modules/es.array.splice.js"() {
"use strict";
var $3 = require_export();
var toObject = require_to_object();
var toAbsoluteIndex = require_to_absolute_index();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var lengthOfArrayLike = require_length_of_array_like();
var setArrayLength = require_array_set_length();
var doesNotExceedSafeInteger = require_does_not_exceed_safe_integer();
var arraySpeciesCreate = require_array_species_create();
var createProperty = require_create_property();
var deletePropertyOrThrow = require_delete_property_or_throw();
var arrayMethodHasSpeciesSupport = require_array_method_has_species_support();
var HAS_SPECIES_SUPPORT = arrayMethodHasSpeciesSupport("splice");
var max2 = Math.max;
var min2 = Math.min;
$3({ target: "Array", proto: true, forced: !HAS_SPECIES_SUPPORT }, {
splice: function splice(start3, deleteCount) {
var O4 = toObject(this);
var len = lengthOfArrayLike(O4);
var actualStart = toAbsoluteIndex(start3, len);
var argumentsLength = arguments.length;
var insertCount, actualDeleteCount, A4, k4, from, to;
if (argumentsLength === 0) {
insertCount = actualDeleteCount = 0;
} else if (argumentsLength === 1) {
insertCount = 0;
actualDeleteCount = len - actualStart;
} else {
insertCount = argumentsLength - 2;
actualDeleteCount = min2(max2(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
}
doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
A4 = arraySpeciesCreate(O4, actualDeleteCount);
for (k4 = 0; k4 < actualDeleteCount; k4++) {
from = actualStart + k4;
if (from in O4)
createProperty(A4, k4, O4[from]);
}
A4.length = actualDeleteCount;
if (insertCount < actualDeleteCount) {
for (k4 = actualStart; k4 < len - actualDeleteCount; k4++) {
from = k4 + actualDeleteCount;
to = k4 + insertCount;
if (from in O4)
O4[to] = O4[from];
else
deletePropertyOrThrow(O4, to);
}
for (k4 = len; k4 > len - actualDeleteCount + insertCount; k4--)
deletePropertyOrThrow(O4, k4 - 1);
} else if (insertCount > actualDeleteCount) {
for (k4 = len - actualDeleteCount; k4 > actualStart; k4--) {
from = k4 + actualDeleteCount - 1;
to = k4 + insertCount - 1;
if (from in O4)
O4[to] = O4[from];
else
deletePropertyOrThrow(O4, to);
}
}
for (k4 = 0; k4 < insertCount; k4++) {
O4[k4 + actualStart] = arguments[k4 + 2];
}
setArrayLength(O4, len - actualDeleteCount + insertCount);
return A4;
}
});
}
});
// node_modules/core-js/internals/array-to-reversed.js
var require_array_to_reversed = __commonJS({
"node_modules/core-js/internals/array-to-reversed.js"(exports2, module2) {
"use strict";
var lengthOfArrayLike = require_length_of_array_like();
module2.exports = function(O4, C4) {
var len = lengthOfArrayLike(O4);
var A4 = new C4(len);
var k4 = 0;
for (; k4 < len; k4++)
A4[k4] = O4[len - k4 - 1];
return A4;
};
}
});
// node_modules/core-js/modules/es.array.to-reversed.js
var require_es_array_to_reversed = __commonJS({
"node_modules/core-js/modules/es.array.to-reversed.js"() {
"use strict";
var $3 = require_export();
var arrayToReversed = require_array_to_reversed();
var toIndexedObject = require_to_indexed_object();
var addToUnscopables = require_add_to_unscopables();
var $Array = Array;
$3({ target: "Array", proto: true }, {
toReversed: function toReversed() {
return arrayToReversed(toIndexedObject(this), $Array);
}
});
addToUnscopables("toReversed");
}
});
// node_modules/core-js/internals/array-from-constructor-and-list.js
var require_array_from_constructor_and_list = __commonJS({
"node_modules/core-js/internals/array-from-constructor-and-list.js"(exports2, module2) {
"use strict";
var lengthOfArrayLike = require_length_of_array_like();
module2.exports = function(Constructor, list, $length) {
var index3 = 0;
var length = arguments.length > 2 ? $length : lengthOfArrayLike(list);
var result = new Constructor(length);
while (length > index3)
result[index3] = list[index3++];
return result;
};
}
});
// node_modules/core-js/internals/get-built-in-prototype-method.js
var require_get_built_in_prototype_method = __commonJS({
"node_modules/core-js/internals/get-built-in-prototype-method.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
module2.exports = function(CONSTRUCTOR, METHOD) {
var Constructor = globalThis2[CONSTRUCTOR];
var Prototype = Constructor && Constructor.prototype;
return Prototype && Prototype[METHOD];
};
}
});
// node_modules/core-js/modules/es.array.to-sorted.js
var require_es_array_to_sorted = __commonJS({
"node_modules/core-js/modules/es.array.to-sorted.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var aCallable = require_a_callable();
var toIndexedObject = require_to_indexed_object();
var arrayFromConstructorAndList = require_array_from_constructor_and_list();
var getBuiltInPrototypeMethod = require_get_built_in_prototype_method();
var addToUnscopables = require_add_to_unscopables();
var $Array = Array;
var sort2 = uncurryThis(getBuiltInPrototypeMethod("Array", "sort"));
$3({ target: "Array", proto: true }, {
toSorted: function toSorted(compareFn) {
if (compareFn !== void 0)
aCallable(compareFn);
var O4 = toIndexedObject(this);
var A4 = arrayFromConstructorAndList($Array, O4);
return sort2(A4, compareFn);
}
});
addToUnscopables("toSorted");
}
});
// node_modules/core-js/modules/es.array.to-spliced.js
var require_es_array_to_spliced = __commonJS({
"node_modules/core-js/modules/es.array.to-spliced.js"() {
"use strict";
var $3 = require_export();
var addToUnscopables = require_add_to_unscopables();
var doesNotExceedSafeInteger = require_does_not_exceed_safe_integer();
var lengthOfArrayLike = require_length_of_array_like();
var toAbsoluteIndex = require_to_absolute_index();
var toIndexedObject = require_to_indexed_object();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var $Array = Array;
var max2 = Math.max;
var min2 = Math.min;
$3({ target: "Array", proto: true }, {
toSpliced: function toSpliced(start3, deleteCount) {
var O4 = toIndexedObject(this);
var len = lengthOfArrayLike(O4);
var actualStart = toAbsoluteIndex(start3, len);
var argumentsLength = arguments.length;
var k4 = 0;
var insertCount, actualDeleteCount, newLen, A4;
if (argumentsLength === 0) {
insertCount = actualDeleteCount = 0;
} else if (argumentsLength === 1) {
insertCount = 0;
actualDeleteCount = len - actualStart;
} else {
insertCount = argumentsLength - 2;
actualDeleteCount = min2(max2(toIntegerOrInfinity(deleteCount), 0), len - actualStart);
}
newLen = doesNotExceedSafeInteger(len + insertCount - actualDeleteCount);
A4 = $Array(newLen);
for (; k4 < actualStart; k4++)
A4[k4] = O4[k4];
for (; k4 < actualStart + insertCount; k4++)
A4[k4] = arguments[k4 - actualStart + 2];
for (; k4 < newLen; k4++)
A4[k4] = O4[k4 + actualDeleteCount - insertCount];
return A4;
}
});
addToUnscopables("toSpliced");
}
});
// node_modules/core-js/modules/es.array.unscopables.flat.js
var require_es_array_unscopables_flat = __commonJS({
"node_modules/core-js/modules/es.array.unscopables.flat.js"() {
"use strict";
var addToUnscopables = require_add_to_unscopables();
addToUnscopables("flat");
}
});
// node_modules/core-js/modules/es.array.unscopables.flat-map.js
var require_es_array_unscopables_flat_map = __commonJS({
"node_modules/core-js/modules/es.array.unscopables.flat-map.js"() {
"use strict";
var addToUnscopables = require_add_to_unscopables();
addToUnscopables("flatMap");
}
});
// node_modules/core-js/modules/es.array.unshift.js
var require_es_array_unshift = __commonJS({
"node_modules/core-js/modules/es.array.unshift.js"() {
"use strict";
var $3 = require_export();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var setArrayLength = require_array_set_length();
var deletePropertyOrThrow = require_delete_property_or_throw();
var doesNotExceedSafeInteger = require_does_not_exceed_safe_integer();
var INCORRECT_RESULT = [].unshift(0) !== 1;
var properErrorOnNonWritableLength = function() {
try {
Object.defineProperty([], "length", { writable: false }).unshift();
} catch (error2) {
return error2 instanceof TypeError;
}
};
var FORCED = INCORRECT_RESULT || !properErrorOnNonWritableLength();
$3({ target: "Array", proto: true, arity: 1, forced: FORCED }, {
unshift: function unshift(item) {
var O4 = toObject(this);
var len = lengthOfArrayLike(O4);
var argCount = arguments.length;
if (argCount) {
doesNotExceedSafeInteger(len + argCount);
var k4 = len;
while (k4--) {
var to = k4 + argCount;
if (k4 in O4)
O4[to] = O4[k4];
else
deletePropertyOrThrow(O4, to);
}
for (var j4 = 0; j4 < argCount; j4++) {
O4[j4] = arguments[j4];
}
}
return setArrayLength(O4, len + argCount);
}
});
}
});
// node_modules/core-js/internals/array-with.js
var require_array_with = __commonJS({
"node_modules/core-js/internals/array-with.js"(exports2, module2) {
"use strict";
var lengthOfArrayLike = require_length_of_array_like();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var $RangeError = RangeError;
module2.exports = function(O4, C4, index3, value) {
var len = lengthOfArrayLike(O4);
var relativeIndex = toIntegerOrInfinity(index3);
var actualIndex = relativeIndex < 0 ? len + relativeIndex : relativeIndex;
if (actualIndex >= len || actualIndex < 0)
throw new $RangeError("Incorrect index");
var A4 = new C4(len);
var k4 = 0;
for (; k4 < len; k4++)
A4[k4] = k4 === actualIndex ? value : O4[k4];
return A4;
};
}
});
// node_modules/core-js/modules/es.array.with.js
var require_es_array_with = __commonJS({
"node_modules/core-js/modules/es.array.with.js"() {
"use strict";
var $3 = require_export();
var arrayWith = require_array_with();
var toIndexedObject = require_to_indexed_object();
var $Array = Array;
$3({ target: "Array", proto: true }, {
"with": function(index3, value) {
return arrayWith(toIndexedObject(this), $Array, index3, value);
}
});
}
});
// node_modules/core-js/internals/array-buffer-basic-detection.js
var require_array_buffer_basic_detection = __commonJS({
"node_modules/core-js/internals/array-buffer-basic-detection.js"(exports2, module2) {
"use strict";
module2.exports = typeof ArrayBuffer != "undefined" && typeof DataView != "undefined";
}
});
// node_modules/core-js/internals/define-built-ins.js
var require_define_built_ins = __commonJS({
"node_modules/core-js/internals/define-built-ins.js"(exports2, module2) {
"use strict";
var defineBuiltIn = require_define_built_in();
module2.exports = function(target, src, options) {
for (var key in src)
defineBuiltIn(target, key, src[key], options);
return target;
};
}
});
// node_modules/core-js/internals/an-instance.js
var require_an_instance = __commonJS({
"node_modules/core-js/internals/an-instance.js"(exports2, module2) {
"use strict";
var isPrototypeOf = require_object_is_prototype_of();
var $TypeError = TypeError;
module2.exports = function(it2, Prototype) {
if (isPrototypeOf(Prototype, it2))
return it2;
throw new $TypeError("Incorrect invocation");
};
}
});
// node_modules/core-js/internals/to-index.js
var require_to_index = __commonJS({
"node_modules/core-js/internals/to-index.js"(exports2, module2) {
"use strict";
var toIntegerOrInfinity = require_to_integer_or_infinity();
var toLength = require_to_length();
var $RangeError = RangeError;
module2.exports = function(it2) {
if (it2 === void 0)
return 0;
var number = toIntegerOrInfinity(it2);
var length = toLength(number);
if (number !== length)
throw new $RangeError("Wrong length or index");
return length;
};
}
});
// node_modules/core-js/internals/math-sign.js
var require_math_sign = __commonJS({
"node_modules/core-js/internals/math-sign.js"(exports2, module2) {
"use strict";
module2.exports = Math.sign || function sign2(x4) {
var n7 = +x4;
return n7 === 0 || n7 !== n7 ? n7 : n7 < 0 ? -1 : 1;
};
}
});
// node_modules/core-js/internals/math-float-round.js
var require_math_float_round = __commonJS({
"node_modules/core-js/internals/math-float-round.js"(exports2, module2) {
"use strict";
var sign2 = require_math_sign();
var abs = Math.abs;
var EPSILON2 = 2220446049250313e-31;
var INVERSE_EPSILON = 1 / EPSILON2;
var roundTiesToEven = function(n7) {
return n7 + INVERSE_EPSILON - INVERSE_EPSILON;
};
module2.exports = function(x4, FLOAT_EPSILON, FLOAT_MAX_VALUE, FLOAT_MIN_VALUE) {
var n7 = +x4;
var absolute = abs(n7);
var s6 = sign2(n7);
if (absolute < FLOAT_MIN_VALUE)
return s6 * roundTiesToEven(absolute / FLOAT_MIN_VALUE / FLOAT_EPSILON) * FLOAT_MIN_VALUE * FLOAT_EPSILON;
var a5 = (1 + FLOAT_EPSILON / EPSILON2) * absolute;
var result = a5 - (a5 - absolute);
if (result > FLOAT_MAX_VALUE || result !== result)
return s6 * Infinity;
return s6 * result;
};
}
});
// node_modules/core-js/internals/math-fround.js
var require_math_fround = __commonJS({
"node_modules/core-js/internals/math-fround.js"(exports2, module2) {
"use strict";
var floatRound = require_math_float_round();
var FLOAT32_EPSILON = 11920928955078125e-23;
var FLOAT32_MAX_VALUE = 34028234663852886e22;
var FLOAT32_MIN_VALUE = 11754943508222875e-54;
module2.exports = Math.fround || function fround(x4) {
return floatRound(x4, FLOAT32_EPSILON, FLOAT32_MAX_VALUE, FLOAT32_MIN_VALUE);
};
}
});
// node_modules/core-js/internals/ieee754.js
var require_ieee754 = __commonJS({
"node_modules/core-js/internals/ieee754.js"(exports2, module2) {
"use strict";
var $Array = Array;
var abs = Math.abs;
var pow = Math.pow;
var floor = Math.floor;
var log = Math.log;
var LN2 = Math.LN2;
var pack = function(number, mantissaLength, bytes) {
var buffer = $Array(bytes);
var exponentLength = bytes * 8 - mantissaLength - 1;
var eMax = (1 << exponentLength) - 1;
var eBias = eMax >> 1;
var rt2 = mantissaLength === 23 ? pow(2, -24) - pow(2, -77) : 0;
var sign2 = number < 0 || number === 0 && 1 / number < 0 ? 1 : 0;
var index3 = 0;
var exponent, mantissa, c4;
number = abs(number);
if (number !== number || number === Infinity) {
mantissa = number !== number ? 1 : 0;
exponent = eMax;
} else {
exponent = floor(log(number) / LN2);
c4 = pow(2, -exponent);
if (number * c4 < 1) {
exponent--;
c4 *= 2;
}
if (exponent + eBias >= 1) {
number += rt2 / c4;
} else {
number += rt2 * pow(2, 1 - eBias);
}
if (number * c4 >= 2) {
exponent++;
c4 /= 2;
}
if (exponent + eBias >= eMax) {
mantissa = 0;
exponent = eMax;
} else if (exponent + eBias >= 1) {
mantissa = (number * c4 - 1) * pow(2, mantissaLength);
exponent += eBias;
} else {
mantissa = number * pow(2, eBias - 1) * pow(2, mantissaLength);
exponent = 0;
}
}
while (mantissaLength >= 8) {
buffer[index3++] = mantissa & 255;
mantissa /= 256;
mantissaLength -= 8;
}
exponent = exponent << mantissaLength | mantissa;
exponentLength += mantissaLength;
while (exponentLength > 0) {
buffer[index3++] = exponent & 255;
exponent /= 256;
exponentLength -= 8;
}
buffer[index3 - 1] |= sign2 * 128;
return buffer;
};
var unpack2 = function(buffer, mantissaLength) {
var bytes = buffer.length;
var exponentLength = bytes * 8 - mantissaLength - 1;
var eMax = (1 << exponentLength) - 1;
var eBias = eMax >> 1;
var nBits = exponentLength - 7;
var index3 = bytes - 1;
var sign2 = buffer[index3--];
var exponent = sign2 & 127;
var mantissa;
sign2 >>= 7;
while (nBits > 0) {
exponent = exponent * 256 + buffer[index3--];
nBits -= 8;
}
mantissa = exponent & (1 << -nBits) - 1;
exponent >>= -nBits;
nBits += mantissaLength;
while (nBits > 0) {
mantissa = mantissa * 256 + buffer[index3--];
nBits -= 8;
}
if (exponent === 0) {
exponent = 1 - eBias;
} else if (exponent === eMax) {
return mantissa ? NaN : sign2 ? -Infinity : Infinity;
} else {
mantissa += pow(2, mantissaLength);
exponent -= eBias;
}
return (sign2 ? -1 : 1) * mantissa * pow(2, exponent - mantissaLength);
};
module2.exports = {
pack,
unpack: unpack2
};
}
});
// node_modules/core-js/internals/array-buffer.js
var require_array_buffer = __commonJS({
"node_modules/core-js/internals/array-buffer.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var uncurryThis = require_function_uncurry_this();
var DESCRIPTORS = require_descriptors();
var NATIVE_ARRAY_BUFFER = require_array_buffer_basic_detection();
var FunctionName = require_function_name();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var defineBuiltInAccessor = require_define_built_in_accessor();
var defineBuiltIns = require_define_built_ins();
var fails = require_fails();
var anInstance = require_an_instance();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var toLength = require_to_length();
var toIndex = require_to_index();
var fround = require_math_fround();
var IEEE754 = require_ieee754();
var getPrototypeOf = require_object_get_prototype_of();
var setPrototypeOf = require_object_set_prototype_of();
var arrayFill = require_array_fill();
var arraySlice = require_array_slice();
var inheritIfRequired = require_inherit_if_required();
var copyConstructorProperties = require_copy_constructor_properties();
var setToStringTag = require_set_to_string_tag();
var InternalStateModule = require_internal_state();
var PROPER_FUNCTION_NAME = FunctionName.PROPER;
var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
var ARRAY_BUFFER = "ArrayBuffer";
var DATA_VIEW = "DataView";
var PROTOTYPE = "prototype";
var WRONG_LENGTH = "Wrong length";
var WRONG_INDEX = "Wrong index";
var getInternalArrayBufferState = InternalStateModule.getterFor(ARRAY_BUFFER);
var getInternalDataViewState = InternalStateModule.getterFor(DATA_VIEW);
var setInternalState = InternalStateModule.set;
var NativeArrayBuffer = globalThis2[ARRAY_BUFFER];
var $ArrayBuffer = NativeArrayBuffer;
var ArrayBufferPrototype = $ArrayBuffer && $ArrayBuffer[PROTOTYPE];
var $DataView = globalThis2[DATA_VIEW];
var DataViewPrototype = $DataView && $DataView[PROTOTYPE];
var ObjectPrototype = Object.prototype;
var Array2 = globalThis2.Array;
var RangeError2 = globalThis2.RangeError;
var fill = uncurryThis(arrayFill);
var reverse = uncurryThis([].reverse);
var packIEEE754 = IEEE754.pack;
var unpackIEEE754 = IEEE754.unpack;
var packInt8 = function(number) {
return [number & 255];
};
var packInt16 = function(number) {
return [number & 255, number >> 8 & 255];
};
var packInt32 = function(number) {
return [number & 255, number >> 8 & 255, number >> 16 & 255, number >> 24 & 255];
};
var unpackInt32 = function(buffer) {
return buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0];
};
var packFloat32 = function(number) {
return packIEEE754(fround(number), 23, 4);
};
var packFloat64 = function(number) {
return packIEEE754(number, 52, 8);
};
var addGetter = function(Constructor, key, getInternalState) {
defineBuiltInAccessor(Constructor[PROTOTYPE], key, {
configurable: true,
get: function() {
return getInternalState(this)[key];
}
});
};
var get = function(view, count, index3, isLittleEndian) {
var store = getInternalDataViewState(view);
var intIndex = toIndex(index3);
var boolIsLittleEndian = !!isLittleEndian;
if (intIndex + count > store.byteLength)
throw new RangeError2(WRONG_INDEX);
var bytes = store.bytes;
var start3 = intIndex + store.byteOffset;
var pack = arraySlice(bytes, start3, start3 + count);
return boolIsLittleEndian ? pack : reverse(pack);
};
var set2 = function(view, count, index3, conversion, value, isLittleEndian) {
var store = getInternalDataViewState(view);
var intIndex = toIndex(index3);
var pack = conversion(+value);
var boolIsLittleEndian = !!isLittleEndian;
if (intIndex + count > store.byteLength)
throw new RangeError2(WRONG_INDEX);
var bytes = store.bytes;
var start3 = intIndex + store.byteOffset;
for (var i5 = 0; i5 < count; i5++)
bytes[start3 + i5] = pack[boolIsLittleEndian ? i5 : count - i5 - 1];
};
if (!NATIVE_ARRAY_BUFFER) {
$ArrayBuffer = function ArrayBuffer2(length) {
anInstance(this, ArrayBufferPrototype);
var byteLength = toIndex(length);
setInternalState(this, {
type: ARRAY_BUFFER,
bytes: fill(Array2(byteLength), 0),
byteLength
});
if (!DESCRIPTORS) {
this.byteLength = byteLength;
this.detached = false;
}
};
ArrayBufferPrototype = $ArrayBuffer[PROTOTYPE];
$DataView = function DataView2(buffer, byteOffset, byteLength) {
anInstance(this, DataViewPrototype);
anInstance(buffer, ArrayBufferPrototype);
var bufferState = getInternalArrayBufferState(buffer);
var bufferLength = bufferState.byteLength;
var offset3 = toIntegerOrInfinity(byteOffset);
if (offset3 < 0 || offset3 > bufferLength)
throw new RangeError2("Wrong offset");
byteLength = byteLength === void 0 ? bufferLength - offset3 : toLength(byteLength);
if (offset3 + byteLength > bufferLength)
throw new RangeError2(WRONG_LENGTH);
setInternalState(this, {
type: DATA_VIEW,
buffer,
byteLength,
byteOffset: offset3,
bytes: bufferState.bytes
});
if (!DESCRIPTORS) {
this.buffer = buffer;
this.byteLength = byteLength;
this.byteOffset = offset3;
}
};
DataViewPrototype = $DataView[PROTOTYPE];
if (DESCRIPTORS) {
addGetter($ArrayBuffer, "byteLength", getInternalArrayBufferState);
addGetter($DataView, "buffer", getInternalDataViewState);
addGetter($DataView, "byteLength", getInternalDataViewState);
addGetter($DataView, "byteOffset", getInternalDataViewState);
}
defineBuiltIns(DataViewPrototype, {
getInt8: function getInt8(byteOffset) {
return get(this, 1, byteOffset)[0] << 24 >> 24;
},
getUint8: function getUint8(byteOffset) {
return get(this, 1, byteOffset)[0];
},
getInt16: function getInt16(byteOffset) {
var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false);
return (bytes[1] << 8 | bytes[0]) << 16 >> 16;
},
getUint16: function getUint16(byteOffset) {
var bytes = get(this, 2, byteOffset, arguments.length > 1 ? arguments[1] : false);
return bytes[1] << 8 | bytes[0];
},
getInt32: function getInt32(byteOffset) {
return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false));
},
getUint32: function getUint32(byteOffset) {
return unpackInt32(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false)) >>> 0;
},
getFloat32: function getFloat32(byteOffset) {
return unpackIEEE754(get(this, 4, byteOffset, arguments.length > 1 ? arguments[1] : false), 23);
},
getFloat64: function getFloat64(byteOffset) {
return unpackIEEE754(get(this, 8, byteOffset, arguments.length > 1 ? arguments[1] : false), 52);
},
setInt8: function setInt8(byteOffset, value) {
set2(this, 1, byteOffset, packInt8, value);
},
setUint8: function setUint8(byteOffset, value) {
set2(this, 1, byteOffset, packInt8, value);
},
setInt16: function setInt16(byteOffset, value) {
set2(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false);
},
setUint16: function setUint16(byteOffset, value) {
set2(this, 2, byteOffset, packInt16, value, arguments.length > 2 ? arguments[2] : false);
},
setInt32: function setInt32(byteOffset, value) {
set2(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false);
},
setUint32: function setUint32(byteOffset, value) {
set2(this, 4, byteOffset, packInt32, value, arguments.length > 2 ? arguments[2] : false);
},
setFloat32: function setFloat32(byteOffset, value) {
set2(this, 4, byteOffset, packFloat32, value, arguments.length > 2 ? arguments[2] : false);
},
setFloat64: function setFloat64(byteOffset, value) {
set2(this, 8, byteOffset, packFloat64, value, arguments.length > 2 ? arguments[2] : false);
}
});
} else {
INCORRECT_ARRAY_BUFFER_NAME = PROPER_FUNCTION_NAME && NativeArrayBuffer.name !== ARRAY_BUFFER;
if (!fails(function() {
NativeArrayBuffer(1);
}) || !fails(function() {
new NativeArrayBuffer(-1);
}) || fails(function() {
new NativeArrayBuffer();
new NativeArrayBuffer(1.5);
new NativeArrayBuffer(NaN);
return NativeArrayBuffer.length !== 1 || INCORRECT_ARRAY_BUFFER_NAME && !CONFIGURABLE_FUNCTION_NAME;
})) {
$ArrayBuffer = function ArrayBuffer2(length) {
anInstance(this, ArrayBufferPrototype);
return inheritIfRequired(new NativeArrayBuffer(toIndex(length)), this, $ArrayBuffer);
};
$ArrayBuffer[PROTOTYPE] = ArrayBufferPrototype;
ArrayBufferPrototype.constructor = $ArrayBuffer;
copyConstructorProperties($ArrayBuffer, NativeArrayBuffer);
} else if (INCORRECT_ARRAY_BUFFER_NAME && CONFIGURABLE_FUNCTION_NAME) {
createNonEnumerableProperty(NativeArrayBuffer, "name", ARRAY_BUFFER);
}
if (setPrototypeOf && getPrototypeOf(DataViewPrototype) !== ObjectPrototype) {
setPrototypeOf(DataViewPrototype, ObjectPrototype);
}
testView = new $DataView(new $ArrayBuffer(2));
$setInt8 = uncurryThis(DataViewPrototype.setInt8);
testView.setInt8(0, 2147483648);
testView.setInt8(1, 2147483649);
if (testView.getInt8(0) || !testView.getInt8(1))
defineBuiltIns(DataViewPrototype, {
setInt8: function setInt8(byteOffset, value) {
$setInt8(this, byteOffset, value << 24 >> 24);
},
setUint8: function setUint8(byteOffset, value) {
$setInt8(this, byteOffset, value << 24 >> 24);
}
}, { unsafe: true });
}
var INCORRECT_ARRAY_BUFFER_NAME;
var testView;
var $setInt8;
setToStringTag($ArrayBuffer, ARRAY_BUFFER);
setToStringTag($DataView, DATA_VIEW);
module2.exports = {
ArrayBuffer: $ArrayBuffer,
DataView: $DataView
};
}
});
// node_modules/core-js/modules/es.array-buffer.constructor.js
var require_es_array_buffer_constructor = __commonJS({
"node_modules/core-js/modules/es.array-buffer.constructor.js"() {
"use strict";
var $3 = require_export();
var globalThis2 = require_global_this();
var arrayBufferModule = require_array_buffer();
var setSpecies = require_set_species();
var ARRAY_BUFFER = "ArrayBuffer";
var ArrayBuffer2 = arrayBufferModule[ARRAY_BUFFER];
var NativeArrayBuffer = globalThis2[ARRAY_BUFFER];
$3({ global: true, constructor: true, forced: NativeArrayBuffer !== ArrayBuffer2 }, {
ArrayBuffer: ArrayBuffer2
});
setSpecies(ARRAY_BUFFER);
}
});
// node_modules/core-js/internals/array-buffer-view-core.js
var require_array_buffer_view_core = __commonJS({
"node_modules/core-js/internals/array-buffer-view-core.js"(exports2, module2) {
"use strict";
var NATIVE_ARRAY_BUFFER = require_array_buffer_basic_detection();
var DESCRIPTORS = require_descriptors();
var globalThis2 = require_global_this();
var isCallable = require_is_callable();
var isObject3 = require_is_object();
var hasOwn = require_has_own_property();
var classof = require_classof();
var tryToString = require_try_to_string();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var defineBuiltIn = require_define_built_in();
var defineBuiltInAccessor = require_define_built_in_accessor();
var isPrototypeOf = require_object_is_prototype_of();
var getPrototypeOf = require_object_get_prototype_of();
var setPrototypeOf = require_object_set_prototype_of();
var wellKnownSymbol = require_well_known_symbol();
var uid2 = require_uid();
var InternalStateModule = require_internal_state();
var enforceInternalState = InternalStateModule.enforce;
var getInternalState = InternalStateModule.get;
var Int8Array2 = globalThis2.Int8Array;
var Int8ArrayPrototype = Int8Array2 && Int8Array2.prototype;
var Uint8ClampedArray2 = globalThis2.Uint8ClampedArray;
var Uint8ClampedArrayPrototype = Uint8ClampedArray2 && Uint8ClampedArray2.prototype;
var TypedArray = Int8Array2 && getPrototypeOf(Int8Array2);
var TypedArrayPrototype = Int8ArrayPrototype && getPrototypeOf(Int8ArrayPrototype);
var ObjectPrototype = Object.prototype;
var TypeError2 = globalThis2.TypeError;
var TO_STRING_TAG = wellKnownSymbol("toStringTag");
var TYPED_ARRAY_TAG = uid2("TYPED_ARRAY_TAG");
var TYPED_ARRAY_CONSTRUCTOR = "TypedArrayConstructor";
var NATIVE_ARRAY_BUFFER_VIEWS = NATIVE_ARRAY_BUFFER && !!setPrototypeOf && classof(globalThis2.opera) !== "Opera";
var TYPED_ARRAY_TAG_REQUIRED = false;
var NAME;
var Constructor;
var Prototype;
var TypedArrayConstructorsList = {
Int8Array: 1,
Uint8Array: 1,
Uint8ClampedArray: 1,
Int16Array: 2,
Uint16Array: 2,
Int32Array: 4,
Uint32Array: 4,
Float32Array: 4,
Float64Array: 8
};
var BigIntArrayConstructorsList = {
BigInt64Array: 8,
BigUint64Array: 8
};
var isView = function isView2(it2) {
if (!isObject3(it2))
return false;
var klass = classof(it2);
return klass === "DataView" || hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass);
};
var getTypedArrayConstructor = function(it2) {
var proto = getPrototypeOf(it2);
if (!isObject3(proto))
return;
var state = getInternalState(proto);
return state && hasOwn(state, TYPED_ARRAY_CONSTRUCTOR) ? state[TYPED_ARRAY_CONSTRUCTOR] : getTypedArrayConstructor(proto);
};
var isTypedArray = function(it2) {
if (!isObject3(it2))
return false;
var klass = classof(it2);
return hasOwn(TypedArrayConstructorsList, klass) || hasOwn(BigIntArrayConstructorsList, klass);
};
var aTypedArray = function(it2) {
if (isTypedArray(it2))
return it2;
throw new TypeError2("Target is not a typed array");
};
var aTypedArrayConstructor = function(C4) {
if (isCallable(C4) && (!setPrototypeOf || isPrototypeOf(TypedArray, C4)))
return C4;
throw new TypeError2(tryToString(C4) + " is not a typed array constructor");
};
var exportTypedArrayMethod = function(KEY, property, forced, options) {
if (!DESCRIPTORS)
return;
if (forced)
for (var ARRAY in TypedArrayConstructorsList) {
var TypedArrayConstructor = globalThis2[ARRAY];
if (TypedArrayConstructor && hasOwn(TypedArrayConstructor.prototype, KEY))
try {
delete TypedArrayConstructor.prototype[KEY];
} catch (error2) {
try {
TypedArrayConstructor.prototype[KEY] = property;
} catch (error22) {
}
}
}
if (!TypedArrayPrototype[KEY] || forced) {
defineBuiltIn(TypedArrayPrototype, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && Int8ArrayPrototype[KEY] || property, options);
}
};
var exportTypedArrayStaticMethod = function(KEY, property, forced) {
var ARRAY, TypedArrayConstructor;
if (!DESCRIPTORS)
return;
if (setPrototypeOf) {
if (forced)
for (ARRAY in TypedArrayConstructorsList) {
TypedArrayConstructor = globalThis2[ARRAY];
if (TypedArrayConstructor && hasOwn(TypedArrayConstructor, KEY))
try {
delete TypedArrayConstructor[KEY];
} catch (error2) {
}
}
if (!TypedArray[KEY] || forced) {
try {
return defineBuiltIn(TypedArray, KEY, forced ? property : NATIVE_ARRAY_BUFFER_VIEWS && TypedArray[KEY] || property);
} catch (error2) {
}
} else
return;
}
for (ARRAY in TypedArrayConstructorsList) {
TypedArrayConstructor = globalThis2[ARRAY];
if (TypedArrayConstructor && (!TypedArrayConstructor[KEY] || forced)) {
defineBuiltIn(TypedArrayConstructor, KEY, property);
}
}
};
for (NAME in TypedArrayConstructorsList) {
Constructor = globalThis2[NAME];
Prototype = Constructor && Constructor.prototype;
if (Prototype)
enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;
else
NATIVE_ARRAY_BUFFER_VIEWS = false;
}
for (NAME in BigIntArrayConstructorsList) {
Constructor = globalThis2[NAME];
Prototype = Constructor && Constructor.prototype;
if (Prototype)
enforceInternalState(Prototype)[TYPED_ARRAY_CONSTRUCTOR] = Constructor;
}
if (!NATIVE_ARRAY_BUFFER_VIEWS || !isCallable(TypedArray) || TypedArray === Function.prototype) {
TypedArray = function TypedArray2() {
throw new TypeError2("Incorrect invocation");
};
if (NATIVE_ARRAY_BUFFER_VIEWS)
for (NAME in TypedArrayConstructorsList) {
if (globalThis2[NAME])
setPrototypeOf(globalThis2[NAME], TypedArray);
}
}
if (!NATIVE_ARRAY_BUFFER_VIEWS || !TypedArrayPrototype || TypedArrayPrototype === ObjectPrototype) {
TypedArrayPrototype = TypedArray.prototype;
if (NATIVE_ARRAY_BUFFER_VIEWS)
for (NAME in TypedArrayConstructorsList) {
if (globalThis2[NAME])
setPrototypeOf(globalThis2[NAME].prototype, TypedArrayPrototype);
}
}
if (NATIVE_ARRAY_BUFFER_VIEWS && getPrototypeOf(Uint8ClampedArrayPrototype) !== TypedArrayPrototype) {
setPrototypeOf(Uint8ClampedArrayPrototype, TypedArrayPrototype);
}
if (DESCRIPTORS && !hasOwn(TypedArrayPrototype, TO_STRING_TAG)) {
TYPED_ARRAY_TAG_REQUIRED = true;
defineBuiltInAccessor(TypedArrayPrototype, TO_STRING_TAG, {
configurable: true,
get: function() {
return isObject3(this) ? this[TYPED_ARRAY_TAG] : void 0;
}
});
for (NAME in TypedArrayConstructorsList)
if (globalThis2[NAME]) {
createNonEnumerableProperty(globalThis2[NAME], TYPED_ARRAY_TAG, NAME);
}
}
module2.exports = {
NATIVE_ARRAY_BUFFER_VIEWS,
TYPED_ARRAY_TAG: TYPED_ARRAY_TAG_REQUIRED && TYPED_ARRAY_TAG,
aTypedArray,
aTypedArrayConstructor,
exportTypedArrayMethod,
exportTypedArrayStaticMethod,
getTypedArrayConstructor,
isView,
isTypedArray,
TypedArray,
TypedArrayPrototype
};
}
});
// node_modules/core-js/modules/es.array-buffer.is-view.js
var require_es_array_buffer_is_view = __commonJS({
"node_modules/core-js/modules/es.array-buffer.is-view.js"() {
"use strict";
var $3 = require_export();
var ArrayBufferViewCore = require_array_buffer_view_core();
var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
$3({ target: "ArrayBuffer", stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {
isView: ArrayBufferViewCore.isView
});
}
});
// node_modules/core-js/modules/es.array-buffer.slice.js
var require_es_array_buffer_slice = __commonJS({
"node_modules/core-js/modules/es.array-buffer.slice.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this_clause();
var fails = require_fails();
var ArrayBufferModule = require_array_buffer();
var anObject = require_an_object();
var toAbsoluteIndex = require_to_absolute_index();
var toLength = require_to_length();
var ArrayBuffer2 = ArrayBufferModule.ArrayBuffer;
var DataView2 = ArrayBufferModule.DataView;
var DataViewPrototype = DataView2.prototype;
var nativeArrayBufferSlice = uncurryThis(ArrayBuffer2.prototype.slice);
var getUint8 = uncurryThis(DataViewPrototype.getUint8);
var setUint8 = uncurryThis(DataViewPrototype.setUint8);
var INCORRECT_SLICE = fails(function() {
return !new ArrayBuffer2(2).slice(1, void 0).byteLength;
});
$3({ target: "ArrayBuffer", proto: true, unsafe: true, forced: INCORRECT_SLICE }, {
slice: function slice(start3, end2) {
if (nativeArrayBufferSlice && end2 === void 0) {
return nativeArrayBufferSlice(anObject(this), start3);
}
var length = anObject(this).byteLength;
var first3 = toAbsoluteIndex(start3, length);
var fin = toAbsoluteIndex(end2 === void 0 ? length : end2, length);
var result = new ArrayBuffer2(toLength(fin - first3));
var viewSource = new DataView2(this);
var viewTarget = new DataView2(result);
var index3 = 0;
while (first3 < fin) {
setUint8(viewTarget, index3++, getUint8(viewSource, first3++));
}
return result;
}
});
}
});
// node_modules/core-js/modules/es.data-view.constructor.js
var require_es_data_view_constructor = __commonJS({
"node_modules/core-js/modules/es.data-view.constructor.js"() {
"use strict";
var $3 = require_export();
var ArrayBufferModule = require_array_buffer();
var NATIVE_ARRAY_BUFFER = require_array_buffer_basic_detection();
$3({ global: true, constructor: true, forced: !NATIVE_ARRAY_BUFFER }, {
DataView: ArrayBufferModule.DataView
});
}
});
// node_modules/core-js/modules/es.data-view.js
var require_es_data_view = __commonJS({
"node_modules/core-js/modules/es.data-view.js"() {
"use strict";
require_es_data_view_constructor();
}
});
// node_modules/core-js/internals/array-buffer-byte-length.js
var require_array_buffer_byte_length = __commonJS({
"node_modules/core-js/internals/array-buffer-byte-length.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var uncurryThisAccessor = require_function_uncurry_this_accessor();
var classof = require_classof_raw();
var ArrayBuffer2 = globalThis2.ArrayBuffer;
var TypeError2 = globalThis2.TypeError;
module2.exports = ArrayBuffer2 && uncurryThisAccessor(ArrayBuffer2.prototype, "byteLength", "get") || function(O4) {
if (classof(O4) !== "ArrayBuffer")
throw new TypeError2("ArrayBuffer expected");
return O4.byteLength;
};
}
});
// node_modules/core-js/internals/array-buffer-is-detached.js
var require_array_buffer_is_detached = __commonJS({
"node_modules/core-js/internals/array-buffer-is-detached.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var uncurryThis = require_function_uncurry_this_clause();
var arrayBufferByteLength = require_array_buffer_byte_length();
var ArrayBuffer2 = globalThis2.ArrayBuffer;
var ArrayBufferPrototype = ArrayBuffer2 && ArrayBuffer2.prototype;
var slice = ArrayBufferPrototype && uncurryThis(ArrayBufferPrototype.slice);
module2.exports = function(O4) {
if (arrayBufferByteLength(O4) !== 0)
return false;
if (!slice)
return false;
try {
slice(O4, 0, 0);
return false;
} catch (error2) {
return true;
}
};
}
});
// node_modules/core-js/modules/es.array-buffer.detached.js
var require_es_array_buffer_detached = __commonJS({
"node_modules/core-js/modules/es.array-buffer.detached.js"() {
"use strict";
var DESCRIPTORS = require_descriptors();
var defineBuiltInAccessor = require_define_built_in_accessor();
var isDetached = require_array_buffer_is_detached();
var ArrayBufferPrototype = ArrayBuffer.prototype;
if (DESCRIPTORS && !("detached" in ArrayBufferPrototype)) {
defineBuiltInAccessor(ArrayBufferPrototype, "detached", {
configurable: true,
get: function detached() {
return isDetached(this);
}
});
}
}
});
// node_modules/core-js/internals/array-buffer-not-detached.js
var require_array_buffer_not_detached = __commonJS({
"node_modules/core-js/internals/array-buffer-not-detached.js"(exports2, module2) {
"use strict";
var isDetached = require_array_buffer_is_detached();
var $TypeError = TypeError;
module2.exports = function(it2) {
if (isDetached(it2))
throw new $TypeError("ArrayBuffer is detached");
return it2;
};
}
});
// node_modules/core-js/internals/get-built-in-node-module.js
var require_get_built_in_node_module = __commonJS({
"node_modules/core-js/internals/get-built-in-node-module.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var IS_NODE = require_environment_is_node();
module2.exports = function(name) {
if (IS_NODE) {
try {
return globalThis2.process.getBuiltinModule(name);
} catch (error2) {
}
try {
return Function('return require("' + name + '")')();
} catch (error2) {
}
}
};
}
});
// node_modules/core-js/internals/structured-clone-proper-transfer.js
var require_structured_clone_proper_transfer = __commonJS({
"node_modules/core-js/internals/structured-clone-proper-transfer.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var fails = require_fails();
var V8 = require_environment_v8_version();
var ENVIRONMENT = require_environment();
var structuredClone = globalThis2.structuredClone;
module2.exports = !!structuredClone && !fails(function() {
if (ENVIRONMENT === "DENO" && V8 > 92 || ENVIRONMENT === "NODE" && V8 > 94 || ENVIRONMENT === "BROWSER" && V8 > 97)
return false;
var buffer = new ArrayBuffer(8);
var clone5 = structuredClone(buffer, { transfer: [buffer] });
return buffer.byteLength !== 0 || clone5.byteLength !== 8;
});
}
});
// node_modules/core-js/internals/detach-transferable.js
var require_detach_transferable = __commonJS({
"node_modules/core-js/internals/detach-transferable.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var getBuiltInNodeModule = require_get_built_in_node_module();
var PROPER_STRUCTURED_CLONE_TRANSFER = require_structured_clone_proper_transfer();
var structuredClone = globalThis2.structuredClone;
var $ArrayBuffer = globalThis2.ArrayBuffer;
var $MessageChannel = globalThis2.MessageChannel;
var detach = false;
var WorkerThreads;
var channel;
var buffer;
var $detach;
if (PROPER_STRUCTURED_CLONE_TRANSFER) {
detach = function(transferable) {
structuredClone(transferable, { transfer: [transferable] });
};
} else if ($ArrayBuffer)
try {
if (!$MessageChannel) {
WorkerThreads = getBuiltInNodeModule("worker_threads");
if (WorkerThreads)
$MessageChannel = WorkerThreads.MessageChannel;
}
if ($MessageChannel) {
channel = new $MessageChannel();
buffer = new $ArrayBuffer(2);
$detach = function(transferable) {
channel.port1.postMessage(null, [transferable]);
};
if (buffer.byteLength === 2) {
$detach(buffer);
if (buffer.byteLength === 0)
detach = $detach;
}
}
} catch (error2) {
}
module2.exports = detach;
}
});
// node_modules/core-js/internals/array-buffer-transfer.js
var require_array_buffer_transfer = __commonJS({
"node_modules/core-js/internals/array-buffer-transfer.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var uncurryThis = require_function_uncurry_this();
var uncurryThisAccessor = require_function_uncurry_this_accessor();
var toIndex = require_to_index();
var notDetached = require_array_buffer_not_detached();
var arrayBufferByteLength = require_array_buffer_byte_length();
var detachTransferable = require_detach_transferable();
var PROPER_STRUCTURED_CLONE_TRANSFER = require_structured_clone_proper_transfer();
var structuredClone = globalThis2.structuredClone;
var ArrayBuffer2 = globalThis2.ArrayBuffer;
var DataView2 = globalThis2.DataView;
var min2 = Math.min;
var ArrayBufferPrototype = ArrayBuffer2.prototype;
var DataViewPrototype = DataView2.prototype;
var slice = uncurryThis(ArrayBufferPrototype.slice);
var isResizable = uncurryThisAccessor(ArrayBufferPrototype, "resizable", "get");
var maxByteLength = uncurryThisAccessor(ArrayBufferPrototype, "maxByteLength", "get");
var getInt8 = uncurryThis(DataViewPrototype.getInt8);
var setInt8 = uncurryThis(DataViewPrototype.setInt8);
module2.exports = (PROPER_STRUCTURED_CLONE_TRANSFER || detachTransferable) && function(arrayBuffer, newLength, preserveResizability) {
var byteLength = arrayBufferByteLength(arrayBuffer);
var newByteLength = newLength === void 0 ? byteLength : toIndex(newLength);
var fixedLength = !isResizable || !isResizable(arrayBuffer);
var newBuffer;
notDetached(arrayBuffer);
if (PROPER_STRUCTURED_CLONE_TRANSFER) {
arrayBuffer = structuredClone(arrayBuffer, { transfer: [arrayBuffer] });
if (byteLength === newByteLength && (preserveResizability || fixedLength))
return arrayBuffer;
}
if (byteLength >= newByteLength && (!preserveResizability || fixedLength)) {
newBuffer = slice(arrayBuffer, 0, newByteLength);
} else {
var options = preserveResizability && !fixedLength && maxByteLength ? { maxByteLength: maxByteLength(arrayBuffer) } : void 0;
newBuffer = new ArrayBuffer2(newByteLength, options);
var a5 = new DataView2(arrayBuffer);
var b4 = new DataView2(newBuffer);
var copyLength = min2(newByteLength, byteLength);
for (var i5 = 0; i5 < copyLength; i5++)
setInt8(b4, i5, getInt8(a5, i5));
}
if (!PROPER_STRUCTURED_CLONE_TRANSFER)
detachTransferable(arrayBuffer);
return newBuffer;
};
}
});
// node_modules/core-js/modules/es.array-buffer.transfer.js
var require_es_array_buffer_transfer = __commonJS({
"node_modules/core-js/modules/es.array-buffer.transfer.js"() {
"use strict";
var $3 = require_export();
var $transfer = require_array_buffer_transfer();
if ($transfer)
$3({ target: "ArrayBuffer", proto: true }, {
transfer: function transfer() {
return $transfer(this, arguments.length ? arguments[0] : void 0, true);
}
});
}
});
// node_modules/core-js/modules/es.array-buffer.transfer-to-fixed-length.js
var require_es_array_buffer_transfer_to_fixed_length = __commonJS({
"node_modules/core-js/modules/es.array-buffer.transfer-to-fixed-length.js"() {
"use strict";
var $3 = require_export();
var $transfer = require_array_buffer_transfer();
if ($transfer)
$3({ target: "ArrayBuffer", proto: true }, {
transferToFixedLength: function transferToFixedLength() {
return $transfer(this, arguments.length ? arguments[0] : void 0, false);
}
});
}
});
// node_modules/core-js/modules/es.date.get-year.js
var require_es_date_get_year = __commonJS({
"node_modules/core-js/modules/es.date.get-year.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var FORCED = fails(function() {
return new Date(16e11).getYear() !== 120;
});
var getFullYear = uncurryThis(Date.prototype.getFullYear);
$3({ target: "Date", proto: true, forced: FORCED }, {
getYear: function getYear() {
return getFullYear(this) - 1900;
}
});
}
});
// node_modules/core-js/modules/es.date.now.js
var require_es_date_now = __commonJS({
"node_modules/core-js/modules/es.date.now.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var $Date = Date;
var thisTimeValue = uncurryThis($Date.prototype.getTime);
$3({ target: "Date", stat: true }, {
now: function now3() {
return thisTimeValue(new $Date());
}
});
}
});
// node_modules/core-js/modules/es.date.set-year.js
var require_es_date_set_year = __commonJS({
"node_modules/core-js/modules/es.date.set-year.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var DatePrototype = Date.prototype;
var thisTimeValue = uncurryThis(DatePrototype.getTime);
var setFullYear = uncurryThis(DatePrototype.setFullYear);
$3({ target: "Date", proto: true }, {
setYear: function setYear(year) {
thisTimeValue(this);
var yi2 = toIntegerOrInfinity(year);
var yyyy = yi2 >= 0 && yi2 <= 99 ? yi2 + 1900 : yi2;
return setFullYear(this, yyyy);
}
});
}
});
// node_modules/core-js/modules/es.date.to-gmt-string.js
var require_es_date_to_gmt_string = __commonJS({
"node_modules/core-js/modules/es.date.to-gmt-string.js"() {
"use strict";
var $3 = require_export();
$3({ target: "Date", proto: true }, {
toGMTString: Date.prototype.toUTCString
});
}
});
// node_modules/core-js/internals/string-repeat.js
var require_string_repeat = __commonJS({
"node_modules/core-js/internals/string-repeat.js"(exports2, module2) {
"use strict";
var toIntegerOrInfinity = require_to_integer_or_infinity();
var toString = require_to_string();
var requireObjectCoercible = require_require_object_coercible();
var $RangeError = RangeError;
module2.exports = function repeat(count) {
var str = toString(requireObjectCoercible(this));
var result = "";
var n7 = toIntegerOrInfinity(count);
if (n7 < 0 || n7 === Infinity)
throw new $RangeError("Wrong number of repetitions");
for (; n7 > 0; (n7 >>>= 1) && (str += str))
if (n7 & 1)
result += str;
return result;
};
}
});
// node_modules/core-js/internals/string-pad.js
var require_string_pad = __commonJS({
"node_modules/core-js/internals/string-pad.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var toLength = require_to_length();
var toString = require_to_string();
var $repeat = require_string_repeat();
var requireObjectCoercible = require_require_object_coercible();
var repeat = uncurryThis($repeat);
var stringSlice = uncurryThis("".slice);
var ceil = Math.ceil;
var createMethod = function(IS_END) {
return function($this, maxLength, fillString) {
var S4 = toString(requireObjectCoercible($this));
var intMaxLength = toLength(maxLength);
var stringLength = S4.length;
var fillStr = fillString === void 0 ? " " : toString(fillString);
var fillLen, stringFiller;
if (intMaxLength <= stringLength || fillStr === "")
return S4;
fillLen = intMaxLength - stringLength;
stringFiller = repeat(fillStr, ceil(fillLen / fillStr.length));
if (stringFiller.length > fillLen)
stringFiller = stringSlice(stringFiller, 0, fillLen);
return IS_END ? S4 + stringFiller : stringFiller + S4;
};
};
module2.exports = {
start: createMethod(false),
end: createMethod(true)
};
}
});
// node_modules/core-js/internals/date-to-iso-string.js
var require_date_to_iso_string = __commonJS({
"node_modules/core-js/internals/date-to-iso-string.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var padStart2 = require_string_pad().start;
var $RangeError = RangeError;
var $isFinite = isFinite;
var abs = Math.abs;
var DatePrototype = Date.prototype;
var nativeDateToISOString = DatePrototype.toISOString;
var thisTimeValue = uncurryThis(DatePrototype.getTime);
var getUTCDate = uncurryThis(DatePrototype.getUTCDate);
var getUTCFullYear = uncurryThis(DatePrototype.getUTCFullYear);
var getUTCHours = uncurryThis(DatePrototype.getUTCHours);
var getUTCMilliseconds = uncurryThis(DatePrototype.getUTCMilliseconds);
var getUTCMinutes = uncurryThis(DatePrototype.getUTCMinutes);
var getUTCMonth = uncurryThis(DatePrototype.getUTCMonth);
var getUTCSeconds = uncurryThis(DatePrototype.getUTCSeconds);
module2.exports = fails(function() {
return nativeDateToISOString.call(new Date(-5e13 - 1)) !== "0385-07-25T07:06:39.999Z";
}) || !fails(function() {
nativeDateToISOString.call(new Date(NaN));
}) ? function toISOString() {
if (!$isFinite(thisTimeValue(this)))
throw new $RangeError("Invalid time value");
var date = this;
var year = getUTCFullYear(date);
var milliseconds = getUTCMilliseconds(date);
var sign2 = year < 0 ? "-" : year > 9999 ? "+" : "";
return sign2 + padStart2(abs(year), sign2 ? 6 : 4, 0) + "-" + padStart2(getUTCMonth(date) + 1, 2, 0) + "-" + padStart2(getUTCDate(date), 2, 0) + "T" + padStart2(getUTCHours(date), 2, 0) + ":" + padStart2(getUTCMinutes(date), 2, 0) + ":" + padStart2(getUTCSeconds(date), 2, 0) + "." + padStart2(milliseconds, 3, 0) + "Z";
} : nativeDateToISOString;
}
});
// node_modules/core-js/modules/es.date.to-iso-string.js
var require_es_date_to_iso_string = __commonJS({
"node_modules/core-js/modules/es.date.to-iso-string.js"() {
"use strict";
var $3 = require_export();
var toISOString = require_date_to_iso_string();
$3({ target: "Date", proto: true, forced: Date.prototype.toISOString !== toISOString }, {
toISOString
});
}
});
// node_modules/core-js/modules/es.date.to-json.js
var require_es_date_to_json = __commonJS({
"node_modules/core-js/modules/es.date.to-json.js"() {
"use strict";
var $3 = require_export();
var fails = require_fails();
var toObject = require_to_object();
var toPrimitive = require_to_primitive();
var FORCED = fails(function() {
return new Date(NaN).toJSON() !== null || Date.prototype.toJSON.call({ toISOString: function() {
return 1;
} }) !== 1;
});
$3({ target: "Date", proto: true, arity: 1, forced: FORCED }, {
toJSON: function toJSON(key) {
var O4 = toObject(this);
var pv = toPrimitive(O4, "number");
return typeof pv == "number" && !isFinite(pv) ? null : O4.toISOString();
}
});
}
});
// node_modules/core-js/internals/date-to-primitive.js
var require_date_to_primitive = __commonJS({
"node_modules/core-js/internals/date-to-primitive.js"(exports2, module2) {
"use strict";
var anObject = require_an_object();
var ordinaryToPrimitive = require_ordinary_to_primitive();
var $TypeError = TypeError;
module2.exports = function(hint) {
anObject(this);
if (hint === "string" || hint === "default")
hint = "string";
else if (hint !== "number")
throw new $TypeError("Incorrect hint");
return ordinaryToPrimitive(this, hint);
};
}
});
// node_modules/core-js/modules/es.date.to-primitive.js
var require_es_date_to_primitive = __commonJS({
"node_modules/core-js/modules/es.date.to-primitive.js"() {
"use strict";
var hasOwn = require_has_own_property();
var defineBuiltIn = require_define_built_in();
var dateToPrimitive = require_date_to_primitive();
var wellKnownSymbol = require_well_known_symbol();
var TO_PRIMITIVE = wellKnownSymbol("toPrimitive");
var DatePrototype = Date.prototype;
if (!hasOwn(DatePrototype, TO_PRIMITIVE)) {
defineBuiltIn(DatePrototype, TO_PRIMITIVE, dateToPrimitive);
}
}
});
// node_modules/core-js/modules/es.date.to-string.js
var require_es_date_to_string = __commonJS({
"node_modules/core-js/modules/es.date.to-string.js"() {
"use strict";
var uncurryThis = require_function_uncurry_this();
var defineBuiltIn = require_define_built_in();
var DatePrototype = Date.prototype;
var INVALID_DATE = "Invalid Date";
var TO_STRING = "toString";
var nativeDateToString = uncurryThis(DatePrototype[TO_STRING]);
var thisTimeValue = uncurryThis(DatePrototype.getTime);
if (String(new Date(NaN)) !== INVALID_DATE) {
defineBuiltIn(DatePrototype, TO_STRING, function toString() {
var value = thisTimeValue(this);
return value === value ? nativeDateToString(this) : INVALID_DATE;
});
}
}
});
// node_modules/core-js/modules/es.escape.js
var require_es_escape = __commonJS({
"node_modules/core-js/modules/es.escape.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var toString = require_to_string();
var charAt = uncurryThis("".charAt);
var charCodeAt = uncurryThis("".charCodeAt);
var exec = uncurryThis(/./.exec);
var numberToString = uncurryThis(1 .toString);
var toUpperCase = uncurryThis("".toUpperCase);
var raw = /[\w*+\-./@]/;
var hex2 = function(code3, length) {
var result = numberToString(code3, 16);
while (result.length < length)
result = "0" + result;
return result;
};
$3({ global: true }, {
escape: function escape2(string) {
var str = toString(string);
var result = "";
var length = str.length;
var index3 = 0;
var chr, code3;
while (index3 < length) {
chr = charAt(str, index3++);
if (exec(raw, chr)) {
result += chr;
} else {
code3 = charCodeAt(chr, 0);
if (code3 < 256) {
result += "%" + hex2(code3, 2);
} else {
result += "%u" + toUpperCase(hex2(code3, 4));
}
}
}
return result;
}
});
}
});
// node_modules/core-js/internals/function-bind.js
var require_function_bind = __commonJS({
"node_modules/core-js/internals/function-bind.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var aCallable = require_a_callable();
var isObject3 = require_is_object();
var hasOwn = require_has_own_property();
var arraySlice = require_array_slice();
var NATIVE_BIND = require_function_bind_native();
var $Function = Function;
var concat = uncurryThis([].concat);
var join3 = uncurryThis([].join);
var factories = {};
var construct = function(C4, argsLength, args) {
if (!hasOwn(factories, argsLength)) {
var list = [];
var i5 = 0;
for (; i5 < argsLength; i5++)
list[i5] = "a[" + i5 + "]";
factories[argsLength] = $Function("C,a", "return new C(" + join3(list, ",") + ")");
}
return factories[argsLength](C4, args);
};
module2.exports = NATIVE_BIND ? $Function.bind : function bind3(that) {
var F3 = aCallable(this);
var Prototype = F3.prototype;
var partArgs = arraySlice(arguments, 1);
var boundFunction = function bound() {
var args = concat(partArgs, arraySlice(arguments));
return this instanceof boundFunction ? construct(F3, args.length, args) : F3.apply(that, args);
};
if (isObject3(Prototype))
boundFunction.prototype = Prototype;
return boundFunction;
};
}
});
// node_modules/core-js/modules/es.function.bind.js
var require_es_function_bind = __commonJS({
"node_modules/core-js/modules/es.function.bind.js"() {
"use strict";
var $3 = require_export();
var bind3 = require_function_bind();
$3({ target: "Function", proto: true, forced: Function.bind !== bind3 }, {
bind: bind3
});
}
});
// node_modules/core-js/modules/es.function.has-instance.js
var require_es_function_has_instance = __commonJS({
"node_modules/core-js/modules/es.function.has-instance.js"() {
"use strict";
var isCallable = require_is_callable();
var isObject3 = require_is_object();
var definePropertyModule = require_object_define_property();
var isPrototypeOf = require_object_is_prototype_of();
var wellKnownSymbol = require_well_known_symbol();
var makeBuiltIn = require_make_built_in();
var HAS_INSTANCE = wellKnownSymbol("hasInstance");
var FunctionPrototype = Function.prototype;
if (!(HAS_INSTANCE in FunctionPrototype)) {
definePropertyModule.f(FunctionPrototype, HAS_INSTANCE, { value: makeBuiltIn(function(O4) {
if (!isCallable(this) || !isObject3(O4))
return false;
var P4 = this.prototype;
return isObject3(P4) ? isPrototypeOf(P4, O4) : O4 instanceof this;
}, HAS_INSTANCE) });
}
}
});
// node_modules/core-js/modules/es.function.name.js
var require_es_function_name = __commonJS({
"node_modules/core-js/modules/es.function.name.js"() {
"use strict";
var DESCRIPTORS = require_descriptors();
var FUNCTION_NAME_EXISTS = require_function_name().EXISTS;
var uncurryThis = require_function_uncurry_this();
var defineBuiltInAccessor = require_define_built_in_accessor();
var FunctionPrototype = Function.prototype;
var functionToString = uncurryThis(FunctionPrototype.toString);
var nameRE = /function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/;
var regExpExec = uncurryThis(nameRE.exec);
var NAME = "name";
if (DESCRIPTORS && !FUNCTION_NAME_EXISTS) {
defineBuiltInAccessor(FunctionPrototype, NAME, {
configurable: true,
get: function() {
try {
return regExpExec(nameRE, functionToString(this))[1];
} catch (error2) {
return "";
}
}
});
}
}
});
// node_modules/core-js/modules/es.global-this.js
var require_es_global_this = __commonJS({
"node_modules/core-js/modules/es.global-this.js"() {
"use strict";
var $3 = require_export();
var globalThis2 = require_global_this();
$3({ global: true, forced: globalThis2.globalThis !== globalThis2 }, {
globalThis: globalThis2
});
}
});
// node_modules/core-js/modules/es.iterator.constructor.js
var require_es_iterator_constructor = __commonJS({
"node_modules/core-js/modules/es.iterator.constructor.js"() {
"use strict";
var $3 = require_export();
var globalThis2 = require_global_this();
var anInstance = require_an_instance();
var anObject = require_an_object();
var isCallable = require_is_callable();
var getPrototypeOf = require_object_get_prototype_of();
var defineBuiltInAccessor = require_define_built_in_accessor();
var createProperty = require_create_property();
var fails = require_fails();
var hasOwn = require_has_own_property();
var wellKnownSymbol = require_well_known_symbol();
var IteratorPrototype = require_iterators_core().IteratorPrototype;
var DESCRIPTORS = require_descriptors();
var IS_PURE = require_is_pure();
var CONSTRUCTOR = "constructor";
var ITERATOR = "Iterator";
var TO_STRING_TAG = wellKnownSymbol("toStringTag");
var $TypeError = TypeError;
var NativeIterator = globalThis2[ITERATOR];
var FORCED = IS_PURE || !isCallable(NativeIterator) || NativeIterator.prototype !== IteratorPrototype || !fails(function() {
NativeIterator({});
});
var IteratorConstructor = function Iterator() {
anInstance(this, IteratorPrototype);
if (getPrototypeOf(this) === IteratorPrototype)
throw new $TypeError("Abstract class Iterator not directly constructable");
};
var defineIteratorPrototypeAccessor = function(key, value) {
if (DESCRIPTORS) {
defineBuiltInAccessor(IteratorPrototype, key, {
configurable: true,
get: function() {
return value;
},
set: function(replacement) {
anObject(this);
if (this === IteratorPrototype)
throw new $TypeError("You can't redefine this property");
if (hasOwn(this, key))
this[key] = replacement;
else
createProperty(this, key, replacement);
}
});
} else
IteratorPrototype[key] = value;
};
if (!hasOwn(IteratorPrototype, TO_STRING_TAG))
defineIteratorPrototypeAccessor(TO_STRING_TAG, ITERATOR);
if (FORCED || !hasOwn(IteratorPrototype, CONSTRUCTOR) || IteratorPrototype[CONSTRUCTOR] === Object) {
defineIteratorPrototypeAccessor(CONSTRUCTOR, IteratorConstructor);
}
IteratorConstructor.prototype = IteratorPrototype;
$3({ global: true, constructor: true, forced: FORCED }, {
Iterator: IteratorConstructor
});
}
});
// node_modules/core-js/internals/get-iterator-direct.js
var require_get_iterator_direct = __commonJS({
"node_modules/core-js/internals/get-iterator-direct.js"(exports2, module2) {
"use strict";
module2.exports = function(obj) {
return {
iterator: obj,
next: obj.next,
done: false
};
};
}
});
// node_modules/core-js/internals/not-a-nan.js
var require_not_a_nan = __commonJS({
"node_modules/core-js/internals/not-a-nan.js"(exports2, module2) {
"use strict";
var $RangeError = RangeError;
module2.exports = function(it2) {
if (it2 === it2)
return it2;
throw new $RangeError("NaN is not allowed");
};
}
});
// node_modules/core-js/internals/to-positive-integer.js
var require_to_positive_integer = __commonJS({
"node_modules/core-js/internals/to-positive-integer.js"(exports2, module2) {
"use strict";
var toIntegerOrInfinity = require_to_integer_or_infinity();
var $RangeError = RangeError;
module2.exports = function(it2) {
var result = toIntegerOrInfinity(it2);
if (result < 0)
throw new $RangeError("The argument can't be less than 0");
return result;
};
}
});
// node_modules/core-js/internals/iterator-create-proxy.js
var require_iterator_create_proxy = __commonJS({
"node_modules/core-js/internals/iterator-create-proxy.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var create = require_object_create();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var defineBuiltIns = require_define_built_ins();
var wellKnownSymbol = require_well_known_symbol();
var InternalStateModule = require_internal_state();
var getMethod2 = require_get_method();
var IteratorPrototype = require_iterators_core().IteratorPrototype;
var createIterResultObject = require_create_iter_result_object();
var iteratorClose = require_iterator_close();
var TO_STRING_TAG = wellKnownSymbol("toStringTag");
var ITERATOR_HELPER = "IteratorHelper";
var WRAP_FOR_VALID_ITERATOR = "WrapForValidIterator";
var setInternalState = InternalStateModule.set;
var createIteratorProxyPrototype = function(IS_ITERATOR) {
var getInternalState = InternalStateModule.getterFor(IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER);
return defineBuiltIns(create(IteratorPrototype), {
next: function next() {
var state = getInternalState(this);
if (IS_ITERATOR)
return state.nextHandler();
try {
var result = state.done ? void 0 : state.nextHandler();
return createIterResultObject(result, state.done);
} catch (error2) {
state.done = true;
throw error2;
}
},
"return": function() {
var state = getInternalState(this);
var iterator = state.iterator;
state.done = true;
if (IS_ITERATOR) {
var returnMethod = getMethod2(iterator, "return");
return returnMethod ? call(returnMethod, iterator) : createIterResultObject(void 0, true);
}
if (state.inner)
try {
iteratorClose(state.inner.iterator, "normal");
} catch (error2) {
return iteratorClose(iterator, "throw", error2);
}
if (iterator)
iteratorClose(iterator, "normal");
return createIterResultObject(void 0, true);
}
});
};
var WrapForValidIteratorPrototype = createIteratorProxyPrototype(true);
var IteratorHelperPrototype = createIteratorProxyPrototype(false);
createNonEnumerableProperty(IteratorHelperPrototype, TO_STRING_TAG, "Iterator Helper");
module2.exports = function(nextHandler, IS_ITERATOR) {
var IteratorProxy = function Iterator(record, state) {
if (state) {
state.iterator = record.iterator;
state.next = record.next;
} else
state = record;
state.type = IS_ITERATOR ? WRAP_FOR_VALID_ITERATOR : ITERATOR_HELPER;
state.nextHandler = nextHandler;
state.counter = 0;
state.done = false;
setInternalState(this, state);
};
IteratorProxy.prototype = IS_ITERATOR ? WrapForValidIteratorPrototype : IteratorHelperPrototype;
return IteratorProxy;
};
}
});
// node_modules/core-js/modules/es.iterator.drop.js
var require_es_iterator_drop = __commonJS({
"node_modules/core-js/modules/es.iterator.drop.js"() {
"use strict";
var $3 = require_export();
var call = require_function_call();
var anObject = require_an_object();
var getIteratorDirect = require_get_iterator_direct();
var notANaN = require_not_a_nan();
var toPositiveInteger = require_to_positive_integer();
var createIteratorProxy = require_iterator_create_proxy();
var IS_PURE = require_is_pure();
var IteratorProxy = createIteratorProxy(function() {
var iterator = this.iterator;
var next = this.next;
var result, done;
while (this.remaining) {
this.remaining--;
result = anObject(call(next, iterator));
done = this.done = !!result.done;
if (done)
return;
}
result = anObject(call(next, iterator));
done = this.done = !!result.done;
if (!done)
return result.value;
});
$3({ target: "Iterator", proto: true, real: true, forced: IS_PURE }, {
drop: function drop3(limit) {
anObject(this);
var remaining = toPositiveInteger(notANaN(+limit));
return new IteratorProxy(getIteratorDirect(this), {
remaining
});
}
});
}
});
// node_modules/core-js/modules/es.iterator.every.js
var require_es_iterator_every = __commonJS({
"node_modules/core-js/modules/es.iterator.every.js"() {
"use strict";
var $3 = require_export();
var iterate = require_iterate();
var aCallable = require_a_callable();
var anObject = require_an_object();
var getIteratorDirect = require_get_iterator_direct();
$3({ target: "Iterator", proto: true, real: true }, {
every: function every(predicate) {
anObject(this);
aCallable(predicate);
var record = getIteratorDirect(this);
var counter = 0;
return !iterate(record, function(value, stop) {
if (!predicate(value, counter++))
return stop();
}, { IS_RECORD: true, INTERRUPTED: true }).stopped;
}
});
}
});
// node_modules/core-js/modules/es.iterator.filter.js
var require_es_iterator_filter = __commonJS({
"node_modules/core-js/modules/es.iterator.filter.js"() {
"use strict";
var $3 = require_export();
var call = require_function_call();
var aCallable = require_a_callable();
var anObject = require_an_object();
var getIteratorDirect = require_get_iterator_direct();
var createIteratorProxy = require_iterator_create_proxy();
var callWithSafeIterationClosing = require_call_with_safe_iteration_closing();
var IS_PURE = require_is_pure();
var IteratorProxy = createIteratorProxy(function() {
var iterator = this.iterator;
var predicate = this.predicate;
var next = this.next;
var result, done, value;
while (true) {
result = anObject(call(next, iterator));
done = this.done = !!result.done;
if (done)
return;
value = result.value;
if (callWithSafeIterationClosing(iterator, predicate, [value, this.counter++], true))
return value;
}
});
$3({ target: "Iterator", proto: true, real: true, forced: IS_PURE }, {
filter: function filter2(predicate) {
anObject(this);
aCallable(predicate);
return new IteratorProxy(getIteratorDirect(this), {
predicate
});
}
});
}
});
// node_modules/core-js/modules/es.iterator.find.js
var require_es_iterator_find = __commonJS({
"node_modules/core-js/modules/es.iterator.find.js"() {
"use strict";
var $3 = require_export();
var iterate = require_iterate();
var aCallable = require_a_callable();
var anObject = require_an_object();
var getIteratorDirect = require_get_iterator_direct();
$3({ target: "Iterator", proto: true, real: true }, {
find: function find3(predicate) {
anObject(this);
aCallable(predicate);
var record = getIteratorDirect(this);
var counter = 0;
return iterate(record, function(value, stop) {
if (predicate(value, counter++))
return stop(value);
}, { IS_RECORD: true, INTERRUPTED: true }).result;
}
});
}
});
// node_modules/core-js/internals/get-iterator-flattenable.js
var require_get_iterator_flattenable = __commonJS({
"node_modules/core-js/internals/get-iterator-flattenable.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var anObject = require_an_object();
var getIteratorDirect = require_get_iterator_direct();
var getIteratorMethod = require_get_iterator_method();
module2.exports = function(obj, stringHandling) {
if (!stringHandling || typeof obj !== "string")
anObject(obj);
var method = getIteratorMethod(obj);
return getIteratorDirect(anObject(method !== void 0 ? call(method, obj) : obj));
};
}
});
// node_modules/core-js/modules/es.iterator.flat-map.js
var require_es_iterator_flat_map = __commonJS({
"node_modules/core-js/modules/es.iterator.flat-map.js"() {
"use strict";
var $3 = require_export();
var call = require_function_call();
var aCallable = require_a_callable();
var anObject = require_an_object();
var getIteratorDirect = require_get_iterator_direct();
var getIteratorFlattenable = require_get_iterator_flattenable();
var createIteratorProxy = require_iterator_create_proxy();
var iteratorClose = require_iterator_close();
var IS_PURE = require_is_pure();
var IteratorProxy = createIteratorProxy(function() {
var iterator = this.iterator;
var mapper = this.mapper;
var result, inner;
while (true) {
if (inner = this.inner)
try {
result = anObject(call(inner.next, inner.iterator));
if (!result.done)
return result.value;
this.inner = null;
} catch (error2) {
iteratorClose(iterator, "throw", error2);
}
result = anObject(call(this.next, iterator));
if (this.done = !!result.done)
return;
try {
this.inner = getIteratorFlattenable(mapper(result.value, this.counter++), false);
} catch (error2) {
iteratorClose(iterator, "throw", error2);
}
}
});
$3({ target: "Iterator", proto: true, real: true, forced: IS_PURE }, {
flatMap: function flatMap(mapper) {
anObject(this);
aCallable(mapper);
return new IteratorProxy(getIteratorDirect(this), {
mapper,
inner: null
});
}
});
}
});
// node_modules/core-js/modules/es.iterator.for-each.js
var require_es_iterator_for_each = __commonJS({
"node_modules/core-js/modules/es.iterator.for-each.js"() {
"use strict";
var $3 = require_export();
var iterate = require_iterate();
var aCallable = require_a_callable();
var anObject = require_an_object();
var getIteratorDirect = require_get_iterator_direct();
$3({ target: "Iterator", proto: true, real: true }, {
forEach: function forEach2(fn3) {
anObject(this);
aCallable(fn3);
var record = getIteratorDirect(this);
var counter = 0;
iterate(record, function(value) {
fn3(value, counter++);
}, { IS_RECORD: true });
}
});
}
});
// node_modules/core-js/modules/es.iterator.from.js
var require_es_iterator_from = __commonJS({
"node_modules/core-js/modules/es.iterator.from.js"() {
"use strict";
var $3 = require_export();
var call = require_function_call();
var toObject = require_to_object();
var isPrototypeOf = require_object_is_prototype_of();
var IteratorPrototype = require_iterators_core().IteratorPrototype;
var createIteratorProxy = require_iterator_create_proxy();
var getIteratorFlattenable = require_get_iterator_flattenable();
var IS_PURE = require_is_pure();
var IteratorProxy = createIteratorProxy(function() {
return call(this.next, this.iterator);
}, true);
$3({ target: "Iterator", stat: true, forced: IS_PURE }, {
from: function from(O4) {
var iteratorRecord = getIteratorFlattenable(typeof O4 == "string" ? toObject(O4) : O4, true);
return isPrototypeOf(IteratorPrototype, iteratorRecord.iterator) ? iteratorRecord.iterator : new IteratorProxy(iteratorRecord);
}
});
}
});
// node_modules/core-js/internals/iterator-map.js
var require_iterator_map = __commonJS({
"node_modules/core-js/internals/iterator-map.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var aCallable = require_a_callable();
var anObject = require_an_object();
var getIteratorDirect = require_get_iterator_direct();
var createIteratorProxy = require_iterator_create_proxy();
var callWithSafeIterationClosing = require_call_with_safe_iteration_closing();
var IteratorProxy = createIteratorProxy(function() {
var iterator = this.iterator;
var result = anObject(call(this.next, iterator));
var done = this.done = !!result.done;
if (!done)
return callWithSafeIterationClosing(iterator, this.mapper, [result.value, this.counter++], true);
});
module2.exports = function map3(mapper) {
anObject(this);
aCallable(mapper);
return new IteratorProxy(getIteratorDirect(this), {
mapper
});
};
}
});
// node_modules/core-js/modules/es.iterator.map.js
var require_es_iterator_map = __commonJS({
"node_modules/core-js/modules/es.iterator.map.js"() {
"use strict";
var $3 = require_export();
var map3 = require_iterator_map();
var IS_PURE = require_is_pure();
$3({ target: "Iterator", proto: true, real: true, forced: IS_PURE }, {
map: map3
});
}
});
// node_modules/core-js/modules/es.iterator.reduce.js
var require_es_iterator_reduce = __commonJS({
"node_modules/core-js/modules/es.iterator.reduce.js"() {
"use strict";
var $3 = require_export();
var iterate = require_iterate();
var aCallable = require_a_callable();
var anObject = require_an_object();
var getIteratorDirect = require_get_iterator_direct();
var $TypeError = TypeError;
$3({ target: "Iterator", proto: true, real: true }, {
reduce: function reduce(reducer) {
anObject(this);
aCallable(reducer);
var record = getIteratorDirect(this);
var noInitial = arguments.length < 2;
var accumulator = noInitial ? void 0 : arguments[1];
var counter = 0;
iterate(record, function(value) {
if (noInitial) {
noInitial = false;
accumulator = value;
} else {
accumulator = reducer(accumulator, value, counter);
}
counter++;
}, { IS_RECORD: true });
if (noInitial)
throw new $TypeError("Reduce of empty iterator with no initial value");
return accumulator;
}
});
}
});
// node_modules/core-js/modules/es.iterator.some.js
var require_es_iterator_some = __commonJS({
"node_modules/core-js/modules/es.iterator.some.js"() {
"use strict";
var $3 = require_export();
var iterate = require_iterate();
var aCallable = require_a_callable();
var anObject = require_an_object();
var getIteratorDirect = require_get_iterator_direct();
$3({ target: "Iterator", proto: true, real: true }, {
some: function some(predicate) {
anObject(this);
aCallable(predicate);
var record = getIteratorDirect(this);
var counter = 0;
return iterate(record, function(value, stop) {
if (predicate(value, counter++))
return stop();
}, { IS_RECORD: true, INTERRUPTED: true }).stopped;
}
});
}
});
// node_modules/core-js/modules/es.iterator.take.js
var require_es_iterator_take = __commonJS({
"node_modules/core-js/modules/es.iterator.take.js"() {
"use strict";
var $3 = require_export();
var call = require_function_call();
var anObject = require_an_object();
var getIteratorDirect = require_get_iterator_direct();
var notANaN = require_not_a_nan();
var toPositiveInteger = require_to_positive_integer();
var createIteratorProxy = require_iterator_create_proxy();
var iteratorClose = require_iterator_close();
var IS_PURE = require_is_pure();
var IteratorProxy = createIteratorProxy(function() {
var iterator = this.iterator;
if (!this.remaining--) {
this.done = true;
return iteratorClose(iterator, "normal", void 0);
}
var result = anObject(call(this.next, iterator));
var done = this.done = !!result.done;
if (!done)
return result.value;
});
$3({ target: "Iterator", proto: true, real: true, forced: IS_PURE }, {
take: function take(limit) {
anObject(this);
var remaining = toPositiveInteger(notANaN(+limit));
return new IteratorProxy(getIteratorDirect(this), {
remaining
});
}
});
}
});
// node_modules/core-js/modules/es.iterator.to-array.js
var require_es_iterator_to_array = __commonJS({
"node_modules/core-js/modules/es.iterator.to-array.js"() {
"use strict";
var $3 = require_export();
var anObject = require_an_object();
var iterate = require_iterate();
var getIteratorDirect = require_get_iterator_direct();
var push = [].push;
$3({ target: "Iterator", proto: true, real: true }, {
toArray: function toArray2() {
var result = [];
iterate(getIteratorDirect(anObject(this)), push, { that: result, IS_RECORD: true });
return result;
}
});
}
});
// node_modules/core-js/modules/es.json.to-string-tag.js
var require_es_json_to_string_tag = __commonJS({
"node_modules/core-js/modules/es.json.to-string-tag.js"() {
"use strict";
var globalThis2 = require_global_this();
var setToStringTag = require_set_to_string_tag();
setToStringTag(globalThis2.JSON, "JSON", true);
}
});
// node_modules/core-js/internals/array-buffer-non-extensible.js
var require_array_buffer_non_extensible = __commonJS({
"node_modules/core-js/internals/array-buffer-non-extensible.js"(exports2, module2) {
"use strict";
var fails = require_fails();
module2.exports = fails(function() {
if (typeof ArrayBuffer == "function") {
var buffer = new ArrayBuffer(8);
if (Object.isExtensible(buffer))
Object.defineProperty(buffer, "a", { value: 8 });
}
});
}
});
// node_modules/core-js/internals/object-is-extensible.js
var require_object_is_extensible = __commonJS({
"node_modules/core-js/internals/object-is-extensible.js"(exports2, module2) {
"use strict";
var fails = require_fails();
var isObject3 = require_is_object();
var classof = require_classof_raw();
var ARRAY_BUFFER_NON_EXTENSIBLE = require_array_buffer_non_extensible();
var $isExtensible = Object.isExtensible;
var FAILS_ON_PRIMITIVES = fails(function() {
$isExtensible(1);
});
module2.exports = FAILS_ON_PRIMITIVES || ARRAY_BUFFER_NON_EXTENSIBLE ? function isExtensible(it2) {
if (!isObject3(it2))
return false;
if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it2) === "ArrayBuffer")
return false;
return $isExtensible ? $isExtensible(it2) : true;
} : $isExtensible;
}
});
// node_modules/core-js/internals/freezing.js
var require_freezing = __commonJS({
"node_modules/core-js/internals/freezing.js"(exports2, module2) {
"use strict";
var fails = require_fails();
module2.exports = !fails(function() {
return Object.isExtensible(Object.preventExtensions({}));
});
}
});
// node_modules/core-js/internals/internal-metadata.js
var require_internal_metadata = __commonJS({
"node_modules/core-js/internals/internal-metadata.js"(exports2, module2) {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var hiddenKeys = require_hidden_keys();
var isObject3 = require_is_object();
var hasOwn = require_has_own_property();
var defineProperty = require_object_define_property().f;
var getOwnPropertyNamesModule = require_object_get_own_property_names();
var getOwnPropertyNamesExternalModule = require_object_get_own_property_names_external();
var isExtensible = require_object_is_extensible();
var uid2 = require_uid();
var FREEZING = require_freezing();
var REQUIRED = false;
var METADATA = uid2("meta");
var id = 0;
var setMetadata = function(it2) {
defineProperty(it2, METADATA, { value: {
objectID: "O" + id++,
weakData: {}
} });
};
var fastKey = function(it2, create) {
if (!isObject3(it2))
return typeof it2 == "symbol" ? it2 : (typeof it2 == "string" ? "S" : "P") + it2;
if (!hasOwn(it2, METADATA)) {
if (!isExtensible(it2))
return "F";
if (!create)
return "E";
setMetadata(it2);
}
return it2[METADATA].objectID;
};
var getWeakData = function(it2, create) {
if (!hasOwn(it2, METADATA)) {
if (!isExtensible(it2))
return true;
if (!create)
return false;
setMetadata(it2);
}
return it2[METADATA].weakData;
};
var onFreeze = function(it2) {
if (FREEZING && REQUIRED && isExtensible(it2) && !hasOwn(it2, METADATA))
setMetadata(it2);
return it2;
};
var enable = function() {
meta.enable = function() {
};
REQUIRED = true;
var getOwnPropertyNames = getOwnPropertyNamesModule.f;
var splice = uncurryThis([].splice);
var test = {};
test[METADATA] = 1;
if (getOwnPropertyNames(test).length) {
getOwnPropertyNamesModule.f = function(it2) {
var result = getOwnPropertyNames(it2);
for (var i5 = 0, length = result.length; i5 < length; i5++) {
if (result[i5] === METADATA) {
splice(result, i5, 1);
break;
}
}
return result;
};
$3({ target: "Object", stat: true, forced: true }, {
getOwnPropertyNames: getOwnPropertyNamesExternalModule.f
});
}
};
var meta = module2.exports = {
enable,
fastKey,
getWeakData,
onFreeze
};
hiddenKeys[METADATA] = true;
}
});
// node_modules/core-js/internals/collection.js
var require_collection = __commonJS({
"node_modules/core-js/internals/collection.js"(exports2, module2) {
"use strict";
var $3 = require_export();
var globalThis2 = require_global_this();
var uncurryThis = require_function_uncurry_this();
var isForced = require_is_forced();
var defineBuiltIn = require_define_built_in();
var InternalMetadataModule = require_internal_metadata();
var iterate = require_iterate();
var anInstance = require_an_instance();
var isCallable = require_is_callable();
var isNullOrUndefined = require_is_null_or_undefined();
var isObject3 = require_is_object();
var fails = require_fails();
var checkCorrectnessOfIteration = require_check_correctness_of_iteration();
var setToStringTag = require_set_to_string_tag();
var inheritIfRequired = require_inherit_if_required();
module2.exports = 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 = globalThis2[CONSTRUCTOR_NAME];
var NativePrototype = NativeConstructor && NativeConstructor.prototype;
var Constructor = NativeConstructor;
var exported = {};
var fixMethod = function(KEY) {
var uncurriedNativeMethod = uncurryThis(NativePrototype[KEY]);
defineBuiltIn(
NativePrototype,
KEY,
KEY === "add" ? function add2(value) {
uncurriedNativeMethod(this, value === 0 ? 0 : value);
return this;
} : KEY === "delete" ? function(key) {
return IS_WEAK && !isObject3(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
} : KEY === "get" ? function get(key) {
return IS_WEAK && !isObject3(key) ? void 0 : uncurriedNativeMethod(this, key === 0 ? 0 : key);
} : KEY === "has" ? function has(key) {
return IS_WEAK && !isObject3(key) ? false : uncurriedNativeMethod(this, key === 0 ? 0 : key);
} : function set2(key, value) {
uncurriedNativeMethod(this, key === 0 ? 0 : key, value);
return this;
}
);
};
var REPLACE = isForced(
CONSTRUCTOR_NAME,
!isCallable(NativeConstructor) || !(IS_WEAK || NativePrototype.forEach && !fails(function() {
new NativeConstructor().entries().next();
}))
);
if (REPLACE) {
Constructor = common.getConstructor(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER);
InternalMetadataModule.enable();
} else if (isForced(CONSTRUCTOR_NAME, true)) {
var instance = new Constructor();
var HASNT_CHAINING = instance[ADDER](IS_WEAK ? {} : -0, 1) !== instance;
var THROWS_ON_PRIMITIVES = fails(function() {
instance.has(1);
});
var ACCEPT_ITERABLES = checkCorrectnessOfIteration(function(iterable) {
new NativeConstructor(iterable);
});
var BUGGY_ZERO = !IS_WEAK && fails(function() {
var $instance = new NativeConstructor();
var index3 = 5;
while (index3--)
$instance[ADDER](index3, index3);
return !$instance.has(-0);
});
if (!ACCEPT_ITERABLES) {
Constructor = wrapper(function(dummy, iterable) {
anInstance(dummy, NativePrototype);
var that = inheritIfRequired(new NativeConstructor(), dummy, Constructor);
if (!isNullOrUndefined(iterable))
iterate(iterable, that[ADDER], { that, 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);
if (IS_WEAK && NativePrototype.clear)
delete NativePrototype.clear;
}
exported[CONSTRUCTOR_NAME] = Constructor;
$3({ global: true, constructor: true, forced: Constructor !== NativeConstructor }, exported);
setToStringTag(Constructor, CONSTRUCTOR_NAME);
if (!IS_WEAK)
common.setStrong(Constructor, CONSTRUCTOR_NAME, IS_MAP);
return Constructor;
};
}
});
// node_modules/core-js/internals/collection-strong.js
var require_collection_strong = __commonJS({
"node_modules/core-js/internals/collection-strong.js"(exports2, module2) {
"use strict";
var create = require_object_create();
var defineBuiltInAccessor = require_define_built_in_accessor();
var defineBuiltIns = require_define_built_ins();
var bind3 = require_function_bind_context();
var anInstance = require_an_instance();
var isNullOrUndefined = require_is_null_or_undefined();
var iterate = require_iterate();
var defineIterator = require_iterator_define();
var createIterResultObject = require_create_iter_result_object();
var setSpecies = require_set_species();
var DESCRIPTORS = require_descriptors();
var fastKey = require_internal_metadata().fastKey;
var InternalStateModule = require_internal_state();
var setInternalState = InternalStateModule.set;
var internalStateGetterFor = InternalStateModule.getterFor;
module2.exports = {
getConstructor: function(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
var Constructor = wrapper(function(that, iterable) {
anInstance(that, Prototype);
setInternalState(that, {
type: CONSTRUCTOR_NAME,
index: create(null),
first: null,
last: null,
size: 0
});
if (!DESCRIPTORS)
that.size = 0;
if (!isNullOrUndefined(iterable))
iterate(iterable, that[ADDER], { that, AS_ENTRIES: IS_MAP });
});
var Prototype = Constructor.prototype;
var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
var define2 = function(that, key, value) {
var state = getInternalState(that);
var entry = getEntry(that, key);
var previous, index3;
if (entry) {
entry.value = value;
} else {
state.last = entry = {
index: index3 = fastKey(key, true),
key,
value,
previous: previous = state.last,
next: null,
removed: false
};
if (!state.first)
state.first = entry;
if (previous)
previous.next = entry;
if (DESCRIPTORS)
state.size++;
else
that.size++;
if (index3 !== "F")
state.index[index3] = entry;
}
return that;
};
var getEntry = function(that, key) {
var state = getInternalState(that);
var index3 = fastKey(key);
var entry;
if (index3 !== "F")
return state.index[index3];
for (entry = state.first; entry; entry = entry.next) {
if (entry.key === key)
return entry;
}
};
defineBuiltIns(Prototype, {
clear: function clear() {
var that = this;
var state = getInternalState(that);
var entry = state.first;
while (entry) {
entry.removed = true;
if (entry.previous)
entry.previous = entry.previous.next = null;
entry = entry.next;
}
state.first = state.last = null;
state.index = create(null);
if (DESCRIPTORS)
state.size = 0;
else
that.size = 0;
},
"delete": function(key) {
var that = this;
var state = getInternalState(that);
var entry = getEntry(that, key);
if (entry) {
var next = entry.next;
var prev = entry.previous;
delete state.index[entry.index];
entry.removed = true;
if (prev)
prev.next = next;
if (next)
next.previous = prev;
if (state.first === entry)
state.first = next;
if (state.last === entry)
state.last = prev;
if (DESCRIPTORS)
state.size--;
else
that.size--;
}
return !!entry;
},
forEach: function forEach2(callbackfn) {
var state = getInternalState(this);
var boundFunction = bind3(callbackfn, arguments.length > 1 ? arguments[1] : void 0);
var entry;
while (entry = entry ? entry.next : state.first) {
boundFunction(entry.value, entry.key, this);
while (entry && entry.removed)
entry = entry.previous;
}
},
has: function has(key) {
return !!getEntry(this, key);
}
});
defineBuiltIns(Prototype, IS_MAP ? {
get: function get(key) {
var entry = getEntry(this, key);
return entry && entry.value;
},
set: function set2(key, value) {
return define2(this, key === 0 ? 0 : key, value);
}
} : {
add: function add2(value) {
return define2(this, value = value === 0 ? 0 : value, value);
}
});
if (DESCRIPTORS)
defineBuiltInAccessor(Prototype, "size", {
configurable: true,
get: function() {
return getInternalState(this).size;
}
});
return Constructor;
},
setStrong: function(Constructor, CONSTRUCTOR_NAME, IS_MAP) {
var ITERATOR_NAME = CONSTRUCTOR_NAME + " Iterator";
var getInternalCollectionState = internalStateGetterFor(CONSTRUCTOR_NAME);
var getInternalIteratorState = internalStateGetterFor(ITERATOR_NAME);
defineIterator(Constructor, CONSTRUCTOR_NAME, function(iterated, kind) {
setInternalState(this, {
type: ITERATOR_NAME,
target: iterated,
state: getInternalCollectionState(iterated),
kind,
last: null
});
}, function() {
var state = getInternalIteratorState(this);
var kind = state.kind;
var entry = state.last;
while (entry && entry.removed)
entry = entry.previous;
if (!state.target || !(state.last = entry = entry ? entry.next : state.state.first)) {
state.target = null;
return createIterResultObject(void 0, true);
}
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);
setSpecies(CONSTRUCTOR_NAME);
}
};
}
});
// node_modules/core-js/modules/es.map.constructor.js
var require_es_map_constructor = __commonJS({
"node_modules/core-js/modules/es.map.constructor.js"() {
"use strict";
var collection = require_collection();
var collectionStrong = require_collection_strong();
collection("Map", function(init3) {
return function Map2() {
return init3(this, arguments.length ? arguments[0] : void 0);
};
}, collectionStrong);
}
});
// node_modules/core-js/modules/es.map.js
var require_es_map = __commonJS({
"node_modules/core-js/modules/es.map.js"() {
"use strict";
require_es_map_constructor();
}
});
// node_modules/core-js/internals/map-helpers.js
var require_map_helpers = __commonJS({
"node_modules/core-js/internals/map-helpers.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var MapPrototype = Map.prototype;
module2.exports = {
Map,
set: uncurryThis(MapPrototype.set),
get: uncurryThis(MapPrototype.get),
has: uncurryThis(MapPrototype.has),
remove: uncurryThis(MapPrototype["delete"]),
proto: MapPrototype
};
}
});
// node_modules/core-js/modules/es.map.group-by.js
var require_es_map_group_by = __commonJS({
"node_modules/core-js/modules/es.map.group-by.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var aCallable = require_a_callable();
var requireObjectCoercible = require_require_object_coercible();
var iterate = require_iterate();
var MapHelpers = require_map_helpers();
var IS_PURE = require_is_pure();
var fails = require_fails();
var Map2 = MapHelpers.Map;
var has = MapHelpers.has;
var get = MapHelpers.get;
var set2 = MapHelpers.set;
var push = uncurryThis([].push);
var DOES_NOT_WORK_WITH_PRIMITIVES = IS_PURE || fails(function() {
return Map2.groupBy("ab", function(it2) {
return it2;
}).get("a").length !== 1;
});
$3({ target: "Map", stat: true, forced: IS_PURE || DOES_NOT_WORK_WITH_PRIMITIVES }, {
groupBy: function groupBy(items, callbackfn) {
requireObjectCoercible(items);
aCallable(callbackfn);
var map3 = new Map2();
var k4 = 0;
iterate(items, function(value) {
var key = callbackfn(value, k4++);
if (!has(map3, key))
set2(map3, key, [value]);
else
push(get(map3, key), value);
});
return map3;
}
});
}
});
// node_modules/core-js/internals/math-log1p.js
var require_math_log1p = __commonJS({
"node_modules/core-js/internals/math-log1p.js"(exports2, module2) {
"use strict";
var log = Math.log;
module2.exports = Math.log1p || function log1p(x4) {
var n7 = +x4;
return n7 > -1e-8 && n7 < 1e-8 ? n7 - n7 * n7 / 2 : log(1 + n7);
};
}
});
// node_modules/core-js/modules/es.math.acosh.js
var require_es_math_acosh = __commonJS({
"node_modules/core-js/modules/es.math.acosh.js"() {
"use strict";
var $3 = require_export();
var log1p = require_math_log1p();
var $acosh = Math.acosh;
var log = Math.log;
var sqrt = Math.sqrt;
var LN2 = Math.LN2;
var FORCED = !$acosh || Math.floor($acosh(Number.MAX_VALUE)) !== 710 || $acosh(Infinity) !== Infinity;
$3({ target: "Math", stat: true, forced: FORCED }, {
acosh: function acosh(x4) {
var n7 = +x4;
return n7 < 1 ? NaN : n7 > 9490626562425156e-8 ? log(n7) + LN2 : log1p(n7 - 1 + sqrt(n7 - 1) * sqrt(n7 + 1));
}
});
}
});
// node_modules/core-js/modules/es.math.asinh.js
var require_es_math_asinh = __commonJS({
"node_modules/core-js/modules/es.math.asinh.js"() {
"use strict";
var $3 = require_export();
var $asinh = Math.asinh;
var log = Math.log;
var sqrt = Math.sqrt;
function asinh(x4) {
var n7 = +x4;
return !isFinite(n7) || n7 === 0 ? n7 : n7 < 0 ? -asinh(-n7) : log(n7 + sqrt(n7 * n7 + 1));
}
var FORCED = !($asinh && 1 / $asinh(0) > 0);
$3({ target: "Math", stat: true, forced: FORCED }, {
asinh
});
}
});
// node_modules/core-js/modules/es.math.atanh.js
var require_es_math_atanh = __commonJS({
"node_modules/core-js/modules/es.math.atanh.js"() {
"use strict";
var $3 = require_export();
var $atanh = Math.atanh;
var log = Math.log;
var FORCED = !($atanh && 1 / $atanh(-0) < 0);
$3({ target: "Math", stat: true, forced: FORCED }, {
atanh: function atanh(x4) {
var n7 = +x4;
return n7 === 0 ? n7 : log((1 + n7) / (1 - n7)) / 2;
}
});
}
});
// node_modules/core-js/modules/es.math.cbrt.js
var require_es_math_cbrt = __commonJS({
"node_modules/core-js/modules/es.math.cbrt.js"() {
"use strict";
var $3 = require_export();
var sign2 = require_math_sign();
var abs = Math.abs;
var pow = Math.pow;
$3({ target: "Math", stat: true }, {
cbrt: function cbrt(x4) {
var n7 = +x4;
return sign2(n7) * pow(abs(n7), 1 / 3);
}
});
}
});
// node_modules/core-js/modules/es.math.clz32.js
var require_es_math_clz32 = __commonJS({
"node_modules/core-js/modules/es.math.clz32.js"() {
"use strict";
var $3 = require_export();
var floor = Math.floor;
var log = Math.log;
var LOG2E = Math.LOG2E;
$3({ target: "Math", stat: true }, {
clz32: function clz32(x4) {
var n7 = x4 >>> 0;
return n7 ? 31 - floor(log(n7 + 0.5) * LOG2E) : 32;
}
});
}
});
// node_modules/core-js/internals/math-expm1.js
var require_math_expm1 = __commonJS({
"node_modules/core-js/internals/math-expm1.js"(exports2, module2) {
"use strict";
var $expm1 = Math.expm1;
var exp = Math.exp;
module2.exports = !$expm1 || $expm1(10) > 22025.465794806718 || $expm1(10) < 22025.465794806718 || $expm1(-2e-17) !== -2e-17 ? function expm1(x4) {
var n7 = +x4;
return n7 === 0 ? n7 : n7 > -1e-6 && n7 < 1e-6 ? n7 + n7 * n7 / 2 : exp(n7) - 1;
} : $expm1;
}
});
// node_modules/core-js/modules/es.math.cosh.js
var require_es_math_cosh = __commonJS({
"node_modules/core-js/modules/es.math.cosh.js"() {
"use strict";
var $3 = require_export();
var expm1 = require_math_expm1();
var $cosh = Math.cosh;
var abs = Math.abs;
var E3 = Math.E;
var FORCED = !$cosh || $cosh(710) === Infinity;
$3({ target: "Math", stat: true, forced: FORCED }, {
cosh: function cosh(x4) {
var t5 = expm1(abs(x4) - 1) + 1;
return (t5 + 1 / (t5 * E3 * E3)) * (E3 / 2);
}
});
}
});
// node_modules/core-js/modules/es.math.expm1.js
var require_es_math_expm1 = __commonJS({
"node_modules/core-js/modules/es.math.expm1.js"() {
"use strict";
var $3 = require_export();
var expm1 = require_math_expm1();
$3({ target: "Math", stat: true, forced: expm1 !== Math.expm1 }, { expm1 });
}
});
// node_modules/core-js/modules/es.math.fround.js
var require_es_math_fround = __commonJS({
"node_modules/core-js/modules/es.math.fround.js"() {
"use strict";
var $3 = require_export();
var fround = require_math_fround();
$3({ target: "Math", stat: true }, { fround });
}
});
// node_modules/core-js/modules/es.math.hypot.js
var require_es_math_hypot = __commonJS({
"node_modules/core-js/modules/es.math.hypot.js"() {
"use strict";
var $3 = require_export();
var $hypot = Math.hypot;
var abs = Math.abs;
var sqrt = Math.sqrt;
var FORCED = !!$hypot && $hypot(Infinity, NaN) !== Infinity;
$3({ target: "Math", stat: true, arity: 2, forced: FORCED }, {
hypot: function hypot(value1, value2) {
var sum = 0;
var i5 = 0;
var aLen = arguments.length;
var larg = 0;
var arg, div2;
while (i5 < aLen) {
arg = abs(arguments[i5++]);
if (larg < arg) {
div2 = larg / arg;
sum = sum * div2 * div2 + 1;
larg = arg;
} else if (arg > 0) {
div2 = arg / larg;
sum += div2 * div2;
} else
sum += arg;
}
return larg === Infinity ? Infinity : larg * sqrt(sum);
}
});
}
});
// node_modules/core-js/modules/es.math.imul.js
var require_es_math_imul = __commonJS({
"node_modules/core-js/modules/es.math.imul.js"() {
"use strict";
var $3 = require_export();
var fails = require_fails();
var $imul = Math.imul;
var FORCED = fails(function() {
return $imul(4294967295, 5) !== -5 || $imul.length !== 2;
});
$3({ target: "Math", stat: true, forced: FORCED }, {
imul: function imul(x4, y4) {
var UINT16 = 65535;
var xn2 = +x4;
var yn2 = +y4;
var xl = UINT16 & xn2;
var yl = UINT16 & yn2;
return 0 | xl * yl + ((UINT16 & xn2 >>> 16) * yl + xl * (UINT16 & yn2 >>> 16) << 16 >>> 0);
}
});
}
});
// node_modules/core-js/internals/math-log10.js
var require_math_log10 = __commonJS({
"node_modules/core-js/internals/math-log10.js"(exports2, module2) {
"use strict";
var log = Math.log;
var LOG10E = Math.LOG10E;
module2.exports = Math.log10 || function log102(x4) {
return log(x4) * LOG10E;
};
}
});
// node_modules/core-js/modules/es.math.log10.js
var require_es_math_log10 = __commonJS({
"node_modules/core-js/modules/es.math.log10.js"() {
"use strict";
var $3 = require_export();
var log102 = require_math_log10();
$3({ target: "Math", stat: true }, {
log10: log102
});
}
});
// node_modules/core-js/modules/es.math.log1p.js
var require_es_math_log1p = __commonJS({
"node_modules/core-js/modules/es.math.log1p.js"() {
"use strict";
var $3 = require_export();
var log1p = require_math_log1p();
$3({ target: "Math", stat: true }, { log1p });
}
});
// node_modules/core-js/modules/es.math.log2.js
var require_es_math_log2 = __commonJS({
"node_modules/core-js/modules/es.math.log2.js"() {
"use strict";
var $3 = require_export();
var log = Math.log;
var LN2 = Math.LN2;
$3({ target: "Math", stat: true }, {
log2: function log2(x4) {
return log(x4) / LN2;
}
});
}
});
// node_modules/core-js/modules/es.math.sign.js
var require_es_math_sign = __commonJS({
"node_modules/core-js/modules/es.math.sign.js"() {
"use strict";
var $3 = require_export();
var sign2 = require_math_sign();
$3({ target: "Math", stat: true }, {
sign: sign2
});
}
});
// node_modules/core-js/modules/es.math.sinh.js
var require_es_math_sinh = __commonJS({
"node_modules/core-js/modules/es.math.sinh.js"() {
"use strict";
var $3 = require_export();
var fails = require_fails();
var expm1 = require_math_expm1();
var abs = Math.abs;
var exp = Math.exp;
var E3 = Math.E;
var FORCED = fails(function() {
return Math.sinh(-2e-17) !== -2e-17;
});
$3({ target: "Math", stat: true, forced: FORCED }, {
sinh: function sinh(x4) {
var n7 = +x4;
return abs(n7) < 1 ? (expm1(n7) - expm1(-n7)) / 2 : (exp(n7 - 1) - exp(-n7 - 1)) * (E3 / 2);
}
});
}
});
// node_modules/core-js/modules/es.math.tanh.js
var require_es_math_tanh = __commonJS({
"node_modules/core-js/modules/es.math.tanh.js"() {
"use strict";
var $3 = require_export();
var expm1 = require_math_expm1();
var exp = Math.exp;
$3({ target: "Math", stat: true }, {
tanh: function tanh(x4) {
var n7 = +x4;
var a5 = expm1(n7);
var b4 = expm1(-n7);
return a5 === Infinity ? 1 : b4 === Infinity ? -1 : (a5 - b4) / (exp(n7) + exp(-n7));
}
});
}
});
// node_modules/core-js/modules/es.math.to-string-tag.js
var require_es_math_to_string_tag = __commonJS({
"node_modules/core-js/modules/es.math.to-string-tag.js"() {
"use strict";
var setToStringTag = require_set_to_string_tag();
setToStringTag(Math, "Math", true);
}
});
// node_modules/core-js/modules/es.math.trunc.js
var require_es_math_trunc = __commonJS({
"node_modules/core-js/modules/es.math.trunc.js"() {
"use strict";
var $3 = require_export();
var trunc = require_math_trunc();
$3({ target: "Math", stat: true }, {
trunc
});
}
});
// node_modules/core-js/internals/this-number-value.js
var require_this_number_value = __commonJS({
"node_modules/core-js/internals/this-number-value.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
module2.exports = uncurryThis(1 .valueOf);
}
});
// node_modules/core-js/internals/whitespaces.js
var require_whitespaces = __commonJS({
"node_modules/core-js/internals/whitespaces.js"(exports2, module2) {
"use strict";
module2.exports = " \n\v\f\r \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF";
}
});
// node_modules/core-js/internals/string-trim.js
var require_string_trim = __commonJS({
"node_modules/core-js/internals/string-trim.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var requireObjectCoercible = require_require_object_coercible();
var toString = require_to_string();
var whitespaces = require_whitespaces();
var replace2 = uncurryThis("".replace);
var ltrim = RegExp("^[" + whitespaces + "]+");
var rtrim = RegExp("(^|[^" + whitespaces + "])[" + whitespaces + "]+$");
var createMethod = function(TYPE) {
return function($this) {
var string = toString(requireObjectCoercible($this));
if (TYPE & 1)
string = replace2(string, ltrim, "");
if (TYPE & 2)
string = replace2(string, rtrim, "$1");
return string;
};
};
module2.exports = {
start: createMethod(1),
end: createMethod(2),
trim: createMethod(3)
};
}
});
// node_modules/core-js/modules/es.number.constructor.js
var require_es_number_constructor = __commonJS({
"node_modules/core-js/modules/es.number.constructor.js"() {
"use strict";
var $3 = require_export();
var IS_PURE = require_is_pure();
var DESCRIPTORS = require_descriptors();
var globalThis2 = require_global_this();
var path = require_path();
var uncurryThis = require_function_uncurry_this();
var isForced = require_is_forced();
var hasOwn = require_has_own_property();
var inheritIfRequired = require_inherit_if_required();
var isPrototypeOf = require_object_is_prototype_of();
var isSymbol = require_is_symbol();
var toPrimitive = require_to_primitive();
var fails = require_fails();
var getOwnPropertyNames = require_object_get_own_property_names().f;
var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
var defineProperty = require_object_define_property().f;
var thisNumberValue = require_this_number_value();
var trim = require_string_trim().trim;
var NUMBER = "Number";
var NativeNumber = globalThis2[NUMBER];
var PureNumberNamespace = path[NUMBER];
var NumberPrototype = NativeNumber.prototype;
var TypeError2 = globalThis2.TypeError;
var stringSlice = uncurryThis("".slice);
var charCodeAt = uncurryThis("".charCodeAt);
var toNumeric = function(value) {
var primValue = toPrimitive(value, "number");
return typeof primValue == "bigint" ? primValue : toNumber(primValue);
};
var toNumber = function(argument) {
var it2 = toPrimitive(argument, "number");
var first3, third, radix, maxCode, digits, length, index3, code3;
if (isSymbol(it2))
throw new TypeError2("Cannot convert a Symbol value to a number");
if (typeof it2 == "string" && it2.length > 2) {
it2 = trim(it2);
first3 = charCodeAt(it2, 0);
if (first3 === 43 || first3 === 45) {
third = charCodeAt(it2, 2);
if (third === 88 || third === 120)
return NaN;
} else if (first3 === 48) {
switch (charCodeAt(it2, 1)) {
case 66:
case 98:
radix = 2;
maxCode = 49;
break;
case 79:
case 111:
radix = 8;
maxCode = 55;
break;
default:
return +it2;
}
digits = stringSlice(it2, 2);
length = digits.length;
for (index3 = 0; index3 < length; index3++) {
code3 = charCodeAt(digits, index3);
if (code3 < 48 || code3 > maxCode)
return NaN;
}
return parseInt(digits, radix);
}
}
return +it2;
};
var FORCED = isForced(NUMBER, !NativeNumber(" 0o1") || !NativeNumber("0b1") || NativeNumber("+0x1"));
var calledWithNew = function(dummy) {
return isPrototypeOf(NumberPrototype, dummy) && fails(function() {
thisNumberValue(dummy);
});
};
var NumberWrapper = function Number2(value) {
var n7 = arguments.length < 1 ? 0 : NativeNumber(toNumeric(value));
return calledWithNew(this) ? inheritIfRequired(Object(n7), this, NumberWrapper) : n7;
};
NumberWrapper.prototype = NumberPrototype;
if (FORCED && !IS_PURE)
NumberPrototype.constructor = NumberWrapper;
$3({ global: true, constructor: true, wrap: true, forced: FORCED }, {
Number: NumberWrapper
});
var copyConstructorProperties = function(target, source) {
for (var keys2 = DESCRIPTORS ? getOwnPropertyNames(source) : "MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","), j4 = 0, key; keys2.length > j4; j4++) {
if (hasOwn(source, key = keys2[j4]) && !hasOwn(target, key)) {
defineProperty(target, key, getOwnPropertyDescriptor(source, key));
}
}
};
if (IS_PURE && PureNumberNamespace)
copyConstructorProperties(path[NUMBER], PureNumberNamespace);
if (FORCED || IS_PURE)
copyConstructorProperties(path[NUMBER], NativeNumber);
}
});
// node_modules/core-js/modules/es.number.epsilon.js
var require_es_number_epsilon = __commonJS({
"node_modules/core-js/modules/es.number.epsilon.js"() {
"use strict";
var $3 = require_export();
$3({ target: "Number", stat: true, nonConfigurable: true, nonWritable: true }, {
EPSILON: Math.pow(2, -52)
});
}
});
// node_modules/core-js/internals/number-is-finite.js
var require_number_is_finite = __commonJS({
"node_modules/core-js/internals/number-is-finite.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var globalIsFinite = globalThis2.isFinite;
module2.exports = Number.isFinite || function isFinite2(it2) {
return typeof it2 == "number" && globalIsFinite(it2);
};
}
});
// node_modules/core-js/modules/es.number.is-finite.js
var require_es_number_is_finite = __commonJS({
"node_modules/core-js/modules/es.number.is-finite.js"() {
"use strict";
var $3 = require_export();
var numberIsFinite = require_number_is_finite();
$3({ target: "Number", stat: true }, { isFinite: numberIsFinite });
}
});
// node_modules/core-js/internals/is-integral-number.js
var require_is_integral_number = __commonJS({
"node_modules/core-js/internals/is-integral-number.js"(exports2, module2) {
"use strict";
var isObject3 = require_is_object();
var floor = Math.floor;
module2.exports = Number.isInteger || function isInteger2(it2) {
return !isObject3(it2) && isFinite(it2) && floor(it2) === it2;
};
}
});
// node_modules/core-js/modules/es.number.is-integer.js
var require_es_number_is_integer = __commonJS({
"node_modules/core-js/modules/es.number.is-integer.js"() {
"use strict";
var $3 = require_export();
var isIntegralNumber = require_is_integral_number();
$3({ target: "Number", stat: true }, {
isInteger: isIntegralNumber
});
}
});
// node_modules/core-js/modules/es.number.is-nan.js
var require_es_number_is_nan = __commonJS({
"node_modules/core-js/modules/es.number.is-nan.js"() {
"use strict";
var $3 = require_export();
$3({ target: "Number", stat: true }, {
isNaN: function isNaN2(number) {
return number !== number;
}
});
}
});
// node_modules/core-js/modules/es.number.is-safe-integer.js
var require_es_number_is_safe_integer = __commonJS({
"node_modules/core-js/modules/es.number.is-safe-integer.js"() {
"use strict";
var $3 = require_export();
var isIntegralNumber = require_is_integral_number();
var abs = Math.abs;
$3({ target: "Number", stat: true }, {
isSafeInteger: function isSafeInteger(number) {
return isIntegralNumber(number) && abs(number) <= 9007199254740991;
}
});
}
});
// node_modules/core-js/modules/es.number.max-safe-integer.js
var require_es_number_max_safe_integer = __commonJS({
"node_modules/core-js/modules/es.number.max-safe-integer.js"() {
"use strict";
var $3 = require_export();
$3({ target: "Number", stat: true, nonConfigurable: true, nonWritable: true }, {
MAX_SAFE_INTEGER: 9007199254740991
});
}
});
// node_modules/core-js/modules/es.number.min-safe-integer.js
var require_es_number_min_safe_integer = __commonJS({
"node_modules/core-js/modules/es.number.min-safe-integer.js"() {
"use strict";
var $3 = require_export();
$3({ target: "Number", stat: true, nonConfigurable: true, nonWritable: true }, {
MIN_SAFE_INTEGER: -9007199254740991
});
}
});
// node_modules/core-js/internals/number-parse-float.js
var require_number_parse_float = __commonJS({
"node_modules/core-js/internals/number-parse-float.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var fails = require_fails();
var uncurryThis = require_function_uncurry_this();
var toString = require_to_string();
var trim = require_string_trim().trim;
var whitespaces = require_whitespaces();
var charAt = uncurryThis("".charAt);
var $parseFloat = globalThis2.parseFloat;
var Symbol2 = globalThis2.Symbol;
var ITERATOR = Symbol2 && Symbol2.iterator;
var FORCED = 1 / $parseFloat(whitespaces + "-0") !== -Infinity || ITERATOR && !fails(function() {
$parseFloat(Object(ITERATOR));
});
module2.exports = FORCED ? function parseFloat2(string) {
var trimmedString = trim(toString(string));
var result = $parseFloat(trimmedString);
return result === 0 && charAt(trimmedString, 0) === "-" ? -0 : result;
} : $parseFloat;
}
});
// node_modules/core-js/modules/es.number.parse-float.js
var require_es_number_parse_float = __commonJS({
"node_modules/core-js/modules/es.number.parse-float.js"() {
"use strict";
var $3 = require_export();
var parseFloat2 = require_number_parse_float();
$3({ target: "Number", stat: true, forced: Number.parseFloat !== parseFloat2 }, {
parseFloat: parseFloat2
});
}
});
// node_modules/core-js/internals/number-parse-int.js
var require_number_parse_int = __commonJS({
"node_modules/core-js/internals/number-parse-int.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var fails = require_fails();
var uncurryThis = require_function_uncurry_this();
var toString = require_to_string();
var trim = require_string_trim().trim;
var whitespaces = require_whitespaces();
var $parseInt = globalThis2.parseInt;
var Symbol2 = globalThis2.Symbol;
var ITERATOR = Symbol2 && Symbol2.iterator;
var hex2 = /^[+-]?0x/i;
var exec = uncurryThis(hex2.exec);
var FORCED = $parseInt(whitespaces + "08") !== 8 || $parseInt(whitespaces + "0x16") !== 22 || ITERATOR && !fails(function() {
$parseInt(Object(ITERATOR));
});
module2.exports = FORCED ? function parseInt2(string, radix) {
var S4 = trim(toString(string));
return $parseInt(S4, radix >>> 0 || (exec(hex2, S4) ? 16 : 10));
} : $parseInt;
}
});
// node_modules/core-js/modules/es.number.parse-int.js
var require_es_number_parse_int = __commonJS({
"node_modules/core-js/modules/es.number.parse-int.js"() {
"use strict";
var $3 = require_export();
var parseInt2 = require_number_parse_int();
$3({ target: "Number", stat: true, forced: Number.parseInt !== parseInt2 }, {
parseInt: parseInt2
});
}
});
// node_modules/core-js/modules/es.number.to-exponential.js
var require_es_number_to_exponential = __commonJS({
"node_modules/core-js/modules/es.number.to-exponential.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var thisNumberValue = require_this_number_value();
var $repeat = require_string_repeat();
var log102 = require_math_log10();
var fails = require_fails();
var $RangeError = RangeError;
var $String = String;
var $isFinite = isFinite;
var abs = Math.abs;
var floor = Math.floor;
var pow = Math.pow;
var round3 = Math.round;
var nativeToExponential = uncurryThis(1 .toExponential);
var repeat = uncurryThis($repeat);
var stringSlice = uncurryThis("".slice);
var ROUNDS_PROPERLY = nativeToExponential(-69e-12, 4) === "-6.9000e-11" && nativeToExponential(1.255, 2) === "1.25e+0" && nativeToExponential(12345, 3) === "1.235e+4" && nativeToExponential(25, 0) === "3e+1";
var throwsOnInfinityFraction = function() {
return fails(function() {
nativeToExponential(1, Infinity);
}) && fails(function() {
nativeToExponential(1, -Infinity);
});
};
var properNonFiniteThisCheck = function() {
return !fails(function() {
nativeToExponential(Infinity, Infinity);
nativeToExponential(NaN, Infinity);
});
};
var FORCED = !ROUNDS_PROPERLY || !throwsOnInfinityFraction() || !properNonFiniteThisCheck();
$3({ target: "Number", proto: true, forced: FORCED }, {
toExponential: function toExponential(fractionDigits) {
var x4 = thisNumberValue(this);
if (fractionDigits === void 0)
return nativeToExponential(x4);
var f4 = toIntegerOrInfinity(fractionDigits);
if (!$isFinite(x4))
return String(x4);
if (f4 < 0 || f4 > 20)
throw new $RangeError("Incorrect fraction digits");
if (ROUNDS_PROPERLY)
return nativeToExponential(x4, f4);
var s6 = "";
var m4, e5, c4, d4;
if (x4 < 0) {
s6 = "-";
x4 = -x4;
}
if (x4 === 0) {
e5 = 0;
m4 = repeat("0", f4 + 1);
} else {
var l7 = log102(x4);
e5 = floor(l7);
var w4 = pow(10, e5 - f4);
var n7 = round3(x4 / w4);
if (2 * x4 >= (2 * n7 + 1) * w4) {
n7 += 1;
}
if (n7 >= pow(10, f4 + 1)) {
n7 /= 10;
e5 += 1;
}
m4 = $String(n7);
}
if (f4 !== 0) {
m4 = stringSlice(m4, 0, 1) + "." + stringSlice(m4, 1);
}
if (e5 === 0) {
c4 = "+";
d4 = "0";
} else {
c4 = e5 > 0 ? "+" : "-";
d4 = $String(abs(e5));
}
m4 += "e" + c4 + d4;
return s6 + m4;
}
});
}
});
// node_modules/core-js/modules/es.number.to-fixed.js
var require_es_number_to_fixed = __commonJS({
"node_modules/core-js/modules/es.number.to-fixed.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var thisNumberValue = require_this_number_value();
var $repeat = require_string_repeat();
var fails = require_fails();
var $RangeError = RangeError;
var $String = String;
var floor = Math.floor;
var repeat = uncurryThis($repeat);
var stringSlice = uncurryThis("".slice);
var nativeToFixed = uncurryThis(1 .toFixed);
var pow = function(x4, n7, acc) {
return n7 === 0 ? acc : n7 % 2 === 1 ? pow(x4, n7 - 1, acc * x4) : pow(x4 * x4, n7 / 2, acc);
};
var log = function(x4) {
var n7 = 0;
var x22 = x4;
while (x22 >= 4096) {
n7 += 12;
x22 /= 4096;
}
while (x22 >= 2) {
n7 += 1;
x22 /= 2;
}
return n7;
};
var multiply = function(data, n7, c4) {
var index3 = -1;
var c22 = c4;
while (++index3 < 6) {
c22 += n7 * data[index3];
data[index3] = c22 % 1e7;
c22 = floor(c22 / 1e7);
}
};
var divide = function(data, n7) {
var index3 = 6;
var c4 = 0;
while (--index3 >= 0) {
c4 += data[index3];
data[index3] = floor(c4 / n7);
c4 = c4 % n7 * 1e7;
}
};
var dataToString = function(data) {
var index3 = 6;
var s6 = "";
while (--index3 >= 0) {
if (s6 !== "" || index3 === 0 || data[index3] !== 0) {
var t5 = $String(data[index3]);
s6 = s6 === "" ? t5 : s6 + repeat("0", 7 - t5.length) + t5;
}
}
return s6;
};
var FORCED = fails(function() {
return nativeToFixed(8e-5, 3) !== "0.000" || nativeToFixed(0.9, 0) !== "1" || nativeToFixed(1.255, 2) !== "1.25" || nativeToFixed(1000000000000000100, 0) !== "1000000000000000128";
}) || !fails(function() {
nativeToFixed({});
});
$3({ target: "Number", proto: true, forced: FORCED }, {
toFixed: function toFixed(fractionDigits) {
var number = thisNumberValue(this);
var fractDigits = toIntegerOrInfinity(fractionDigits);
var data = [0, 0, 0, 0, 0, 0];
var sign2 = "";
var result = "0";
var e5, z4, j4, k4;
if (fractDigits < 0 || fractDigits > 20)
throw new $RangeError("Incorrect fraction digits");
if (number !== number)
return "NaN";
if (number <= -1e21 || number >= 1e21)
return $String(number);
if (number < 0) {
sign2 = "-";
number = -number;
}
if (number > 1e-21) {
e5 = log(number * pow(2, 69, 1)) - 69;
z4 = e5 < 0 ? number * pow(2, -e5, 1) : number / pow(2, e5, 1);
z4 *= 4503599627370496;
e5 = 52 - e5;
if (e5 > 0) {
multiply(data, 0, z4);
j4 = fractDigits;
while (j4 >= 7) {
multiply(data, 1e7, 0);
j4 -= 7;
}
multiply(data, pow(10, j4, 1), 0);
j4 = e5 - 1;
while (j4 >= 23) {
divide(data, 1 << 23);
j4 -= 23;
}
divide(data, 1 << j4);
multiply(data, 1, 1);
divide(data, 2);
result = dataToString(data);
} else {
multiply(data, 0, z4);
multiply(data, 1 << -e5, 0);
result = dataToString(data) + repeat("0", fractDigits);
}
}
if (fractDigits > 0) {
k4 = result.length;
result = sign2 + (k4 <= fractDigits ? "0." + repeat("0", fractDigits - k4) + result : stringSlice(result, 0, k4 - fractDigits) + "." + stringSlice(result, k4 - fractDigits));
} else {
result = sign2 + result;
}
return result;
}
});
}
});
// node_modules/core-js/modules/es.number.to-precision.js
var require_es_number_to_precision = __commonJS({
"node_modules/core-js/modules/es.number.to-precision.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var thisNumberValue = require_this_number_value();
var nativeToPrecision = uncurryThis(1 .toPrecision);
var FORCED = fails(function() {
return nativeToPrecision(1, void 0) !== "1";
}) || !fails(function() {
nativeToPrecision({});
});
$3({ target: "Number", proto: true, forced: FORCED }, {
toPrecision: function toPrecision(precision) {
return precision === void 0 ? nativeToPrecision(thisNumberValue(this)) : nativeToPrecision(thisNumberValue(this), precision);
}
});
}
});
// node_modules/core-js/internals/object-assign.js
var require_object_assign = __commonJS({
"node_modules/core-js/internals/object-assign.js"(exports2, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var uncurryThis = require_function_uncurry_this();
var call = require_function_call();
var fails = require_fails();
var objectKeys = require_object_keys();
var getOwnPropertySymbolsModule = require_object_get_own_property_symbols();
var propertyIsEnumerableModule = require_object_property_is_enumerable();
var toObject = require_to_object();
var IndexedObject = require_indexed_object();
var $assign = Object.assign;
var defineProperty = Object.defineProperty;
var concat = uncurryThis([].concat);
module2.exports = !$assign || fails(function() {
if (DESCRIPTORS && $assign({ b: 1 }, $assign(defineProperty({}, "a", {
enumerable: true,
get: function() {
defineProperty(this, "b", {
value: 3,
enumerable: false
});
}
}), { b: 2 })).b !== 1)
return true;
var A4 = {};
var B3 = {};
var symbol = Symbol("assign detection");
var alphabet = "abcdefghijklmnopqrst";
A4[symbol] = 7;
alphabet.split("").forEach(function(chr) {
B3[chr] = chr;
});
return $assign({}, A4)[symbol] !== 7 || objectKeys($assign({}, B3)).join("") !== alphabet;
}) ? function assign4(target, source) {
var T4 = toObject(target);
var argumentsLength = arguments.length;
var index3 = 1;
var getOwnPropertySymbols = getOwnPropertySymbolsModule.f;
var propertyIsEnumerable = propertyIsEnumerableModule.f;
while (argumentsLength > index3) {
var S4 = IndexedObject(arguments[index3++]);
var keys2 = getOwnPropertySymbols ? concat(objectKeys(S4), getOwnPropertySymbols(S4)) : objectKeys(S4);
var length = keys2.length;
var j4 = 0;
var key;
while (length > j4) {
key = keys2[j4++];
if (!DESCRIPTORS || call(propertyIsEnumerable, S4, key))
T4[key] = S4[key];
}
}
return T4;
} : $assign;
}
});
// node_modules/core-js/modules/es.object.assign.js
var require_es_object_assign = __commonJS({
"node_modules/core-js/modules/es.object.assign.js"() {
"use strict";
var $3 = require_export();
var assign4 = require_object_assign();
$3({ target: "Object", stat: true, arity: 2, forced: Object.assign !== assign4 }, {
assign: assign4
});
}
});
// node_modules/core-js/modules/es.object.create.js
var require_es_object_create = __commonJS({
"node_modules/core-js/modules/es.object.create.js"() {
"use strict";
var $3 = require_export();
var DESCRIPTORS = require_descriptors();
var create = require_object_create();
$3({ target: "Object", stat: true, sham: !DESCRIPTORS }, {
create
});
}
});
// node_modules/core-js/internals/object-prototype-accessors-forced.js
var require_object_prototype_accessors_forced = __commonJS({
"node_modules/core-js/internals/object-prototype-accessors-forced.js"(exports2, module2) {
"use strict";
var IS_PURE = require_is_pure();
var globalThis2 = require_global_this();
var fails = require_fails();
var WEBKIT = require_environment_webkit_version();
module2.exports = IS_PURE || !fails(function() {
if (WEBKIT && WEBKIT < 535)
return;
var key = Math.random();
__defineSetter__.call(null, key, function() {
});
delete globalThis2[key];
});
}
});
// node_modules/core-js/modules/es.object.define-getter.js
var require_es_object_define_getter = __commonJS({
"node_modules/core-js/modules/es.object.define-getter.js"() {
"use strict";
var $3 = require_export();
var DESCRIPTORS = require_descriptors();
var FORCED = require_object_prototype_accessors_forced();
var aCallable = require_a_callable();
var toObject = require_to_object();
var definePropertyModule = require_object_define_property();
if (DESCRIPTORS) {
$3({ target: "Object", proto: true, forced: FORCED }, {
__defineGetter__: function __defineGetter__(P4, getter) {
definePropertyModule.f(toObject(this), P4, { get: aCallable(getter), enumerable: true, configurable: true });
}
});
}
}
});
// node_modules/core-js/modules/es.object.define-properties.js
var require_es_object_define_properties = __commonJS({
"node_modules/core-js/modules/es.object.define-properties.js"() {
"use strict";
var $3 = require_export();
var DESCRIPTORS = require_descriptors();
var defineProperties = require_object_define_properties().f;
$3({ target: "Object", stat: true, forced: Object.defineProperties !== defineProperties, sham: !DESCRIPTORS }, {
defineProperties
});
}
});
// node_modules/core-js/modules/es.object.define-property.js
var require_es_object_define_property = __commonJS({
"node_modules/core-js/modules/es.object.define-property.js"() {
"use strict";
var $3 = require_export();
var DESCRIPTORS = require_descriptors();
var defineProperty = require_object_define_property().f;
$3({ target: "Object", stat: true, forced: Object.defineProperty !== defineProperty, sham: !DESCRIPTORS }, {
defineProperty
});
}
});
// node_modules/core-js/modules/es.object.define-setter.js
var require_es_object_define_setter = __commonJS({
"node_modules/core-js/modules/es.object.define-setter.js"() {
"use strict";
var $3 = require_export();
var DESCRIPTORS = require_descriptors();
var FORCED = require_object_prototype_accessors_forced();
var aCallable = require_a_callable();
var toObject = require_to_object();
var definePropertyModule = require_object_define_property();
if (DESCRIPTORS) {
$3({ target: "Object", proto: true, forced: FORCED }, {
__defineSetter__: function __defineSetter__2(P4, setter) {
definePropertyModule.f(toObject(this), P4, { set: aCallable(setter), enumerable: true, configurable: true });
}
});
}
}
});
// node_modules/core-js/internals/object-to-array.js
var require_object_to_array = __commonJS({
"node_modules/core-js/internals/object-to-array.js"(exports2, module2) {
"use strict";
var DESCRIPTORS = require_descriptors();
var fails = require_fails();
var uncurryThis = require_function_uncurry_this();
var objectGetPrototypeOf = require_object_get_prototype_of();
var objectKeys = require_object_keys();
var toIndexedObject = require_to_indexed_object();
var $propertyIsEnumerable = require_object_property_is_enumerable().f;
var propertyIsEnumerable = uncurryThis($propertyIsEnumerable);
var push = uncurryThis([].push);
var IE_BUG = DESCRIPTORS && fails(function() {
var O4 = /* @__PURE__ */ Object.create(null);
O4[2] = 2;
return !propertyIsEnumerable(O4, 2);
});
var createMethod = function(TO_ENTRIES) {
return function(it2) {
var O4 = toIndexedObject(it2);
var keys2 = objectKeys(O4);
var IE_WORKAROUND = IE_BUG && objectGetPrototypeOf(O4) === null;
var length = keys2.length;
var i5 = 0;
var result = [];
var key;
while (length > i5) {
key = keys2[i5++];
if (!DESCRIPTORS || (IE_WORKAROUND ? key in O4 : propertyIsEnumerable(O4, key))) {
push(result, TO_ENTRIES ? [key, O4[key]] : O4[key]);
}
}
return result;
};
};
module2.exports = {
entries: createMethod(true),
values: createMethod(false)
};
}
});
// node_modules/core-js/modules/es.object.entries.js
var require_es_object_entries = __commonJS({
"node_modules/core-js/modules/es.object.entries.js"() {
"use strict";
var $3 = require_export();
var $entries = require_object_to_array().entries;
$3({ target: "Object", stat: true }, {
entries: function entries(O4) {
return $entries(O4);
}
});
}
});
// node_modules/core-js/modules/es.object.freeze.js
var require_es_object_freeze = __commonJS({
"node_modules/core-js/modules/es.object.freeze.js"() {
"use strict";
var $3 = require_export();
var FREEZING = require_freezing();
var fails = require_fails();
var isObject3 = require_is_object();
var onFreeze = require_internal_metadata().onFreeze;
var $freeze = Object.freeze;
var FAILS_ON_PRIMITIVES = fails(function() {
$freeze(1);
});
$3({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
freeze: function freeze(it2) {
return $freeze && isObject3(it2) ? $freeze(onFreeze(it2)) : it2;
}
});
}
});
// node_modules/core-js/modules/es.object.from-entries.js
var require_es_object_from_entries = __commonJS({
"node_modules/core-js/modules/es.object.from-entries.js"() {
"use strict";
var $3 = require_export();
var iterate = require_iterate();
var createProperty = require_create_property();
$3({ target: "Object", stat: true }, {
fromEntries: function fromEntries(iterable) {
var obj = {};
iterate(iterable, function(k4, v4) {
createProperty(obj, k4, v4);
}, { AS_ENTRIES: true });
return obj;
}
});
}
});
// node_modules/core-js/modules/es.object.get-own-property-descriptor.js
var require_es_object_get_own_property_descriptor = __commonJS({
"node_modules/core-js/modules/es.object.get-own-property-descriptor.js"() {
"use strict";
var $3 = require_export();
var fails = require_fails();
var toIndexedObject = require_to_indexed_object();
var nativeGetOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
var DESCRIPTORS = require_descriptors();
var FORCED = !DESCRIPTORS || fails(function() {
nativeGetOwnPropertyDescriptor(1);
});
$3({ target: "Object", stat: true, forced: FORCED, sham: !DESCRIPTORS }, {
getOwnPropertyDescriptor: function getOwnPropertyDescriptor(it2, key) {
return nativeGetOwnPropertyDescriptor(toIndexedObject(it2), key);
}
});
}
});
// node_modules/core-js/modules/es.object.get-own-property-descriptors.js
var require_es_object_get_own_property_descriptors = __commonJS({
"node_modules/core-js/modules/es.object.get-own-property-descriptors.js"() {
"use strict";
var $3 = require_export();
var DESCRIPTORS = require_descriptors();
var ownKeys26 = require_own_keys();
var toIndexedObject = require_to_indexed_object();
var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
var createProperty = require_create_property();
$3({ target: "Object", stat: true, sham: !DESCRIPTORS }, {
getOwnPropertyDescriptors: function getOwnPropertyDescriptors(object) {
var O4 = toIndexedObject(object);
var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
var keys2 = ownKeys26(O4);
var result = {};
var index3 = 0;
var key, descriptor;
while (keys2.length > index3) {
descriptor = getOwnPropertyDescriptor(O4, key = keys2[index3++]);
if (descriptor !== void 0)
createProperty(result, key, descriptor);
}
return result;
}
});
}
});
// node_modules/core-js/modules/es.object.get-own-property-names.js
var require_es_object_get_own_property_names = __commonJS({
"node_modules/core-js/modules/es.object.get-own-property-names.js"() {
"use strict";
var $3 = require_export();
var fails = require_fails();
var getOwnPropertyNames = require_object_get_own_property_names_external().f;
var FAILS_ON_PRIMITIVES = fails(function() {
return !Object.getOwnPropertyNames(1);
});
$3({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES }, {
getOwnPropertyNames
});
}
});
// node_modules/core-js/modules/es.object.get-prototype-of.js
var require_es_object_get_prototype_of = __commonJS({
"node_modules/core-js/modules/es.object.get-prototype-of.js"() {
"use strict";
var $3 = require_export();
var fails = require_fails();
var toObject = require_to_object();
var nativeGetPrototypeOf = require_object_get_prototype_of();
var CORRECT_PROTOTYPE_GETTER = require_correct_prototype_getter();
var FAILS_ON_PRIMITIVES = fails(function() {
nativeGetPrototypeOf(1);
});
$3({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES, sham: !CORRECT_PROTOTYPE_GETTER }, {
getPrototypeOf: function getPrototypeOf(it2) {
return nativeGetPrototypeOf(toObject(it2));
}
});
}
});
// node_modules/core-js/modules/es.object.group-by.js
var require_es_object_group_by = __commonJS({
"node_modules/core-js/modules/es.object.group-by.js"() {
"use strict";
var $3 = require_export();
var getBuiltIn = require_get_built_in();
var uncurryThis = require_function_uncurry_this();
var aCallable = require_a_callable();
var requireObjectCoercible = require_require_object_coercible();
var toPropertyKey = require_to_property_key();
var iterate = require_iterate();
var fails = require_fails();
var nativeGroupBy = Object.groupBy;
var create = getBuiltIn("Object", "create");
var push = uncurryThis([].push);
var DOES_NOT_WORK_WITH_PRIMITIVES = !nativeGroupBy || fails(function() {
return nativeGroupBy("ab", function(it2) {
return it2;
}).a.length !== 1;
});
$3({ target: "Object", stat: true, forced: DOES_NOT_WORK_WITH_PRIMITIVES }, {
groupBy: function groupBy(items, callbackfn) {
requireObjectCoercible(items);
aCallable(callbackfn);
var obj = create(null);
var k4 = 0;
iterate(items, function(value) {
var key = toPropertyKey(callbackfn(value, k4++));
if (key in obj)
push(obj[key], value);
else
obj[key] = [value];
});
return obj;
}
});
}
});
// node_modules/core-js/modules/es.object.has-own.js
var require_es_object_has_own = __commonJS({
"node_modules/core-js/modules/es.object.has-own.js"() {
"use strict";
var $3 = require_export();
var hasOwn = require_has_own_property();
$3({ target: "Object", stat: true }, {
hasOwn
});
}
});
// node_modules/core-js/internals/same-value.js
var require_same_value = __commonJS({
"node_modules/core-js/internals/same-value.js"(exports2, module2) {
"use strict";
module2.exports = Object.is || function is2(x4, y4) {
return x4 === y4 ? x4 !== 0 || 1 / x4 === 1 / y4 : x4 !== x4 && y4 !== y4;
};
}
});
// node_modules/core-js/modules/es.object.is.js
var require_es_object_is = __commonJS({
"node_modules/core-js/modules/es.object.is.js"() {
"use strict";
var $3 = require_export();
var is2 = require_same_value();
$3({ target: "Object", stat: true }, {
is: is2
});
}
});
// node_modules/core-js/modules/es.object.is-extensible.js
var require_es_object_is_extensible = __commonJS({
"node_modules/core-js/modules/es.object.is-extensible.js"() {
"use strict";
var $3 = require_export();
var $isExtensible = require_object_is_extensible();
$3({ target: "Object", stat: true, forced: Object.isExtensible !== $isExtensible }, {
isExtensible: $isExtensible
});
}
});
// node_modules/core-js/modules/es.object.is-frozen.js
var require_es_object_is_frozen = __commonJS({
"node_modules/core-js/modules/es.object.is-frozen.js"() {
"use strict";
var $3 = require_export();
var fails = require_fails();
var isObject3 = require_is_object();
var classof = require_classof_raw();
var ARRAY_BUFFER_NON_EXTENSIBLE = require_array_buffer_non_extensible();
var $isFrozen = Object.isFrozen;
var FORCED = ARRAY_BUFFER_NON_EXTENSIBLE || fails(function() {
$isFrozen(1);
});
$3({ target: "Object", stat: true, forced: FORCED }, {
isFrozen: function isFrozen(it2) {
if (!isObject3(it2))
return true;
if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it2) === "ArrayBuffer")
return true;
return $isFrozen ? $isFrozen(it2) : false;
}
});
}
});
// node_modules/core-js/modules/es.object.is-sealed.js
var require_es_object_is_sealed = __commonJS({
"node_modules/core-js/modules/es.object.is-sealed.js"() {
"use strict";
var $3 = require_export();
var fails = require_fails();
var isObject3 = require_is_object();
var classof = require_classof_raw();
var ARRAY_BUFFER_NON_EXTENSIBLE = require_array_buffer_non_extensible();
var $isSealed = Object.isSealed;
var FORCED = ARRAY_BUFFER_NON_EXTENSIBLE || fails(function() {
$isSealed(1);
});
$3({ target: "Object", stat: true, forced: FORCED }, {
isSealed: function isSealed(it2) {
if (!isObject3(it2))
return true;
if (ARRAY_BUFFER_NON_EXTENSIBLE && classof(it2) === "ArrayBuffer")
return true;
return $isSealed ? $isSealed(it2) : false;
}
});
}
});
// node_modules/core-js/modules/es.object.keys.js
var require_es_object_keys = __commonJS({
"node_modules/core-js/modules/es.object.keys.js"() {
"use strict";
var $3 = require_export();
var toObject = require_to_object();
var nativeKeys = require_object_keys();
var fails = require_fails();
var FAILS_ON_PRIMITIVES = fails(function() {
nativeKeys(1);
});
$3({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES }, {
keys: function keys2(it2) {
return nativeKeys(toObject(it2));
}
});
}
});
// node_modules/core-js/modules/es.object.lookup-getter.js
var require_es_object_lookup_getter = __commonJS({
"node_modules/core-js/modules/es.object.lookup-getter.js"() {
"use strict";
var $3 = require_export();
var DESCRIPTORS = require_descriptors();
var FORCED = require_object_prototype_accessors_forced();
var toObject = require_to_object();
var toPropertyKey = require_to_property_key();
var getPrototypeOf = require_object_get_prototype_of();
var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
if (DESCRIPTORS) {
$3({ target: "Object", proto: true, forced: FORCED }, {
__lookupGetter__: function __lookupGetter__(P4) {
var O4 = toObject(this);
var key = toPropertyKey(P4);
var desc;
do {
if (desc = getOwnPropertyDescriptor(O4, key))
return desc.get;
} while (O4 = getPrototypeOf(O4));
}
});
}
}
});
// node_modules/core-js/modules/es.object.lookup-setter.js
var require_es_object_lookup_setter = __commonJS({
"node_modules/core-js/modules/es.object.lookup-setter.js"() {
"use strict";
var $3 = require_export();
var DESCRIPTORS = require_descriptors();
var FORCED = require_object_prototype_accessors_forced();
var toObject = require_to_object();
var toPropertyKey = require_to_property_key();
var getPrototypeOf = require_object_get_prototype_of();
var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
if (DESCRIPTORS) {
$3({ target: "Object", proto: true, forced: FORCED }, {
__lookupSetter__: function __lookupSetter__(P4) {
var O4 = toObject(this);
var key = toPropertyKey(P4);
var desc;
do {
if (desc = getOwnPropertyDescriptor(O4, key))
return desc.set;
} while (O4 = getPrototypeOf(O4));
}
});
}
}
});
// node_modules/core-js/modules/es.object.prevent-extensions.js
var require_es_object_prevent_extensions = __commonJS({
"node_modules/core-js/modules/es.object.prevent-extensions.js"() {
"use strict";
var $3 = require_export();
var isObject3 = require_is_object();
var onFreeze = require_internal_metadata().onFreeze;
var FREEZING = require_freezing();
var fails = require_fails();
var $preventExtensions = Object.preventExtensions;
var FAILS_ON_PRIMITIVES = fails(function() {
$preventExtensions(1);
});
$3({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
preventExtensions: function preventExtensions(it2) {
return $preventExtensions && isObject3(it2) ? $preventExtensions(onFreeze(it2)) : it2;
}
});
}
});
// node_modules/core-js/modules/es.object.proto.js
var require_es_object_proto = __commonJS({
"node_modules/core-js/modules/es.object.proto.js"() {
"use strict";
var DESCRIPTORS = require_descriptors();
var defineBuiltInAccessor = require_define_built_in_accessor();
var isObject3 = require_is_object();
var isPossiblePrototype = require_is_possible_prototype();
var toObject = require_to_object();
var requireObjectCoercible = require_require_object_coercible();
var getPrototypeOf = Object.getPrototypeOf;
var setPrototypeOf = Object.setPrototypeOf;
var ObjectPrototype = Object.prototype;
var PROTO = "__proto__";
if (DESCRIPTORS && getPrototypeOf && setPrototypeOf && !(PROTO in ObjectPrototype))
try {
defineBuiltInAccessor(ObjectPrototype, PROTO, {
configurable: true,
get: function __proto__() {
return getPrototypeOf(toObject(this));
},
set: function __proto__(proto) {
var O4 = requireObjectCoercible(this);
if (isPossiblePrototype(proto) && isObject3(O4)) {
setPrototypeOf(O4, proto);
}
}
});
} catch (error2) {
}
}
});
// node_modules/core-js/modules/es.object.seal.js
var require_es_object_seal = __commonJS({
"node_modules/core-js/modules/es.object.seal.js"() {
"use strict";
var $3 = require_export();
var isObject3 = require_is_object();
var onFreeze = require_internal_metadata().onFreeze;
var FREEZING = require_freezing();
var fails = require_fails();
var $seal = Object.seal;
var FAILS_ON_PRIMITIVES = fails(function() {
$seal(1);
});
$3({ target: "Object", stat: true, forced: FAILS_ON_PRIMITIVES, sham: !FREEZING }, {
seal: function seal(it2) {
return $seal && isObject3(it2) ? $seal(onFreeze(it2)) : it2;
}
});
}
});
// node_modules/core-js/modules/es.object.set-prototype-of.js
var require_es_object_set_prototype_of = __commonJS({
"node_modules/core-js/modules/es.object.set-prototype-of.js"() {
"use strict";
var $3 = require_export();
var setPrototypeOf = require_object_set_prototype_of();
$3({ target: "Object", stat: true }, {
setPrototypeOf
});
}
});
// node_modules/core-js/internals/object-to-string.js
var require_object_to_string = __commonJS({
"node_modules/core-js/internals/object-to-string.js"(exports2, module2) {
"use strict";
var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
var classof = require_classof();
module2.exports = TO_STRING_TAG_SUPPORT ? {}.toString : function toString() {
return "[object " + classof(this) + "]";
};
}
});
// node_modules/core-js/modules/es.object.to-string.js
var require_es_object_to_string = __commonJS({
"node_modules/core-js/modules/es.object.to-string.js"() {
"use strict";
var TO_STRING_TAG_SUPPORT = require_to_string_tag_support();
var defineBuiltIn = require_define_built_in();
var toString = require_object_to_string();
if (!TO_STRING_TAG_SUPPORT) {
defineBuiltIn(Object.prototype, "toString", toString, { unsafe: true });
}
}
});
// node_modules/core-js/modules/es.object.values.js
var require_es_object_values = __commonJS({
"node_modules/core-js/modules/es.object.values.js"() {
"use strict";
var $3 = require_export();
var $values = require_object_to_array().values;
$3({ target: "Object", stat: true }, {
values: function values(O4) {
return $values(O4);
}
});
}
});
// node_modules/core-js/modules/es.parse-float.js
var require_es_parse_float = __commonJS({
"node_modules/core-js/modules/es.parse-float.js"() {
"use strict";
var $3 = require_export();
var $parseFloat = require_number_parse_float();
$3({ global: true, forced: parseFloat !== $parseFloat }, {
parseFloat: $parseFloat
});
}
});
// node_modules/core-js/modules/es.parse-int.js
var require_es_parse_int = __commonJS({
"node_modules/core-js/modules/es.parse-int.js"() {
"use strict";
var $3 = require_export();
var $parseInt = require_number_parse_int();
$3({ global: true, forced: parseInt !== $parseInt }, {
parseInt: $parseInt
});
}
});
// node_modules/core-js/internals/a-constructor.js
var require_a_constructor = __commonJS({
"node_modules/core-js/internals/a-constructor.js"(exports2, module2) {
"use strict";
var isConstructor = require_is_constructor();
var tryToString = require_try_to_string();
var $TypeError = TypeError;
module2.exports = function(argument) {
if (isConstructor(argument))
return argument;
throw new $TypeError(tryToString(argument) + " is not a constructor");
};
}
});
// node_modules/core-js/internals/species-constructor.js
var require_species_constructor = __commonJS({
"node_modules/core-js/internals/species-constructor.js"(exports2, module2) {
"use strict";
var anObject = require_an_object();
var aConstructor = require_a_constructor();
var isNullOrUndefined = require_is_null_or_undefined();
var wellKnownSymbol = require_well_known_symbol();
var SPECIES = wellKnownSymbol("species");
module2.exports = function(O4, defaultConstructor) {
var C4 = anObject(O4).constructor;
var S4;
return C4 === void 0 || isNullOrUndefined(S4 = anObject(C4)[SPECIES]) ? defaultConstructor : aConstructor(S4);
};
}
});
// node_modules/core-js/internals/validate-arguments-length.js
var require_validate_arguments_length = __commonJS({
"node_modules/core-js/internals/validate-arguments-length.js"(exports2, module2) {
"use strict";
var $TypeError = TypeError;
module2.exports = function(passed, required) {
if (passed < required)
throw new $TypeError("Not enough arguments");
return passed;
};
}
});
// node_modules/core-js/internals/environment-is-ios.js
var require_environment_is_ios = __commonJS({
"node_modules/core-js/internals/environment-is-ios.js"(exports2, module2) {
"use strict";
var userAgent2 = require_environment_user_agent();
module2.exports = /(?:ipad|iphone|ipod).*applewebkit/i.test(userAgent2);
}
});
// node_modules/core-js/internals/task.js
var require_task = __commonJS({
"node_modules/core-js/internals/task.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var apply2 = require_function_apply();
var bind3 = require_function_bind_context();
var isCallable = require_is_callable();
var hasOwn = require_has_own_property();
var fails = require_fails();
var html = require_html();
var arraySlice = require_array_slice();
var createElement2 = require_document_create_element();
var validateArgumentsLength = require_validate_arguments_length();
var IS_IOS = require_environment_is_ios();
var IS_NODE = require_environment_is_node();
var set2 = globalThis2.setImmediate;
var clear = globalThis2.clearImmediate;
var process2 = globalThis2.process;
var Dispatch = globalThis2.Dispatch;
var Function2 = globalThis2.Function;
var MessageChannel2 = globalThis2.MessageChannel;
var String2 = globalThis2.String;
var counter = 0;
var queue = {};
var ONREADYSTATECHANGE = "onreadystatechange";
var $location;
var defer;
var channel;
var port;
fails(function() {
$location = globalThis2.location;
});
var run3 = function(id) {
if (hasOwn(queue, id)) {
var fn3 = queue[id];
delete queue[id];
fn3();
}
};
var runner = function(id) {
return function() {
run3(id);
};
};
var eventListener = function(event2) {
run3(event2.data);
};
var globalPostMessageDefer = function(id) {
globalThis2.postMessage(String2(id), $location.protocol + "//" + $location.host);
};
if (!set2 || !clear) {
set2 = function setImmediate(handler) {
validateArgumentsLength(arguments.length, 1);
var fn3 = isCallable(handler) ? handler : Function2(handler);
var args = arraySlice(arguments, 1);
queue[++counter] = function() {
apply2(fn3, void 0, args);
};
defer(counter);
return counter;
};
clear = function clearImmediate(id) {
delete queue[id];
};
if (IS_NODE) {
defer = function(id) {
process2.nextTick(runner(id));
};
} else if (Dispatch && Dispatch.now) {
defer = function(id) {
Dispatch.now(runner(id));
};
} else if (MessageChannel2 && !IS_IOS) {
channel = new MessageChannel2();
port = channel.port2;
channel.port1.onmessage = eventListener;
defer = bind3(port.postMessage, port);
} else if (globalThis2.addEventListener && isCallable(globalThis2.postMessage) && !globalThis2.importScripts && $location && $location.protocol !== "file:" && !fails(globalPostMessageDefer)) {
defer = globalPostMessageDefer;
globalThis2.addEventListener("message", eventListener, false);
} else if (ONREADYSTATECHANGE in createElement2("script")) {
defer = function(id) {
html.appendChild(createElement2("script"))[ONREADYSTATECHANGE] = function() {
html.removeChild(this);
run3(id);
};
};
} else {
defer = function(id) {
setTimeout(runner(id), 0);
};
}
}
module2.exports = {
set: set2,
clear
};
}
});
// node_modules/core-js/internals/safe-get-built-in.js
var require_safe_get_built_in = __commonJS({
"node_modules/core-js/internals/safe-get-built-in.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var DESCRIPTORS = require_descriptors();
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
module2.exports = function(name) {
if (!DESCRIPTORS)
return globalThis2[name];
var descriptor = getOwnPropertyDescriptor(globalThis2, name);
return descriptor && descriptor.value;
};
}
});
// node_modules/core-js/internals/queue.js
var require_queue = __commonJS({
"node_modules/core-js/internals/queue.js"(exports2, module2) {
"use strict";
var Queue = function() {
this.head = null;
this.tail = null;
};
Queue.prototype = {
add: function(item) {
var entry = { item, next: null };
var tail = this.tail;
if (tail)
tail.next = entry;
else
this.head = entry;
this.tail = entry;
},
get: function() {
var entry = this.head;
if (entry) {
var next = this.head = entry.next;
if (next === null)
this.tail = null;
return entry.item;
}
}
};
module2.exports = Queue;
}
});
// node_modules/core-js/internals/environment-is-ios-pebble.js
var require_environment_is_ios_pebble = __commonJS({
"node_modules/core-js/internals/environment-is-ios-pebble.js"(exports2, module2) {
"use strict";
var userAgent2 = require_environment_user_agent();
module2.exports = /ipad|iphone|ipod/i.test(userAgent2) && typeof Pebble != "undefined";
}
});
// node_modules/core-js/internals/environment-is-webos-webkit.js
var require_environment_is_webos_webkit = __commonJS({
"node_modules/core-js/internals/environment-is-webos-webkit.js"(exports2, module2) {
"use strict";
var userAgent2 = require_environment_user_agent();
module2.exports = /web0s(?!.*chrome)/i.test(userAgent2);
}
});
// node_modules/core-js/internals/microtask.js
var require_microtask = __commonJS({
"node_modules/core-js/internals/microtask.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var safeGetBuiltIn = require_safe_get_built_in();
var bind3 = require_function_bind_context();
var macrotask = require_task().set;
var Queue = require_queue();
var IS_IOS = require_environment_is_ios();
var IS_IOS_PEBBLE = require_environment_is_ios_pebble();
var IS_WEBOS_WEBKIT = require_environment_is_webos_webkit();
var IS_NODE = require_environment_is_node();
var MutationObserver2 = globalThis2.MutationObserver || globalThis2.WebKitMutationObserver;
var document2 = globalThis2.document;
var process2 = globalThis2.process;
var Promise2 = globalThis2.Promise;
var microtask = safeGetBuiltIn("queueMicrotask");
var notify;
var toggle2;
var node;
var promise;
var then;
if (!microtask) {
queue = new Queue();
flush = function() {
var parent, fn3;
if (IS_NODE && (parent = process2.domain))
parent.exit();
while (fn3 = queue.get())
try {
fn3();
} catch (error2) {
if (queue.head)
notify();
throw error2;
}
if (parent)
parent.enter();
};
if (!IS_IOS && !IS_NODE && !IS_WEBOS_WEBKIT && MutationObserver2 && document2) {
toggle2 = true;
node = document2.createTextNode("");
new MutationObserver2(flush).observe(node, { characterData: true });
notify = function() {
node.data = toggle2 = !toggle2;
};
} else if (!IS_IOS_PEBBLE && Promise2 && Promise2.resolve) {
promise = Promise2.resolve(void 0);
promise.constructor = Promise2;
then = bind3(promise.then, promise);
notify = function() {
then(flush);
};
} else if (IS_NODE) {
notify = function() {
process2.nextTick(flush);
};
} else {
macrotask = bind3(macrotask, globalThis2);
notify = function() {
macrotask(flush);
};
}
microtask = function(fn3) {
if (!queue.head)
notify();
queue.add(fn3);
};
}
var queue;
var flush;
module2.exports = microtask;
}
});
// node_modules/core-js/internals/host-report-errors.js
var require_host_report_errors = __commonJS({
"node_modules/core-js/internals/host-report-errors.js"(exports2, module2) {
"use strict";
module2.exports = function(a5, b4) {
try {
arguments.length === 1 ? console.error(a5) : console.error(a5, b4);
} catch (error2) {
}
};
}
});
// node_modules/core-js/internals/perform.js
var require_perform = __commonJS({
"node_modules/core-js/internals/perform.js"(exports2, module2) {
"use strict";
module2.exports = function(exec) {
try {
return { error: false, value: exec() };
} catch (error2) {
return { error: true, value: error2 };
}
};
}
});
// node_modules/core-js/internals/promise-native-constructor.js
var require_promise_native_constructor = __commonJS({
"node_modules/core-js/internals/promise-native-constructor.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
module2.exports = globalThis2.Promise;
}
});
// node_modules/core-js/internals/promise-constructor-detection.js
var require_promise_constructor_detection = __commonJS({
"node_modules/core-js/internals/promise-constructor-detection.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var NativePromiseConstructor = require_promise_native_constructor();
var isCallable = require_is_callable();
var isForced = require_is_forced();
var inspectSource = require_inspect_source();
var wellKnownSymbol = require_well_known_symbol();
var ENVIRONMENT = require_environment();
var IS_PURE = require_is_pure();
var V8_VERSION = require_environment_v8_version();
var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
var SPECIES = wellKnownSymbol("species");
var SUBCLASSING = false;
var NATIVE_PROMISE_REJECTION_EVENT = isCallable(globalThis2.PromiseRejectionEvent);
var FORCED_PROMISE_CONSTRUCTOR = isForced("Promise", function() {
var PROMISE_CONSTRUCTOR_SOURCE = inspectSource(NativePromiseConstructor);
var GLOBAL_CORE_JS_PROMISE = PROMISE_CONSTRUCTOR_SOURCE !== String(NativePromiseConstructor);
if (!GLOBAL_CORE_JS_PROMISE && V8_VERSION === 66)
return true;
if (IS_PURE && !(NativePromisePrototype["catch"] && NativePromisePrototype["finally"]))
return true;
if (!V8_VERSION || V8_VERSION < 51 || !/native code/.test(PROMISE_CONSTRUCTOR_SOURCE)) {
var promise = new NativePromiseConstructor(function(resolve3) {
resolve3(1);
});
var FakePromise = function(exec) {
exec(function() {
}, function() {
});
};
var constructor = promise.constructor = {};
constructor[SPECIES] = FakePromise;
SUBCLASSING = promise.then(function() {
}) instanceof FakePromise;
if (!SUBCLASSING)
return true;
}
return !GLOBAL_CORE_JS_PROMISE && (ENVIRONMENT === "BROWSER" || ENVIRONMENT === "DENO") && !NATIVE_PROMISE_REJECTION_EVENT;
});
module2.exports = {
CONSTRUCTOR: FORCED_PROMISE_CONSTRUCTOR,
REJECTION_EVENT: NATIVE_PROMISE_REJECTION_EVENT,
SUBCLASSING
};
}
});
// node_modules/core-js/internals/new-promise-capability.js
var require_new_promise_capability = __commonJS({
"node_modules/core-js/internals/new-promise-capability.js"(exports2, module2) {
"use strict";
var aCallable = require_a_callable();
var $TypeError = TypeError;
var PromiseCapability = function(C4) {
var resolve3, reject;
this.promise = new C4(function($$resolve, $$reject) {
if (resolve3 !== void 0 || reject !== void 0)
throw new $TypeError("Bad Promise constructor");
resolve3 = $$resolve;
reject = $$reject;
});
this.resolve = aCallable(resolve3);
this.reject = aCallable(reject);
};
module2.exports.f = function(C4) {
return new PromiseCapability(C4);
};
}
});
// node_modules/core-js/modules/es.promise.constructor.js
var require_es_promise_constructor = __commonJS({
"node_modules/core-js/modules/es.promise.constructor.js"() {
"use strict";
var $3 = require_export();
var IS_PURE = require_is_pure();
var IS_NODE = require_environment_is_node();
var globalThis2 = require_global_this();
var call = require_function_call();
var defineBuiltIn = require_define_built_in();
var setPrototypeOf = require_object_set_prototype_of();
var setToStringTag = require_set_to_string_tag();
var setSpecies = require_set_species();
var aCallable = require_a_callable();
var isCallable = require_is_callable();
var isObject3 = require_is_object();
var anInstance = require_an_instance();
var speciesConstructor = require_species_constructor();
var task = require_task().set;
var microtask = require_microtask();
var hostReportErrors = require_host_report_errors();
var perform = require_perform();
var Queue = require_queue();
var InternalStateModule = require_internal_state();
var NativePromiseConstructor = require_promise_native_constructor();
var PromiseConstructorDetection = require_promise_constructor_detection();
var newPromiseCapabilityModule = require_new_promise_capability();
var PROMISE = "Promise";
var FORCED_PROMISE_CONSTRUCTOR = PromiseConstructorDetection.CONSTRUCTOR;
var NATIVE_PROMISE_REJECTION_EVENT = PromiseConstructorDetection.REJECTION_EVENT;
var NATIVE_PROMISE_SUBCLASSING = PromiseConstructorDetection.SUBCLASSING;
var getInternalPromiseState = InternalStateModule.getterFor(PROMISE);
var setInternalState = InternalStateModule.set;
var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
var PromiseConstructor = NativePromiseConstructor;
var PromisePrototype = NativePromisePrototype;
var TypeError2 = globalThis2.TypeError;
var document2 = globalThis2.document;
var process2 = globalThis2.process;
var newPromiseCapability = newPromiseCapabilityModule.f;
var newGenericPromiseCapability = newPromiseCapability;
var DISPATCH_EVENT = !!(document2 && document2.createEvent && globalThis2.dispatchEvent);
var UNHANDLED_REJECTION = "unhandledrejection";
var REJECTION_HANDLED = "rejectionhandled";
var PENDING = 0;
var FULFILLED = 1;
var REJECTED = 2;
var HANDLED = 1;
var UNHANDLED = 2;
var Internal;
var OwnPromiseCapability;
var PromiseWrapper;
var nativeThen;
var isThenable = function(it2) {
var then;
return isObject3(it2) && isCallable(then = it2.then) ? then : false;
};
var callReaction = function(reaction, state) {
var value = state.value;
var ok = state.state === FULFILLED;
var handler = ok ? reaction.ok : reaction.fail;
var resolve3 = reaction.resolve;
var reject = reaction.reject;
var domain2 = reaction.domain;
var result, then, exited;
try {
if (handler) {
if (!ok) {
if (state.rejection === UNHANDLED)
onHandleUnhandled(state);
state.rejection = HANDLED;
}
if (handler === true)
result = value;
else {
if (domain2)
domain2.enter();
result = handler(value);
if (domain2) {
domain2.exit();
exited = true;
}
}
if (result === reaction.promise) {
reject(new TypeError2("Promise-chain cycle"));
} else if (then = isThenable(result)) {
call(then, result, resolve3, reject);
} else
resolve3(result);
} else
reject(value);
} catch (error2) {
if (domain2 && !exited)
domain2.exit();
reject(error2);
}
};
var notify = function(state, isReject) {
if (state.notified)
return;
state.notified = true;
microtask(function() {
var reactions = state.reactions;
var reaction;
while (reaction = reactions.get()) {
callReaction(reaction, state);
}
state.notified = false;
if (isReject && !state.rejection)
onUnhandled(state);
});
};
var dispatchEvent4 = function(name, promise, reason) {
var event2, handler;
if (DISPATCH_EVENT) {
event2 = document2.createEvent("Event");
event2.promise = promise;
event2.reason = reason;
event2.initEvent(name, false, true);
globalThis2.dispatchEvent(event2);
} else
event2 = { promise, reason };
if (!NATIVE_PROMISE_REJECTION_EVENT && (handler = globalThis2["on" + name]))
handler(event2);
else if (name === UNHANDLED_REJECTION)
hostReportErrors("Unhandled promise rejection", reason);
};
var onUnhandled = function(state) {
call(task, globalThis2, function() {
var promise = state.facade;
var value = state.value;
var IS_UNHANDLED = isUnhandled(state);
var result;
if (IS_UNHANDLED) {
result = perform(function() {
if (IS_NODE) {
process2.emit("unhandledRejection", value, promise);
} else
dispatchEvent4(UNHANDLED_REJECTION, promise, value);
});
state.rejection = IS_NODE || isUnhandled(state) ? UNHANDLED : HANDLED;
if (result.error)
throw result.value;
}
});
};
var isUnhandled = function(state) {
return state.rejection !== HANDLED && !state.parent;
};
var onHandleUnhandled = function(state) {
call(task, globalThis2, function() {
var promise = state.facade;
if (IS_NODE) {
process2.emit("rejectionHandled", promise);
} else
dispatchEvent4(REJECTION_HANDLED, promise, state.value);
});
};
var bind3 = function(fn3, state, unwrap) {
return function(value) {
fn3(state, value, unwrap);
};
};
var internalReject = function(state, value, unwrap) {
if (state.done)
return;
state.done = true;
if (unwrap)
state = unwrap;
state.value = value;
state.state = REJECTED;
notify(state, true);
};
var internalResolve = function(state, value, unwrap) {
if (state.done)
return;
state.done = true;
if (unwrap)
state = unwrap;
try {
if (state.facade === value)
throw new TypeError2("Promise can't be resolved itself");
var then = isThenable(value);
if (then) {
microtask(function() {
var wrapper = { done: false };
try {
call(
then,
value,
bind3(internalResolve, wrapper, state),
bind3(internalReject, wrapper, state)
);
} catch (error2) {
internalReject(wrapper, error2, state);
}
});
} else {
state.value = value;
state.state = FULFILLED;
notify(state, false);
}
} catch (error2) {
internalReject({ done: false }, error2, state);
}
};
if (FORCED_PROMISE_CONSTRUCTOR) {
PromiseConstructor = function Promise2(executor) {
anInstance(this, PromisePrototype);
aCallable(executor);
call(Internal, this);
var state = getInternalPromiseState(this);
try {
executor(bind3(internalResolve, state), bind3(internalReject, state));
} catch (error2) {
internalReject(state, error2);
}
};
PromisePrototype = PromiseConstructor.prototype;
Internal = function Promise2(executor) {
setInternalState(this, {
type: PROMISE,
done: false,
notified: false,
parent: false,
reactions: new Queue(),
rejection: false,
state: PENDING,
value: null
});
};
Internal.prototype = defineBuiltIn(PromisePrototype, "then", function then(onFulfilled, onRejected) {
var state = getInternalPromiseState(this);
var reaction = newPromiseCapability(speciesConstructor(this, PromiseConstructor));
state.parent = true;
reaction.ok = isCallable(onFulfilled) ? onFulfilled : true;
reaction.fail = isCallable(onRejected) && onRejected;
reaction.domain = IS_NODE ? process2.domain : void 0;
if (state.state === PENDING)
state.reactions.add(reaction);
else
microtask(function() {
callReaction(reaction, state);
});
return reaction.promise;
});
OwnPromiseCapability = function() {
var promise = new Internal();
var state = getInternalPromiseState(promise);
this.promise = promise;
this.resolve = bind3(internalResolve, state);
this.reject = bind3(internalReject, state);
};
newPromiseCapabilityModule.f = newPromiseCapability = function(C4) {
return C4 === PromiseConstructor || C4 === PromiseWrapper ? new OwnPromiseCapability(C4) : newGenericPromiseCapability(C4);
};
if (!IS_PURE && isCallable(NativePromiseConstructor) && NativePromisePrototype !== Object.prototype) {
nativeThen = NativePromisePrototype.then;
if (!NATIVE_PROMISE_SUBCLASSING) {
defineBuiltIn(NativePromisePrototype, "then", function then(onFulfilled, onRejected) {
var that = this;
return new PromiseConstructor(function(resolve3, reject) {
call(nativeThen, that, resolve3, reject);
}).then(onFulfilled, onRejected);
}, { unsafe: true });
}
try {
delete NativePromisePrototype.constructor;
} catch (error2) {
}
if (setPrototypeOf) {
setPrototypeOf(NativePromisePrototype, PromisePrototype);
}
}
}
$3({ global: true, constructor: true, wrap: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
Promise: PromiseConstructor
});
setToStringTag(PromiseConstructor, PROMISE, false, true);
setSpecies(PROMISE);
}
});
// node_modules/core-js/internals/promise-statics-incorrect-iteration.js
var require_promise_statics_incorrect_iteration = __commonJS({
"node_modules/core-js/internals/promise-statics-incorrect-iteration.js"(exports2, module2) {
"use strict";
var NativePromiseConstructor = require_promise_native_constructor();
var checkCorrectnessOfIteration = require_check_correctness_of_iteration();
var FORCED_PROMISE_CONSTRUCTOR = require_promise_constructor_detection().CONSTRUCTOR;
module2.exports = FORCED_PROMISE_CONSTRUCTOR || !checkCorrectnessOfIteration(function(iterable) {
NativePromiseConstructor.all(iterable).then(void 0, function() {
});
});
}
});
// node_modules/core-js/modules/es.promise.all.js
var require_es_promise_all = __commonJS({
"node_modules/core-js/modules/es.promise.all.js"() {
"use strict";
var $3 = require_export();
var call = require_function_call();
var aCallable = require_a_callable();
var newPromiseCapabilityModule = require_new_promise_capability();
var perform = require_perform();
var iterate = require_iterate();
var PROMISE_STATICS_INCORRECT_ITERATION = require_promise_statics_incorrect_iteration();
$3({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
all: function all(iterable) {
var C4 = this;
var capability = newPromiseCapabilityModule.f(C4);
var resolve3 = capability.resolve;
var reject = capability.reject;
var result = perform(function() {
var $promiseResolve = aCallable(C4.resolve);
var values = [];
var counter = 0;
var remaining = 1;
iterate(iterable, function(promise) {
var index3 = counter++;
var alreadyCalled = false;
remaining++;
call($promiseResolve, C4, promise).then(function(value) {
if (alreadyCalled)
return;
alreadyCalled = true;
values[index3] = value;
--remaining || resolve3(values);
}, reject);
});
--remaining || resolve3(values);
});
if (result.error)
reject(result.value);
return capability.promise;
}
});
}
});
// node_modules/core-js/modules/es.promise.catch.js
var require_es_promise_catch = __commonJS({
"node_modules/core-js/modules/es.promise.catch.js"() {
"use strict";
var $3 = require_export();
var IS_PURE = require_is_pure();
var FORCED_PROMISE_CONSTRUCTOR = require_promise_constructor_detection().CONSTRUCTOR;
var NativePromiseConstructor = require_promise_native_constructor();
var getBuiltIn = require_get_built_in();
var isCallable = require_is_callable();
var defineBuiltIn = require_define_built_in();
var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
$3({ target: "Promise", proto: true, forced: FORCED_PROMISE_CONSTRUCTOR, real: true }, {
"catch": function(onRejected) {
return this.then(void 0, onRejected);
}
});
if (!IS_PURE && isCallable(NativePromiseConstructor)) {
method = getBuiltIn("Promise").prototype["catch"];
if (NativePromisePrototype["catch"] !== method) {
defineBuiltIn(NativePromisePrototype, "catch", method, { unsafe: true });
}
}
var method;
}
});
// node_modules/core-js/modules/es.promise.race.js
var require_es_promise_race = __commonJS({
"node_modules/core-js/modules/es.promise.race.js"() {
"use strict";
var $3 = require_export();
var call = require_function_call();
var aCallable = require_a_callable();
var newPromiseCapabilityModule = require_new_promise_capability();
var perform = require_perform();
var iterate = require_iterate();
var PROMISE_STATICS_INCORRECT_ITERATION = require_promise_statics_incorrect_iteration();
$3({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
race: function race(iterable) {
var C4 = this;
var capability = newPromiseCapabilityModule.f(C4);
var reject = capability.reject;
var result = perform(function() {
var $promiseResolve = aCallable(C4.resolve);
iterate(iterable, function(promise) {
call($promiseResolve, C4, promise).then(capability.resolve, reject);
});
});
if (result.error)
reject(result.value);
return capability.promise;
}
});
}
});
// node_modules/core-js/modules/es.promise.reject.js
var require_es_promise_reject = __commonJS({
"node_modules/core-js/modules/es.promise.reject.js"() {
"use strict";
var $3 = require_export();
var newPromiseCapabilityModule = require_new_promise_capability();
var FORCED_PROMISE_CONSTRUCTOR = require_promise_constructor_detection().CONSTRUCTOR;
$3({ target: "Promise", stat: true, forced: FORCED_PROMISE_CONSTRUCTOR }, {
reject: function reject(r6) {
var capability = newPromiseCapabilityModule.f(this);
var capabilityReject = capability.reject;
capabilityReject(r6);
return capability.promise;
}
});
}
});
// node_modules/core-js/internals/promise-resolve.js
var require_promise_resolve = __commonJS({
"node_modules/core-js/internals/promise-resolve.js"(exports2, module2) {
"use strict";
var anObject = require_an_object();
var isObject3 = require_is_object();
var newPromiseCapability = require_new_promise_capability();
module2.exports = function(C4, x4) {
anObject(C4);
if (isObject3(x4) && x4.constructor === C4)
return x4;
var promiseCapability = newPromiseCapability.f(C4);
var resolve3 = promiseCapability.resolve;
resolve3(x4);
return promiseCapability.promise;
};
}
});
// node_modules/core-js/modules/es.promise.resolve.js
var require_es_promise_resolve = __commonJS({
"node_modules/core-js/modules/es.promise.resolve.js"() {
"use strict";
var $3 = require_export();
var getBuiltIn = require_get_built_in();
var IS_PURE = require_is_pure();
var NativePromiseConstructor = require_promise_native_constructor();
var FORCED_PROMISE_CONSTRUCTOR = require_promise_constructor_detection().CONSTRUCTOR;
var promiseResolve = require_promise_resolve();
var PromiseConstructorWrapper = getBuiltIn("Promise");
var CHECK_WRAPPER = IS_PURE && !FORCED_PROMISE_CONSTRUCTOR;
$3({ target: "Promise", stat: true, forced: IS_PURE || FORCED_PROMISE_CONSTRUCTOR }, {
resolve: function resolve3(x4) {
return promiseResolve(CHECK_WRAPPER && this === PromiseConstructorWrapper ? NativePromiseConstructor : this, x4);
}
});
}
});
// node_modules/core-js/modules/es.promise.js
var require_es_promise = __commonJS({
"node_modules/core-js/modules/es.promise.js"() {
"use strict";
require_es_promise_constructor();
require_es_promise_all();
require_es_promise_catch();
require_es_promise_race();
require_es_promise_reject();
require_es_promise_resolve();
}
});
// node_modules/core-js/modules/es.promise.all-settled.js
var require_es_promise_all_settled = __commonJS({
"node_modules/core-js/modules/es.promise.all-settled.js"() {
"use strict";
var $3 = require_export();
var call = require_function_call();
var aCallable = require_a_callable();
var newPromiseCapabilityModule = require_new_promise_capability();
var perform = require_perform();
var iterate = require_iterate();
var PROMISE_STATICS_INCORRECT_ITERATION = require_promise_statics_incorrect_iteration();
$3({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
allSettled: function allSettled(iterable) {
var C4 = this;
var capability = newPromiseCapabilityModule.f(C4);
var resolve3 = capability.resolve;
var reject = capability.reject;
var result = perform(function() {
var promiseResolve = aCallable(C4.resolve);
var values = [];
var counter = 0;
var remaining = 1;
iterate(iterable, function(promise) {
var index3 = counter++;
var alreadyCalled = false;
remaining++;
call(promiseResolve, C4, promise).then(function(value) {
if (alreadyCalled)
return;
alreadyCalled = true;
values[index3] = { status: "fulfilled", value };
--remaining || resolve3(values);
}, function(error2) {
if (alreadyCalled)
return;
alreadyCalled = true;
values[index3] = { status: "rejected", reason: error2 };
--remaining || resolve3(values);
});
});
--remaining || resolve3(values);
});
if (result.error)
reject(result.value);
return capability.promise;
}
});
}
});
// node_modules/core-js/modules/es.promise.any.js
var require_es_promise_any = __commonJS({
"node_modules/core-js/modules/es.promise.any.js"() {
"use strict";
var $3 = require_export();
var call = require_function_call();
var aCallable = require_a_callable();
var getBuiltIn = require_get_built_in();
var newPromiseCapabilityModule = require_new_promise_capability();
var perform = require_perform();
var iterate = require_iterate();
var PROMISE_STATICS_INCORRECT_ITERATION = require_promise_statics_incorrect_iteration();
var PROMISE_ANY_ERROR = "No one promise resolved";
$3({ target: "Promise", stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION }, {
any: function any(iterable) {
var C4 = this;
var AggregateError = getBuiltIn("AggregateError");
var capability = newPromiseCapabilityModule.f(C4);
var resolve3 = capability.resolve;
var reject = capability.reject;
var result = perform(function() {
var promiseResolve = aCallable(C4.resolve);
var errors = [];
var counter = 0;
var remaining = 1;
var alreadyResolved = false;
iterate(iterable, function(promise) {
var index3 = counter++;
var alreadyRejected = false;
remaining++;
call(promiseResolve, C4, promise).then(function(value) {
if (alreadyRejected || alreadyResolved)
return;
alreadyResolved = true;
resolve3(value);
}, function(error2) {
if (alreadyRejected || alreadyResolved)
return;
alreadyRejected = true;
errors[index3] = error2;
--remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
});
});
--remaining || reject(new AggregateError(errors, PROMISE_ANY_ERROR));
});
if (result.error)
reject(result.value);
return capability.promise;
}
});
}
});
// node_modules/core-js/modules/es.promise.finally.js
var require_es_promise_finally = __commonJS({
"node_modules/core-js/modules/es.promise.finally.js"() {
"use strict";
var $3 = require_export();
var IS_PURE = require_is_pure();
var NativePromiseConstructor = require_promise_native_constructor();
var fails = require_fails();
var getBuiltIn = require_get_built_in();
var isCallable = require_is_callable();
var speciesConstructor = require_species_constructor();
var promiseResolve = require_promise_resolve();
var defineBuiltIn = require_define_built_in();
var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
var NON_GENERIC = !!NativePromiseConstructor && fails(function() {
NativePromisePrototype["finally"].call({ then: function() {
} }, function() {
});
});
$3({ target: "Promise", proto: true, real: true, forced: NON_GENERIC }, {
"finally": function(onFinally) {
var C4 = speciesConstructor(this, getBuiltIn("Promise"));
var isFunction3 = isCallable(onFinally);
return this.then(
isFunction3 ? function(x4) {
return promiseResolve(C4, onFinally()).then(function() {
return x4;
});
} : onFinally,
isFunction3 ? function(e5) {
return promiseResolve(C4, onFinally()).then(function() {
throw e5;
});
} : onFinally
);
}
});
if (!IS_PURE && isCallable(NativePromiseConstructor)) {
method = getBuiltIn("Promise").prototype["finally"];
if (NativePromisePrototype["finally"] !== method) {
defineBuiltIn(NativePromisePrototype, "finally", method, { unsafe: true });
}
}
var method;
}
});
// node_modules/core-js/modules/es.promise.try.js
var require_es_promise_try = __commonJS({
"node_modules/core-js/modules/es.promise.try.js"() {
"use strict";
var $3 = require_export();
var globalThis2 = require_global_this();
var apply2 = require_function_apply();
var slice = require_array_slice();
var newPromiseCapabilityModule = require_new_promise_capability();
var aCallable = require_a_callable();
var perform = require_perform();
var Promise2 = globalThis2.Promise;
var ACCEPT_ARGUMENTS = false;
var FORCED = !Promise2 || !Promise2["try"] || perform(function() {
Promise2["try"](function(argument) {
ACCEPT_ARGUMENTS = argument === 8;
}, 8);
}).error || !ACCEPT_ARGUMENTS;
$3({ target: "Promise", stat: true, forced: FORCED }, {
"try": function(callbackfn) {
var args = arguments.length > 1 ? slice(arguments, 1) : [];
var promiseCapability = newPromiseCapabilityModule.f(this);
var result = perform(function() {
return apply2(aCallable(callbackfn), void 0, args);
});
(result.error ? promiseCapability.reject : promiseCapability.resolve)(result.value);
return promiseCapability.promise;
}
});
}
});
// node_modules/core-js/modules/es.promise.with-resolvers.js
var require_es_promise_with_resolvers = __commonJS({
"node_modules/core-js/modules/es.promise.with-resolvers.js"() {
"use strict";
var $3 = require_export();
var newPromiseCapabilityModule = require_new_promise_capability();
$3({ target: "Promise", stat: true }, {
withResolvers: function withResolvers() {
var promiseCapability = newPromiseCapabilityModule.f(this);
return {
promise: promiseCapability.promise,
resolve: promiseCapability.resolve,
reject: promiseCapability.reject
};
}
});
}
});
// node_modules/core-js/modules/es.reflect.apply.js
var require_es_reflect_apply = __commonJS({
"node_modules/core-js/modules/es.reflect.apply.js"() {
"use strict";
var $3 = require_export();
var functionApply = require_function_apply();
var aCallable = require_a_callable();
var anObject = require_an_object();
var fails = require_fails();
var OPTIONAL_ARGUMENTS_LIST = !fails(function() {
Reflect.apply(function() {
});
});
$3({ target: "Reflect", stat: true, forced: OPTIONAL_ARGUMENTS_LIST }, {
apply: function apply2(target, thisArgument, argumentsList) {
return functionApply(aCallable(target), thisArgument, anObject(argumentsList));
}
});
}
});
// node_modules/core-js/modules/es.reflect.construct.js
var require_es_reflect_construct = __commonJS({
"node_modules/core-js/modules/es.reflect.construct.js"() {
"use strict";
var $3 = require_export();
var getBuiltIn = require_get_built_in();
var apply2 = require_function_apply();
var bind3 = require_function_bind();
var aConstructor = require_a_constructor();
var anObject = require_an_object();
var isObject3 = require_is_object();
var create = require_object_create();
var fails = require_fails();
var nativeConstruct = getBuiltIn("Reflect", "construct");
var ObjectPrototype = Object.prototype;
var push = [].push;
var NEW_TARGET_BUG = fails(function() {
function F3() {
}
return !(nativeConstruct(function() {
}, [], F3) instanceof F3);
});
var ARGS_BUG = !fails(function() {
nativeConstruct(function() {
});
});
var FORCED = NEW_TARGET_BUG || ARGS_BUG;
$3({ target: "Reflect", stat: true, forced: FORCED, sham: FORCED }, {
construct: function construct(Target, args) {
aConstructor(Target);
anObject(args);
var newTarget = arguments.length < 3 ? Target : aConstructor(arguments[2]);
if (ARGS_BUG && !NEW_TARGET_BUG)
return nativeConstruct(Target, args, newTarget);
if (Target === newTarget) {
switch (args.length) {
case 0:
return new Target();
case 1:
return new Target(args[0]);
case 2:
return new Target(args[0], args[1]);
case 3:
return new Target(args[0], args[1], args[2]);
case 4:
return new Target(args[0], args[1], args[2], args[3]);
}
var $args = [null];
apply2(push, $args, args);
return new (apply2(bind3, Target, $args))();
}
var proto = newTarget.prototype;
var instance = create(isObject3(proto) ? proto : ObjectPrototype);
var result = apply2(Target, instance, args);
return isObject3(result) ? result : instance;
}
});
}
});
// node_modules/core-js/modules/es.reflect.define-property.js
var require_es_reflect_define_property = __commonJS({
"node_modules/core-js/modules/es.reflect.define-property.js"() {
"use strict";
var $3 = require_export();
var DESCRIPTORS = require_descriptors();
var anObject = require_an_object();
var toPropertyKey = require_to_property_key();
var definePropertyModule = require_object_define_property();
var fails = require_fails();
var ERROR_INSTEAD_OF_FALSE = fails(function() {
Reflect.defineProperty(definePropertyModule.f({}, 1, { value: 1 }), 1, { value: 2 });
});
$3({ target: "Reflect", stat: true, forced: ERROR_INSTEAD_OF_FALSE, sham: !DESCRIPTORS }, {
defineProperty: function defineProperty(target, propertyKey, attributes) {
anObject(target);
var key = toPropertyKey(propertyKey);
anObject(attributes);
try {
definePropertyModule.f(target, key, attributes);
return true;
} catch (error2) {
return false;
}
}
});
}
});
// node_modules/core-js/modules/es.reflect.delete-property.js
var require_es_reflect_delete_property = __commonJS({
"node_modules/core-js/modules/es.reflect.delete-property.js"() {
"use strict";
var $3 = require_export();
var anObject = require_an_object();
var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
$3({ target: "Reflect", stat: true }, {
deleteProperty: function deleteProperty(target, propertyKey) {
var descriptor = getOwnPropertyDescriptor(anObject(target), propertyKey);
return descriptor && !descriptor.configurable ? false : delete target[propertyKey];
}
});
}
});
// node_modules/core-js/internals/is-data-descriptor.js
var require_is_data_descriptor = __commonJS({
"node_modules/core-js/internals/is-data-descriptor.js"(exports2, module2) {
"use strict";
var hasOwn = require_has_own_property();
module2.exports = function(descriptor) {
return descriptor !== void 0 && (hasOwn(descriptor, "value") || hasOwn(descriptor, "writable"));
};
}
});
// node_modules/core-js/modules/es.reflect.get.js
var require_es_reflect_get = __commonJS({
"node_modules/core-js/modules/es.reflect.get.js"() {
"use strict";
var $3 = require_export();
var call = require_function_call();
var isObject3 = require_is_object();
var anObject = require_an_object();
var isDataDescriptor = require_is_data_descriptor();
var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
var getPrototypeOf = require_object_get_prototype_of();
function get(target, propertyKey) {
var receiver = arguments.length < 3 ? target : arguments[2];
var descriptor, prototype;
if (anObject(target) === receiver)
return target[propertyKey];
descriptor = getOwnPropertyDescriptorModule.f(target, propertyKey);
if (descriptor)
return isDataDescriptor(descriptor) ? descriptor.value : descriptor.get === void 0 ? void 0 : call(descriptor.get, receiver);
if (isObject3(prototype = getPrototypeOf(target)))
return get(prototype, propertyKey, receiver);
}
$3({ target: "Reflect", stat: true }, {
get
});
}
});
// node_modules/core-js/modules/es.reflect.get-own-property-descriptor.js
var require_es_reflect_get_own_property_descriptor = __commonJS({
"node_modules/core-js/modules/es.reflect.get-own-property-descriptor.js"() {
"use strict";
var $3 = require_export();
var DESCRIPTORS = require_descriptors();
var anObject = require_an_object();
var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
$3({ target: "Reflect", stat: true, sham: !DESCRIPTORS }, {
getOwnPropertyDescriptor: function getOwnPropertyDescriptor(target, propertyKey) {
return getOwnPropertyDescriptorModule.f(anObject(target), propertyKey);
}
});
}
});
// node_modules/core-js/modules/es.reflect.get-prototype-of.js
var require_es_reflect_get_prototype_of = __commonJS({
"node_modules/core-js/modules/es.reflect.get-prototype-of.js"() {
"use strict";
var $3 = require_export();
var anObject = require_an_object();
var objectGetPrototypeOf = require_object_get_prototype_of();
var CORRECT_PROTOTYPE_GETTER = require_correct_prototype_getter();
$3({ target: "Reflect", stat: true, sham: !CORRECT_PROTOTYPE_GETTER }, {
getPrototypeOf: function getPrototypeOf(target) {
return objectGetPrototypeOf(anObject(target));
}
});
}
});
// node_modules/core-js/modules/es.reflect.has.js
var require_es_reflect_has = __commonJS({
"node_modules/core-js/modules/es.reflect.has.js"() {
"use strict";
var $3 = require_export();
$3({ target: "Reflect", stat: true }, {
has: function has(target, propertyKey) {
return propertyKey in target;
}
});
}
});
// node_modules/core-js/modules/es.reflect.is-extensible.js
var require_es_reflect_is_extensible = __commonJS({
"node_modules/core-js/modules/es.reflect.is-extensible.js"() {
"use strict";
var $3 = require_export();
var anObject = require_an_object();
var $isExtensible = require_object_is_extensible();
$3({ target: "Reflect", stat: true }, {
isExtensible: function isExtensible(target) {
anObject(target);
return $isExtensible(target);
}
});
}
});
// node_modules/core-js/modules/es.reflect.own-keys.js
var require_es_reflect_own_keys = __commonJS({
"node_modules/core-js/modules/es.reflect.own-keys.js"() {
"use strict";
var $3 = require_export();
var ownKeys26 = require_own_keys();
$3({ target: "Reflect", stat: true }, {
ownKeys: ownKeys26
});
}
});
// node_modules/core-js/modules/es.reflect.prevent-extensions.js
var require_es_reflect_prevent_extensions = __commonJS({
"node_modules/core-js/modules/es.reflect.prevent-extensions.js"() {
"use strict";
var $3 = require_export();
var getBuiltIn = require_get_built_in();
var anObject = require_an_object();
var FREEZING = require_freezing();
$3({ target: "Reflect", stat: true, sham: !FREEZING }, {
preventExtensions: function preventExtensions(target) {
anObject(target);
try {
var objectPreventExtensions = getBuiltIn("Object", "preventExtensions");
if (objectPreventExtensions)
objectPreventExtensions(target);
return true;
} catch (error2) {
return false;
}
}
});
}
});
// node_modules/core-js/modules/es.reflect.set.js
var require_es_reflect_set = __commonJS({
"node_modules/core-js/modules/es.reflect.set.js"() {
"use strict";
var $3 = require_export();
var call = require_function_call();
var anObject = require_an_object();
var isObject3 = require_is_object();
var isDataDescriptor = require_is_data_descriptor();
var fails = require_fails();
var definePropertyModule = require_object_define_property();
var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
var getPrototypeOf = require_object_get_prototype_of();
var createPropertyDescriptor = require_create_property_descriptor();
function set2(target, propertyKey, V3) {
var receiver = arguments.length < 4 ? target : arguments[3];
var ownDescriptor = getOwnPropertyDescriptorModule.f(anObject(target), propertyKey);
var existingDescriptor, prototype, setter;
if (!ownDescriptor) {
if (isObject3(prototype = getPrototypeOf(target))) {
return set2(prototype, propertyKey, V3, receiver);
}
ownDescriptor = createPropertyDescriptor(0);
}
if (isDataDescriptor(ownDescriptor)) {
if (ownDescriptor.writable === false || !isObject3(receiver))
return false;
if (existingDescriptor = getOwnPropertyDescriptorModule.f(receiver, propertyKey)) {
if (existingDescriptor.get || existingDescriptor.set || existingDescriptor.writable === false)
return false;
existingDescriptor.value = V3;
definePropertyModule.f(receiver, propertyKey, existingDescriptor);
} else
definePropertyModule.f(receiver, propertyKey, createPropertyDescriptor(0, V3));
} else {
setter = ownDescriptor.set;
if (setter === void 0)
return false;
call(setter, receiver, V3);
}
return true;
}
var MS_EDGE_BUG = fails(function() {
var Constructor = function() {
};
var object = definePropertyModule.f(new Constructor(), "a", { configurable: true });
return Reflect.set(Constructor.prototype, "a", 1, object) !== false;
});
$3({ target: "Reflect", stat: true, forced: MS_EDGE_BUG }, {
set: set2
});
}
});
// node_modules/core-js/modules/es.reflect.set-prototype-of.js
var require_es_reflect_set_prototype_of = __commonJS({
"node_modules/core-js/modules/es.reflect.set-prototype-of.js"() {
"use strict";
var $3 = require_export();
var anObject = require_an_object();
var aPossiblePrototype = require_a_possible_prototype();
var objectSetPrototypeOf = require_object_set_prototype_of();
if (objectSetPrototypeOf)
$3({ target: "Reflect", stat: true }, {
setPrototypeOf: function setPrototypeOf(target, proto) {
anObject(target);
aPossiblePrototype(proto);
try {
objectSetPrototypeOf(target, proto);
return true;
} catch (error2) {
return false;
}
}
});
}
});
// node_modules/core-js/modules/es.reflect.to-string-tag.js
var require_es_reflect_to_string_tag = __commonJS({
"node_modules/core-js/modules/es.reflect.to-string-tag.js"() {
"use strict";
var $3 = require_export();
var globalThis2 = require_global_this();
var setToStringTag = require_set_to_string_tag();
$3({ global: true }, { Reflect: {} });
setToStringTag(globalThis2.Reflect, "Reflect", true);
}
});
// node_modules/core-js/internals/is-regexp.js
var require_is_regexp = __commonJS({
"node_modules/core-js/internals/is-regexp.js"(exports2, module2) {
"use strict";
var isObject3 = require_is_object();
var classof = require_classof_raw();
var wellKnownSymbol = require_well_known_symbol();
var MATCH = wellKnownSymbol("match");
module2.exports = function(it2) {
var isRegExp2;
return isObject3(it2) && ((isRegExp2 = it2[MATCH]) !== void 0 ? !!isRegExp2 : classof(it2) === "RegExp");
};
}
});
// node_modules/core-js/internals/regexp-flags.js
var require_regexp_flags = __commonJS({
"node_modules/core-js/internals/regexp-flags.js"(exports2, module2) {
"use strict";
var anObject = require_an_object();
module2.exports = function() {
var that = anObject(this);
var result = "";
if (that.hasIndices)
result += "d";
if (that.global)
result += "g";
if (that.ignoreCase)
result += "i";
if (that.multiline)
result += "m";
if (that.dotAll)
result += "s";
if (that.unicode)
result += "u";
if (that.unicodeSets)
result += "v";
if (that.sticky)
result += "y";
return result;
};
}
});
// node_modules/core-js/internals/regexp-get-flags.js
var require_regexp_get_flags = __commonJS({
"node_modules/core-js/internals/regexp-get-flags.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var hasOwn = require_has_own_property();
var isPrototypeOf = require_object_is_prototype_of();
var regExpFlags = require_regexp_flags();
var RegExpPrototype = RegExp.prototype;
module2.exports = function(R3) {
var flags = R3.flags;
return flags === void 0 && !("flags" in RegExpPrototype) && !hasOwn(R3, "flags") && isPrototypeOf(RegExpPrototype, R3) ? call(regExpFlags, R3) : flags;
};
}
});
// node_modules/core-js/internals/regexp-sticky-helpers.js
var require_regexp_sticky_helpers = __commonJS({
"node_modules/core-js/internals/regexp-sticky-helpers.js"(exports2, module2) {
"use strict";
var fails = require_fails();
var globalThis2 = require_global_this();
var $RegExp = globalThis2.RegExp;
var UNSUPPORTED_Y = fails(function() {
var re2 = $RegExp("a", "y");
re2.lastIndex = 2;
return re2.exec("abcd") !== null;
});
var MISSED_STICKY = UNSUPPORTED_Y || fails(function() {
return !$RegExp("a", "y").sticky;
});
var BROKEN_CARET = UNSUPPORTED_Y || fails(function() {
var re2 = $RegExp("^r", "gy");
re2.lastIndex = 2;
return re2.exec("str") !== null;
});
module2.exports = {
BROKEN_CARET,
MISSED_STICKY,
UNSUPPORTED_Y
};
}
});
// node_modules/core-js/internals/regexp-unsupported-dot-all.js
var require_regexp_unsupported_dot_all = __commonJS({
"node_modules/core-js/internals/regexp-unsupported-dot-all.js"(exports2, module2) {
"use strict";
var fails = require_fails();
var globalThis2 = require_global_this();
var $RegExp = globalThis2.RegExp;
module2.exports = fails(function() {
var re2 = $RegExp(".", "s");
return !(re2.dotAll && re2.test("\n") && re2.flags === "s");
});
}
});
// node_modules/core-js/internals/regexp-unsupported-ncg.js
var require_regexp_unsupported_ncg = __commonJS({
"node_modules/core-js/internals/regexp-unsupported-ncg.js"(exports2, module2) {
"use strict";
var fails = require_fails();
var globalThis2 = require_global_this();
var $RegExp = globalThis2.RegExp;
module2.exports = fails(function() {
var re2 = $RegExp("(?b)", "g");
return re2.exec("b").groups.a !== "b" || "b".replace(re2, "$c") !== "bc";
});
}
});
// node_modules/core-js/modules/es.regexp.constructor.js
var require_es_regexp_constructor = __commonJS({
"node_modules/core-js/modules/es.regexp.constructor.js"() {
"use strict";
var DESCRIPTORS = require_descriptors();
var globalThis2 = require_global_this();
var uncurryThis = require_function_uncurry_this();
var isForced = require_is_forced();
var inheritIfRequired = require_inherit_if_required();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var create = require_object_create();
var getOwnPropertyNames = require_object_get_own_property_names().f;
var isPrototypeOf = require_object_is_prototype_of();
var isRegExp2 = require_is_regexp();
var toString = require_to_string();
var getRegExpFlags = require_regexp_get_flags();
var stickyHelpers = require_regexp_sticky_helpers();
var proxyAccessor = require_proxy_accessor();
var defineBuiltIn = require_define_built_in();
var fails = require_fails();
var hasOwn = require_has_own_property();
var enforceInternalState = require_internal_state().enforce;
var setSpecies = require_set_species();
var wellKnownSymbol = require_well_known_symbol();
var UNSUPPORTED_DOT_ALL = require_regexp_unsupported_dot_all();
var UNSUPPORTED_NCG = require_regexp_unsupported_ncg();
var MATCH = wellKnownSymbol("match");
var NativeRegExp = globalThis2.RegExp;
var RegExpPrototype = NativeRegExp.prototype;
var SyntaxError2 = globalThis2.SyntaxError;
var exec = uncurryThis(RegExpPrototype.exec);
var charAt = uncurryThis("".charAt);
var replace2 = uncurryThis("".replace);
var stringIndexOf = uncurryThis("".indexOf);
var stringSlice = uncurryThis("".slice);
var IS_NCG = /^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/;
var re1 = /a/g;
var re2 = /a/g;
var CORRECT_NEW = new NativeRegExp(re1) !== re1;
var MISSED_STICKY = stickyHelpers.MISSED_STICKY;
var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
var BASE_FORCED = DESCRIPTORS && (!CORRECT_NEW || MISSED_STICKY || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG || fails(function() {
re2[MATCH] = false;
return NativeRegExp(re1) !== re1 || NativeRegExp(re2) === re2 || String(NativeRegExp(re1, "i")) !== "/a/i";
}));
var handleDotAll = function(string) {
var length = string.length;
var index4 = 0;
var result = "";
var brackets = false;
var chr;
for (; index4 <= length; index4++) {
chr = charAt(string, index4);
if (chr === "\\") {
result += chr + charAt(string, ++index4);
continue;
}
if (!brackets && chr === ".") {
result += "[\\s\\S]";
} else {
if (chr === "[") {
brackets = true;
} else if (chr === "]") {
brackets = false;
}
result += chr;
}
}
return result;
};
var handleNCG = function(string) {
var length = string.length;
var index4 = 0;
var result = "";
var named = [];
var names2 = create(null);
var brackets = false;
var ncg = false;
var groupid = 0;
var groupname = "";
var chr;
for (; index4 <= length; index4++) {
chr = charAt(string, index4);
if (chr === "\\") {
chr += charAt(string, ++index4);
} else if (chr === "]") {
brackets = false;
} else if (!brackets)
switch (true) {
case chr === "[":
brackets = true;
break;
case chr === "(":
result += chr;
if (stringSlice(string, index4 + 1, index4 + 3) === "?:") {
continue;
}
if (exec(IS_NCG, stringSlice(string, index4 + 1))) {
index4 += 2;
ncg = true;
}
groupid++;
continue;
case (chr === ">" && ncg):
if (groupname === "" || hasOwn(names2, groupname)) {
throw new SyntaxError2("Invalid capture group name");
}
names2[groupname] = true;
named[named.length] = [groupname, groupid];
ncg = false;
groupname = "";
continue;
}
if (ncg)
groupname += chr;
else
result += chr;
}
return [result, named];
};
if (isForced("RegExp", BASE_FORCED)) {
RegExpWrapper = function RegExp2(pattern, flags) {
var thisIsRegExp = isPrototypeOf(RegExpPrototype, this);
var patternIsRegExp = isRegExp2(pattern);
var flagsAreUndefined = flags === void 0;
var groups = [];
var rawPattern = pattern;
var rawFlags, dotAll, sticky, handled, result, state;
if (!thisIsRegExp && patternIsRegExp && flagsAreUndefined && pattern.constructor === RegExpWrapper) {
return pattern;
}
if (patternIsRegExp || isPrototypeOf(RegExpPrototype, pattern)) {
pattern = pattern.source;
if (flagsAreUndefined)
flags = getRegExpFlags(rawPattern);
}
pattern = pattern === void 0 ? "" : toString(pattern);
flags = flags === void 0 ? "" : toString(flags);
rawPattern = pattern;
if (UNSUPPORTED_DOT_ALL && "dotAll" in re1) {
dotAll = !!flags && stringIndexOf(flags, "s") > -1;
if (dotAll)
flags = replace2(flags, /s/g, "");
}
rawFlags = flags;
if (MISSED_STICKY && "sticky" in re1) {
sticky = !!flags && stringIndexOf(flags, "y") > -1;
if (sticky && UNSUPPORTED_Y)
flags = replace2(flags, /y/g, "");
}
if (UNSUPPORTED_NCG) {
handled = handleNCG(pattern);
pattern = handled[0];
groups = handled[1];
}
result = inheritIfRequired(NativeRegExp(pattern, flags), thisIsRegExp ? this : RegExpPrototype, RegExpWrapper);
if (dotAll || sticky || groups.length) {
state = enforceInternalState(result);
if (dotAll) {
state.dotAll = true;
state.raw = RegExpWrapper(handleDotAll(pattern), rawFlags);
}
if (sticky)
state.sticky = true;
if (groups.length)
state.groups = groups;
}
if (pattern !== rawPattern)
try {
createNonEnumerableProperty(result, "source", rawPattern === "" ? "(?:)" : rawPattern);
} catch (error2) {
}
return result;
};
for (keys2 = getOwnPropertyNames(NativeRegExp), index3 = 0; keys2.length > index3; ) {
proxyAccessor(RegExpWrapper, NativeRegExp, keys2[index3++]);
}
RegExpPrototype.constructor = RegExpWrapper;
RegExpWrapper.prototype = RegExpPrototype;
defineBuiltIn(globalThis2, "RegExp", RegExpWrapper, { constructor: true });
}
var RegExpWrapper;
var keys2;
var index3;
setSpecies("RegExp");
}
});
// node_modules/core-js/modules/es.regexp.dot-all.js
var require_es_regexp_dot_all = __commonJS({
"node_modules/core-js/modules/es.regexp.dot-all.js"() {
"use strict";
var DESCRIPTORS = require_descriptors();
var UNSUPPORTED_DOT_ALL = require_regexp_unsupported_dot_all();
var classof = require_classof_raw();
var defineBuiltInAccessor = require_define_built_in_accessor();
var getInternalState = require_internal_state().get;
var RegExpPrototype = RegExp.prototype;
var $TypeError = TypeError;
if (DESCRIPTORS && UNSUPPORTED_DOT_ALL) {
defineBuiltInAccessor(RegExpPrototype, "dotAll", {
configurable: true,
get: function dotAll() {
if (this === RegExpPrototype)
return;
if (classof(this) === "RegExp") {
return !!getInternalState(this).dotAll;
}
throw new $TypeError("Incompatible receiver, RegExp required");
}
});
}
}
});
// node_modules/core-js/internals/regexp-exec.js
var require_regexp_exec = __commonJS({
"node_modules/core-js/internals/regexp-exec.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var uncurryThis = require_function_uncurry_this();
var toString = require_to_string();
var regexpFlags = require_regexp_flags();
var stickyHelpers = require_regexp_sticky_helpers();
var shared = require_shared();
var create = require_object_create();
var getInternalState = require_internal_state().get;
var UNSUPPORTED_DOT_ALL = require_regexp_unsupported_dot_all();
var UNSUPPORTED_NCG = require_regexp_unsupported_ncg();
var nativeReplace = shared("native-string-replace", String.prototype.replace);
var nativeExec = RegExp.prototype.exec;
var patchedExec = nativeExec;
var charAt = uncurryThis("".charAt);
var indexOf2 = uncurryThis("".indexOf);
var replace2 = uncurryThis("".replace);
var stringSlice = uncurryThis("".slice);
var UPDATES_LAST_INDEX_WRONG = function() {
var re1 = /a/;
var re2 = /b*/g;
call(nativeExec, re1, "a");
call(nativeExec, re2, "a");
return re1.lastIndex !== 0 || re2.lastIndex !== 0;
}();
var UNSUPPORTED_Y = stickyHelpers.BROKEN_CARET;
var NPCG_INCLUDED = /()??/.exec("")[1] !== void 0;
var PATCH = UPDATES_LAST_INDEX_WRONG || NPCG_INCLUDED || UNSUPPORTED_Y || UNSUPPORTED_DOT_ALL || UNSUPPORTED_NCG;
if (PATCH) {
patchedExec = function exec(string) {
var re2 = this;
var state = getInternalState(re2);
var str = toString(string);
var raw = state.raw;
var result, reCopy, lastIndex, match3, i5, object, group;
if (raw) {
raw.lastIndex = re2.lastIndex;
result = call(patchedExec, raw, str);
re2.lastIndex = raw.lastIndex;
return result;
}
var groups = state.groups;
var sticky = UNSUPPORTED_Y && re2.sticky;
var flags = call(regexpFlags, re2);
var source = re2.source;
var charsAdded = 0;
var strCopy = str;
if (sticky) {
flags = replace2(flags, "y", "");
if (indexOf2(flags, "g") === -1) {
flags += "g";
}
strCopy = stringSlice(str, re2.lastIndex);
if (re2.lastIndex > 0 && (!re2.multiline || re2.multiline && charAt(str, re2.lastIndex - 1) !== "\n")) {
source = "(?: " + source + ")";
strCopy = " " + strCopy;
charsAdded++;
}
reCopy = new RegExp("^(?:" + source + ")", flags);
}
if (NPCG_INCLUDED) {
reCopy = new RegExp("^" + source + "$(?!\\s)", flags);
}
if (UPDATES_LAST_INDEX_WRONG)
lastIndex = re2.lastIndex;
match3 = call(nativeExec, sticky ? reCopy : re2, strCopy);
if (sticky) {
if (match3) {
match3.input = stringSlice(match3.input, charsAdded);
match3[0] = stringSlice(match3[0], charsAdded);
match3.index = re2.lastIndex;
re2.lastIndex += match3[0].length;
} else
re2.lastIndex = 0;
} else if (UPDATES_LAST_INDEX_WRONG && match3) {
re2.lastIndex = re2.global ? match3.index + match3[0].length : lastIndex;
}
if (NPCG_INCLUDED && match3 && match3.length > 1) {
call(nativeReplace, match3[0], reCopy, function() {
for (i5 = 1; i5 < arguments.length - 2; i5++) {
if (arguments[i5] === void 0)
match3[i5] = void 0;
}
});
}
if (match3 && groups) {
match3.groups = object = create(null);
for (i5 = 0; i5 < groups.length; i5++) {
group = groups[i5];
object[group[0]] = match3[group[1]];
}
}
return match3;
};
}
module2.exports = patchedExec;
}
});
// node_modules/core-js/modules/es.regexp.exec.js
var require_es_regexp_exec = __commonJS({
"node_modules/core-js/modules/es.regexp.exec.js"() {
"use strict";
var $3 = require_export();
var exec = require_regexp_exec();
$3({ target: "RegExp", proto: true, forced: /./.exec !== exec }, {
exec
});
}
});
// node_modules/core-js/modules/es.regexp.flags.js
var require_es_regexp_flags = __commonJS({
"node_modules/core-js/modules/es.regexp.flags.js"() {
"use strict";
var globalThis2 = require_global_this();
var DESCRIPTORS = require_descriptors();
var defineBuiltInAccessor = require_define_built_in_accessor();
var regExpFlags = require_regexp_flags();
var fails = require_fails();
var RegExp2 = globalThis2.RegExp;
var RegExpPrototype = RegExp2.prototype;
var FORCED = DESCRIPTORS && fails(function() {
var INDICES_SUPPORT = true;
try {
RegExp2(".", "d");
} catch (error2) {
INDICES_SUPPORT = false;
}
var O4 = {};
var calls = "";
var expected = INDICES_SUPPORT ? "dgimsy" : "gimsy";
var addGetter = function(key2, chr) {
Object.defineProperty(O4, key2, { get: function() {
calls += chr;
return true;
} });
};
var pairs = {
dotAll: "s",
global: "g",
ignoreCase: "i",
multiline: "m",
sticky: "y"
};
if (INDICES_SUPPORT)
pairs.hasIndices = "d";
for (var key in pairs)
addGetter(key, pairs[key]);
var result = Object.getOwnPropertyDescriptor(RegExpPrototype, "flags").get.call(O4);
return result !== expected || calls !== expected;
});
if (FORCED)
defineBuiltInAccessor(RegExpPrototype, "flags", {
configurable: true,
get: regExpFlags
});
}
});
// node_modules/core-js/modules/es.regexp.sticky.js
var require_es_regexp_sticky = __commonJS({
"node_modules/core-js/modules/es.regexp.sticky.js"() {
"use strict";
var DESCRIPTORS = require_descriptors();
var MISSED_STICKY = require_regexp_sticky_helpers().MISSED_STICKY;
var classof = require_classof_raw();
var defineBuiltInAccessor = require_define_built_in_accessor();
var getInternalState = require_internal_state().get;
var RegExpPrototype = RegExp.prototype;
var $TypeError = TypeError;
if (DESCRIPTORS && MISSED_STICKY) {
defineBuiltInAccessor(RegExpPrototype, "sticky", {
configurable: true,
get: function sticky() {
if (this === RegExpPrototype)
return;
if (classof(this) === "RegExp") {
return !!getInternalState(this).sticky;
}
throw new $TypeError("Incompatible receiver, RegExp required");
}
});
}
}
});
// node_modules/core-js/modules/es.regexp.test.js
var require_es_regexp_test = __commonJS({
"node_modules/core-js/modules/es.regexp.test.js"() {
"use strict";
require_es_regexp_exec();
var $3 = require_export();
var call = require_function_call();
var isCallable = require_is_callable();
var anObject = require_an_object();
var toString = require_to_string();
var DELEGATES_TO_EXEC = function() {
var execCalled = false;
var re2 = /[ac]/;
re2.exec = function() {
execCalled = true;
return /./.exec.apply(this, arguments);
};
return re2.test("abc") === true && execCalled;
}();
var nativeTest = /./.test;
$3({ target: "RegExp", proto: true, forced: !DELEGATES_TO_EXEC }, {
test: function(S4) {
var R3 = anObject(this);
var string = toString(S4);
var exec = R3.exec;
if (!isCallable(exec))
return call(nativeTest, R3, string);
var result = call(exec, R3, string);
if (result === null)
return false;
anObject(result);
return true;
}
});
}
});
// node_modules/core-js/modules/es.regexp.to-string.js
var require_es_regexp_to_string = __commonJS({
"node_modules/core-js/modules/es.regexp.to-string.js"() {
"use strict";
var PROPER_FUNCTION_NAME = require_function_name().PROPER;
var defineBuiltIn = require_define_built_in();
var anObject = require_an_object();
var $toString = require_to_string();
var fails = require_fails();
var getRegExpFlags = require_regexp_get_flags();
var TO_STRING = "toString";
var RegExpPrototype = RegExp.prototype;
var nativeToString = RegExpPrototype[TO_STRING];
var NOT_GENERIC = fails(function() {
return nativeToString.call({ source: "a", flags: "b" }) !== "/a/b";
});
var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
if (NOT_GENERIC || INCORRECT_NAME) {
defineBuiltIn(RegExpPrototype, TO_STRING, function toString() {
var R3 = anObject(this);
var pattern = $toString(R3.source);
var flags = $toString(getRegExpFlags(R3));
return "/" + pattern + "/" + flags;
}, { unsafe: true });
}
}
});
// node_modules/core-js/modules/es.set.constructor.js
var require_es_set_constructor = __commonJS({
"node_modules/core-js/modules/es.set.constructor.js"() {
"use strict";
var collection = require_collection();
var collectionStrong = require_collection_strong();
collection("Set", function(init3) {
return function Set2() {
return init3(this, arguments.length ? arguments[0] : void 0);
};
}, collectionStrong);
}
});
// node_modules/core-js/modules/es.set.js
var require_es_set = __commonJS({
"node_modules/core-js/modules/es.set.js"() {
"use strict";
require_es_set_constructor();
}
});
// node_modules/core-js/internals/set-helpers.js
var require_set_helpers = __commonJS({
"node_modules/core-js/internals/set-helpers.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var SetPrototype = Set.prototype;
module2.exports = {
Set,
add: uncurryThis(SetPrototype.add),
has: uncurryThis(SetPrototype.has),
remove: uncurryThis(SetPrototype["delete"]),
proto: SetPrototype
};
}
});
// node_modules/core-js/internals/a-set.js
var require_a_set = __commonJS({
"node_modules/core-js/internals/a-set.js"(exports2, module2) {
"use strict";
var has = require_set_helpers().has;
module2.exports = function(it2) {
has(it2);
return it2;
};
}
});
// node_modules/core-js/internals/iterate-simple.js
var require_iterate_simple = __commonJS({
"node_modules/core-js/internals/iterate-simple.js"(exports2, module2) {
"use strict";
var call = require_function_call();
module2.exports = function(record, fn3, ITERATOR_INSTEAD_OF_RECORD) {
var iterator = ITERATOR_INSTEAD_OF_RECORD ? record : record.iterator;
var next = record.next;
var step, result;
while (!(step = call(next, iterator)).done) {
result = fn3(step.value);
if (result !== void 0)
return result;
}
};
}
});
// node_modules/core-js/internals/set-iterate.js
var require_set_iterate = __commonJS({
"node_modules/core-js/internals/set-iterate.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var iterateSimple = require_iterate_simple();
var SetHelpers = require_set_helpers();
var Set2 = SetHelpers.Set;
var SetPrototype = SetHelpers.proto;
var forEach2 = uncurryThis(SetPrototype.forEach);
var keys2 = uncurryThis(SetPrototype.keys);
var next = keys2(new Set2()).next;
module2.exports = function(set2, fn3, interruptible) {
return interruptible ? iterateSimple({ iterator: keys2(set2), next }, fn3) : forEach2(set2, fn3);
};
}
});
// node_modules/core-js/internals/set-clone.js
var require_set_clone = __commonJS({
"node_modules/core-js/internals/set-clone.js"(exports2, module2) {
"use strict";
var SetHelpers = require_set_helpers();
var iterate = require_set_iterate();
var Set2 = SetHelpers.Set;
var add2 = SetHelpers.add;
module2.exports = function(set2) {
var result = new Set2();
iterate(set2, function(it2) {
add2(result, it2);
});
return result;
};
}
});
// node_modules/core-js/internals/set-size.js
var require_set_size = __commonJS({
"node_modules/core-js/internals/set-size.js"(exports2, module2) {
"use strict";
var uncurryThisAccessor = require_function_uncurry_this_accessor();
var SetHelpers = require_set_helpers();
module2.exports = uncurryThisAccessor(SetHelpers.proto, "size", "get") || function(set2) {
return set2.size;
};
}
});
// node_modules/core-js/internals/get-set-record.js
var require_get_set_record = __commonJS({
"node_modules/core-js/internals/get-set-record.js"(exports2, module2) {
"use strict";
var aCallable = require_a_callable();
var anObject = require_an_object();
var call = require_function_call();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var getIteratorDirect = require_get_iterator_direct();
var INVALID_SIZE = "Invalid size";
var $RangeError = RangeError;
var $TypeError = TypeError;
var max2 = Math.max;
var SetRecord = function(set2, intSize) {
this.set = set2;
this.size = max2(intSize, 0);
this.has = aCallable(set2.has);
this.keys = aCallable(set2.keys);
};
SetRecord.prototype = {
getIterator: function() {
return getIteratorDirect(anObject(call(this.keys, this.set)));
},
includes: function(it2) {
return call(this.has, this.set, it2);
}
};
module2.exports = function(obj) {
anObject(obj);
var numSize = +obj.size;
if (numSize !== numSize)
throw new $TypeError(INVALID_SIZE);
var intSize = toIntegerOrInfinity(numSize);
if (intSize < 0)
throw new $RangeError(INVALID_SIZE);
return new SetRecord(obj, intSize);
};
}
});
// node_modules/core-js/internals/set-difference.js
var require_set_difference = __commonJS({
"node_modules/core-js/internals/set-difference.js"(exports2, module2) {
"use strict";
var aSet = require_a_set();
var SetHelpers = require_set_helpers();
var clone5 = require_set_clone();
var size = require_set_size();
var getSetRecord = require_get_set_record();
var iterateSet = require_set_iterate();
var iterateSimple = require_iterate_simple();
var has = SetHelpers.has;
var remove = SetHelpers.remove;
module2.exports = function difference(other) {
var O4 = aSet(this);
var otherRec = getSetRecord(other);
var result = clone5(O4);
if (size(O4) <= otherRec.size)
iterateSet(O4, function(e5) {
if (otherRec.includes(e5))
remove(result, e5);
});
else
iterateSimple(otherRec.getIterator(), function(e5) {
if (has(O4, e5))
remove(result, e5);
});
return result;
};
}
});
// node_modules/core-js/internals/set-method-accept-set-like.js
var require_set_method_accept_set_like = __commonJS({
"node_modules/core-js/internals/set-method-accept-set-like.js"(exports2, module2) {
"use strict";
var getBuiltIn = require_get_built_in();
var createSetLike = function(size) {
return {
size,
has: function() {
return false;
},
keys: function() {
return {
next: function() {
return { done: true };
}
};
}
};
};
module2.exports = function(name) {
var Set2 = getBuiltIn("Set");
try {
new Set2()[name](createSetLike(0));
try {
new Set2()[name](createSetLike(-1));
return false;
} catch (error2) {
return true;
}
} catch (error2) {
return false;
}
};
}
});
// node_modules/core-js/modules/es.set.difference.v2.js
var require_es_set_difference_v2 = __commonJS({
"node_modules/core-js/modules/es.set.difference.v2.js"() {
"use strict";
var $3 = require_export();
var difference = require_set_difference();
var setMethodAcceptSetLike = require_set_method_accept_set_like();
$3({ target: "Set", proto: true, real: true, forced: !setMethodAcceptSetLike("difference") }, {
difference
});
}
});
// node_modules/core-js/internals/set-intersection.js
var require_set_intersection = __commonJS({
"node_modules/core-js/internals/set-intersection.js"(exports2, module2) {
"use strict";
var aSet = require_a_set();
var SetHelpers = require_set_helpers();
var size = require_set_size();
var getSetRecord = require_get_set_record();
var iterateSet = require_set_iterate();
var iterateSimple = require_iterate_simple();
var Set2 = SetHelpers.Set;
var add2 = SetHelpers.add;
var has = SetHelpers.has;
module2.exports = function intersection(other) {
var O4 = aSet(this);
var otherRec = getSetRecord(other);
var result = new Set2();
if (size(O4) > otherRec.size) {
iterateSimple(otherRec.getIterator(), function(e5) {
if (has(O4, e5))
add2(result, e5);
});
} else {
iterateSet(O4, function(e5) {
if (otherRec.includes(e5))
add2(result, e5);
});
}
return result;
};
}
});
// node_modules/core-js/modules/es.set.intersection.v2.js
var require_es_set_intersection_v2 = __commonJS({
"node_modules/core-js/modules/es.set.intersection.v2.js"() {
"use strict";
var $3 = require_export();
var fails = require_fails();
var intersection = require_set_intersection();
var setMethodAcceptSetLike = require_set_method_accept_set_like();
var INCORRECT = !setMethodAcceptSetLike("intersection") || fails(function() {
return String(Array.from((/* @__PURE__ */ new Set([1, 2, 3])).intersection(/* @__PURE__ */ new Set([3, 2])))) !== "3,2";
});
$3({ target: "Set", proto: true, real: true, forced: INCORRECT }, {
intersection
});
}
});
// node_modules/core-js/internals/set-is-disjoint-from.js
var require_set_is_disjoint_from = __commonJS({
"node_modules/core-js/internals/set-is-disjoint-from.js"(exports2, module2) {
"use strict";
var aSet = require_a_set();
var has = require_set_helpers().has;
var size = require_set_size();
var getSetRecord = require_get_set_record();
var iterateSet = require_set_iterate();
var iterateSimple = require_iterate_simple();
var iteratorClose = require_iterator_close();
module2.exports = function isDisjointFrom(other) {
var O4 = aSet(this);
var otherRec = getSetRecord(other);
if (size(O4) <= otherRec.size)
return iterateSet(O4, function(e5) {
if (otherRec.includes(e5))
return false;
}, true) !== false;
var iterator = otherRec.getIterator();
return iterateSimple(iterator, function(e5) {
if (has(O4, e5))
return iteratorClose(iterator, "normal", false);
}) !== false;
};
}
});
// node_modules/core-js/modules/es.set.is-disjoint-from.v2.js
var require_es_set_is_disjoint_from_v2 = __commonJS({
"node_modules/core-js/modules/es.set.is-disjoint-from.v2.js"() {
"use strict";
var $3 = require_export();
var isDisjointFrom = require_set_is_disjoint_from();
var setMethodAcceptSetLike = require_set_method_accept_set_like();
$3({ target: "Set", proto: true, real: true, forced: !setMethodAcceptSetLike("isDisjointFrom") }, {
isDisjointFrom
});
}
});
// node_modules/core-js/internals/set-is-subset-of.js
var require_set_is_subset_of = __commonJS({
"node_modules/core-js/internals/set-is-subset-of.js"(exports2, module2) {
"use strict";
var aSet = require_a_set();
var size = require_set_size();
var iterate = require_set_iterate();
var getSetRecord = require_get_set_record();
module2.exports = function isSubsetOf(other) {
var O4 = aSet(this);
var otherRec = getSetRecord(other);
if (size(O4) > otherRec.size)
return false;
return iterate(O4, function(e5) {
if (!otherRec.includes(e5))
return false;
}, true) !== false;
};
}
});
// node_modules/core-js/modules/es.set.is-subset-of.v2.js
var require_es_set_is_subset_of_v2 = __commonJS({
"node_modules/core-js/modules/es.set.is-subset-of.v2.js"() {
"use strict";
var $3 = require_export();
var isSubsetOf = require_set_is_subset_of();
var setMethodAcceptSetLike = require_set_method_accept_set_like();
$3({ target: "Set", proto: true, real: true, forced: !setMethodAcceptSetLike("isSubsetOf") }, {
isSubsetOf
});
}
});
// node_modules/core-js/internals/set-is-superset-of.js
var require_set_is_superset_of = __commonJS({
"node_modules/core-js/internals/set-is-superset-of.js"(exports2, module2) {
"use strict";
var aSet = require_a_set();
var has = require_set_helpers().has;
var size = require_set_size();
var getSetRecord = require_get_set_record();
var iterateSimple = require_iterate_simple();
var iteratorClose = require_iterator_close();
module2.exports = function isSupersetOf(other) {
var O4 = aSet(this);
var otherRec = getSetRecord(other);
if (size(O4) < otherRec.size)
return false;
var iterator = otherRec.getIterator();
return iterateSimple(iterator, function(e5) {
if (!has(O4, e5))
return iteratorClose(iterator, "normal", false);
}) !== false;
};
}
});
// node_modules/core-js/modules/es.set.is-superset-of.v2.js
var require_es_set_is_superset_of_v2 = __commonJS({
"node_modules/core-js/modules/es.set.is-superset-of.v2.js"() {
"use strict";
var $3 = require_export();
var isSupersetOf = require_set_is_superset_of();
var setMethodAcceptSetLike = require_set_method_accept_set_like();
$3({ target: "Set", proto: true, real: true, forced: !setMethodAcceptSetLike("isSupersetOf") }, {
isSupersetOf
});
}
});
// node_modules/core-js/internals/set-symmetric-difference.js
var require_set_symmetric_difference = __commonJS({
"node_modules/core-js/internals/set-symmetric-difference.js"(exports2, module2) {
"use strict";
var aSet = require_a_set();
var SetHelpers = require_set_helpers();
var clone5 = require_set_clone();
var getSetRecord = require_get_set_record();
var iterateSimple = require_iterate_simple();
var add2 = SetHelpers.add;
var has = SetHelpers.has;
var remove = SetHelpers.remove;
module2.exports = function symmetricDifference(other) {
var O4 = aSet(this);
var keysIter = getSetRecord(other).getIterator();
var result = clone5(O4);
iterateSimple(keysIter, function(e5) {
if (has(O4, e5))
remove(result, e5);
else
add2(result, e5);
});
return result;
};
}
});
// node_modules/core-js/modules/es.set.symmetric-difference.v2.js
var require_es_set_symmetric_difference_v2 = __commonJS({
"node_modules/core-js/modules/es.set.symmetric-difference.v2.js"() {
"use strict";
var $3 = require_export();
var symmetricDifference = require_set_symmetric_difference();
var setMethodAcceptSetLike = require_set_method_accept_set_like();
$3({ target: "Set", proto: true, real: true, forced: !setMethodAcceptSetLike("symmetricDifference") }, {
symmetricDifference
});
}
});
// node_modules/core-js/internals/set-union.js
var require_set_union = __commonJS({
"node_modules/core-js/internals/set-union.js"(exports2, module2) {
"use strict";
var aSet = require_a_set();
var add2 = require_set_helpers().add;
var clone5 = require_set_clone();
var getSetRecord = require_get_set_record();
var iterateSimple = require_iterate_simple();
module2.exports = function union(other) {
var O4 = aSet(this);
var keysIter = getSetRecord(other).getIterator();
var result = clone5(O4);
iterateSimple(keysIter, function(it2) {
add2(result, it2);
});
return result;
};
}
});
// node_modules/core-js/modules/es.set.union.v2.js
var require_es_set_union_v2 = __commonJS({
"node_modules/core-js/modules/es.set.union.v2.js"() {
"use strict";
var $3 = require_export();
var union = require_set_union();
var setMethodAcceptSetLike = require_set_method_accept_set_like();
$3({ target: "Set", proto: true, real: true, forced: !setMethodAcceptSetLike("union") }, {
union
});
}
});
// node_modules/core-js/modules/es.string.at-alternative.js
var require_es_string_at_alternative = __commonJS({
"node_modules/core-js/modules/es.string.at-alternative.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var requireObjectCoercible = require_require_object_coercible();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var toString = require_to_string();
var fails = require_fails();
var charAt = uncurryThis("".charAt);
var FORCED = fails(function() {
return "\u{20BB7}".at(-2) !== "\uD842";
});
$3({ target: "String", proto: true, forced: FORCED }, {
at: function at2(index3) {
var S4 = toString(requireObjectCoercible(this));
var len = S4.length;
var relativeIndex = toIntegerOrInfinity(index3);
var k4 = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
return k4 < 0 || k4 >= len ? void 0 : charAt(S4, k4);
}
});
}
});
// node_modules/core-js/internals/string-multibyte.js
var require_string_multibyte = __commonJS({
"node_modules/core-js/internals/string-multibyte.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var toString = require_to_string();
var requireObjectCoercible = require_require_object_coercible();
var charAt = uncurryThis("".charAt);
var charCodeAt = uncurryThis("".charCodeAt);
var stringSlice = uncurryThis("".slice);
var createMethod = function(CONVERT_TO_STRING) {
return function($this, pos) {
var S4 = toString(requireObjectCoercible($this));
var position = toIntegerOrInfinity(pos);
var size = S4.length;
var first3, second;
if (position < 0 || position >= size)
return CONVERT_TO_STRING ? "" : void 0;
first3 = charCodeAt(S4, position);
return first3 < 55296 || first3 > 56319 || position + 1 === size || (second = charCodeAt(S4, position + 1)) < 56320 || second > 57343 ? CONVERT_TO_STRING ? charAt(S4, position) : first3 : CONVERT_TO_STRING ? stringSlice(S4, position, position + 2) : (first3 - 55296 << 10) + (second - 56320) + 65536;
};
};
module2.exports = {
codeAt: createMethod(false),
charAt: createMethod(true)
};
}
});
// node_modules/core-js/modules/es.string.code-point-at.js
var require_es_string_code_point_at = __commonJS({
"node_modules/core-js/modules/es.string.code-point-at.js"() {
"use strict";
var $3 = require_export();
var codeAt = require_string_multibyte().codeAt;
$3({ target: "String", proto: true }, {
codePointAt: function codePointAt(pos) {
return codeAt(this, pos);
}
});
}
});
// node_modules/core-js/internals/not-a-regexp.js
var require_not_a_regexp = __commonJS({
"node_modules/core-js/internals/not-a-regexp.js"(exports2, module2) {
"use strict";
var isRegExp2 = require_is_regexp();
var $TypeError = TypeError;
module2.exports = function(it2) {
if (isRegExp2(it2)) {
throw new $TypeError("The method doesn't accept regular expressions");
}
return it2;
};
}
});
// node_modules/core-js/internals/correct-is-regexp-logic.js
var require_correct_is_regexp_logic = __commonJS({
"node_modules/core-js/internals/correct-is-regexp-logic.js"(exports2, module2) {
"use strict";
var wellKnownSymbol = require_well_known_symbol();
var MATCH = wellKnownSymbol("match");
module2.exports = function(METHOD_NAME) {
var regexp = /./;
try {
"/./"[METHOD_NAME](regexp);
} catch (error1) {
try {
regexp[MATCH] = false;
return "/./"[METHOD_NAME](regexp);
} catch (error2) {
}
}
return false;
};
}
});
// node_modules/core-js/modules/es.string.ends-with.js
var require_es_string_ends_with = __commonJS({
"node_modules/core-js/modules/es.string.ends-with.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this_clause();
var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
var toLength = require_to_length();
var toString = require_to_string();
var notARegExp = require_not_a_regexp();
var requireObjectCoercible = require_require_object_coercible();
var correctIsRegExpLogic = require_correct_is_regexp_logic();
var IS_PURE = require_is_pure();
var slice = uncurryThis("".slice);
var min2 = Math.min;
var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic("endsWith");
var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function() {
var descriptor = getOwnPropertyDescriptor(String.prototype, "endsWith");
return descriptor && !descriptor.writable;
}();
$3({ target: "String", proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
endsWith: function endsWith(searchString) {
var that = toString(requireObjectCoercible(this));
notARegExp(searchString);
var endPosition = arguments.length > 1 ? arguments[1] : void 0;
var len = that.length;
var end2 = endPosition === void 0 ? len : min2(toLength(endPosition), len);
var search = toString(searchString);
return slice(that, end2 - search.length, end2) === search;
}
});
}
});
// node_modules/core-js/modules/es.string.from-code-point.js
var require_es_string_from_code_point = __commonJS({
"node_modules/core-js/modules/es.string.from-code-point.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var toAbsoluteIndex = require_to_absolute_index();
var $RangeError = RangeError;
var fromCharCode = String.fromCharCode;
var $fromCodePoint = String.fromCodePoint;
var join3 = uncurryThis([].join);
var INCORRECT_LENGTH = !!$fromCodePoint && $fromCodePoint.length !== 1;
$3({ target: "String", stat: true, arity: 1, forced: INCORRECT_LENGTH }, {
fromCodePoint: function fromCodePoint(x4) {
var elements2 = [];
var length = arguments.length;
var i5 = 0;
var code3;
while (length > i5) {
code3 = +arguments[i5++];
if (toAbsoluteIndex(code3, 1114111) !== code3)
throw new $RangeError(code3 + " is not a valid code point");
elements2[i5] = code3 < 65536 ? fromCharCode(code3) : fromCharCode(((code3 -= 65536) >> 10) + 55296, code3 % 1024 + 56320);
}
return join3(elements2, "");
}
});
}
});
// node_modules/core-js/modules/es.string.includes.js
var require_es_string_includes = __commonJS({
"node_modules/core-js/modules/es.string.includes.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var notARegExp = require_not_a_regexp();
var requireObjectCoercible = require_require_object_coercible();
var toString = require_to_string();
var correctIsRegExpLogic = require_correct_is_regexp_logic();
var stringIndexOf = uncurryThis("".indexOf);
$3({ target: "String", proto: true, forced: !correctIsRegExpLogic("includes") }, {
includes: function includes(searchString) {
return !!~stringIndexOf(
toString(requireObjectCoercible(this)),
toString(notARegExp(searchString)),
arguments.length > 1 ? arguments[1] : void 0
);
}
});
}
});
// node_modules/core-js/modules/es.string.is-well-formed.js
var require_es_string_is_well_formed = __commonJS({
"node_modules/core-js/modules/es.string.is-well-formed.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var requireObjectCoercible = require_require_object_coercible();
var toString = require_to_string();
var charCodeAt = uncurryThis("".charCodeAt);
$3({ target: "String", proto: true }, {
isWellFormed: function isWellFormed() {
var S4 = toString(requireObjectCoercible(this));
var length = S4.length;
for (var i5 = 0; i5 < length; i5++) {
var charCode = charCodeAt(S4, i5);
if ((charCode & 63488) !== 55296)
continue;
if (charCode >= 56320 || ++i5 >= length || (charCodeAt(S4, i5) & 64512) !== 56320)
return false;
}
return true;
}
});
}
});
// node_modules/core-js/modules/es.string.iterator.js
var require_es_string_iterator = __commonJS({
"node_modules/core-js/modules/es.string.iterator.js"() {
"use strict";
var charAt = require_string_multibyte().charAt;
var toString = require_to_string();
var InternalStateModule = require_internal_state();
var defineIterator = require_iterator_define();
var createIterResultObject = require_create_iter_result_object();
var STRING_ITERATOR = "String Iterator";
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(STRING_ITERATOR);
defineIterator(String, "String", function(iterated) {
setInternalState(this, {
type: STRING_ITERATOR,
string: toString(iterated),
index: 0
});
}, function next() {
var state = getInternalState(this);
var string = state.string;
var index3 = state.index;
var point;
if (index3 >= string.length)
return createIterResultObject(void 0, true);
point = charAt(string, index3);
state.index += point.length;
return createIterResultObject(point, false);
});
}
});
// node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js
var require_fix_regexp_well_known_symbol_logic = __commonJS({
"node_modules/core-js/internals/fix-regexp-well-known-symbol-logic.js"(exports2, module2) {
"use strict";
require_es_regexp_exec();
var call = require_function_call();
var defineBuiltIn = require_define_built_in();
var regexpExec = require_regexp_exec();
var fails = require_fails();
var wellKnownSymbol = require_well_known_symbol();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var SPECIES = wellKnownSymbol("species");
var RegExpPrototype = RegExp.prototype;
module2.exports = function(KEY, exec, FORCED, SHAM) {
var SYMBOL = wellKnownSymbol(KEY);
var DELEGATES_TO_SYMBOL = !fails(function() {
var O4 = {};
O4[SYMBOL] = function() {
return 7;
};
return ""[KEY](O4) !== 7;
});
var DELEGATES_TO_EXEC = DELEGATES_TO_SYMBOL && !fails(function() {
var execCalled = false;
var re2 = /a/;
if (KEY === "split") {
re2 = {};
re2.constructor = {};
re2.constructor[SPECIES] = function() {
return re2;
};
re2.flags = "";
re2[SYMBOL] = /./[SYMBOL];
}
re2.exec = function() {
execCalled = true;
return null;
};
re2[SYMBOL]("");
return !execCalled;
});
if (!DELEGATES_TO_SYMBOL || !DELEGATES_TO_EXEC || FORCED) {
var nativeRegExpMethod = /./[SYMBOL];
var methods = exec(SYMBOL, ""[KEY], function(nativeMethod, regexp, str, arg2, forceStringMethod) {
var $exec = regexp.exec;
if ($exec === regexpExec || $exec === RegExpPrototype.exec) {
if (DELEGATES_TO_SYMBOL && !forceStringMethod) {
return { done: true, value: call(nativeRegExpMethod, regexp, str, arg2) };
}
return { done: true, value: call(nativeMethod, str, regexp, arg2) };
}
return { done: false };
});
defineBuiltIn(String.prototype, KEY, methods[0]);
defineBuiltIn(RegExpPrototype, SYMBOL, methods[1]);
}
if (SHAM)
createNonEnumerableProperty(RegExpPrototype[SYMBOL], "sham", true);
};
}
});
// node_modules/core-js/internals/advance-string-index.js
var require_advance_string_index = __commonJS({
"node_modules/core-js/internals/advance-string-index.js"(exports2, module2) {
"use strict";
var charAt = require_string_multibyte().charAt;
module2.exports = function(S4, index3, unicode) {
return index3 + (unicode ? charAt(S4, index3).length : 1);
};
}
});
// node_modules/core-js/internals/regexp-exec-abstract.js
var require_regexp_exec_abstract = __commonJS({
"node_modules/core-js/internals/regexp-exec-abstract.js"(exports2, module2) {
"use strict";
var call = require_function_call();
var anObject = require_an_object();
var isCallable = require_is_callable();
var classof = require_classof_raw();
var regexpExec = require_regexp_exec();
var $TypeError = TypeError;
module2.exports = function(R3, S4) {
var exec = R3.exec;
if (isCallable(exec)) {
var result = call(exec, R3, S4);
if (result !== null)
anObject(result);
return result;
}
if (classof(R3) === "RegExp")
return call(regexpExec, R3, S4);
throw new $TypeError("RegExp#exec called on incompatible receiver");
};
}
});
// node_modules/core-js/modules/es.string.match.js
var require_es_string_match = __commonJS({
"node_modules/core-js/modules/es.string.match.js"() {
"use strict";
var call = require_function_call();
var fixRegExpWellKnownSymbolLogic = require_fix_regexp_well_known_symbol_logic();
var anObject = require_an_object();
var isNullOrUndefined = require_is_null_or_undefined();
var toLength = require_to_length();
var toString = require_to_string();
var requireObjectCoercible = require_require_object_coercible();
var getMethod2 = require_get_method();
var advanceStringIndex = require_advance_string_index();
var regExpExec = require_regexp_exec_abstract();
fixRegExpWellKnownSymbolLogic("match", function(MATCH, nativeMatch, maybeCallNative) {
return [
function match3(regexp) {
var O4 = requireObjectCoercible(this);
var matcher = isNullOrUndefined(regexp) ? void 0 : getMethod2(regexp, MATCH);
return matcher ? call(matcher, regexp, O4) : new RegExp(regexp)[MATCH](toString(O4));
},
function(string) {
var rx = anObject(this);
var S4 = toString(string);
var res = maybeCallNative(nativeMatch, rx, S4);
if (res.done)
return res.value;
if (!rx.global)
return regExpExec(rx, S4);
var fullUnicode = rx.unicode;
rx.lastIndex = 0;
var A4 = [];
var n7 = 0;
var result;
while ((result = regExpExec(rx, S4)) !== null) {
var matchStr = toString(result[0]);
A4[n7] = matchStr;
if (matchStr === "")
rx.lastIndex = advanceStringIndex(S4, toLength(rx.lastIndex), fullUnicode);
n7++;
}
return n7 === 0 ? null : A4;
}
];
});
}
});
// node_modules/core-js/modules/es.string.match-all.js
var require_es_string_match_all = __commonJS({
"node_modules/core-js/modules/es.string.match-all.js"() {
"use strict";
var $3 = require_export();
var call = require_function_call();
var uncurryThis = require_function_uncurry_this_clause();
var createIteratorConstructor = require_iterator_create_constructor();
var createIterResultObject = require_create_iter_result_object();
var requireObjectCoercible = require_require_object_coercible();
var toLength = require_to_length();
var toString = require_to_string();
var anObject = require_an_object();
var isNullOrUndefined = require_is_null_or_undefined();
var classof = require_classof_raw();
var isRegExp2 = require_is_regexp();
var getRegExpFlags = require_regexp_get_flags();
var getMethod2 = require_get_method();
var defineBuiltIn = require_define_built_in();
var fails = require_fails();
var wellKnownSymbol = require_well_known_symbol();
var speciesConstructor = require_species_constructor();
var advanceStringIndex = require_advance_string_index();
var regExpExec = require_regexp_exec_abstract();
var InternalStateModule = require_internal_state();
var IS_PURE = require_is_pure();
var MATCH_ALL = wellKnownSymbol("matchAll");
var REGEXP_STRING = "RegExp String";
var REGEXP_STRING_ITERATOR = REGEXP_STRING + " Iterator";
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(REGEXP_STRING_ITERATOR);
var RegExpPrototype = RegExp.prototype;
var $TypeError = TypeError;
var stringIndexOf = uncurryThis("".indexOf);
var nativeMatchAll = uncurryThis("".matchAll);
var WORKS_WITH_NON_GLOBAL_REGEX = !!nativeMatchAll && !fails(function() {
nativeMatchAll("a", /./);
});
var $RegExpStringIterator = createIteratorConstructor(function RegExpStringIterator(regexp, string, $global, fullUnicode) {
setInternalState(this, {
type: REGEXP_STRING_ITERATOR,
regexp,
string,
global: $global,
unicode: fullUnicode,
done: false
});
}, REGEXP_STRING, function next() {
var state = getInternalState(this);
if (state.done)
return createIterResultObject(void 0, true);
var R3 = state.regexp;
var S4 = state.string;
var match3 = regExpExec(R3, S4);
if (match3 === null) {
state.done = true;
return createIterResultObject(void 0, true);
}
if (state.global) {
if (toString(match3[0]) === "")
R3.lastIndex = advanceStringIndex(S4, toLength(R3.lastIndex), state.unicode);
return createIterResultObject(match3, false);
}
state.done = true;
return createIterResultObject(match3, false);
});
var $matchAll = function(string) {
var R3 = anObject(this);
var S4 = toString(string);
var C4 = speciesConstructor(R3, RegExp);
var flags = toString(getRegExpFlags(R3));
var matcher, $global, fullUnicode;
matcher = new C4(C4 === RegExp ? R3.source : R3, flags);
$global = !!~stringIndexOf(flags, "g");
fullUnicode = !!~stringIndexOf(flags, "u");
matcher.lastIndex = toLength(R3.lastIndex);
return new $RegExpStringIterator(matcher, S4, $global, fullUnicode);
};
$3({ target: "String", proto: true, forced: WORKS_WITH_NON_GLOBAL_REGEX }, {
matchAll: function matchAll(regexp) {
var O4 = requireObjectCoercible(this);
var flags, S4, matcher, rx;
if (!isNullOrUndefined(regexp)) {
if (isRegExp2(regexp)) {
flags = toString(requireObjectCoercible(getRegExpFlags(regexp)));
if (!~stringIndexOf(flags, "g"))
throw new $TypeError("`.matchAll` does not allow non-global regexes");
}
if (WORKS_WITH_NON_GLOBAL_REGEX)
return nativeMatchAll(O4, regexp);
matcher = getMethod2(regexp, MATCH_ALL);
if (matcher === void 0 && IS_PURE && classof(regexp) === "RegExp")
matcher = $matchAll;
if (matcher)
return call(matcher, regexp, O4);
} else if (WORKS_WITH_NON_GLOBAL_REGEX)
return nativeMatchAll(O4, regexp);
S4 = toString(O4);
rx = new RegExp(regexp, "g");
return IS_PURE ? call($matchAll, rx, S4) : rx[MATCH_ALL](S4);
}
});
IS_PURE || MATCH_ALL in RegExpPrototype || defineBuiltIn(RegExpPrototype, MATCH_ALL, $matchAll);
}
});
// node_modules/core-js/internals/string-pad-webkit-bug.js
var require_string_pad_webkit_bug = __commonJS({
"node_modules/core-js/internals/string-pad-webkit-bug.js"(exports2, module2) {
"use strict";
var userAgent2 = require_environment_user_agent();
module2.exports = /Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(userAgent2);
}
});
// node_modules/core-js/modules/es.string.pad-end.js
var require_es_string_pad_end = __commonJS({
"node_modules/core-js/modules/es.string.pad-end.js"() {
"use strict";
var $3 = require_export();
var $padEnd = require_string_pad().end;
var WEBKIT_BUG = require_string_pad_webkit_bug();
$3({ target: "String", proto: true, forced: WEBKIT_BUG }, {
padEnd: function padEnd(maxLength) {
return $padEnd(this, maxLength, arguments.length > 1 ? arguments[1] : void 0);
}
});
}
});
// node_modules/core-js/modules/es.string.pad-start.js
var require_es_string_pad_start = __commonJS({
"node_modules/core-js/modules/es.string.pad-start.js"() {
"use strict";
var $3 = require_export();
var $padStart = require_string_pad().start;
var WEBKIT_BUG = require_string_pad_webkit_bug();
$3({ target: "String", proto: true, forced: WEBKIT_BUG }, {
padStart: function padStart2(maxLength) {
return $padStart(this, maxLength, arguments.length > 1 ? arguments[1] : void 0);
}
});
}
});
// node_modules/core-js/modules/es.string.raw.js
var require_es_string_raw = __commonJS({
"node_modules/core-js/modules/es.string.raw.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var toIndexedObject = require_to_indexed_object();
var toObject = require_to_object();
var toString = require_to_string();
var lengthOfArrayLike = require_length_of_array_like();
var push = uncurryThis([].push);
var join3 = uncurryThis([].join);
$3({ target: "String", stat: true }, {
raw: function raw(template) {
var rawTemplate = toIndexedObject(toObject(template).raw);
var literalSegments = lengthOfArrayLike(rawTemplate);
if (!literalSegments)
return "";
var argumentsLength = arguments.length;
var elements2 = [];
var i5 = 0;
while (true) {
push(elements2, toString(rawTemplate[i5++]));
if (i5 === literalSegments)
return join3(elements2, "");
if (i5 < argumentsLength)
push(elements2, toString(arguments[i5]));
}
}
});
}
});
// node_modules/core-js/modules/es.string.repeat.js
var require_es_string_repeat = __commonJS({
"node_modules/core-js/modules/es.string.repeat.js"() {
"use strict";
var $3 = require_export();
var repeat = require_string_repeat();
$3({ target: "String", proto: true }, {
repeat
});
}
});
// node_modules/core-js/internals/get-substitution.js
var require_get_substitution = __commonJS({
"node_modules/core-js/internals/get-substitution.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var toObject = require_to_object();
var floor = Math.floor;
var charAt = uncurryThis("".charAt);
var replace2 = uncurryThis("".replace);
var stringSlice = uncurryThis("".slice);
var SUBSTITUTION_SYMBOLS = /\$([$&'`]|\d{1,2}|<[^>]*>)/g;
var SUBSTITUTION_SYMBOLS_NO_NAMED = /\$([$&'`]|\d{1,2})/g;
module2.exports = function(matched, str, position, captures, namedCaptures, replacement) {
var tailPos = position + matched.length;
var m4 = captures.length;
var symbols = SUBSTITUTION_SYMBOLS_NO_NAMED;
if (namedCaptures !== void 0) {
namedCaptures = toObject(namedCaptures);
symbols = SUBSTITUTION_SYMBOLS;
}
return replace2(replacement, symbols, function(match3, ch) {
var capture;
switch (charAt(ch, 0)) {
case "$":
return "$";
case "&":
return matched;
case "`":
return stringSlice(str, 0, position);
case "'":
return stringSlice(str, tailPos);
case "<":
capture = namedCaptures[stringSlice(ch, 1, -1)];
break;
default:
var n7 = +ch;
if (n7 === 0)
return match3;
if (n7 > m4) {
var f4 = floor(n7 / 10);
if (f4 === 0)
return match3;
if (f4 <= m4)
return captures[f4 - 1] === void 0 ? charAt(ch, 1) : captures[f4 - 1] + charAt(ch, 1);
return match3;
}
capture = captures[n7 - 1];
}
return capture === void 0 ? "" : capture;
});
};
}
});
// node_modules/core-js/modules/es.string.replace.js
var require_es_string_replace = __commonJS({
"node_modules/core-js/modules/es.string.replace.js"() {
"use strict";
var apply2 = require_function_apply();
var call = require_function_call();
var uncurryThis = require_function_uncurry_this();
var fixRegExpWellKnownSymbolLogic = require_fix_regexp_well_known_symbol_logic();
var fails = require_fails();
var anObject = require_an_object();
var isCallable = require_is_callable();
var isNullOrUndefined = require_is_null_or_undefined();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var toLength = require_to_length();
var toString = require_to_string();
var requireObjectCoercible = require_require_object_coercible();
var advanceStringIndex = require_advance_string_index();
var getMethod2 = require_get_method();
var getSubstitution = require_get_substitution();
var regExpExec = require_regexp_exec_abstract();
var wellKnownSymbol = require_well_known_symbol();
var REPLACE = wellKnownSymbol("replace");
var max2 = Math.max;
var min2 = Math.min;
var concat = uncurryThis([].concat);
var push = uncurryThis([].push);
var stringIndexOf = uncurryThis("".indexOf);
var stringSlice = uncurryThis("".slice);
var maybeToString = function(it2) {
return it2 === void 0 ? it2 : String(it2);
};
var REPLACE_KEEPS_$0 = function() {
return "a".replace(/./, "$0") === "$0";
}();
var REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE = function() {
if (/./[REPLACE]) {
return /./[REPLACE]("a", "$0") === "";
}
return false;
}();
var REPLACE_SUPPORTS_NAMED_GROUPS = !fails(function() {
var re2 = /./;
re2.exec = function() {
var result = [];
result.groups = { a: "7" };
return result;
};
return "".replace(re2, "$") !== "7";
});
fixRegExpWellKnownSymbolLogic("replace", function(_3, nativeReplace, maybeCallNative) {
var UNSAFE_SUBSTITUTE = REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE ? "$" : "$0";
return [
function replace2(searchValue, replaceValue) {
var O4 = requireObjectCoercible(this);
var replacer = isNullOrUndefined(searchValue) ? void 0 : getMethod2(searchValue, REPLACE);
return replacer ? call(replacer, searchValue, O4, replaceValue) : call(nativeReplace, toString(O4), searchValue, replaceValue);
},
function(string, replaceValue) {
var rx = anObject(this);
var S4 = toString(string);
if (typeof replaceValue == "string" && stringIndexOf(replaceValue, UNSAFE_SUBSTITUTE) === -1 && stringIndexOf(replaceValue, "$<") === -1) {
var res = maybeCallNative(nativeReplace, rx, S4, replaceValue);
if (res.done)
return res.value;
}
var functionalReplace = isCallable(replaceValue);
if (!functionalReplace)
replaceValue = toString(replaceValue);
var global2 = rx.global;
var fullUnicode;
if (global2) {
fullUnicode = rx.unicode;
rx.lastIndex = 0;
}
var results = [];
var result;
while (true) {
result = regExpExec(rx, S4);
if (result === null)
break;
push(results, result);
if (!global2)
break;
var matchStr = toString(result[0]);
if (matchStr === "")
rx.lastIndex = advanceStringIndex(S4, toLength(rx.lastIndex), fullUnicode);
}
var accumulatedResult = "";
var nextSourcePosition = 0;
for (var i5 = 0; i5 < results.length; i5++) {
result = results[i5];
var matched = toString(result[0]);
var position = max2(min2(toIntegerOrInfinity(result.index), S4.length), 0);
var captures = [];
var replacement;
for (var j4 = 1; j4 < result.length; j4++)
push(captures, maybeToString(result[j4]));
var namedCaptures = result.groups;
if (functionalReplace) {
var replacerArgs = concat([matched], captures, position, S4);
if (namedCaptures !== void 0)
push(replacerArgs, namedCaptures);
replacement = toString(apply2(replaceValue, void 0, replacerArgs));
} else {
replacement = getSubstitution(matched, S4, position, captures, namedCaptures, replaceValue);
}
if (position >= nextSourcePosition) {
accumulatedResult += stringSlice(S4, nextSourcePosition, position) + replacement;
nextSourcePosition = position + matched.length;
}
}
return accumulatedResult + stringSlice(S4, nextSourcePosition);
}
];
}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
}
});
// node_modules/core-js/modules/es.string.replace-all.js
var require_es_string_replace_all = __commonJS({
"node_modules/core-js/modules/es.string.replace-all.js"() {
"use strict";
var $3 = require_export();
var call = require_function_call();
var uncurryThis = require_function_uncurry_this();
var requireObjectCoercible = require_require_object_coercible();
var isCallable = require_is_callable();
var isNullOrUndefined = require_is_null_or_undefined();
var isRegExp2 = require_is_regexp();
var toString = require_to_string();
var getMethod2 = require_get_method();
var getRegExpFlags = require_regexp_get_flags();
var getSubstitution = require_get_substitution();
var wellKnownSymbol = require_well_known_symbol();
var IS_PURE = require_is_pure();
var REPLACE = wellKnownSymbol("replace");
var $TypeError = TypeError;
var indexOf2 = uncurryThis("".indexOf);
var replace2 = uncurryThis("".replace);
var stringSlice = uncurryThis("".slice);
var max2 = Math.max;
$3({ target: "String", proto: true }, {
replaceAll: function replaceAll(searchValue, replaceValue) {
var O4 = requireObjectCoercible(this);
var IS_REG_EXP, flags, replacer, string, searchString, functionalReplace, searchLength, advanceBy, position, replacement;
var endOfLastMatch = 0;
var result = "";
if (!isNullOrUndefined(searchValue)) {
IS_REG_EXP = isRegExp2(searchValue);
if (IS_REG_EXP) {
flags = toString(requireObjectCoercible(getRegExpFlags(searchValue)));
if (!~indexOf2(flags, "g"))
throw new $TypeError("`.replaceAll` does not allow non-global regexes");
}
replacer = getMethod2(searchValue, REPLACE);
if (replacer)
return call(replacer, searchValue, O4, replaceValue);
if (IS_PURE && IS_REG_EXP)
return replace2(toString(O4), searchValue, replaceValue);
}
string = toString(O4);
searchString = toString(searchValue);
functionalReplace = isCallable(replaceValue);
if (!functionalReplace)
replaceValue = toString(replaceValue);
searchLength = searchString.length;
advanceBy = max2(1, searchLength);
position = indexOf2(string, searchString);
while (position !== -1) {
replacement = functionalReplace ? toString(replaceValue(searchString, position, string)) : getSubstitution(searchString, string, position, [], void 0, replaceValue);
result += stringSlice(string, endOfLastMatch, position) + replacement;
endOfLastMatch = position + searchLength;
position = position + advanceBy > string.length ? -1 : indexOf2(string, searchString, position + advanceBy);
}
if (endOfLastMatch < string.length) {
result += stringSlice(string, endOfLastMatch);
}
return result;
}
});
}
});
// node_modules/core-js/modules/es.string.search.js
var require_es_string_search = __commonJS({
"node_modules/core-js/modules/es.string.search.js"() {
"use strict";
var call = require_function_call();
var fixRegExpWellKnownSymbolLogic = require_fix_regexp_well_known_symbol_logic();
var anObject = require_an_object();
var isNullOrUndefined = require_is_null_or_undefined();
var requireObjectCoercible = require_require_object_coercible();
var sameValue = require_same_value();
var toString = require_to_string();
var getMethod2 = require_get_method();
var regExpExec = require_regexp_exec_abstract();
fixRegExpWellKnownSymbolLogic("search", function(SEARCH, nativeSearch, maybeCallNative) {
return [
function search(regexp) {
var O4 = requireObjectCoercible(this);
var searcher = isNullOrUndefined(regexp) ? void 0 : getMethod2(regexp, SEARCH);
return searcher ? call(searcher, regexp, O4) : new RegExp(regexp)[SEARCH](toString(O4));
},
function(string) {
var rx = anObject(this);
var S4 = toString(string);
var res = maybeCallNative(nativeSearch, rx, S4);
if (res.done)
return res.value;
var previousLastIndex = rx.lastIndex;
if (!sameValue(previousLastIndex, 0))
rx.lastIndex = 0;
var result = regExpExec(rx, S4);
if (!sameValue(rx.lastIndex, previousLastIndex))
rx.lastIndex = previousLastIndex;
return result === null ? -1 : result.index;
}
];
});
}
});
// node_modules/core-js/modules/es.string.split.js
var require_es_string_split = __commonJS({
"node_modules/core-js/modules/es.string.split.js"() {
"use strict";
var call = require_function_call();
var uncurryThis = require_function_uncurry_this();
var fixRegExpWellKnownSymbolLogic = require_fix_regexp_well_known_symbol_logic();
var anObject = require_an_object();
var isNullOrUndefined = require_is_null_or_undefined();
var requireObjectCoercible = require_require_object_coercible();
var speciesConstructor = require_species_constructor();
var advanceStringIndex = require_advance_string_index();
var toLength = require_to_length();
var toString = require_to_string();
var getMethod2 = require_get_method();
var regExpExec = require_regexp_exec_abstract();
var stickyHelpers = require_regexp_sticky_helpers();
var fails = require_fails();
var UNSUPPORTED_Y = stickyHelpers.UNSUPPORTED_Y;
var MAX_UINT32 = 4294967295;
var min2 = Math.min;
var push = uncurryThis([].push);
var stringSlice = uncurryThis("".slice);
var SPLIT_WORKS_WITH_OVERWRITTEN_EXEC = !fails(function() {
var re2 = /(?:)/;
var originalExec = re2.exec;
re2.exec = function() {
return originalExec.apply(this, arguments);
};
var result = "ab".split(re2);
return result.length !== 2 || result[0] !== "a" || result[1] !== "b";
});
var BUGGY = "abbc".split(/(b)*/)[1] === "c" || "test".split(/(?:)/, -1).length !== 4 || "ab".split(/(?:ab)*/).length !== 2 || ".".split(/(.?)(.?)/).length !== 4 || ".".split(/()()/).length > 1 || "".split(/.?/).length;
fixRegExpWellKnownSymbolLogic("split", function(SPLIT, nativeSplit, maybeCallNative) {
var internalSplit = "0".split(void 0, 0).length ? function(separator, limit) {
return separator === void 0 && limit === 0 ? [] : call(nativeSplit, this, separator, limit);
} : nativeSplit;
return [
function split3(separator, limit) {
var O4 = requireObjectCoercible(this);
var splitter = isNullOrUndefined(separator) ? void 0 : getMethod2(separator, SPLIT);
return splitter ? call(splitter, separator, O4, limit) : call(internalSplit, toString(O4), separator, limit);
},
function(string, limit) {
var rx = anObject(this);
var S4 = toString(string);
if (!BUGGY) {
var res = maybeCallNative(internalSplit, rx, S4, limit, internalSplit !== nativeSplit);
if (res.done)
return res.value;
}
var C4 = speciesConstructor(rx, RegExp);
var unicodeMatching = rx.unicode;
var flags = (rx.ignoreCase ? "i" : "") + (rx.multiline ? "m" : "") + (rx.unicode ? "u" : "") + (UNSUPPORTED_Y ? "g" : "y");
var splitter = new C4(UNSUPPORTED_Y ? "^(?:" + rx.source + ")" : rx, flags);
var lim2 = limit === void 0 ? MAX_UINT32 : limit >>> 0;
if (lim2 === 0)
return [];
if (S4.length === 0)
return regExpExec(splitter, S4) === null ? [S4] : [];
var p4 = 0;
var q4 = 0;
var A4 = [];
while (q4 < S4.length) {
splitter.lastIndex = UNSUPPORTED_Y ? 0 : q4;
var z4 = regExpExec(splitter, UNSUPPORTED_Y ? stringSlice(S4, q4) : S4);
var e5;
if (z4 === null || (e5 = min2(toLength(splitter.lastIndex + (UNSUPPORTED_Y ? q4 : 0)), S4.length)) === p4) {
q4 = advanceStringIndex(S4, q4, unicodeMatching);
} else {
push(A4, stringSlice(S4, p4, q4));
if (A4.length === lim2)
return A4;
for (var i5 = 1; i5 <= z4.length - 1; i5++) {
push(A4, z4[i5]);
if (A4.length === lim2)
return A4;
}
q4 = p4 = e5;
}
}
push(A4, stringSlice(S4, p4));
return A4;
}
];
}, BUGGY || !SPLIT_WORKS_WITH_OVERWRITTEN_EXEC, UNSUPPORTED_Y);
}
});
// node_modules/core-js/modules/es.string.starts-with.js
var require_es_string_starts_with = __commonJS({
"node_modules/core-js/modules/es.string.starts-with.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this_clause();
var getOwnPropertyDescriptor = require_object_get_own_property_descriptor().f;
var toLength = require_to_length();
var toString = require_to_string();
var notARegExp = require_not_a_regexp();
var requireObjectCoercible = require_require_object_coercible();
var correctIsRegExpLogic = require_correct_is_regexp_logic();
var IS_PURE = require_is_pure();
var stringSlice = uncurryThis("".slice);
var min2 = Math.min;
var CORRECT_IS_REGEXP_LOGIC = correctIsRegExpLogic("startsWith");
var MDN_POLYFILL_BUG = !IS_PURE && !CORRECT_IS_REGEXP_LOGIC && !!function() {
var descriptor = getOwnPropertyDescriptor(String.prototype, "startsWith");
return descriptor && !descriptor.writable;
}();
$3({ target: "String", proto: true, forced: !MDN_POLYFILL_BUG && !CORRECT_IS_REGEXP_LOGIC }, {
startsWith: function startsWith(searchString) {
var that = toString(requireObjectCoercible(this));
notARegExp(searchString);
var index3 = toLength(min2(arguments.length > 1 ? arguments[1] : void 0, that.length));
var search = toString(searchString);
return stringSlice(that, index3, index3 + search.length) === search;
}
});
}
});
// node_modules/core-js/modules/es.string.substr.js
var require_es_string_substr = __commonJS({
"node_modules/core-js/modules/es.string.substr.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var requireObjectCoercible = require_require_object_coercible();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var toString = require_to_string();
var stringSlice = uncurryThis("".slice);
var max2 = Math.max;
var min2 = Math.min;
var FORCED = !"".substr || "ab".substr(-1) !== "b";
$3({ target: "String", proto: true, forced: FORCED }, {
substr: function substr(start3, length) {
var that = toString(requireObjectCoercible(this));
var size = that.length;
var intStart = toIntegerOrInfinity(start3);
var intLength, intEnd;
if (intStart === Infinity)
intStart = 0;
if (intStart < 0)
intStart = max2(size + intStart, 0);
intLength = length === void 0 ? size : toIntegerOrInfinity(length);
if (intLength <= 0 || intLength === Infinity)
return "";
intEnd = min2(intStart + intLength, size);
return intStart >= intEnd ? "" : stringSlice(that, intStart, intEnd);
}
});
}
});
// node_modules/core-js/modules/es.string.to-well-formed.js
var require_es_string_to_well_formed = __commonJS({
"node_modules/core-js/modules/es.string.to-well-formed.js"() {
"use strict";
var $3 = require_export();
var call = require_function_call();
var uncurryThis = require_function_uncurry_this();
var requireObjectCoercible = require_require_object_coercible();
var toString = require_to_string();
var fails = require_fails();
var $Array = Array;
var charAt = uncurryThis("".charAt);
var charCodeAt = uncurryThis("".charCodeAt);
var join3 = uncurryThis([].join);
var $toWellFormed = "".toWellFormed;
var REPLACEMENT_CHARACTER = "\uFFFD";
var TO_STRING_CONVERSION_BUG = $toWellFormed && fails(function() {
return call($toWellFormed, 1) !== "1";
});
$3({ target: "String", proto: true, forced: TO_STRING_CONVERSION_BUG }, {
toWellFormed: function toWellFormed() {
var S4 = toString(requireObjectCoercible(this));
if (TO_STRING_CONVERSION_BUG)
return call($toWellFormed, S4);
var length = S4.length;
var result = $Array(length);
for (var i5 = 0; i5 < length; i5++) {
var charCode = charCodeAt(S4, i5);
if ((charCode & 63488) !== 55296)
result[i5] = charAt(S4, i5);
else if (charCode >= 56320 || i5 + 1 >= length || (charCodeAt(S4, i5 + 1) & 64512) !== 56320)
result[i5] = REPLACEMENT_CHARACTER;
else {
result[i5] = charAt(S4, i5);
result[++i5] = charAt(S4, i5);
}
}
return join3(result, "");
}
});
}
});
// node_modules/core-js/internals/string-trim-forced.js
var require_string_trim_forced = __commonJS({
"node_modules/core-js/internals/string-trim-forced.js"(exports2, module2) {
"use strict";
var PROPER_FUNCTION_NAME = require_function_name().PROPER;
var fails = require_fails();
var whitespaces = require_whitespaces();
var non = "\u200B\x85\u180E";
module2.exports = function(METHOD_NAME) {
return fails(function() {
return !!whitespaces[METHOD_NAME]() || non[METHOD_NAME]() !== non || PROPER_FUNCTION_NAME && whitespaces[METHOD_NAME].name !== METHOD_NAME;
});
};
}
});
// node_modules/core-js/modules/es.string.trim.js
var require_es_string_trim = __commonJS({
"node_modules/core-js/modules/es.string.trim.js"() {
"use strict";
var $3 = require_export();
var $trim = require_string_trim().trim;
var forcedStringTrimMethod = require_string_trim_forced();
$3({ target: "String", proto: true, forced: forcedStringTrimMethod("trim") }, {
trim: function trim() {
return $trim(this);
}
});
}
});
// node_modules/core-js/internals/string-trim-end.js
var require_string_trim_end = __commonJS({
"node_modules/core-js/internals/string-trim-end.js"(exports2, module2) {
"use strict";
var $trimEnd = require_string_trim().end;
var forcedStringTrimMethod = require_string_trim_forced();
module2.exports = forcedStringTrimMethod("trimEnd") ? function trimEnd() {
return $trimEnd(this);
} : "".trimEnd;
}
});
// node_modules/core-js/modules/es.string.trim-right.js
var require_es_string_trim_right = __commonJS({
"node_modules/core-js/modules/es.string.trim-right.js"() {
"use strict";
var $3 = require_export();
var trimEnd = require_string_trim_end();
$3({ target: "String", proto: true, name: "trimEnd", forced: "".trimRight !== trimEnd }, {
trimRight: trimEnd
});
}
});
// node_modules/core-js/modules/es.string.trim-end.js
var require_es_string_trim_end = __commonJS({
"node_modules/core-js/modules/es.string.trim-end.js"() {
"use strict";
require_es_string_trim_right();
var $3 = require_export();
var trimEnd = require_string_trim_end();
$3({ target: "String", proto: true, name: "trimEnd", forced: "".trimEnd !== trimEnd }, {
trimEnd
});
}
});
// node_modules/core-js/internals/string-trim-start.js
var require_string_trim_start = __commonJS({
"node_modules/core-js/internals/string-trim-start.js"(exports2, module2) {
"use strict";
var $trimStart = require_string_trim().start;
var forcedStringTrimMethod = require_string_trim_forced();
module2.exports = forcedStringTrimMethod("trimStart") ? function trimStart() {
return $trimStart(this);
} : "".trimStart;
}
});
// node_modules/core-js/modules/es.string.trim-left.js
var require_es_string_trim_left = __commonJS({
"node_modules/core-js/modules/es.string.trim-left.js"() {
"use strict";
var $3 = require_export();
var trimStart = require_string_trim_start();
$3({ target: "String", proto: true, name: "trimStart", forced: "".trimLeft !== trimStart }, {
trimLeft: trimStart
});
}
});
// node_modules/core-js/modules/es.string.trim-start.js
var require_es_string_trim_start = __commonJS({
"node_modules/core-js/modules/es.string.trim-start.js"() {
"use strict";
require_es_string_trim_left();
var $3 = require_export();
var trimStart = require_string_trim_start();
$3({ target: "String", proto: true, name: "trimStart", forced: "".trimStart !== trimStart }, {
trimStart
});
}
});
// node_modules/core-js/internals/create-html.js
var require_create_html = __commonJS({
"node_modules/core-js/internals/create-html.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var requireObjectCoercible = require_require_object_coercible();
var toString = require_to_string();
var quot = /"/g;
var replace2 = uncurryThis("".replace);
module2.exports = function(string, tag, attribute, value) {
var S4 = toString(requireObjectCoercible(string));
var p1 = "<" + tag;
if (attribute !== "")
p1 += " " + attribute + '="' + replace2(toString(value), quot, """) + '"';
return p1 + ">" + S4 + "" + tag + ">";
};
}
});
// node_modules/core-js/internals/string-html-forced.js
var require_string_html_forced = __commonJS({
"node_modules/core-js/internals/string-html-forced.js"(exports2, module2) {
"use strict";
var fails = require_fails();
module2.exports = function(METHOD_NAME) {
return fails(function() {
var test = ""[METHOD_NAME]('"');
return test !== test.toLowerCase() || test.split('"').length > 3;
});
};
}
});
// node_modules/core-js/modules/es.string.anchor.js
var require_es_string_anchor = __commonJS({
"node_modules/core-js/modules/es.string.anchor.js"() {
"use strict";
var $3 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$3({ target: "String", proto: true, forced: forcedStringHTMLMethod("anchor") }, {
anchor: function anchor(name) {
return createHTML(this, "a", "name", name);
}
});
}
});
// node_modules/core-js/modules/es.string.big.js
var require_es_string_big = __commonJS({
"node_modules/core-js/modules/es.string.big.js"() {
"use strict";
var $3 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$3({ target: "String", proto: true, forced: forcedStringHTMLMethod("big") }, {
big: function big() {
return createHTML(this, "big", "", "");
}
});
}
});
// node_modules/core-js/modules/es.string.blink.js
var require_es_string_blink = __commonJS({
"node_modules/core-js/modules/es.string.blink.js"() {
"use strict";
var $3 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$3({ target: "String", proto: true, forced: forcedStringHTMLMethod("blink") }, {
blink: function blink() {
return createHTML(this, "blink", "", "");
}
});
}
});
// node_modules/core-js/modules/es.string.bold.js
var require_es_string_bold = __commonJS({
"node_modules/core-js/modules/es.string.bold.js"() {
"use strict";
var $3 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$3({ target: "String", proto: true, forced: forcedStringHTMLMethod("bold") }, {
bold: function bold() {
return createHTML(this, "b", "", "");
}
});
}
});
// node_modules/core-js/modules/es.string.fixed.js
var require_es_string_fixed = __commonJS({
"node_modules/core-js/modules/es.string.fixed.js"() {
"use strict";
var $3 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$3({ target: "String", proto: true, forced: forcedStringHTMLMethod("fixed") }, {
fixed: function fixed() {
return createHTML(this, "tt", "", "");
}
});
}
});
// node_modules/core-js/modules/es.string.fontcolor.js
var require_es_string_fontcolor = __commonJS({
"node_modules/core-js/modules/es.string.fontcolor.js"() {
"use strict";
var $3 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$3({ target: "String", proto: true, forced: forcedStringHTMLMethod("fontcolor") }, {
fontcolor: function fontcolor(color2) {
return createHTML(this, "font", "color", color2);
}
});
}
});
// node_modules/core-js/modules/es.string.fontsize.js
var require_es_string_fontsize = __commonJS({
"node_modules/core-js/modules/es.string.fontsize.js"() {
"use strict";
var $3 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$3({ target: "String", proto: true, forced: forcedStringHTMLMethod("fontsize") }, {
fontsize: function fontsize(size) {
return createHTML(this, "font", "size", size);
}
});
}
});
// node_modules/core-js/modules/es.string.italics.js
var require_es_string_italics = __commonJS({
"node_modules/core-js/modules/es.string.italics.js"() {
"use strict";
var $3 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$3({ target: "String", proto: true, forced: forcedStringHTMLMethod("italics") }, {
italics: function italics() {
return createHTML(this, "i", "", "");
}
});
}
});
// node_modules/core-js/modules/es.string.link.js
var require_es_string_link = __commonJS({
"node_modules/core-js/modules/es.string.link.js"() {
"use strict";
var $3 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$3({ target: "String", proto: true, forced: forcedStringHTMLMethod("link") }, {
link: function link(url) {
return createHTML(this, "a", "href", url);
}
});
}
});
// node_modules/core-js/modules/es.string.small.js
var require_es_string_small = __commonJS({
"node_modules/core-js/modules/es.string.small.js"() {
"use strict";
var $3 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$3({ target: "String", proto: true, forced: forcedStringHTMLMethod("small") }, {
small: function small() {
return createHTML(this, "small", "", "");
}
});
}
});
// node_modules/core-js/modules/es.string.strike.js
var require_es_string_strike = __commonJS({
"node_modules/core-js/modules/es.string.strike.js"() {
"use strict";
var $3 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$3({ target: "String", proto: true, forced: forcedStringHTMLMethod("strike") }, {
strike: function strike() {
return createHTML(this, "strike", "", "");
}
});
}
});
// node_modules/core-js/modules/es.string.sub.js
var require_es_string_sub = __commonJS({
"node_modules/core-js/modules/es.string.sub.js"() {
"use strict";
var $3 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$3({ target: "String", proto: true, forced: forcedStringHTMLMethod("sub") }, {
sub: function sub() {
return createHTML(this, "sub", "", "");
}
});
}
});
// node_modules/core-js/modules/es.string.sup.js
var require_es_string_sup = __commonJS({
"node_modules/core-js/modules/es.string.sup.js"() {
"use strict";
var $3 = require_export();
var createHTML = require_create_html();
var forcedStringHTMLMethod = require_string_html_forced();
$3({ target: "String", proto: true, forced: forcedStringHTMLMethod("sup") }, {
sup: function sup() {
return createHTML(this, "sup", "", "");
}
});
}
});
// node_modules/core-js/internals/typed-array-constructors-require-wrappers.js
var require_typed_array_constructors_require_wrappers = __commonJS({
"node_modules/core-js/internals/typed-array-constructors-require-wrappers.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var fails = require_fails();
var checkCorrectnessOfIteration = require_check_correctness_of_iteration();
var NATIVE_ARRAY_BUFFER_VIEWS = require_array_buffer_view_core().NATIVE_ARRAY_BUFFER_VIEWS;
var ArrayBuffer2 = globalThis2.ArrayBuffer;
var Int8Array2 = globalThis2.Int8Array;
module2.exports = !NATIVE_ARRAY_BUFFER_VIEWS || !fails(function() {
Int8Array2(1);
}) || !fails(function() {
new Int8Array2(-1);
}) || !checkCorrectnessOfIteration(function(iterable) {
new Int8Array2();
new Int8Array2(null);
new Int8Array2(1.5);
new Int8Array2(iterable);
}, true) || fails(function() {
return new Int8Array2(new ArrayBuffer2(2), 1, void 0).length !== 1;
});
}
});
// node_modules/core-js/internals/to-offset.js
var require_to_offset = __commonJS({
"node_modules/core-js/internals/to-offset.js"(exports2, module2) {
"use strict";
var toPositiveInteger = require_to_positive_integer();
var $RangeError = RangeError;
module2.exports = function(it2, BYTES) {
var offset3 = toPositiveInteger(it2);
if (offset3 % BYTES)
throw new $RangeError("Wrong offset");
return offset3;
};
}
});
// node_modules/core-js/internals/to-uint8-clamped.js
var require_to_uint8_clamped = __commonJS({
"node_modules/core-js/internals/to-uint8-clamped.js"(exports2, module2) {
"use strict";
var round3 = Math.round;
module2.exports = function(it2) {
var value = round3(it2);
return value < 0 ? 0 : value > 255 ? 255 : value & 255;
};
}
});
// node_modules/core-js/internals/is-big-int-array.js
var require_is_big_int_array = __commonJS({
"node_modules/core-js/internals/is-big-int-array.js"(exports2, module2) {
"use strict";
var classof = require_classof();
module2.exports = function(it2) {
var klass = classof(it2);
return klass === "BigInt64Array" || klass === "BigUint64Array";
};
}
});
// node_modules/core-js/internals/to-big-int.js
var require_to_big_int = __commonJS({
"node_modules/core-js/internals/to-big-int.js"(exports2, module2) {
"use strict";
var toPrimitive = require_to_primitive();
var $TypeError = TypeError;
module2.exports = function(argument) {
var prim = toPrimitive(argument, "number");
if (typeof prim == "number")
throw new $TypeError("Can't convert number to bigint");
return BigInt(prim);
};
}
});
// node_modules/core-js/internals/typed-array-from.js
var require_typed_array_from = __commonJS({
"node_modules/core-js/internals/typed-array-from.js"(exports2, module2) {
"use strict";
var bind3 = require_function_bind_context();
var call = require_function_call();
var aConstructor = require_a_constructor();
var toObject = require_to_object();
var lengthOfArrayLike = require_length_of_array_like();
var getIterator = require_get_iterator();
var getIteratorMethod = require_get_iterator_method();
var isArrayIteratorMethod = require_is_array_iterator_method();
var isBigIntArray = require_is_big_int_array();
var aTypedArrayConstructor = require_array_buffer_view_core().aTypedArrayConstructor;
var toBigInt = require_to_big_int();
module2.exports = function from(source) {
var C4 = aConstructor(this);
var O4 = toObject(source);
var argumentsLength = arguments.length;
var mapfn = argumentsLength > 1 ? arguments[1] : void 0;
var mapping = mapfn !== void 0;
var iteratorMethod = getIteratorMethod(O4);
var i5, length, result, thisIsBigIntArray, value, step, iterator, next;
if (iteratorMethod && !isArrayIteratorMethod(iteratorMethod)) {
iterator = getIterator(O4, iteratorMethod);
next = iterator.next;
O4 = [];
while (!(step = call(next, iterator)).done) {
O4.push(step.value);
}
}
if (mapping && argumentsLength > 2) {
mapfn = bind3(mapfn, arguments[2]);
}
length = lengthOfArrayLike(O4);
result = new (aTypedArrayConstructor(C4))(length);
thisIsBigIntArray = isBigIntArray(result);
for (i5 = 0; length > i5; i5++) {
value = mapping ? mapfn(O4[i5], i5) : O4[i5];
result[i5] = thisIsBigIntArray ? toBigInt(value) : +value;
}
return result;
};
}
});
// node_modules/core-js/internals/typed-array-constructor.js
var require_typed_array_constructor = __commonJS({
"node_modules/core-js/internals/typed-array-constructor.js"(exports2, module2) {
"use strict";
var $3 = require_export();
var globalThis2 = require_global_this();
var call = require_function_call();
var DESCRIPTORS = require_descriptors();
var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require_typed_array_constructors_require_wrappers();
var ArrayBufferViewCore = require_array_buffer_view_core();
var ArrayBufferModule = require_array_buffer();
var anInstance = require_an_instance();
var createPropertyDescriptor = require_create_property_descriptor();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var isIntegralNumber = require_is_integral_number();
var toLength = require_to_length();
var toIndex = require_to_index();
var toOffset = require_to_offset();
var toUint8Clamped = require_to_uint8_clamped();
var toPropertyKey = require_to_property_key();
var hasOwn = require_has_own_property();
var classof = require_classof();
var isObject3 = require_is_object();
var isSymbol = require_is_symbol();
var create = require_object_create();
var isPrototypeOf = require_object_is_prototype_of();
var setPrototypeOf = require_object_set_prototype_of();
var getOwnPropertyNames = require_object_get_own_property_names().f;
var typedArrayFrom = require_typed_array_from();
var forEach2 = require_array_iteration().forEach;
var setSpecies = require_set_species();
var defineBuiltInAccessor = require_define_built_in_accessor();
var definePropertyModule = require_object_define_property();
var getOwnPropertyDescriptorModule = require_object_get_own_property_descriptor();
var arrayFromConstructorAndList = require_array_from_constructor_and_list();
var InternalStateModule = require_internal_state();
var inheritIfRequired = require_inherit_if_required();
var getInternalState = InternalStateModule.get;
var setInternalState = InternalStateModule.set;
var enforceInternalState = InternalStateModule.enforce;
var nativeDefineProperty = definePropertyModule.f;
var nativeGetOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
var RangeError2 = globalThis2.RangeError;
var ArrayBuffer2 = ArrayBufferModule.ArrayBuffer;
var ArrayBufferPrototype = ArrayBuffer2.prototype;
var DataView2 = ArrayBufferModule.DataView;
var NATIVE_ARRAY_BUFFER_VIEWS = ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS;
var TYPED_ARRAY_TAG = ArrayBufferViewCore.TYPED_ARRAY_TAG;
var TypedArray = ArrayBufferViewCore.TypedArray;
var TypedArrayPrototype = ArrayBufferViewCore.TypedArrayPrototype;
var isTypedArray = ArrayBufferViewCore.isTypedArray;
var BYTES_PER_ELEMENT = "BYTES_PER_ELEMENT";
var WRONG_LENGTH = "Wrong length";
var addGetter = function(it2, key) {
defineBuiltInAccessor(it2, key, {
configurable: true,
get: function() {
return getInternalState(this)[key];
}
});
};
var isArrayBuffer = function(it2) {
var klass;
return isPrototypeOf(ArrayBufferPrototype, it2) || (klass = classof(it2)) === "ArrayBuffer" || klass === "SharedArrayBuffer";
};
var isTypedArrayIndex = function(target, key) {
return isTypedArray(target) && !isSymbol(key) && key in target && isIntegralNumber(+key) && key >= 0;
};
var wrappedGetOwnPropertyDescriptor = function getOwnPropertyDescriptor(target, key) {
key = toPropertyKey(key);
return isTypedArrayIndex(target, key) ? createPropertyDescriptor(2, target[key]) : nativeGetOwnPropertyDescriptor(target, key);
};
var wrappedDefineProperty = function defineProperty(target, key, descriptor) {
key = toPropertyKey(key);
if (isTypedArrayIndex(target, key) && isObject3(descriptor) && hasOwn(descriptor, "value") && !hasOwn(descriptor, "get") && !hasOwn(descriptor, "set") && !descriptor.configurable && (!hasOwn(descriptor, "writable") || descriptor.writable) && (!hasOwn(descriptor, "enumerable") || descriptor.enumerable)) {
target[key] = descriptor.value;
return target;
}
return nativeDefineProperty(target, key, descriptor);
};
if (DESCRIPTORS) {
if (!NATIVE_ARRAY_BUFFER_VIEWS) {
getOwnPropertyDescriptorModule.f = wrappedGetOwnPropertyDescriptor;
definePropertyModule.f = wrappedDefineProperty;
addGetter(TypedArrayPrototype, "buffer");
addGetter(TypedArrayPrototype, "byteOffset");
addGetter(TypedArrayPrototype, "byteLength");
addGetter(TypedArrayPrototype, "length");
}
$3({ target: "Object", stat: true, forced: !NATIVE_ARRAY_BUFFER_VIEWS }, {
getOwnPropertyDescriptor: wrappedGetOwnPropertyDescriptor,
defineProperty: wrappedDefineProperty
});
module2.exports = function(TYPE, wrapper, CLAMPED) {
var BYTES = TYPE.match(/\d+/)[0] / 8;
var CONSTRUCTOR_NAME = TYPE + (CLAMPED ? "Clamped" : "") + "Array";
var GETTER = "get" + TYPE;
var SETTER = "set" + TYPE;
var NativeTypedArrayConstructor = globalThis2[CONSTRUCTOR_NAME];
var TypedArrayConstructor = NativeTypedArrayConstructor;
var TypedArrayConstructorPrototype = TypedArrayConstructor && TypedArrayConstructor.prototype;
var exported = {};
var getter = function(that, index3) {
var data = getInternalState(that);
return data.view[GETTER](index3 * BYTES + data.byteOffset, true);
};
var setter = function(that, index3, value) {
var data = getInternalState(that);
data.view[SETTER](index3 * BYTES + data.byteOffset, CLAMPED ? toUint8Clamped(value) : value, true);
};
var addElement = function(that, index3) {
nativeDefineProperty(that, index3, {
get: function() {
return getter(this, index3);
},
set: function(value) {
return setter(this, index3, value);
},
enumerable: true
});
};
if (!NATIVE_ARRAY_BUFFER_VIEWS) {
TypedArrayConstructor = wrapper(function(that, data, offset3, $length) {
anInstance(that, TypedArrayConstructorPrototype);
var index3 = 0;
var byteOffset = 0;
var buffer, byteLength, length;
if (!isObject3(data)) {
length = toIndex(data);
byteLength = length * BYTES;
buffer = new ArrayBuffer2(byteLength);
} else if (isArrayBuffer(data)) {
buffer = data;
byteOffset = toOffset(offset3, BYTES);
var $len = data.byteLength;
if ($length === void 0) {
if ($len % BYTES)
throw new RangeError2(WRONG_LENGTH);
byteLength = $len - byteOffset;
if (byteLength < 0)
throw new RangeError2(WRONG_LENGTH);
} else {
byteLength = toLength($length) * BYTES;
if (byteLength + byteOffset > $len)
throw new RangeError2(WRONG_LENGTH);
}
length = byteLength / BYTES;
} else if (isTypedArray(data)) {
return arrayFromConstructorAndList(TypedArrayConstructor, data);
} else {
return call(typedArrayFrom, TypedArrayConstructor, data);
}
setInternalState(that, {
buffer,
byteOffset,
byteLength,
length,
view: new DataView2(buffer)
});
while (index3 < length)
addElement(that, index3++);
});
if (setPrototypeOf)
setPrototypeOf(TypedArrayConstructor, TypedArray);
TypedArrayConstructorPrototype = TypedArrayConstructor.prototype = create(TypedArrayPrototype);
} else if (TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS) {
TypedArrayConstructor = wrapper(function(dummy, data, typedArrayOffset, $length) {
anInstance(dummy, TypedArrayConstructorPrototype);
return inheritIfRequired(function() {
if (!isObject3(data))
return new NativeTypedArrayConstructor(toIndex(data));
if (isArrayBuffer(data))
return $length !== void 0 ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES), $length) : typedArrayOffset !== void 0 ? new NativeTypedArrayConstructor(data, toOffset(typedArrayOffset, BYTES)) : new NativeTypedArrayConstructor(data);
if (isTypedArray(data))
return arrayFromConstructorAndList(TypedArrayConstructor, data);
return call(typedArrayFrom, TypedArrayConstructor, data);
}(), dummy, TypedArrayConstructor);
});
if (setPrototypeOf)
setPrototypeOf(TypedArrayConstructor, TypedArray);
forEach2(getOwnPropertyNames(NativeTypedArrayConstructor), function(key) {
if (!(key in TypedArrayConstructor)) {
createNonEnumerableProperty(TypedArrayConstructor, key, NativeTypedArrayConstructor[key]);
}
});
TypedArrayConstructor.prototype = TypedArrayConstructorPrototype;
}
if (TypedArrayConstructorPrototype.constructor !== TypedArrayConstructor) {
createNonEnumerableProperty(TypedArrayConstructorPrototype, "constructor", TypedArrayConstructor);
}
enforceInternalState(TypedArrayConstructorPrototype).TypedArrayConstructor = TypedArrayConstructor;
if (TYPED_ARRAY_TAG) {
createNonEnumerableProperty(TypedArrayConstructorPrototype, TYPED_ARRAY_TAG, CONSTRUCTOR_NAME);
}
var FORCED = TypedArrayConstructor !== NativeTypedArrayConstructor;
exported[CONSTRUCTOR_NAME] = TypedArrayConstructor;
$3({ global: true, constructor: true, forced: FORCED, sham: !NATIVE_ARRAY_BUFFER_VIEWS }, exported);
if (!(BYTES_PER_ELEMENT in TypedArrayConstructor)) {
createNonEnumerableProperty(TypedArrayConstructor, BYTES_PER_ELEMENT, BYTES);
}
if (!(BYTES_PER_ELEMENT in TypedArrayConstructorPrototype)) {
createNonEnumerableProperty(TypedArrayConstructorPrototype, BYTES_PER_ELEMENT, BYTES);
}
setSpecies(CONSTRUCTOR_NAME);
};
} else
module2.exports = function() {
};
}
});
// node_modules/core-js/modules/es.typed-array.float32-array.js
var require_es_typed_array_float32_array = __commonJS({
"node_modules/core-js/modules/es.typed-array.float32-array.js"() {
"use strict";
var createTypedArrayConstructor = require_typed_array_constructor();
createTypedArrayConstructor("Float32", function(init3) {
return function Float32Array2(data, byteOffset, length) {
return init3(this, data, byteOffset, length);
};
});
}
});
// node_modules/core-js/modules/es.typed-array.float64-array.js
var require_es_typed_array_float64_array = __commonJS({
"node_modules/core-js/modules/es.typed-array.float64-array.js"() {
"use strict";
var createTypedArrayConstructor = require_typed_array_constructor();
createTypedArrayConstructor("Float64", function(init3) {
return function Float64Array2(data, byteOffset, length) {
return init3(this, data, byteOffset, length);
};
});
}
});
// node_modules/core-js/modules/es.typed-array.int8-array.js
var require_es_typed_array_int8_array = __commonJS({
"node_modules/core-js/modules/es.typed-array.int8-array.js"() {
"use strict";
var createTypedArrayConstructor = require_typed_array_constructor();
createTypedArrayConstructor("Int8", function(init3) {
return function Int8Array2(data, byteOffset, length) {
return init3(this, data, byteOffset, length);
};
});
}
});
// node_modules/core-js/modules/es.typed-array.int16-array.js
var require_es_typed_array_int16_array = __commonJS({
"node_modules/core-js/modules/es.typed-array.int16-array.js"() {
"use strict";
var createTypedArrayConstructor = require_typed_array_constructor();
createTypedArrayConstructor("Int16", function(init3) {
return function Int16Array2(data, byteOffset, length) {
return init3(this, data, byteOffset, length);
};
});
}
});
// node_modules/core-js/modules/es.typed-array.int32-array.js
var require_es_typed_array_int32_array = __commonJS({
"node_modules/core-js/modules/es.typed-array.int32-array.js"() {
"use strict";
var createTypedArrayConstructor = require_typed_array_constructor();
createTypedArrayConstructor("Int32", function(init3) {
return function Int32Array2(data, byteOffset, length) {
return init3(this, data, byteOffset, length);
};
});
}
});
// node_modules/core-js/modules/es.typed-array.uint8-array.js
var require_es_typed_array_uint8_array = __commonJS({
"node_modules/core-js/modules/es.typed-array.uint8-array.js"() {
"use strict";
var createTypedArrayConstructor = require_typed_array_constructor();
createTypedArrayConstructor("Uint8", function(init3) {
return function Uint8Array2(data, byteOffset, length) {
return init3(this, data, byteOffset, length);
};
});
}
});
// node_modules/core-js/modules/es.typed-array.uint8-clamped-array.js
var require_es_typed_array_uint8_clamped_array = __commonJS({
"node_modules/core-js/modules/es.typed-array.uint8-clamped-array.js"() {
"use strict";
var createTypedArrayConstructor = require_typed_array_constructor();
createTypedArrayConstructor("Uint8", function(init3) {
return function Uint8ClampedArray2(data, byteOffset, length) {
return init3(this, data, byteOffset, length);
};
}, true);
}
});
// node_modules/core-js/modules/es.typed-array.uint16-array.js
var require_es_typed_array_uint16_array = __commonJS({
"node_modules/core-js/modules/es.typed-array.uint16-array.js"() {
"use strict";
var createTypedArrayConstructor = require_typed_array_constructor();
createTypedArrayConstructor("Uint16", function(init3) {
return function Uint16Array2(data, byteOffset, length) {
return init3(this, data, byteOffset, length);
};
});
}
});
// node_modules/core-js/modules/es.typed-array.uint32-array.js
var require_es_typed_array_uint32_array = __commonJS({
"node_modules/core-js/modules/es.typed-array.uint32-array.js"() {
"use strict";
var createTypedArrayConstructor = require_typed_array_constructor();
createTypedArrayConstructor("Uint32", function(init3) {
return function Uint32Array2(data, byteOffset, length) {
return init3(this, data, byteOffset, length);
};
});
}
});
// node_modules/core-js/modules/es.typed-array.at.js
var require_es_typed_array_at = __commonJS({
"node_modules/core-js/modules/es.typed-array.at.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var lengthOfArrayLike = require_length_of_array_like();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("at", function at2(index3) {
var O4 = aTypedArray(this);
var len = lengthOfArrayLike(O4);
var relativeIndex = toIntegerOrInfinity(index3);
var k4 = relativeIndex >= 0 ? relativeIndex : len + relativeIndex;
return k4 < 0 || k4 >= len ? void 0 : O4[k4];
});
}
});
// node_modules/core-js/modules/es.typed-array.copy-within.js
var require_es_typed_array_copy_within = __commonJS({
"node_modules/core-js/modules/es.typed-array.copy-within.js"() {
"use strict";
var uncurryThis = require_function_uncurry_this();
var ArrayBufferViewCore = require_array_buffer_view_core();
var $ArrayCopyWithin = require_array_copy_within();
var u$ArrayCopyWithin = uncurryThis($ArrayCopyWithin);
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("copyWithin", function copyWithin(target, start3) {
return u$ArrayCopyWithin(aTypedArray(this), target, start3, arguments.length > 2 ? arguments[2] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.every.js
var require_es_typed_array_every = __commonJS({
"node_modules/core-js/modules/es.typed-array.every.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $every = require_array_iteration().every;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("every", function every(callbackfn) {
return $every(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.fill.js
var require_es_typed_array_fill = __commonJS({
"node_modules/core-js/modules/es.typed-array.fill.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $fill = require_array_fill();
var toBigInt = require_to_big_int();
var classof = require_classof();
var call = require_function_call();
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var slice = uncurryThis("".slice);
var CONVERSION_BUG = fails(function() {
var count = 0;
new Int8Array(2).fill({ valueOf: function() {
return count++;
} });
return count !== 1;
});
exportTypedArrayMethod("fill", function fill(value) {
var length = arguments.length;
aTypedArray(this);
var actualValue = slice(classof(this), 0, 3) === "Big" ? toBigInt(value) : +value;
return call($fill, this, actualValue, length > 1 ? arguments[1] : void 0, length > 2 ? arguments[2] : void 0);
}, CONVERSION_BUG);
}
});
// node_modules/core-js/internals/typed-array-from-same-type-and-list.js
var require_typed_array_from_same_type_and_list = __commonJS({
"node_modules/core-js/internals/typed-array-from-same-type-and-list.js"(exports2, module2) {
"use strict";
var arrayFromConstructorAndList = require_array_from_constructor_and_list();
var getTypedArrayConstructor = require_array_buffer_view_core().getTypedArrayConstructor;
module2.exports = function(instance, list) {
return arrayFromConstructorAndList(getTypedArrayConstructor(instance), list);
};
}
});
// node_modules/core-js/modules/es.typed-array.filter.js
var require_es_typed_array_filter = __commonJS({
"node_modules/core-js/modules/es.typed-array.filter.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $filter = require_array_iteration().filter;
var fromSameTypeAndList = require_typed_array_from_same_type_and_list();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("filter", function filter2(callbackfn) {
var list = $filter(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : void 0);
return fromSameTypeAndList(this, list);
});
}
});
// node_modules/core-js/modules/es.typed-array.find.js
var require_es_typed_array_find = __commonJS({
"node_modules/core-js/modules/es.typed-array.find.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $find = require_array_iteration().find;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("find", function find3(predicate) {
return $find(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.find-index.js
var require_es_typed_array_find_index = __commonJS({
"node_modules/core-js/modules/es.typed-array.find-index.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $findIndex = require_array_iteration().findIndex;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("findIndex", function findIndex2(predicate) {
return $findIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.find-last.js
var require_es_typed_array_find_last = __commonJS({
"node_modules/core-js/modules/es.typed-array.find-last.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $findLast = require_array_iteration_from_last().findLast;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("findLast", function findLast(predicate) {
return $findLast(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.find-last-index.js
var require_es_typed_array_find_last_index = __commonJS({
"node_modules/core-js/modules/es.typed-array.find-last-index.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $findLastIndex = require_array_iteration_from_last().findLastIndex;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("findLastIndex", function findLastIndex(predicate) {
return $findLastIndex(aTypedArray(this), predicate, arguments.length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.for-each.js
var require_es_typed_array_for_each = __commonJS({
"node_modules/core-js/modules/es.typed-array.for-each.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $forEach = require_array_iteration().forEach;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("forEach", function forEach2(callbackfn) {
$forEach(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.from.js
var require_es_typed_array_from = __commonJS({
"node_modules/core-js/modules/es.typed-array.from.js"() {
"use strict";
var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require_typed_array_constructors_require_wrappers();
var exportTypedArrayStaticMethod = require_array_buffer_view_core().exportTypedArrayStaticMethod;
var typedArrayFrom = require_typed_array_from();
exportTypedArrayStaticMethod("from", typedArrayFrom, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS);
}
});
// node_modules/core-js/modules/es.typed-array.includes.js
var require_es_typed_array_includes = __commonJS({
"node_modules/core-js/modules/es.typed-array.includes.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $includes = require_array_includes().includes;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("includes", function includes(searchElement) {
return $includes(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.index-of.js
var require_es_typed_array_index_of = __commonJS({
"node_modules/core-js/modules/es.typed-array.index-of.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $indexOf = require_array_includes().indexOf;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("indexOf", function indexOf2(searchElement) {
return $indexOf(aTypedArray(this), searchElement, arguments.length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.iterator.js
var require_es_typed_array_iterator = __commonJS({
"node_modules/core-js/modules/es.typed-array.iterator.js"() {
"use strict";
var globalThis2 = require_global_this();
var fails = require_fails();
var uncurryThis = require_function_uncurry_this();
var ArrayBufferViewCore = require_array_buffer_view_core();
var ArrayIterators = require_es_array_iterator();
var wellKnownSymbol = require_well_known_symbol();
var ITERATOR = wellKnownSymbol("iterator");
var Uint8Array2 = globalThis2.Uint8Array;
var arrayValues = uncurryThis(ArrayIterators.values);
var arrayKeys = uncurryThis(ArrayIterators.keys);
var arrayEntries = uncurryThis(ArrayIterators.entries);
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var TypedArrayPrototype = Uint8Array2 && Uint8Array2.prototype;
var GENERIC = !fails(function() {
TypedArrayPrototype[ITERATOR].call([1]);
});
var ITERATOR_IS_VALUES = !!TypedArrayPrototype && TypedArrayPrototype.values && TypedArrayPrototype[ITERATOR] === TypedArrayPrototype.values && TypedArrayPrototype.values.name === "values";
var typedArrayValues = function values() {
return arrayValues(aTypedArray(this));
};
exportTypedArrayMethod("entries", function entries() {
return arrayEntries(aTypedArray(this));
}, GENERIC);
exportTypedArrayMethod("keys", function keys2() {
return arrayKeys(aTypedArray(this));
}, GENERIC);
exportTypedArrayMethod("values", typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: "values" });
exportTypedArrayMethod(ITERATOR, typedArrayValues, GENERIC || !ITERATOR_IS_VALUES, { name: "values" });
}
});
// node_modules/core-js/modules/es.typed-array.join.js
var require_es_typed_array_join = __commonJS({
"node_modules/core-js/modules/es.typed-array.join.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var uncurryThis = require_function_uncurry_this();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var $join = uncurryThis([].join);
exportTypedArrayMethod("join", function join3(separator) {
return $join(aTypedArray(this), separator);
});
}
});
// node_modules/core-js/modules/es.typed-array.last-index-of.js
var require_es_typed_array_last_index_of = __commonJS({
"node_modules/core-js/modules/es.typed-array.last-index-of.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var apply2 = require_function_apply();
var $lastIndexOf = require_array_last_index_of();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("lastIndexOf", function lastIndexOf(searchElement) {
var length = arguments.length;
return apply2($lastIndexOf, aTypedArray(this), length > 1 ? [searchElement, arguments[1]] : [searchElement]);
});
}
});
// node_modules/core-js/modules/es.typed-array.map.js
var require_es_typed_array_map = __commonJS({
"node_modules/core-js/modules/es.typed-array.map.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $map = require_array_iteration().map;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("map", function map3(mapfn) {
return $map(aTypedArray(this), mapfn, arguments.length > 1 ? arguments[1] : void 0, function(O4, length) {
return new (getTypedArrayConstructor(O4))(length);
});
});
}
});
// node_modules/core-js/modules/es.typed-array.of.js
var require_es_typed_array_of = __commonJS({
"node_modules/core-js/modules/es.typed-array.of.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS = require_typed_array_constructors_require_wrappers();
var aTypedArrayConstructor = ArrayBufferViewCore.aTypedArrayConstructor;
var exportTypedArrayStaticMethod = ArrayBufferViewCore.exportTypedArrayStaticMethod;
exportTypedArrayStaticMethod("of", function of() {
var index3 = 0;
var length = arguments.length;
var result = new (aTypedArrayConstructor(this))(length);
while (length > index3)
result[index3] = arguments[index3++];
return result;
}, TYPED_ARRAYS_CONSTRUCTORS_REQUIRES_WRAPPERS);
}
});
// node_modules/core-js/modules/es.typed-array.reduce.js
var require_es_typed_array_reduce = __commonJS({
"node_modules/core-js/modules/es.typed-array.reduce.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $reduce = require_array_reduce().left;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("reduce", function reduce(callbackfn) {
var length = arguments.length;
return $reduce(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.reduce-right.js
var require_es_typed_array_reduce_right = __commonJS({
"node_modules/core-js/modules/es.typed-array.reduce-right.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $reduceRight = require_array_reduce().right;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("reduceRight", function reduceRight(callbackfn) {
var length = arguments.length;
return $reduceRight(aTypedArray(this), callbackfn, length, length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.reverse.js
var require_es_typed_array_reverse = __commonJS({
"node_modules/core-js/modules/es.typed-array.reverse.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var floor = Math.floor;
exportTypedArrayMethod("reverse", function reverse() {
var that = this;
var length = aTypedArray(that).length;
var middle = floor(length / 2);
var index3 = 0;
var value;
while (index3 < middle) {
value = that[index3];
that[index3++] = that[--length];
that[length] = value;
}
return that;
});
}
});
// node_modules/core-js/modules/es.typed-array.set.js
var require_es_typed_array_set = __commonJS({
"node_modules/core-js/modules/es.typed-array.set.js"() {
"use strict";
var globalThis2 = require_global_this();
var call = require_function_call();
var ArrayBufferViewCore = require_array_buffer_view_core();
var lengthOfArrayLike = require_length_of_array_like();
var toOffset = require_to_offset();
var toIndexedObject = require_to_object();
var fails = require_fails();
var RangeError2 = globalThis2.RangeError;
var Int8Array2 = globalThis2.Int8Array;
var Int8ArrayPrototype = Int8Array2 && Int8Array2.prototype;
var $set = Int8ArrayPrototype && Int8ArrayPrototype.set;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS = !fails(function() {
var array = new Uint8ClampedArray(2);
call($set, array, { length: 1, 0: 3 }, 1);
return array[1] !== 3;
});
var TO_OBJECT_BUG = WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS && ArrayBufferViewCore.NATIVE_ARRAY_BUFFER_VIEWS && fails(function() {
var array = new Int8Array2(2);
array.set(1);
array.set("2", 1);
return array[0] !== 0 || array[1] !== 2;
});
exportTypedArrayMethod("set", function set2(arrayLike) {
aTypedArray(this);
var offset3 = toOffset(arguments.length > 1 ? arguments[1] : void 0, 1);
var src = toIndexedObject(arrayLike);
if (WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS)
return call($set, this, src, offset3);
var length = this.length;
var len = lengthOfArrayLike(src);
var index3 = 0;
if (len + offset3 > length)
throw new RangeError2("Wrong length");
while (index3 < len)
this[offset3 + index3] = src[index3++];
}, !WORKS_WITH_OBJECTS_AND_GENERIC_ON_TYPED_ARRAYS || TO_OBJECT_BUG);
}
});
// node_modules/core-js/modules/es.typed-array.slice.js
var require_es_typed_array_slice = __commonJS({
"node_modules/core-js/modules/es.typed-array.slice.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var fails = require_fails();
var arraySlice = require_array_slice();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var FORCED = fails(function() {
new Int8Array(1).slice();
});
exportTypedArrayMethod("slice", function slice(start3, end2) {
var list = arraySlice(aTypedArray(this), start3, end2);
var C4 = getTypedArrayConstructor(this);
var index3 = 0;
var length = list.length;
var result = new C4(length);
while (length > index3)
result[index3] = list[index3++];
return result;
}, FORCED);
}
});
// node_modules/core-js/modules/es.typed-array.some.js
var require_es_typed_array_some = __commonJS({
"node_modules/core-js/modules/es.typed-array.some.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var $some = require_array_iteration().some;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("some", function some(callbackfn) {
return $some(aTypedArray(this), callbackfn, arguments.length > 1 ? arguments[1] : void 0);
});
}
});
// node_modules/core-js/modules/es.typed-array.sort.js
var require_es_typed_array_sort = __commonJS({
"node_modules/core-js/modules/es.typed-array.sort.js"() {
"use strict";
var globalThis2 = require_global_this();
var uncurryThis = require_function_uncurry_this_clause();
var fails = require_fails();
var aCallable = require_a_callable();
var internalSort = require_array_sort();
var ArrayBufferViewCore = require_array_buffer_view_core();
var FF = require_environment_ff_version();
var IE_OR_EDGE = require_environment_is_ie_or_edge();
var V8 = require_environment_v8_version();
var WEBKIT = require_environment_webkit_version();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var Uint16Array2 = globalThis2.Uint16Array;
var nativeSort = Uint16Array2 && uncurryThis(Uint16Array2.prototype.sort);
var ACCEPT_INCORRECT_ARGUMENTS = !!nativeSort && !(fails(function() {
nativeSort(new Uint16Array2(2), null);
}) && fails(function() {
nativeSort(new Uint16Array2(2), {});
}));
var STABLE_SORT = !!nativeSort && !fails(function() {
if (V8)
return V8 < 74;
if (FF)
return FF < 67;
if (IE_OR_EDGE)
return true;
if (WEBKIT)
return WEBKIT < 602;
var array = new Uint16Array2(516);
var expected = Array(516);
var index3, mod;
for (index3 = 0; index3 < 516; index3++) {
mod = index3 % 4;
array[index3] = 515 - index3;
expected[index3] = index3 - 2 * mod + 3;
}
nativeSort(array, function(a5, b4) {
return (a5 / 4 | 0) - (b4 / 4 | 0);
});
for (index3 = 0; index3 < 516; index3++) {
if (array[index3] !== expected[index3])
return true;
}
});
var getSortCompare = function(comparefn) {
return function(x4, y4) {
if (comparefn !== void 0)
return +comparefn(x4, y4) || 0;
if (y4 !== y4)
return -1;
if (x4 !== x4)
return 1;
if (x4 === 0 && y4 === 0)
return 1 / x4 > 0 && 1 / y4 < 0 ? 1 : -1;
return x4 > y4;
};
};
exportTypedArrayMethod("sort", function sort2(comparefn) {
if (comparefn !== void 0)
aCallable(comparefn);
if (STABLE_SORT)
return nativeSort(this, comparefn);
return internalSort(aTypedArray(this), getSortCompare(comparefn));
}, !STABLE_SORT || ACCEPT_INCORRECT_ARGUMENTS);
}
});
// node_modules/core-js/modules/es.typed-array.subarray.js
var require_es_typed_array_subarray = __commonJS({
"node_modules/core-js/modules/es.typed-array.subarray.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var toLength = require_to_length();
var toAbsoluteIndex = require_to_absolute_index();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
exportTypedArrayMethod("subarray", function subarray(begin, end2) {
var O4 = aTypedArray(this);
var length = O4.length;
var beginIndex = toAbsoluteIndex(begin, length);
var C4 = getTypedArrayConstructor(O4);
return new C4(
O4.buffer,
O4.byteOffset + beginIndex * O4.BYTES_PER_ELEMENT,
toLength((end2 === void 0 ? length : toAbsoluteIndex(end2, length)) - beginIndex)
);
});
}
});
// node_modules/core-js/modules/es.typed-array.to-locale-string.js
var require_es_typed_array_to_locale_string = __commonJS({
"node_modules/core-js/modules/es.typed-array.to-locale-string.js"() {
"use strict";
var globalThis2 = require_global_this();
var apply2 = require_function_apply();
var ArrayBufferViewCore = require_array_buffer_view_core();
var fails = require_fails();
var arraySlice = require_array_slice();
var Int8Array2 = globalThis2.Int8Array;
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var $toLocaleString = [].toLocaleString;
var TO_LOCALE_STRING_BUG = !!Int8Array2 && fails(function() {
$toLocaleString.call(new Int8Array2(1));
});
var FORCED = fails(function() {
return [1, 2].toLocaleString() !== new Int8Array2([1, 2]).toLocaleString();
}) || !fails(function() {
Int8Array2.prototype.toLocaleString.call([1, 2]);
});
exportTypedArrayMethod("toLocaleString", function toLocaleString() {
return apply2(
$toLocaleString,
TO_LOCALE_STRING_BUG ? arraySlice(aTypedArray(this)) : aTypedArray(this),
arraySlice(arguments)
);
}, FORCED);
}
});
// node_modules/core-js/modules/es.typed-array.to-reversed.js
var require_es_typed_array_to_reversed = __commonJS({
"node_modules/core-js/modules/es.typed-array.to-reversed.js"() {
"use strict";
var arrayToReversed = require_array_to_reversed();
var ArrayBufferViewCore = require_array_buffer_view_core();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
exportTypedArrayMethod("toReversed", function toReversed() {
return arrayToReversed(aTypedArray(this), getTypedArrayConstructor(this));
});
}
});
// node_modules/core-js/modules/es.typed-array.to-sorted.js
var require_es_typed_array_to_sorted = __commonJS({
"node_modules/core-js/modules/es.typed-array.to-sorted.js"() {
"use strict";
var ArrayBufferViewCore = require_array_buffer_view_core();
var uncurryThis = require_function_uncurry_this();
var aCallable = require_a_callable();
var arrayFromConstructorAndList = require_array_from_constructor_and_list();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var sort2 = uncurryThis(ArrayBufferViewCore.TypedArrayPrototype.sort);
exportTypedArrayMethod("toSorted", function toSorted(compareFn) {
if (compareFn !== void 0)
aCallable(compareFn);
var O4 = aTypedArray(this);
var A4 = arrayFromConstructorAndList(getTypedArrayConstructor(O4), O4);
return sort2(A4, compareFn);
});
}
});
// node_modules/core-js/modules/es.typed-array.to-string.js
var require_es_typed_array_to_string = __commonJS({
"node_modules/core-js/modules/es.typed-array.to-string.js"() {
"use strict";
var exportTypedArrayMethod = require_array_buffer_view_core().exportTypedArrayMethod;
var fails = require_fails();
var globalThis2 = require_global_this();
var uncurryThis = require_function_uncurry_this();
var Uint8Array2 = globalThis2.Uint8Array;
var Uint8ArrayPrototype = Uint8Array2 && Uint8Array2.prototype || {};
var arrayToString = [].toString;
var join3 = uncurryThis([].join);
if (fails(function() {
arrayToString.call({});
})) {
arrayToString = function toString() {
return join3(this);
};
}
var IS_NOT_ARRAY_METHOD = Uint8ArrayPrototype.toString !== arrayToString;
exportTypedArrayMethod("toString", arrayToString, IS_NOT_ARRAY_METHOD);
}
});
// node_modules/core-js/modules/es.typed-array.with.js
var require_es_typed_array_with = __commonJS({
"node_modules/core-js/modules/es.typed-array.with.js"() {
"use strict";
var arrayWith = require_array_with();
var ArrayBufferViewCore = require_array_buffer_view_core();
var isBigIntArray = require_is_big_int_array();
var toIntegerOrInfinity = require_to_integer_or_infinity();
var toBigInt = require_to_big_int();
var aTypedArray = ArrayBufferViewCore.aTypedArray;
var getTypedArrayConstructor = ArrayBufferViewCore.getTypedArrayConstructor;
var exportTypedArrayMethod = ArrayBufferViewCore.exportTypedArrayMethod;
var PROPER_ORDER = !!function() {
try {
new Int8Array(1)["with"](2, { valueOf: function() {
throw 8;
} });
} catch (error2) {
return error2 === 8;
}
}();
exportTypedArrayMethod("with", { "with": function(index3, value) {
var O4 = aTypedArray(this);
var relativeIndex = toIntegerOrInfinity(index3);
var actualValue = isBigIntArray(O4) ? toBigInt(value) : +value;
return arrayWith(O4, getTypedArrayConstructor(O4), relativeIndex, actualValue);
} }["with"], !PROPER_ORDER);
}
});
// node_modules/core-js/modules/es.unescape.js
var require_es_unescape = __commonJS({
"node_modules/core-js/modules/es.unescape.js"() {
"use strict";
var $3 = require_export();
var uncurryThis = require_function_uncurry_this();
var toString = require_to_string();
var fromCharCode = String.fromCharCode;
var charAt = uncurryThis("".charAt);
var exec = uncurryThis(/./.exec);
var stringSlice = uncurryThis("".slice);
var hex2 = /^[\da-f]{2}$/i;
var hex4 = /^[\da-f]{4}$/i;
$3({ global: true }, {
unescape: function unescape3(string) {
var str = toString(string);
var result = "";
var length = str.length;
var index3 = 0;
var chr, part;
while (index3 < length) {
chr = charAt(str, index3++);
if (chr === "%") {
if (charAt(str, index3) === "u") {
part = stringSlice(str, index3 + 1, index3 + 5);
if (exec(hex4, part)) {
result += fromCharCode(parseInt(part, 16));
index3 += 5;
continue;
}
} else {
part = stringSlice(str, index3, index3 + 2);
if (exec(hex2, part)) {
result += fromCharCode(parseInt(part, 16));
index3 += 2;
continue;
}
}
}
result += chr;
}
return result;
}
});
}
});
// node_modules/core-js/internals/collection-weak.js
var require_collection_weak = __commonJS({
"node_modules/core-js/internals/collection-weak.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var defineBuiltIns = require_define_built_ins();
var getWeakData = require_internal_metadata().getWeakData;
var anInstance = require_an_instance();
var anObject = require_an_object();
var isNullOrUndefined = require_is_null_or_undefined();
var isObject3 = require_is_object();
var iterate = require_iterate();
var ArrayIterationModule = require_array_iteration();
var hasOwn = require_has_own_property();
var InternalStateModule = require_internal_state();
var setInternalState = InternalStateModule.set;
var internalStateGetterFor = InternalStateModule.getterFor;
var find3 = ArrayIterationModule.find;
var findIndex2 = ArrayIterationModule.findIndex;
var splice = uncurryThis([].splice);
var id = 0;
var uncaughtFrozenStore = function(state) {
return state.frozen || (state.frozen = new UncaughtFrozenStore());
};
var UncaughtFrozenStore = function() {
this.entries = [];
};
var findUncaughtFrozen = function(store, key) {
return find3(store.entries, function(it2) {
return it2[0] === key;
});
};
UncaughtFrozenStore.prototype = {
get: function(key) {
var entry = findUncaughtFrozen(this, key);
if (entry)
return entry[1];
},
has: function(key) {
return !!findUncaughtFrozen(this, key);
},
set: function(key, value) {
var entry = findUncaughtFrozen(this, key);
if (entry)
entry[1] = value;
else
this.entries.push([key, value]);
},
"delete": function(key) {
var index3 = findIndex2(this.entries, function(it2) {
return it2[0] === key;
});
if (~index3)
splice(this.entries, index3, 1);
return !!~index3;
}
};
module2.exports = {
getConstructor: function(wrapper, CONSTRUCTOR_NAME, IS_MAP, ADDER) {
var Constructor = wrapper(function(that, iterable) {
anInstance(that, Prototype);
setInternalState(that, {
type: CONSTRUCTOR_NAME,
id: id++,
frozen: null
});
if (!isNullOrUndefined(iterable))
iterate(iterable, that[ADDER], { that, AS_ENTRIES: IS_MAP });
});
var Prototype = Constructor.prototype;
var getInternalState = internalStateGetterFor(CONSTRUCTOR_NAME);
var define2 = function(that, key, value) {
var state = getInternalState(that);
var data = getWeakData(anObject(key), true);
if (data === true)
uncaughtFrozenStore(state).set(key, value);
else
data[state.id] = value;
return that;
};
defineBuiltIns(Prototype, {
"delete": function(key) {
var state = getInternalState(this);
if (!isObject3(key))
return false;
var data = getWeakData(key);
if (data === true)
return uncaughtFrozenStore(state)["delete"](key);
return data && hasOwn(data, state.id) && delete data[state.id];
},
has: function has(key) {
var state = getInternalState(this);
if (!isObject3(key))
return false;
var data = getWeakData(key);
if (data === true)
return uncaughtFrozenStore(state).has(key);
return data && hasOwn(data, state.id);
}
});
defineBuiltIns(Prototype, IS_MAP ? {
get: function get(key) {
var state = getInternalState(this);
if (isObject3(key)) {
var data = getWeakData(key);
if (data === true)
return uncaughtFrozenStore(state).get(key);
if (data)
return data[state.id];
}
},
set: function set2(key, value) {
return define2(this, key, value);
}
} : {
add: function add2(value) {
return define2(this, value, true);
}
});
return Constructor;
}
};
}
});
// node_modules/core-js/modules/es.weak-map.constructor.js
var require_es_weak_map_constructor = __commonJS({
"node_modules/core-js/modules/es.weak-map.constructor.js"() {
"use strict";
var FREEZING = require_freezing();
var globalThis2 = require_global_this();
var uncurryThis = require_function_uncurry_this();
var defineBuiltIns = require_define_built_ins();
var InternalMetadataModule = require_internal_metadata();
var collection = require_collection();
var collectionWeak = require_collection_weak();
var isObject3 = require_is_object();
var enforceInternalState = require_internal_state().enforce;
var fails = require_fails();
var NATIVE_WEAK_MAP = require_weak_map_basic_detection();
var $Object = Object;
var isArray2 = Array.isArray;
var isExtensible = $Object.isExtensible;
var isFrozen = $Object.isFrozen;
var isSealed = $Object.isSealed;
var freeze = $Object.freeze;
var seal = $Object.seal;
var IS_IE11 = !globalThis2.ActiveXObject && "ActiveXObject" in globalThis2;
var InternalWeakMap;
var wrapper = function(init3) {
return function WeakMap2() {
return init3(this, arguments.length ? arguments[0] : void 0);
};
};
var $WeakMap = collection("WeakMap", wrapper, collectionWeak);
var WeakMapPrototype = $WeakMap.prototype;
var nativeSet = uncurryThis(WeakMapPrototype.set);
var hasMSEdgeFreezingBug = function() {
return FREEZING && fails(function() {
var frozenArray = freeze([]);
nativeSet(new $WeakMap(), frozenArray, 1);
return !isFrozen(frozenArray);
});
};
if (NATIVE_WEAK_MAP) {
if (IS_IE11) {
InternalWeakMap = collectionWeak.getConstructor(wrapper, "WeakMap", true);
InternalMetadataModule.enable();
nativeDelete = uncurryThis(WeakMapPrototype["delete"]);
nativeHas = uncurryThis(WeakMapPrototype.has);
nativeGet = uncurryThis(WeakMapPrototype.get);
defineBuiltIns(WeakMapPrototype, {
"delete": function(key) {
if (isObject3(key) && !isExtensible(key)) {
var state = enforceInternalState(this);
if (!state.frozen)
state.frozen = new InternalWeakMap();
return nativeDelete(this, key) || state.frozen["delete"](key);
}
return nativeDelete(this, key);
},
has: function has(key) {
if (isObject3(key) && !isExtensible(key)) {
var state = enforceInternalState(this);
if (!state.frozen)
state.frozen = new InternalWeakMap();
return nativeHas(this, key) || state.frozen.has(key);
}
return nativeHas(this, key);
},
get: function get(key) {
if (isObject3(key) && !isExtensible(key)) {
var state = enforceInternalState(this);
if (!state.frozen)
state.frozen = new InternalWeakMap();
return nativeHas(this, key) ? nativeGet(this, key) : state.frozen.get(key);
}
return nativeGet(this, key);
},
set: function set2(key, value) {
if (isObject3(key) && !isExtensible(key)) {
var state = enforceInternalState(this);
if (!state.frozen)
state.frozen = new InternalWeakMap();
nativeHas(this, key) ? nativeSet(this, key, value) : state.frozen.set(key, value);
} else
nativeSet(this, key, value);
return this;
}
});
} else if (hasMSEdgeFreezingBug()) {
defineBuiltIns(WeakMapPrototype, {
set: function set2(key, value) {
var arrayIntegrityLevel;
if (isArray2(key)) {
if (isFrozen(key))
arrayIntegrityLevel = freeze;
else if (isSealed(key))
arrayIntegrityLevel = seal;
}
nativeSet(this, key, value);
if (arrayIntegrityLevel)
arrayIntegrityLevel(key);
return this;
}
});
}
}
var nativeDelete;
var nativeHas;
var nativeGet;
}
});
// node_modules/core-js/modules/es.weak-map.js
var require_es_weak_map = __commonJS({
"node_modules/core-js/modules/es.weak-map.js"() {
"use strict";
require_es_weak_map_constructor();
}
});
// node_modules/core-js/modules/es.weak-set.constructor.js
var require_es_weak_set_constructor = __commonJS({
"node_modules/core-js/modules/es.weak-set.constructor.js"() {
"use strict";
var collection = require_collection();
var collectionWeak = require_collection_weak();
collection("WeakSet", function(init3) {
return function WeakSet2() {
return init3(this, arguments.length ? arguments[0] : void 0);
};
}, collectionWeak);
}
});
// node_modules/core-js/modules/es.weak-set.js
var require_es_weak_set = __commonJS({
"node_modules/core-js/modules/es.weak-set.js"() {
"use strict";
require_es_weak_set_constructor();
}
});
// node_modules/core-js/internals/base64-map.js
var require_base64_map = __commonJS({
"node_modules/core-js/internals/base64-map.js"(exports2, module2) {
"use strict";
var commonAlphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
var base64Alphabet = commonAlphabet + "+/";
var base64UrlAlphabet = commonAlphabet + "-_";
var inverse = function(characters) {
var result = {};
var index3 = 0;
for (; index3 < 64; index3++)
result[characters.charAt(index3)] = index3;
return result;
};
module2.exports = {
i2c: base64Alphabet,
c2i: inverse(base64Alphabet),
i2cUrl: base64UrlAlphabet,
c2iUrl: inverse(base64UrlAlphabet)
};
}
});
// node_modules/core-js/modules/web.atob.js
var require_web_atob = __commonJS({
"node_modules/core-js/modules/web.atob.js"() {
"use strict";
var $3 = require_export();
var globalThis2 = require_global_this();
var getBuiltIn = require_get_built_in();
var uncurryThis = require_function_uncurry_this();
var call = require_function_call();
var fails = require_fails();
var toString = require_to_string();
var validateArgumentsLength = require_validate_arguments_length();
var c2i = require_base64_map().c2i;
var disallowed = /[^\d+/a-z]/i;
var whitespaces = /[\t\n\f\r ]+/g;
var finalEq = /[=]{1,2}$/;
var $atob = getBuiltIn("atob");
var fromCharCode = String.fromCharCode;
var charAt = uncurryThis("".charAt);
var replace2 = uncurryThis("".replace);
var exec = uncurryThis(disallowed.exec);
var BASIC = !!$atob && !fails(function() {
return $atob("aGk=") !== "hi";
});
var NO_SPACES_IGNORE = BASIC && fails(function() {
return $atob(" ") !== "";
});
var NO_ENCODING_CHECK = BASIC && !fails(function() {
$atob("a");
});
var NO_ARG_RECEIVING_CHECK = BASIC && !fails(function() {
$atob();
});
var WRONG_ARITY = BASIC && $atob.length !== 1;
var FORCED = !BASIC || NO_SPACES_IGNORE || NO_ENCODING_CHECK || NO_ARG_RECEIVING_CHECK || WRONG_ARITY;
$3({ global: true, bind: true, enumerable: true, forced: FORCED }, {
atob: function atob2(data) {
validateArgumentsLength(arguments.length, 1);
if (BASIC && !NO_SPACES_IGNORE && !NO_ENCODING_CHECK)
return call($atob, globalThis2, data);
var string = replace2(toString(data), whitespaces, "");
var output = "";
var position = 0;
var bc = 0;
var length, chr, bs;
if (string.length % 4 === 0) {
string = replace2(string, finalEq, "");
}
length = string.length;
if (length % 4 === 1 || exec(disallowed, string)) {
throw new (getBuiltIn("DOMException"))("The string is not correctly encoded", "InvalidCharacterError");
}
while (position < length) {
chr = charAt(string, position++);
bs = bc % 4 ? bs * 64 + c2i[chr] : c2i[chr];
if (bc++ % 4)
output += fromCharCode(255 & bs >> (-2 * bc & 6));
}
return output;
}
});
}
});
// node_modules/core-js/modules/web.btoa.js
var require_web_btoa = __commonJS({
"node_modules/core-js/modules/web.btoa.js"() {
"use strict";
var $3 = require_export();
var globalThis2 = require_global_this();
var getBuiltIn = require_get_built_in();
var uncurryThis = require_function_uncurry_this();
var call = require_function_call();
var fails = require_fails();
var toString = require_to_string();
var validateArgumentsLength = require_validate_arguments_length();
var i2c = require_base64_map().i2c;
var $btoa = getBuiltIn("btoa");
var charAt = uncurryThis("".charAt);
var charCodeAt = uncurryThis("".charCodeAt);
var BASIC = !!$btoa && !fails(function() {
return $btoa("hi") !== "aGk=";
});
var NO_ARG_RECEIVING_CHECK = BASIC && !fails(function() {
$btoa();
});
var WRONG_ARG_CONVERSION = BASIC && fails(function() {
return $btoa(null) !== "bnVsbA==";
});
var WRONG_ARITY = BASIC && $btoa.length !== 1;
$3({ global: true, bind: true, enumerable: true, forced: !BASIC || NO_ARG_RECEIVING_CHECK || WRONG_ARG_CONVERSION || WRONG_ARITY }, {
btoa: function btoa2(data) {
validateArgumentsLength(arguments.length, 1);
if (BASIC)
return call($btoa, globalThis2, toString(data));
var string = toString(data);
var output = "";
var position = 0;
var map3 = i2c;
var block, charCode;
while (charAt(string, position) || (map3 = "=", position % 1)) {
charCode = charCodeAt(string, position += 3 / 4);
if (charCode > 255) {
throw new (getBuiltIn("DOMException"))("The string contains characters outside of the Latin1 range", "InvalidCharacterError");
}
block = block << 8 | charCode;
output += charAt(map3, 63 & block >> 8 - position % 1 * 8);
}
return output;
}
});
}
});
// node_modules/core-js/internals/dom-iterables.js
var require_dom_iterables = __commonJS({
"node_modules/core-js/internals/dom-iterables.js"(exports2, module2) {
"use strict";
module2.exports = {
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
};
}
});
// node_modules/core-js/internals/dom-token-list-prototype.js
var require_dom_token_list_prototype = __commonJS({
"node_modules/core-js/internals/dom-token-list-prototype.js"(exports2, module2) {
"use strict";
var documentCreateElement = require_document_create_element();
var classList = documentCreateElement("span").classList;
var DOMTokenListPrototype = classList && classList.constructor && classList.constructor.prototype;
module2.exports = DOMTokenListPrototype === Object.prototype ? void 0 : DOMTokenListPrototype;
}
});
// node_modules/core-js/modules/web.dom-collections.for-each.js
var require_web_dom_collections_for_each = __commonJS({
"node_modules/core-js/modules/web.dom-collections.for-each.js"() {
"use strict";
var globalThis2 = require_global_this();
var DOMIterables = require_dom_iterables();
var DOMTokenListPrototype = require_dom_token_list_prototype();
var forEach2 = require_array_for_each();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var handlePrototype = function(CollectionPrototype) {
if (CollectionPrototype && CollectionPrototype.forEach !== forEach2)
try {
createNonEnumerableProperty(CollectionPrototype, "forEach", forEach2);
} catch (error2) {
CollectionPrototype.forEach = forEach2;
}
};
for (COLLECTION_NAME in DOMIterables) {
if (DOMIterables[COLLECTION_NAME]) {
handlePrototype(globalThis2[COLLECTION_NAME] && globalThis2[COLLECTION_NAME].prototype);
}
}
var COLLECTION_NAME;
handlePrototype(DOMTokenListPrototype);
}
});
// node_modules/core-js/modules/web.dom-collections.iterator.js
var require_web_dom_collections_iterator = __commonJS({
"node_modules/core-js/modules/web.dom-collections.iterator.js"() {
"use strict";
var globalThis2 = require_global_this();
var DOMIterables = require_dom_iterables();
var DOMTokenListPrototype = require_dom_token_list_prototype();
var ArrayIteratorMethods = require_es_array_iterator();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var setToStringTag = require_set_to_string_tag();
var wellKnownSymbol = require_well_known_symbol();
var ITERATOR = wellKnownSymbol("iterator");
var ArrayValues = ArrayIteratorMethods.values;
var handlePrototype = function(CollectionPrototype, COLLECTION_NAME2) {
if (CollectionPrototype) {
if (CollectionPrototype[ITERATOR] !== ArrayValues)
try {
createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
} catch (error2) {
CollectionPrototype[ITERATOR] = ArrayValues;
}
setToStringTag(CollectionPrototype, COLLECTION_NAME2, true);
if (DOMIterables[COLLECTION_NAME2])
for (var METHOD_NAME in ArrayIteratorMethods) {
if (CollectionPrototype[METHOD_NAME] !== ArrayIteratorMethods[METHOD_NAME])
try {
createNonEnumerableProperty(CollectionPrototype, METHOD_NAME, ArrayIteratorMethods[METHOD_NAME]);
} catch (error2) {
CollectionPrototype[METHOD_NAME] = ArrayIteratorMethods[METHOD_NAME];
}
}
}
};
for (COLLECTION_NAME in DOMIterables) {
handlePrototype(globalThis2[COLLECTION_NAME] && globalThis2[COLLECTION_NAME].prototype, COLLECTION_NAME);
}
var COLLECTION_NAME;
handlePrototype(DOMTokenListPrototype, "DOMTokenList");
}
});
// node_modules/core-js/internals/dom-exception-constants.js
var require_dom_exception_constants = __commonJS({
"node_modules/core-js/internals/dom-exception-constants.js"(exports2, module2) {
"use strict";
module2.exports = {
IndexSizeError: { s: "INDEX_SIZE_ERR", c: 1, m: 1 },
DOMStringSizeError: { s: "DOMSTRING_SIZE_ERR", c: 2, m: 0 },
HierarchyRequestError: { s: "HIERARCHY_REQUEST_ERR", c: 3, m: 1 },
WrongDocumentError: { s: "WRONG_DOCUMENT_ERR", c: 4, m: 1 },
InvalidCharacterError: { s: "INVALID_CHARACTER_ERR", c: 5, m: 1 },
NoDataAllowedError: { s: "NO_DATA_ALLOWED_ERR", c: 6, m: 0 },
NoModificationAllowedError: { s: "NO_MODIFICATION_ALLOWED_ERR", c: 7, m: 1 },
NotFoundError: { s: "NOT_FOUND_ERR", c: 8, m: 1 },
NotSupportedError: { s: "NOT_SUPPORTED_ERR", c: 9, m: 1 },
InUseAttributeError: { s: "INUSE_ATTRIBUTE_ERR", c: 10, m: 1 },
InvalidStateError: { s: "INVALID_STATE_ERR", c: 11, m: 1 },
SyntaxError: { s: "SYNTAX_ERR", c: 12, m: 1 },
InvalidModificationError: { s: "INVALID_MODIFICATION_ERR", c: 13, m: 1 },
NamespaceError: { s: "NAMESPACE_ERR", c: 14, m: 1 },
InvalidAccessError: { s: "INVALID_ACCESS_ERR", c: 15, m: 1 },
ValidationError: { s: "VALIDATION_ERR", c: 16, m: 0 },
TypeMismatchError: { s: "TYPE_MISMATCH_ERR", c: 17, m: 1 },
SecurityError: { s: "SECURITY_ERR", c: 18, m: 1 },
NetworkError: { s: "NETWORK_ERR", c: 19, m: 1 },
AbortError: { s: "ABORT_ERR", c: 20, m: 1 },
URLMismatchError: { s: "URL_MISMATCH_ERR", c: 21, m: 1 },
QuotaExceededError: { s: "QUOTA_EXCEEDED_ERR", c: 22, m: 1 },
TimeoutError: { s: "TIMEOUT_ERR", c: 23, m: 1 },
InvalidNodeTypeError: { s: "INVALID_NODE_TYPE_ERR", c: 24, m: 1 },
DataCloneError: { s: "DATA_CLONE_ERR", c: 25, m: 1 }
};
}
});
// node_modules/core-js/modules/web.dom-exception.constructor.js
var require_web_dom_exception_constructor = __commonJS({
"node_modules/core-js/modules/web.dom-exception.constructor.js"() {
"use strict";
var $3 = require_export();
var getBuiltIn = require_get_built_in();
var getBuiltInNodeModule = require_get_built_in_node_module();
var fails = require_fails();
var create = require_object_create();
var createPropertyDescriptor = require_create_property_descriptor();
var defineProperty = require_object_define_property().f;
var defineBuiltIn = require_define_built_in();
var defineBuiltInAccessor = require_define_built_in_accessor();
var hasOwn = require_has_own_property();
var anInstance = require_an_instance();
var anObject = require_an_object();
var errorToString = require_error_to_string();
var normalizeStringArgument = require_normalize_string_argument();
var DOMExceptionConstants = require_dom_exception_constants();
var clearErrorStack = require_error_stack_clear();
var InternalStateModule = require_internal_state();
var DESCRIPTORS = require_descriptors();
var IS_PURE = require_is_pure();
var DOM_EXCEPTION = "DOMException";
var DATA_CLONE_ERR = "DATA_CLONE_ERR";
var Error2 = getBuiltIn("Error");
var NativeDOMException = getBuiltIn(DOM_EXCEPTION) || function() {
try {
var MessageChannel2 = getBuiltIn("MessageChannel") || getBuiltInNodeModule("worker_threads").MessageChannel;
new MessageChannel2().port1.postMessage(/* @__PURE__ */ new WeakMap());
} catch (error2) {
if (error2.name === DATA_CLONE_ERR && error2.code === 25)
return error2.constructor;
}
}();
var NativeDOMExceptionPrototype = NativeDOMException && NativeDOMException.prototype;
var ErrorPrototype = Error2.prototype;
var setInternalState = InternalStateModule.set;
var getInternalState = InternalStateModule.getterFor(DOM_EXCEPTION);
var HAS_STACK = "stack" in new Error2(DOM_EXCEPTION);
var codeFor = function(name) {
return hasOwn(DOMExceptionConstants, name) && DOMExceptionConstants[name].m ? DOMExceptionConstants[name].c : 0;
};
var $DOMException = function DOMException2() {
anInstance(this, DOMExceptionPrototype);
var argumentsLength = arguments.length;
var message = normalizeStringArgument(argumentsLength < 1 ? void 0 : arguments[0]);
var name = normalizeStringArgument(argumentsLength < 2 ? void 0 : arguments[1], "Error");
var code3 = codeFor(name);
setInternalState(this, {
type: DOM_EXCEPTION,
name,
message,
code: code3
});
if (!DESCRIPTORS) {
this.name = name;
this.message = message;
this.code = code3;
}
if (HAS_STACK) {
var error2 = new Error2(message);
error2.name = DOM_EXCEPTION;
defineProperty(this, "stack", createPropertyDescriptor(1, clearErrorStack(error2.stack, 1)));
}
};
var DOMExceptionPrototype = $DOMException.prototype = create(ErrorPrototype);
var createGetterDescriptor = function(get) {
return { enumerable: true, configurable: true, get };
};
var getterFor = function(key2) {
return createGetterDescriptor(function() {
return getInternalState(this)[key2];
});
};
if (DESCRIPTORS) {
defineBuiltInAccessor(DOMExceptionPrototype, "code", getterFor("code"));
defineBuiltInAccessor(DOMExceptionPrototype, "message", getterFor("message"));
defineBuiltInAccessor(DOMExceptionPrototype, "name", getterFor("name"));
}
defineProperty(DOMExceptionPrototype, "constructor", createPropertyDescriptor(1, $DOMException));
var INCORRECT_CONSTRUCTOR = fails(function() {
return !(new NativeDOMException() instanceof Error2);
});
var INCORRECT_TO_STRING = INCORRECT_CONSTRUCTOR || fails(function() {
return ErrorPrototype.toString !== errorToString || String(new NativeDOMException(1, 2)) !== "2: 1";
});
var INCORRECT_CODE = INCORRECT_CONSTRUCTOR || fails(function() {
return new NativeDOMException(1, "DataCloneError").code !== 25;
});
var MISSED_CONSTANTS = INCORRECT_CONSTRUCTOR || NativeDOMException[DATA_CLONE_ERR] !== 25 || NativeDOMExceptionPrototype[DATA_CLONE_ERR] !== 25;
var FORCED_CONSTRUCTOR = IS_PURE ? INCORRECT_TO_STRING || INCORRECT_CODE || MISSED_CONSTANTS : INCORRECT_CONSTRUCTOR;
$3({ global: true, constructor: true, forced: FORCED_CONSTRUCTOR }, {
DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException
});
var PolyfilledDOMException = getBuiltIn(DOM_EXCEPTION);
var PolyfilledDOMExceptionPrototype = PolyfilledDOMException.prototype;
if (INCORRECT_TO_STRING && (IS_PURE || NativeDOMException === PolyfilledDOMException)) {
defineBuiltIn(PolyfilledDOMExceptionPrototype, "toString", errorToString);
}
if (INCORRECT_CODE && DESCRIPTORS && NativeDOMException === PolyfilledDOMException) {
defineBuiltInAccessor(PolyfilledDOMExceptionPrototype, "code", createGetterDescriptor(function() {
return codeFor(anObject(this).name);
}));
}
for (key in DOMExceptionConstants)
if (hasOwn(DOMExceptionConstants, key)) {
constant = DOMExceptionConstants[key];
constantName = constant.s;
descriptor = createPropertyDescriptor(6, constant.c);
if (!hasOwn(PolyfilledDOMException, constantName)) {
defineProperty(PolyfilledDOMException, constantName, descriptor);
}
if (!hasOwn(PolyfilledDOMExceptionPrototype, constantName)) {
defineProperty(PolyfilledDOMExceptionPrototype, constantName, descriptor);
}
}
var constant;
var constantName;
var descriptor;
var key;
}
});
// node_modules/core-js/modules/web.dom-exception.stack.js
var require_web_dom_exception_stack = __commonJS({
"node_modules/core-js/modules/web.dom-exception.stack.js"() {
"use strict";
var $3 = require_export();
var globalThis2 = require_global_this();
var getBuiltIn = require_get_built_in();
var createPropertyDescriptor = require_create_property_descriptor();
var defineProperty = require_object_define_property().f;
var hasOwn = require_has_own_property();
var anInstance = require_an_instance();
var inheritIfRequired = require_inherit_if_required();
var normalizeStringArgument = require_normalize_string_argument();
var DOMExceptionConstants = require_dom_exception_constants();
var clearErrorStack = require_error_stack_clear();
var DESCRIPTORS = require_descriptors();
var IS_PURE = require_is_pure();
var DOM_EXCEPTION = "DOMException";
var Error2 = getBuiltIn("Error");
var NativeDOMException = getBuiltIn(DOM_EXCEPTION);
var $DOMException = function DOMException2() {
anInstance(this, DOMExceptionPrototype);
var argumentsLength = arguments.length;
var message = normalizeStringArgument(argumentsLength < 1 ? void 0 : arguments[0]);
var name = normalizeStringArgument(argumentsLength < 2 ? void 0 : arguments[1], "Error");
var that = new NativeDOMException(message, name);
var error2 = new Error2(message);
error2.name = DOM_EXCEPTION;
defineProperty(that, "stack", createPropertyDescriptor(1, clearErrorStack(error2.stack, 1)));
inheritIfRequired(that, this, $DOMException);
return that;
};
var DOMExceptionPrototype = $DOMException.prototype = NativeDOMException.prototype;
var ERROR_HAS_STACK = "stack" in new Error2(DOM_EXCEPTION);
var DOM_EXCEPTION_HAS_STACK = "stack" in new NativeDOMException(1, 2);
var descriptor = NativeDOMException && DESCRIPTORS && Object.getOwnPropertyDescriptor(globalThis2, DOM_EXCEPTION);
var BUGGY_DESCRIPTOR = !!descriptor && !(descriptor.writable && descriptor.configurable);
var FORCED_CONSTRUCTOR = ERROR_HAS_STACK && !BUGGY_DESCRIPTOR && !DOM_EXCEPTION_HAS_STACK;
$3({ global: true, constructor: true, forced: IS_PURE || FORCED_CONSTRUCTOR }, {
DOMException: FORCED_CONSTRUCTOR ? $DOMException : NativeDOMException
});
var PolyfilledDOMException = getBuiltIn(DOM_EXCEPTION);
var PolyfilledDOMExceptionPrototype = PolyfilledDOMException.prototype;
if (PolyfilledDOMExceptionPrototype.constructor !== PolyfilledDOMException) {
if (!IS_PURE) {
defineProperty(PolyfilledDOMExceptionPrototype, "constructor", createPropertyDescriptor(1, PolyfilledDOMException));
}
for (key in DOMExceptionConstants)
if (hasOwn(DOMExceptionConstants, key)) {
constant = DOMExceptionConstants[key];
constantName = constant.s;
if (!hasOwn(PolyfilledDOMException, constantName)) {
defineProperty(PolyfilledDOMException, constantName, createPropertyDescriptor(6, constant.c));
}
}
}
var constant;
var constantName;
var key;
}
});
// node_modules/core-js/modules/web.dom-exception.to-string-tag.js
var require_web_dom_exception_to_string_tag = __commonJS({
"node_modules/core-js/modules/web.dom-exception.to-string-tag.js"() {
"use strict";
var getBuiltIn = require_get_built_in();
var setToStringTag = require_set_to_string_tag();
var DOM_EXCEPTION = "DOMException";
setToStringTag(getBuiltIn(DOM_EXCEPTION), DOM_EXCEPTION);
}
});
// node_modules/core-js/modules/web.clear-immediate.js
var require_web_clear_immediate = __commonJS({
"node_modules/core-js/modules/web.clear-immediate.js"() {
"use strict";
var $3 = require_export();
var globalThis2 = require_global_this();
var clearImmediate = require_task().clear;
$3({ global: true, bind: true, enumerable: true, forced: globalThis2.clearImmediate !== clearImmediate }, {
clearImmediate
});
}
});
// node_modules/core-js/internals/schedulers-fix.js
var require_schedulers_fix = __commonJS({
"node_modules/core-js/internals/schedulers-fix.js"(exports2, module2) {
"use strict";
var globalThis2 = require_global_this();
var apply2 = require_function_apply();
var isCallable = require_is_callable();
var ENVIRONMENT = require_environment();
var USER_AGENT = require_environment_user_agent();
var arraySlice = require_array_slice();
var validateArgumentsLength = require_validate_arguments_length();
var Function2 = globalThis2.Function;
var WRAP = /MSIE .\./.test(USER_AGENT) || ENVIRONMENT === "BUN" && function() {
var version4 = globalThis2.Bun.version.split(".");
return version4.length < 3 || version4[0] === "0" && (version4[1] < 3 || version4[1] === "3" && version4[2] === "0");
}();
module2.exports = function(scheduler, hasTimeArg) {
var firstParamIndex = hasTimeArg ? 2 : 1;
return WRAP ? function(handler, timeout) {
var boundArgs = validateArgumentsLength(arguments.length, 1) > firstParamIndex;
var fn3 = isCallable(handler) ? handler : Function2(handler);
var params = boundArgs ? arraySlice(arguments, firstParamIndex) : [];
var callback2 = boundArgs ? function() {
apply2(fn3, this, params);
} : fn3;
return hasTimeArg ? scheduler(callback2, timeout) : scheduler(callback2);
} : scheduler;
};
}
});
// node_modules/core-js/modules/web.set-immediate.js
var require_web_set_immediate = __commonJS({
"node_modules/core-js/modules/web.set-immediate.js"() {
"use strict";
var $3 = require_export();
var globalThis2 = require_global_this();
var setTask = require_task().set;
var schedulersFix = require_schedulers_fix();
var setImmediate = globalThis2.setImmediate ? schedulersFix(setTask, false) : setTask;
$3({ global: true, bind: true, enumerable: true, forced: globalThis2.setImmediate !== setImmediate }, {
setImmediate
});
}
});
// node_modules/core-js/modules/web.immediate.js
var require_web_immediate = __commonJS({
"node_modules/core-js/modules/web.immediate.js"() {
"use strict";
require_web_clear_immediate();
require_web_set_immediate();
}
});
// node_modules/core-js/modules/web.queue-microtask.js
var require_web_queue_microtask = __commonJS({
"node_modules/core-js/modules/web.queue-microtask.js"() {
"use strict";
var $3 = require_export();
var globalThis2 = require_global_this();
var microtask = require_microtask();
var aCallable = require_a_callable();
var validateArgumentsLength = require_validate_arguments_length();
var fails = require_fails();
var DESCRIPTORS = require_descriptors();
var WRONG_ARITY = fails(function() {
return DESCRIPTORS && Object.getOwnPropertyDescriptor(globalThis2, "queueMicrotask").value.length !== 1;
});
$3({ global: true, enumerable: true, dontCallGetSet: true, forced: WRONG_ARITY }, {
queueMicrotask: function queueMicrotask(fn3) {
validateArgumentsLength(arguments.length, 1);
microtask(aCallable(fn3));
}
});
}
});
// node_modules/core-js/modules/web.self.js
var require_web_self = __commonJS({
"node_modules/core-js/modules/web.self.js"() {
"use strict";
var $3 = require_export();
var globalThis2 = require_global_this();
var defineBuiltInAccessor = require_define_built_in_accessor();
var DESCRIPTORS = require_descriptors();
var $TypeError = TypeError;
var defineProperty = Object.defineProperty;
var INCORRECT_VALUE = globalThis2.self !== globalThis2;
try {
if (DESCRIPTORS) {
descriptor = Object.getOwnPropertyDescriptor(globalThis2, "self");
if (INCORRECT_VALUE || !descriptor || !descriptor.get || !descriptor.enumerable) {
defineBuiltInAccessor(globalThis2, "self", {
get: function self2() {
return globalThis2;
},
set: function self2(value) {
if (this !== globalThis2)
throw new $TypeError("Illegal invocation");
defineProperty(globalThis2, "self", {
value,
writable: true,
configurable: true,
enumerable: true
});
},
configurable: true,
enumerable: true
});
}
} else
$3({ global: true, simple: true, forced: INCORRECT_VALUE }, {
self: globalThis2
});
} catch (error2) {
}
var descriptor;
}
});
// node_modules/core-js/modules/web.structured-clone.js
var require_web_structured_clone = __commonJS({
"node_modules/core-js/modules/web.structured-clone.js"() {
"use strict";
var IS_PURE = require_is_pure();
var $3 = require_export();
var globalThis2 = require_global_this();
var getBuiltIn = require_get_built_in();
var uncurryThis = require_function_uncurry_this();
var fails = require_fails();
var uid2 = require_uid();
var isCallable = require_is_callable();
var isConstructor = require_is_constructor();
var isNullOrUndefined = require_is_null_or_undefined();
var isObject3 = require_is_object();
var isSymbol = require_is_symbol();
var iterate = require_iterate();
var anObject = require_an_object();
var classof = require_classof();
var hasOwn = require_has_own_property();
var createProperty = require_create_property();
var createNonEnumerableProperty = require_create_non_enumerable_property();
var lengthOfArrayLike = require_length_of_array_like();
var validateArgumentsLength = require_validate_arguments_length();
var getRegExpFlags = require_regexp_get_flags();
var MapHelpers = require_map_helpers();
var SetHelpers = require_set_helpers();
var setIterate = require_set_iterate();
var detachTransferable = require_detach_transferable();
var ERROR_STACK_INSTALLABLE = require_error_stack_installable();
var PROPER_STRUCTURED_CLONE_TRANSFER = require_structured_clone_proper_transfer();
var Object2 = globalThis2.Object;
var Array2 = globalThis2.Array;
var Date2 = globalThis2.Date;
var Error2 = globalThis2.Error;
var TypeError2 = globalThis2.TypeError;
var PerformanceMark = globalThis2.PerformanceMark;
var DOMException2 = getBuiltIn("DOMException");
var Map2 = MapHelpers.Map;
var mapHas = MapHelpers.has;
var mapGet = MapHelpers.get;
var mapSet = MapHelpers.set;
var Set2 = SetHelpers.Set;
var setAdd = SetHelpers.add;
var setHas = SetHelpers.has;
var objectKeys = getBuiltIn("Object", "keys");
var push = uncurryThis([].push);
var thisBooleanValue = uncurryThis(true.valueOf);
var thisNumberValue = uncurryThis(1 .valueOf);
var thisStringValue = uncurryThis("".valueOf);
var thisTimeValue = uncurryThis(Date2.prototype.getTime);
var PERFORMANCE_MARK = uid2("structuredClone");
var DATA_CLONE_ERROR = "DataCloneError";
var TRANSFERRING = "Transferring";
var checkBasicSemantic = function(structuredCloneImplementation) {
return !fails(function() {
var set1 = new globalThis2.Set([7]);
var set2 = structuredCloneImplementation(set1);
var number = structuredCloneImplementation(Object2(7));
return set2 === set1 || !set2.has(7) || !isObject3(number) || +number !== 7;
}) && structuredCloneImplementation;
};
var checkErrorsCloning = function(structuredCloneImplementation, $Error) {
return !fails(function() {
var error2 = new $Error();
var test = structuredCloneImplementation({ a: error2, b: error2 });
return !(test && test.a === test.b && test.a instanceof $Error && test.a.stack === error2.stack);
});
};
var checkNewErrorsCloningSemantic = function(structuredCloneImplementation) {
return !fails(function() {
var test = structuredCloneImplementation(new globalThis2.AggregateError([1], PERFORMANCE_MARK, { cause: 3 }));
return test.name !== "AggregateError" || test.errors[0] !== 1 || test.message !== PERFORMANCE_MARK || test.cause !== 3;
});
};
var nativeStructuredClone = globalThis2.structuredClone;
var FORCED_REPLACEMENT = IS_PURE || !checkErrorsCloning(nativeStructuredClone, Error2) || !checkErrorsCloning(nativeStructuredClone, DOMException2) || !checkNewErrorsCloningSemantic(nativeStructuredClone);
var structuredCloneFromMark = !nativeStructuredClone && checkBasicSemantic(function(value) {
return new PerformanceMark(PERFORMANCE_MARK, { detail: value }).detail;
});
var nativeRestrictedStructuredClone = checkBasicSemantic(nativeStructuredClone) || structuredCloneFromMark;
var throwUncloneable = function(type) {
throw new DOMException2("Uncloneable type: " + type, DATA_CLONE_ERROR);
};
var throwUnpolyfillable = function(type, action) {
throw new DOMException2((action || "Cloning") + " of " + type + " cannot be properly polyfilled in this engine", DATA_CLONE_ERROR);
};
var tryNativeRestrictedStructuredClone = function(value, type) {
if (!nativeRestrictedStructuredClone)
throwUnpolyfillable(type);
return nativeRestrictedStructuredClone(value);
};
var createDataTransfer = function() {
var dataTransfer;
try {
dataTransfer = new globalThis2.DataTransfer();
} catch (error2) {
try {
dataTransfer = new globalThis2.ClipboardEvent("").clipboardData;
} catch (error22) {
}
}
return dataTransfer && dataTransfer.items && dataTransfer.files ? dataTransfer : null;
};
var cloneBuffer = function(value, map3, $type) {
if (mapHas(map3, value))
return mapGet(map3, value);
var type = $type || classof(value);
var clone5, length, options, source, target, i5;
if (type === "SharedArrayBuffer") {
if (nativeRestrictedStructuredClone)
clone5 = nativeRestrictedStructuredClone(value);
else
clone5 = value;
} else {
var DataView2 = globalThis2.DataView;
if (!DataView2 && !isCallable(value.slice))
throwUnpolyfillable("ArrayBuffer");
try {
if (isCallable(value.slice) && !value.resizable) {
clone5 = value.slice(0);
} else {
length = value.byteLength;
options = "maxByteLength" in value ? { maxByteLength: value.maxByteLength } : void 0;
clone5 = new ArrayBuffer(length, options);
source = new DataView2(value);
target = new DataView2(clone5);
for (i5 = 0; i5 < length; i5++) {
target.setUint8(i5, source.getUint8(i5));
}
}
} catch (error2) {
throw new DOMException2("ArrayBuffer is detached", DATA_CLONE_ERROR);
}
}
mapSet(map3, value, clone5);
return clone5;
};
var cloneView = function(value, type, offset3, length, map3) {
var C4 = globalThis2[type];
if (!isObject3(C4))
throwUnpolyfillable(type);
return new C4(cloneBuffer(value.buffer, map3), offset3, length);
};
var structuredCloneInternal = function(value, map3) {
if (isSymbol(value))
throwUncloneable("Symbol");
if (!isObject3(value))
return value;
if (map3) {
if (mapHas(map3, value))
return mapGet(map3, value);
} else
map3 = new Map2();
var type = classof(value);
var C4, name, cloned, dataTransfer, i5, length, keys2, key;
switch (type) {
case "Array":
cloned = Array2(lengthOfArrayLike(value));
break;
case "Object":
cloned = {};
break;
case "Map":
cloned = new Map2();
break;
case "Set":
cloned = new Set2();
break;
case "RegExp":
cloned = new RegExp(value.source, getRegExpFlags(value));
break;
case "Error":
name = value.name;
switch (name) {
case "AggregateError":
cloned = new (getBuiltIn(name))([]);
break;
case "EvalError":
case "RangeError":
case "ReferenceError":
case "SuppressedError":
case "SyntaxError":
case "TypeError":
case "URIError":
cloned = new (getBuiltIn(name))();
break;
case "CompileError":
case "LinkError":
case "RuntimeError":
cloned = new (getBuiltIn("WebAssembly", name))();
break;
default:
cloned = new Error2();
}
break;
case "DOMException":
cloned = new DOMException2(value.message, value.name);
break;
case "ArrayBuffer":
case "SharedArrayBuffer":
cloned = cloneBuffer(value, map3, type);
break;
case "DataView":
case "Int8Array":
case "Uint8Array":
case "Uint8ClampedArray":
case "Int16Array":
case "Uint16Array":
case "Int32Array":
case "Uint32Array":
case "Float16Array":
case "Float32Array":
case "Float64Array":
case "BigInt64Array":
case "BigUint64Array":
length = type === "DataView" ? value.byteLength : value.length;
cloned = cloneView(value, type, value.byteOffset, length, map3);
break;
case "DOMQuad":
try {
cloned = new DOMQuad(
structuredCloneInternal(value.p1, map3),
structuredCloneInternal(value.p2, map3),
structuredCloneInternal(value.p3, map3),
structuredCloneInternal(value.p4, map3)
);
} catch (error2) {
cloned = tryNativeRestrictedStructuredClone(value, type);
}
break;
case "File":
if (nativeRestrictedStructuredClone)
try {
cloned = nativeRestrictedStructuredClone(value);
if (classof(cloned) !== type)
cloned = void 0;
} catch (error2) {
}
if (!cloned)
try {
cloned = new File([value], value.name, value);
} catch (error2) {
}
if (!cloned)
throwUnpolyfillable(type);
break;
case "FileList":
dataTransfer = createDataTransfer();
if (dataTransfer) {
for (i5 = 0, length = lengthOfArrayLike(value); i5 < length; i5++) {
dataTransfer.items.add(structuredCloneInternal(value[i5], map3));
}
cloned = dataTransfer.files;
} else
cloned = tryNativeRestrictedStructuredClone(value, type);
break;
case "ImageData":
try {
cloned = new ImageData(
structuredCloneInternal(value.data, map3),
value.width,
value.height,
{ colorSpace: value.colorSpace }
);
} catch (error2) {
cloned = tryNativeRestrictedStructuredClone(value, type);
}
break;
default:
if (nativeRestrictedStructuredClone) {
cloned = nativeRestrictedStructuredClone(value);
} else
switch (type) {
case "BigInt":
cloned = Object2(value.valueOf());
break;
case "Boolean":
cloned = Object2(thisBooleanValue(value));
break;
case "Number":
cloned = Object2(thisNumberValue(value));
break;
case "String":
cloned = Object2(thisStringValue(value));
break;
case "Date":
cloned = new Date2(thisTimeValue(value));
break;
case "Blob":
try {
cloned = value.slice(0, value.size, value.type);
} catch (error2) {
throwUnpolyfillable(type);
}
break;
case "DOMPoint":
case "DOMPointReadOnly":
C4 = globalThis2[type];
try {
cloned = C4.fromPoint ? C4.fromPoint(value) : new C4(value.x, value.y, value.z, value.w);
} catch (error2) {
throwUnpolyfillable(type);
}
break;
case "DOMRect":
case "DOMRectReadOnly":
C4 = globalThis2[type];
try {
cloned = C4.fromRect ? C4.fromRect(value) : new C4(value.x, value.y, value.width, value.height);
} catch (error2) {
throwUnpolyfillable(type);
}
break;
case "DOMMatrix":
case "DOMMatrixReadOnly":
C4 = globalThis2[type];
try {
cloned = C4.fromMatrix ? C4.fromMatrix(value) : new C4(value);
} catch (error2) {
throwUnpolyfillable(type);
}
break;
case "AudioData":
case "VideoFrame":
if (!isCallable(value.clone))
throwUnpolyfillable(type);
try {
cloned = value.clone();
} catch (error2) {
throwUncloneable(type);
}
break;
case "CropTarget":
case "CryptoKey":
case "FileSystemDirectoryHandle":
case "FileSystemFileHandle":
case "FileSystemHandle":
case "GPUCompilationInfo":
case "GPUCompilationMessage":
case "ImageBitmap":
case "RTCCertificate":
case "WebAssembly.Module":
throwUnpolyfillable(type);
default:
throwUncloneable(type);
}
}
mapSet(map3, value, cloned);
switch (type) {
case "Array":
case "Object":
keys2 = objectKeys(value);
for (i5 = 0, length = lengthOfArrayLike(keys2); i5 < length; i5++) {
key = keys2[i5];
createProperty(cloned, key, structuredCloneInternal(value[key], map3));
}
break;
case "Map":
value.forEach(function(v4, k4) {
mapSet(cloned, structuredCloneInternal(k4, map3), structuredCloneInternal(v4, map3));
});
break;
case "Set":
value.forEach(function(v4) {
setAdd(cloned, structuredCloneInternal(v4, map3));
});
break;
case "Error":
createNonEnumerableProperty(cloned, "message", structuredCloneInternal(value.message, map3));
if (hasOwn(value, "cause")) {
createNonEnumerableProperty(cloned, "cause", structuredCloneInternal(value.cause, map3));
}
if (name === "AggregateError") {
cloned.errors = structuredCloneInternal(value.errors, map3);
} else if (name === "SuppressedError") {
cloned.error = structuredCloneInternal(value.error, map3);
cloned.suppressed = structuredCloneInternal(value.suppressed, map3);
}
case "DOMException":
if (ERROR_STACK_INSTALLABLE) {
createNonEnumerableProperty(cloned, "stack", structuredCloneInternal(value.stack, map3));
}
}
return cloned;
};
var tryToTransfer = function(rawTransfer, map3) {
if (!isObject3(rawTransfer))
throw new TypeError2("Transfer option cannot be converted to a sequence");
var transfer = [];
iterate(rawTransfer, function(value2) {
push(transfer, anObject(value2));
});
var i5 = 0;
var length = lengthOfArrayLike(transfer);
var buffers = new Set2();
var value, type, C4, transferred, canvas, context;
while (i5 < length) {
value = transfer[i5++];
type = classof(value);
if (type === "ArrayBuffer" ? setHas(buffers, value) : mapHas(map3, value)) {
throw new DOMException2("Duplicate transferable", DATA_CLONE_ERROR);
}
if (type === "ArrayBuffer") {
setAdd(buffers, value);
continue;
}
if (PROPER_STRUCTURED_CLONE_TRANSFER) {
transferred = nativeStructuredClone(value, { transfer: [value] });
} else
switch (type) {
case "ImageBitmap":
C4 = globalThis2.OffscreenCanvas;
if (!isConstructor(C4))
throwUnpolyfillable(type, TRANSFERRING);
try {
canvas = new C4(value.width, value.height);
context = canvas.getContext("bitmaprenderer");
context.transferFromImageBitmap(value);
transferred = canvas.transferToImageBitmap();
} catch (error2) {
}
break;
case "AudioData":
case "VideoFrame":
if (!isCallable(value.clone) || !isCallable(value.close))
throwUnpolyfillable(type, TRANSFERRING);
try {
transferred = value.clone();
value.close();
} catch (error2) {
}
break;
case "MediaSourceHandle":
case "MessagePort":
case "MIDIAccess":
case "OffscreenCanvas":
case "ReadableStream":
case "RTCDataChannel":
case "TransformStream":
case "WebTransportReceiveStream":
case "WebTransportSendStream":
case "WritableStream":
throwUnpolyfillable(type, TRANSFERRING);
}
if (transferred === void 0)
throw new DOMException2("This object cannot be transferred: " + type, DATA_CLONE_ERROR);
mapSet(map3, value, transferred);
}
return buffers;
};
var detachBuffers = function(buffers) {
setIterate(buffers, function(buffer) {
if (PROPER_STRUCTURED_CLONE_TRANSFER) {
nativeRestrictedStructuredClone(buffer, { transfer: [buffer] });
} else if (isCallable(buffer.transfer)) {
buffer.transfer();
} else if (detachTransferable) {
detachTransferable(buffer);
} else {
throwUnpolyfillable("ArrayBuffer", TRANSFERRING);
}
});
};
$3({ global: true, enumerable: true, sham: !PROPER_STRUCTURED_CLONE_TRANSFER, forced: FORCED_REPLACEMENT }, {
structuredClone: function structuredClone(value) {
var options = validateArgumentsLength(arguments.length, 1) > 1 && !isNullOrUndefined(arguments[1]) ? anObject(arguments[1]) : void 0;
var transfer = options ? options.transfer : void 0;
var map3, buffers;
if (transfer !== void 0) {
map3 = new Map2();
buffers = tryToTransfer(transfer, map3);
}
var clone5 = structuredCloneInternal(value, map3);
if (buffers)
detachBuffers(buffers);
return clone5;
}
});
}
});
// node_modules/core-js/modules/web.set-interval.js
var require_web_set_interval = __commonJS({
"node_modules/core-js/modules/web.set-interval.js"() {
"use strict";
var $3 = require_export();
var globalThis2 = require_global_this();
var schedulersFix = require_schedulers_fix();
var setInterval2 = schedulersFix(globalThis2.setInterval, true);
$3({ global: true, bind: true, forced: globalThis2.setInterval !== setInterval2 }, {
setInterval: setInterval2
});
}
});
// node_modules/core-js/modules/web.set-timeout.js
var require_web_set_timeout = __commonJS({
"node_modules/core-js/modules/web.set-timeout.js"() {
"use strict";
var $3 = require_export();
var globalThis2 = require_global_this();
var schedulersFix = require_schedulers_fix();
var setTimeout2 = schedulersFix(globalThis2.setTimeout, true);
$3({ global: true, bind: true, forced: globalThis2.setTimeout !== setTimeout2 }, {
setTimeout: setTimeout2
});
}
});
// node_modules/core-js/modules/web.timers.js
var require_web_timers = __commonJS({
"node_modules/core-js/modules/web.timers.js"() {
"use strict";
require_web_set_interval();
require_web_set_timeout();
}
});
// node_modules/core-js/internals/url-constructor-detection.js
var require_url_constructor_detection = __commonJS({
"node_modules/core-js/internals/url-constructor-detection.js"(exports2, module2) {
"use strict";
var fails = require_fails();
var wellKnownSymbol = require_well_known_symbol();
var DESCRIPTORS = require_descriptors();
var IS_PURE = require_is_pure();
var ITERATOR = wellKnownSymbol("iterator");
module2.exports = !fails(function() {
var url = new URL("b?a=1&b=2&c=3", "https://a");
var params = url.searchParams;
var params2 = new URLSearchParams("a=1&a=2&b=3");
var result = "";
url.pathname = "c%20d";
params.forEach(function(value, key) {
params["delete"]("b");
result += key + value;
});
params2["delete"]("a", 2);
params2["delete"]("b", void 0);
return IS_PURE && (!url.toJSON || !params2.has("a", 1) || params2.has("a", 2) || !params2.has("a", void 0) || params2.has("b")) || !params.size && (IS_PURE || !DESCRIPTORS) || !params.sort || url.href !== "https://a/c%20d?a=1&c=3" || params.get("c") !== "3" || String(new URLSearchParams("?a=1")) !== "a=1" || !params[ITERATOR] || new URL("https://a@b").username !== "a" || new URLSearchParams(new URLSearchParams("a=b")).get("a") !== "b" || new URL("https://\u0442\u0435\u0441\u0442").host !== "xn--e1aybc" || new URL("https://a#\u0431").hash !== "#%D0%B1" || result !== "a1c3" || new URL("https://x", void 0).host !== "x";
});
}
});
// node_modules/core-js/internals/string-punycode-to-ascii.js
var require_string_punycode_to_ascii = __commonJS({
"node_modules/core-js/internals/string-punycode-to-ascii.js"(exports2, module2) {
"use strict";
var uncurryThis = require_function_uncurry_this();
var maxInt = 2147483647;
var base2 = 36;
var tMin = 1;
var tMax = 26;
var skew = 38;
var damp = 700;
var initialBias = 72;
var initialN = 128;
var delimiter = "-";
var regexNonASCII = /[^\0-\u007E]/;
var regexSeparators = /[.\u3002\uFF0E\uFF61]/g;
var OVERFLOW_ERROR = "Overflow: input needs wider integers to process";
var baseMinusTMin = base2 - tMin;
var $RangeError = RangeError;
var exec = uncurryThis(regexSeparators.exec);
var floor = Math.floor;
var fromCharCode = String.fromCharCode;
var charCodeAt = uncurryThis("".charCodeAt);
var join3 = uncurryThis([].join);
var push = uncurryThis([].push);
var replace2 = uncurryThis("".replace);
var split3 = uncurryThis("".split);
var toLowerCase = uncurryThis("".toLowerCase);
var ucs2decode = function(string) {
var output = [];
var counter = 0;
var length = string.length;
while (counter < length) {
var value = charCodeAt(string, counter++);
if (value >= 55296 && value <= 56319 && counter < length) {
var extra = charCodeAt(string, counter++);
if ((extra & 64512) === 56320) {
push(output, ((value & 1023) << 10) + (extra & 1023) + 65536);
} else {
push(output, value);
counter--;
}
} else {
push(output, value);
}
}
return output;
};
var digitToBasic = function(digit) {
return digit + 22 + 75 * (digit < 26);
};
var adapt = function(delta, numPoints, firstTime) {
var k4 = 0;
delta = firstTime ? floor(delta / damp) : delta >> 1;
delta += floor(delta / numPoints);
while (delta > baseMinusTMin * tMax >> 1) {
delta = floor(delta / baseMinusTMin);
k4 += base2;
}
return floor(k4 + (baseMinusTMin + 1) * delta / (delta + skew));
};
var encode = function(input) {
var output = [];
input = ucs2decode(input);
var inputLength = input.length;
var n7 = initialN;
var delta = 0;
var bias = initialBias;
var i5, currentValue;
for (i5 = 0; i5 < input.length; i5++) {
currentValue = input[i5];
if (currentValue < 128) {
push(output, fromCharCode(currentValue));
}
}
var basicLength = output.length;
var handledCPCount = basicLength;
if (basicLength) {
push(output, delimiter);
}
while (handledCPCount < inputLength) {
var m4 = maxInt;
for (i5 = 0; i5 < input.length; i5++) {
currentValue = input[i5];
if (currentValue >= n7 && currentValue < m4) {
m4 = currentValue;
}
}
var handledCPCountPlusOne = handledCPCount + 1;
if (m4 - n7 > floor((maxInt - delta) / handledCPCountPlusOne)) {
throw new $RangeError(OVERFLOW_ERROR);
}
delta += (m4 - n7) * handledCPCountPlusOne;
n7 = m4;
for (i5 = 0; i5 < input.length; i5++) {
currentValue = input[i5];
if (currentValue < n7 && ++delta > maxInt) {
throw new $RangeError(OVERFLOW_ERROR);
}
if (currentValue === n7) {
var q4 = delta;
var k4 = base2;
while (true) {
var t5 = k4 <= bias ? tMin : k4 >= bias + tMax ? tMax : k4 - bias;
if (q4 < t5)
break;
var qMinusT = q4 - t5;
var baseMinusT = base2 - t5;
push(output, fromCharCode(digitToBasic(t5 + qMinusT % baseMinusT)));
q4 = floor(qMinusT / baseMinusT);
k4 += base2;
}
push(output, fromCharCode(digitToBasic(q4)));
bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
delta = 0;
handledCPCount++;
}
}
delta++;
n7++;
}
return join3(output, "");
};
module2.exports = function(input) {
var encoded = [];
var labels = split3(replace2(toLowerCase(input), regexSeparators, "."), ".");
var i5, label;
for (i5 = 0; i5 < labels.length; i5++) {
label = labels[i5];
push(encoded, exec(regexNonASCII, label) ? "xn--" + encode(label) : label);
}
return join3(encoded, ".");
};
}
});
// node_modules/core-js/modules/web.url-search-params.constructor.js
var require_web_url_search_params_constructor = __commonJS({
"node_modules/core-js/modules/web.url-search-params.constructor.js"(exports2, module2) {
"use strict";
require_es_array_iterator();
require_es_string_from_code_point();
var $3 = require_export();
var globalThis2 = require_global_this();
var safeGetBuiltIn = require_safe_get_built_in();
var getBuiltIn = require_get_built_in();
var call = require_function_call();
var uncurryThis = require_function_uncurry_this();
var DESCRIPTORS = require_descriptors();
var USE_NATIVE_URL = require_url_constructor_detection();
var defineBuiltIn = require_define_built_in();
var defineBuiltInAccessor = require_define_built_in_accessor();
var defineBuiltIns = require_define_built_ins();
var setToStringTag = require_set_to_string_tag();
var createIteratorConstructor = require_iterator_create_constructor();
var InternalStateModule = require_internal_state();
var anInstance = require_an_instance();
var isCallable = require_is_callable();
var hasOwn = require_has_own_property();
var bind3 = require_function_bind_context();
var classof = require_classof();
var anObject = require_an_object();
var isObject3 = require_is_object();
var $toString = require_to_string();
var create = require_object_create();
var createPropertyDescriptor = require_create_property_descriptor();
var getIterator = require_get_iterator();
var getIteratorMethod = require_get_iterator_method();
var createIterResultObject = require_create_iter_result_object();
var validateArgumentsLength = require_validate_arguments_length();
var wellKnownSymbol = require_well_known_symbol();
var arraySort = require_array_sort();
var ITERATOR = wellKnownSymbol("iterator");
var URL_SEARCH_PARAMS = "URLSearchParams";
var URL_SEARCH_PARAMS_ITERATOR = URL_SEARCH_PARAMS + "Iterator";
var setInternalState = InternalStateModule.set;
var getInternalParamsState = InternalStateModule.getterFor(URL_SEARCH_PARAMS);
var getInternalIteratorState = InternalStateModule.getterFor(URL_SEARCH_PARAMS_ITERATOR);
var nativeFetch2 = safeGetBuiltIn("fetch");
var NativeRequest = safeGetBuiltIn("Request");
var Headers2 = safeGetBuiltIn("Headers");
var RequestPrototype = NativeRequest && NativeRequest.prototype;
var HeadersPrototype = Headers2 && Headers2.prototype;
var TypeError2 = globalThis2.TypeError;
var encodeURIComponent2 = globalThis2.encodeURIComponent;
var fromCharCode = String.fromCharCode;
var fromCodePoint = getBuiltIn("String", "fromCodePoint");
var $parseInt = parseInt;
var charAt = uncurryThis("".charAt);
var join3 = uncurryThis([].join);
var push = uncurryThis([].push);
var replace2 = uncurryThis("".replace);
var shift2 = uncurryThis([].shift);
var splice = uncurryThis([].splice);
var split3 = uncurryThis("".split);
var stringSlice = uncurryThis("".slice);
var exec = uncurryThis(/./.exec);
var plus = /\+/g;
var FALLBACK_REPLACER = "\uFFFD";
var VALID_HEX = /^[0-9a-f]+$/i;
var parseHexOctet = function(string, start3) {
var substr = stringSlice(string, start3, start3 + 2);
if (!exec(VALID_HEX, substr))
return NaN;
return $parseInt(substr, 16);
};
var getLeadingOnes = function(octet) {
var count = 0;
for (var mask = 128; mask > 0 && (octet & mask) !== 0; mask >>= 1) {
count++;
}
return count;
};
var utf8Decode = function(octets) {
var codePoint = null;
switch (octets.length) {
case 1:
codePoint = octets[0];
break;
case 2:
codePoint = (octets[0] & 31) << 6 | octets[1] & 63;
break;
case 3:
codePoint = (octets[0] & 15) << 12 | (octets[1] & 63) << 6 | octets[2] & 63;
break;
case 4:
codePoint = (octets[0] & 7) << 18 | (octets[1] & 63) << 12 | (octets[2] & 63) << 6 | octets[3] & 63;
break;
}
return codePoint > 1114111 ? null : codePoint;
};
var decode = function(input) {
input = replace2(input, plus, " ");
var length = input.length;
var result = "";
var i5 = 0;
while (i5 < length) {
var decodedChar = charAt(input, i5);
if (decodedChar === "%") {
if (charAt(input, i5 + 1) === "%" || i5 + 3 > length) {
result += "%";
i5++;
continue;
}
var octet = parseHexOctet(input, i5 + 1);
if (octet !== octet) {
result += decodedChar;
i5++;
continue;
}
i5 += 2;
var byteSequenceLength = getLeadingOnes(octet);
if (byteSequenceLength === 0) {
decodedChar = fromCharCode(octet);
} else {
if (byteSequenceLength === 1 || byteSequenceLength > 4) {
result += FALLBACK_REPLACER;
i5++;
continue;
}
var octets = [octet];
var sequenceIndex = 1;
while (sequenceIndex < byteSequenceLength) {
i5++;
if (i5 + 3 > length || charAt(input, i5) !== "%")
break;
var nextByte = parseHexOctet(input, i5 + 1);
if (nextByte !== nextByte) {
i5 += 3;
break;
}
if (nextByte > 191 || nextByte < 128)
break;
push(octets, nextByte);
i5 += 2;
sequenceIndex++;
}
if (octets.length !== byteSequenceLength) {
result += FALLBACK_REPLACER;
continue;
}
var codePoint = utf8Decode(octets);
if (codePoint === null) {
result += FALLBACK_REPLACER;
} else {
decodedChar = fromCodePoint(codePoint);
}
}
}
result += decodedChar;
i5++;
}
return result;
};
var find3 = /[!'()~]|%20/g;
var replacements = {
"!": "%21",
"'": "%27",
"(": "%28",
")": "%29",
"~": "%7E",
"%20": "+"
};
var replacer = function(match3) {
return replacements[match3];
};
var serialize = function(it2) {
return replace2(encodeURIComponent2(it2), find3, replacer);
};
var URLSearchParamsIterator = createIteratorConstructor(function Iterator(params, kind) {
setInternalState(this, {
type: URL_SEARCH_PARAMS_ITERATOR,
target: getInternalParamsState(params).entries,
index: 0,
kind
});
}, URL_SEARCH_PARAMS, function next() {
var state = getInternalIteratorState(this);
var target = state.target;
var index3 = state.index++;
if (!target || index3 >= target.length) {
state.target = null;
return createIterResultObject(void 0, true);
}
var entry = target[index3];
switch (state.kind) {
case "keys":
return createIterResultObject(entry.key, false);
case "values":
return createIterResultObject(entry.value, false);
}
return createIterResultObject([entry.key, entry.value], false);
}, true);
var URLSearchParamsState = function(init3) {
this.entries = [];
this.url = null;
if (init3 !== void 0) {
if (isObject3(init3))
this.parseObject(init3);
else
this.parseQuery(typeof init3 == "string" ? charAt(init3, 0) === "?" ? stringSlice(init3, 1) : init3 : $toString(init3));
}
};
URLSearchParamsState.prototype = {
type: URL_SEARCH_PARAMS,
bindURL: function(url) {
this.url = url;
this.update();
},
parseObject: function(object) {
var entries = this.entries;
var iteratorMethod = getIteratorMethod(object);
var iterator, next, step, entryIterator, entryNext, first3, second;
if (iteratorMethod) {
iterator = getIterator(object, iteratorMethod);
next = iterator.next;
while (!(step = call(next, iterator)).done) {
entryIterator = getIterator(anObject(step.value));
entryNext = entryIterator.next;
if ((first3 = call(entryNext, entryIterator)).done || (second = call(entryNext, entryIterator)).done || !call(entryNext, entryIterator).done)
throw new TypeError2("Expected sequence with length 2");
push(entries, { key: $toString(first3.value), value: $toString(second.value) });
}
} else
for (var key in object)
if (hasOwn(object, key)) {
push(entries, { key, value: $toString(object[key]) });
}
},
parseQuery: function(query) {
if (query) {
var entries = this.entries;
var attributes = split3(query, "&");
var index3 = 0;
var attribute, entry;
while (index3 < attributes.length) {
attribute = attributes[index3++];
if (attribute.length) {
entry = split3(attribute, "=");
push(entries, {
key: decode(shift2(entry)),
value: decode(join3(entry, "="))
});
}
}
}
},
serialize: function() {
var entries = this.entries;
var result = [];
var index3 = 0;
var entry;
while (index3 < entries.length) {
entry = entries[index3++];
push(result, serialize(entry.key) + "=" + serialize(entry.value));
}
return join3(result, "&");
},
update: function() {
this.entries.length = 0;
this.parseQuery(this.url.query);
},
updateURL: function() {
if (this.url)
this.url.update();
}
};
var URLSearchParamsConstructor = function URLSearchParams2() {
anInstance(this, URLSearchParamsPrototype);
var init3 = arguments.length > 0 ? arguments[0] : void 0;
var state = setInternalState(this, new URLSearchParamsState(init3));
if (!DESCRIPTORS)
this.size = state.entries.length;
};
var URLSearchParamsPrototype = URLSearchParamsConstructor.prototype;
defineBuiltIns(URLSearchParamsPrototype, {
append: function append(name, value) {
var state = getInternalParamsState(this);
validateArgumentsLength(arguments.length, 2);
push(state.entries, { key: $toString(name), value: $toString(value) });
if (!DESCRIPTORS)
this.length++;
state.updateURL();
},
"delete": function(name) {
var state = getInternalParamsState(this);
var length = validateArgumentsLength(arguments.length, 1);
var entries = state.entries;
var key = $toString(name);
var $value = length < 2 ? void 0 : arguments[1];
var value = $value === void 0 ? $value : $toString($value);
var index3 = 0;
while (index3 < entries.length) {
var entry = entries[index3];
if (entry.key === key && (value === void 0 || entry.value === value)) {
splice(entries, index3, 1);
if (value !== void 0)
break;
} else
index3++;
}
if (!DESCRIPTORS)
this.size = entries.length;
state.updateURL();
},
get: function get(name) {
var entries = getInternalParamsState(this).entries;
validateArgumentsLength(arguments.length, 1);
var key = $toString(name);
var index3 = 0;
for (; index3 < entries.length; index3++) {
if (entries[index3].key === key)
return entries[index3].value;
}
return null;
},
getAll: function getAll(name) {
var entries = getInternalParamsState(this).entries;
validateArgumentsLength(arguments.length, 1);
var key = $toString(name);
var result = [];
var index3 = 0;
for (; index3 < entries.length; index3++) {
if (entries[index3].key === key)
push(result, entries[index3].value);
}
return result;
},
has: function has(name) {
var entries = getInternalParamsState(this).entries;
var length = validateArgumentsLength(arguments.length, 1);
var key = $toString(name);
var $value = length < 2 ? void 0 : arguments[1];
var value = $value === void 0 ? $value : $toString($value);
var index3 = 0;
while (index3 < entries.length) {
var entry = entries[index3++];
if (entry.key === key && (value === void 0 || entry.value === value))
return true;
}
return false;
},
set: function set2(name, value) {
var state = getInternalParamsState(this);
validateArgumentsLength(arguments.length, 1);
var entries = state.entries;
var found2 = false;
var key = $toString(name);
var val = $toString(value);
var index3 = 0;
var entry;
for (; index3 < entries.length; index3++) {
entry = entries[index3];
if (entry.key === key) {
if (found2)
splice(entries, index3--, 1);
else {
found2 = true;
entry.value = val;
}
}
}
if (!found2)
push(entries, { key, value: val });
if (!DESCRIPTORS)
this.size = entries.length;
state.updateURL();
},
sort: function sort2() {
var state = getInternalParamsState(this);
arraySort(state.entries, function(a5, b4) {
return a5.key > b4.key ? 1 : -1;
});
state.updateURL();
},
forEach: function forEach2(callback2) {
var entries = getInternalParamsState(this).entries;
var boundFunction = bind3(callback2, arguments.length > 1 ? arguments[1] : void 0);
var index3 = 0;
var entry;
while (index3 < entries.length) {
entry = entries[index3++];
boundFunction(entry.value, entry.key, this);
}
},
keys: function keys2() {
return new URLSearchParamsIterator(this, "keys");
},
values: function values() {
return new URLSearchParamsIterator(this, "values");
},
entries: function entries() {
return new URLSearchParamsIterator(this, "entries");
}
}, { enumerable: true });
defineBuiltIn(URLSearchParamsPrototype, ITERATOR, URLSearchParamsPrototype.entries, { name: "entries" });
defineBuiltIn(URLSearchParamsPrototype, "toString", function toString() {
return getInternalParamsState(this).serialize();
}, { enumerable: true });
if (DESCRIPTORS)
defineBuiltInAccessor(URLSearchParamsPrototype, "size", {
get: function size() {
return getInternalParamsState(this).entries.length;
},
configurable: true,
enumerable: true
});
setToStringTag(URLSearchParamsConstructor, URL_SEARCH_PARAMS);
$3({ global: true, constructor: true, forced: !USE_NATIVE_URL }, {
URLSearchParams: URLSearchParamsConstructor
});
if (!USE_NATIVE_URL && isCallable(Headers2)) {
headersHas = uncurryThis(HeadersPrototype.has);
headersSet = uncurryThis(HeadersPrototype.set);
wrapRequestOptions = function(init3) {
if (isObject3(init3)) {
var body = init3.body;
var headers;
if (classof(body) === URL_SEARCH_PARAMS) {
headers = init3.headers ? new Headers2(init3.headers) : new Headers2();
if (!headersHas(headers, "content-type")) {
headersSet(headers, "content-type", "application/x-www-form-urlencoded;charset=UTF-8");
}
return create(init3, {
body: createPropertyDescriptor(0, $toString(body)),
headers: createPropertyDescriptor(0, headers)
});
}
}
return init3;
};
if (isCallable(nativeFetch2)) {
$3({ global: true, enumerable: true, dontCallGetSet: true, forced: true }, {
fetch: function fetch3(input) {
return nativeFetch2(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
}
});
}
if (isCallable(NativeRequest)) {
RequestConstructor = function Request(input) {
anInstance(this, RequestPrototype);
return new NativeRequest(input, arguments.length > 1 ? wrapRequestOptions(arguments[1]) : {});
};
RequestPrototype.constructor = RequestConstructor;
RequestConstructor.prototype = RequestPrototype;
$3({ global: true, constructor: true, dontCallGetSet: true, forced: true }, {
Request: RequestConstructor
});
}
}
var headersHas;
var headersSet;
var wrapRequestOptions;
var RequestConstructor;
module2.exports = {
URLSearchParams: URLSearchParamsConstructor,
getState: getInternalParamsState
};
}
});
// node_modules/core-js/modules/web.url.constructor.js
var require_web_url_constructor = __commonJS({
"node_modules/core-js/modules/web.url.constructor.js"() {
"use strict";
require_es_string_iterator();
var $3 = require_export();
var DESCRIPTORS = require_descriptors();
var USE_NATIVE_URL = require_url_constructor_detection();
var globalThis2 = require_global_this();
var bind3 = require_function_bind_context();
var uncurryThis = require_function_uncurry_this();
var defineBuiltIn = require_define_built_in();
var defineBuiltInAccessor = require_define_built_in_accessor();
var anInstance = require_an_instance();
var hasOwn = require_has_own_property();
var assign4 = require_object_assign();
var arrayFrom2 = require_array_from();
var arraySlice = require_array_slice();
var codeAt = require_string_multibyte().codeAt;
var toASCII = require_string_punycode_to_ascii();
var $toString = require_to_string();
var setToStringTag = require_set_to_string_tag();
var validateArgumentsLength = require_validate_arguments_length();
var URLSearchParamsModule = require_web_url_search_params_constructor();
var InternalStateModule = require_internal_state();
var setInternalState = InternalStateModule.set;
var getInternalURLState = InternalStateModule.getterFor("URL");
var URLSearchParams2 = URLSearchParamsModule.URLSearchParams;
var getInternalSearchParamsState = URLSearchParamsModule.getState;
var NativeURL = globalThis2.URL;
var TypeError2 = globalThis2.TypeError;
var parseInt2 = globalThis2.parseInt;
var floor = Math.floor;
var pow = Math.pow;
var charAt = uncurryThis("".charAt);
var exec = uncurryThis(/./.exec);
var join3 = uncurryThis([].join);
var numberToString = uncurryThis(1 .toString);
var pop = uncurryThis([].pop);
var push = uncurryThis([].push);
var replace2 = uncurryThis("".replace);
var shift2 = uncurryThis([].shift);
var split3 = uncurryThis("".split);
var stringSlice = uncurryThis("".slice);
var toLowerCase = uncurryThis("".toLowerCase);
var unshift = uncurryThis([].unshift);
var INVALID_AUTHORITY = "Invalid authority";
var INVALID_SCHEME = "Invalid scheme";
var INVALID_HOST = "Invalid host";
var INVALID_PORT = "Invalid port";
var ALPHA = /[a-z]/i;
var ALPHANUMERIC = /[\d+-.a-z]/i;
var DIGIT2 = /\d/;
var HEX_START = /^0x/i;
var OCT = /^[0-7]+$/;
var DEC = /^\d+$/;
var HEX = /^[\da-f]+$/i;
var FORBIDDEN_HOST_CODE_POINT = /[\0\t\n\r #%/:<>?@[\\\]^|]/;
var FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT = /[\0\t\n\r #/:<>?@[\\\]^|]/;
var LEADING_C0_CONTROL_OR_SPACE = /^[\u0000-\u0020]+/;
var TRAILING_C0_CONTROL_OR_SPACE = /(^|[^\u0000-\u0020])[\u0000-\u0020]+$/;
var TAB_AND_NEW_LINE = /[\t\n\r]/g;
var EOF;
var parseIPv4 = function(input) {
var parts = split3(input, ".");
var partsLength, numbers2, index3, part, radix, number, ipv4;
if (parts.length && parts[parts.length - 1] === "") {
parts.length--;
}
partsLength = parts.length;
if (partsLength > 4)
return input;
numbers2 = [];
for (index3 = 0; index3 < partsLength; index3++) {
part = parts[index3];
if (part === "")
return input;
radix = 10;
if (part.length > 1 && charAt(part, 0) === "0") {
radix = exec(HEX_START, part) ? 16 : 8;
part = stringSlice(part, radix === 8 ? 1 : 2);
}
if (part === "") {
number = 0;
} else {
if (!exec(radix === 10 ? DEC : radix === 8 ? OCT : HEX, part))
return input;
number = parseInt2(part, radix);
}
push(numbers2, number);
}
for (index3 = 0; index3 < partsLength; index3++) {
number = numbers2[index3];
if (index3 === partsLength - 1) {
if (number >= pow(256, 5 - partsLength))
return null;
} else if (number > 255)
return null;
}
ipv4 = pop(numbers2);
for (index3 = 0; index3 < numbers2.length; index3++) {
ipv4 += numbers2[index3] * pow(256, 3 - index3);
}
return ipv4;
};
var parseIPv6 = function(input) {
var address = [0, 0, 0, 0, 0, 0, 0, 0];
var pieceIndex = 0;
var compress = null;
var pointer = 0;
var value, length, numbersSeen, ipv4Piece, number, swaps, swap2;
var chr = function() {
return charAt(input, pointer);
};
if (chr() === ":") {
if (charAt(input, 1) !== ":")
return;
pointer += 2;
pieceIndex++;
compress = pieceIndex;
}
while (chr()) {
if (pieceIndex === 8)
return;
if (chr() === ":") {
if (compress !== null)
return;
pointer++;
pieceIndex++;
compress = pieceIndex;
continue;
}
value = length = 0;
while (length < 4 && exec(HEX, chr())) {
value = value * 16 + parseInt2(chr(), 16);
pointer++;
length++;
}
if (chr() === ".") {
if (length === 0)
return;
pointer -= length;
if (pieceIndex > 6)
return;
numbersSeen = 0;
while (chr()) {
ipv4Piece = null;
if (numbersSeen > 0) {
if (chr() === "." && numbersSeen < 4)
pointer++;
else
return;
}
if (!exec(DIGIT2, chr()))
return;
while (exec(DIGIT2, chr())) {
number = parseInt2(chr(), 10);
if (ipv4Piece === null)
ipv4Piece = number;
else if (ipv4Piece === 0)
return;
else
ipv4Piece = ipv4Piece * 10 + number;
if (ipv4Piece > 255)
return;
pointer++;
}
address[pieceIndex] = address[pieceIndex] * 256 + ipv4Piece;
numbersSeen++;
if (numbersSeen === 2 || numbersSeen === 4)
pieceIndex++;
}
if (numbersSeen !== 4)
return;
break;
} else if (chr() === ":") {
pointer++;
if (!chr())
return;
} else if (chr())
return;
address[pieceIndex++] = value;
}
if (compress !== null) {
swaps = pieceIndex - compress;
pieceIndex = 7;
while (pieceIndex !== 0 && swaps > 0) {
swap2 = address[pieceIndex];
address[pieceIndex--] = address[compress + swaps - 1];
address[compress + --swaps] = swap2;
}
} else if (pieceIndex !== 8)
return;
return address;
};
var findLongestZeroSequence = function(ipv6) {
var maxIndex = null;
var maxLength = 1;
var currStart = null;
var currLength = 0;
var index3 = 0;
for (; index3 < 8; index3++) {
if (ipv6[index3] !== 0) {
if (currLength > maxLength) {
maxIndex = currStart;
maxLength = currLength;
}
currStart = null;
currLength = 0;
} else {
if (currStart === null)
currStart = index3;
++currLength;
}
}
return currLength > maxLength ? currStart : maxIndex;
};
var serializeHost = function(host) {
var result, index3, compress, ignore0;
if (typeof host == "number") {
result = [];
for (index3 = 0; index3 < 4; index3++) {
unshift(result, host % 256);
host = floor(host / 256);
}
return join3(result, ".");
}
if (typeof host == "object") {
result = "";
compress = findLongestZeroSequence(host);
for (index3 = 0; index3 < 8; index3++) {
if (ignore0 && host[index3] === 0)
continue;
if (ignore0)
ignore0 = false;
if (compress === index3) {
result += index3 ? ":" : "::";
ignore0 = true;
} else {
result += numberToString(host[index3], 16);
if (index3 < 7)
result += ":";
}
}
return "[" + result + "]";
}
return host;
};
var C0ControlPercentEncodeSet = {};
var fragmentPercentEncodeSet = assign4({}, C0ControlPercentEncodeSet, {
" ": 1,
'"': 1,
"<": 1,
">": 1,
"`": 1
});
var pathPercentEncodeSet = assign4({}, fragmentPercentEncodeSet, {
"#": 1,
"?": 1,
"{": 1,
"}": 1
});
var userinfoPercentEncodeSet = assign4({}, pathPercentEncodeSet, {
"/": 1,
":": 1,
";": 1,
"=": 1,
"@": 1,
"[": 1,
"\\": 1,
"]": 1,
"^": 1,
"|": 1
});
var percentEncode = function(chr, set2) {
var code3 = codeAt(chr, 0);
return code3 > 32 && code3 < 127 && !hasOwn(set2, chr) ? chr : encodeURIComponent(chr);
};
var specialSchemes = {
ftp: 21,
file: null,
http: 80,
https: 443,
ws: 80,
wss: 443
};
var isWindowsDriveLetter = function(string, normalized) {
var second;
return string.length === 2 && exec(ALPHA, charAt(string, 0)) && ((second = charAt(string, 1)) === ":" || !normalized && second === "|");
};
var startsWithWindowsDriveLetter = function(string) {
var third;
return string.length > 1 && isWindowsDriveLetter(stringSlice(string, 0, 2)) && (string.length === 2 || ((third = charAt(string, 2)) === "/" || third === "\\" || third === "?" || third === "#"));
};
var isSingleDot = function(segment) {
return segment === "." || toLowerCase(segment) === "%2e";
};
var isDoubleDot = function(segment) {
segment = toLowerCase(segment);
return segment === ".." || segment === "%2e." || segment === ".%2e" || segment === "%2e%2e";
};
var SCHEME_START = {};
var SCHEME2 = {};
var NO_SCHEME = {};
var SPECIAL_RELATIVE_OR_AUTHORITY = {};
var PATH_OR_AUTHORITY = {};
var RELATIVE = {};
var RELATIVE_SLASH = {};
var SPECIAL_AUTHORITY_SLASHES = {};
var SPECIAL_AUTHORITY_IGNORE_SLASHES = {};
var AUTHORITY = {};
var HOST = {};
var HOSTNAME = {};
var PORT = {};
var FILE = {};
var FILE_SLASH = {};
var FILE_HOST = {};
var PATH_START = {};
var PATH = {};
var CANNOT_BE_A_BASE_URL_PATH = {};
var QUERY2 = {};
var FRAGMENT = {};
var URLState = function(url, isBase, base2) {
var urlString = $toString(url);
var baseState, failure, searchParams;
if (isBase) {
failure = this.parse(urlString);
if (failure)
throw new TypeError2(failure);
this.searchParams = null;
} else {
if (base2 !== void 0)
baseState = new URLState(base2, true);
failure = this.parse(urlString, null, baseState);
if (failure)
throw new TypeError2(failure);
searchParams = getInternalSearchParamsState(new URLSearchParams2());
searchParams.bindURL(this);
this.searchParams = searchParams;
}
};
URLState.prototype = {
type: "URL",
parse: function(input, stateOverride, base2) {
var url = this;
var state = stateOverride || SCHEME_START;
var pointer = 0;
var buffer = "";
var seenAt = false;
var seenBracket = false;
var seenPasswordToken = false;
var codePoints, chr, bufferCodePoints, failure;
input = $toString(input);
if (!stateOverride) {
url.scheme = "";
url.username = "";
url.password = "";
url.host = null;
url.port = null;
url.path = [];
url.query = null;
url.fragment = null;
url.cannotBeABaseURL = false;
input = replace2(input, LEADING_C0_CONTROL_OR_SPACE, "");
input = replace2(input, TRAILING_C0_CONTROL_OR_SPACE, "$1");
}
input = replace2(input, TAB_AND_NEW_LINE, "");
codePoints = arrayFrom2(input);
while (pointer <= codePoints.length) {
chr = codePoints[pointer];
switch (state) {
case SCHEME_START:
if (chr && exec(ALPHA, chr)) {
buffer += toLowerCase(chr);
state = SCHEME2;
} else if (!stateOverride) {
state = NO_SCHEME;
continue;
} else
return INVALID_SCHEME;
break;
case SCHEME2:
if (chr && (exec(ALPHANUMERIC, chr) || chr === "+" || chr === "-" || chr === ".")) {
buffer += toLowerCase(chr);
} else if (chr === ":") {
if (stateOverride && (url.isSpecial() !== hasOwn(specialSchemes, buffer) || buffer === "file" && (url.includesCredentials() || url.port !== null) || url.scheme === "file" && !url.host))
return;
url.scheme = buffer;
if (stateOverride) {
if (url.isSpecial() && specialSchemes[url.scheme] === url.port)
url.port = null;
return;
}
buffer = "";
if (url.scheme === "file") {
state = FILE;
} else if (url.isSpecial() && base2 && base2.scheme === url.scheme) {
state = SPECIAL_RELATIVE_OR_AUTHORITY;
} else if (url.isSpecial()) {
state = SPECIAL_AUTHORITY_SLASHES;
} else if (codePoints[pointer + 1] === "/") {
state = PATH_OR_AUTHORITY;
pointer++;
} else {
url.cannotBeABaseURL = true;
push(url.path, "");
state = CANNOT_BE_A_BASE_URL_PATH;
}
} else if (!stateOverride) {
buffer = "";
state = NO_SCHEME;
pointer = 0;
continue;
} else
return INVALID_SCHEME;
break;
case NO_SCHEME:
if (!base2 || base2.cannotBeABaseURL && chr !== "#")
return INVALID_SCHEME;
if (base2.cannotBeABaseURL && chr === "#") {
url.scheme = base2.scheme;
url.path = arraySlice(base2.path);
url.query = base2.query;
url.fragment = "";
url.cannotBeABaseURL = true;
state = FRAGMENT;
break;
}
state = base2.scheme === "file" ? FILE : RELATIVE;
continue;
case SPECIAL_RELATIVE_OR_AUTHORITY:
if (chr === "/" && codePoints[pointer + 1] === "/") {
state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
pointer++;
} else {
state = RELATIVE;
continue;
}
break;
case PATH_OR_AUTHORITY:
if (chr === "/") {
state = AUTHORITY;
break;
} else {
state = PATH;
continue;
}
case RELATIVE:
url.scheme = base2.scheme;
if (chr === EOF) {
url.username = base2.username;
url.password = base2.password;
url.host = base2.host;
url.port = base2.port;
url.path = arraySlice(base2.path);
url.query = base2.query;
} else if (chr === "/" || chr === "\\" && url.isSpecial()) {
state = RELATIVE_SLASH;
} else if (chr === "?") {
url.username = base2.username;
url.password = base2.password;
url.host = base2.host;
url.port = base2.port;
url.path = arraySlice(base2.path);
url.query = "";
state = QUERY2;
} else if (chr === "#") {
url.username = base2.username;
url.password = base2.password;
url.host = base2.host;
url.port = base2.port;
url.path = arraySlice(base2.path);
url.query = base2.query;
url.fragment = "";
state = FRAGMENT;
} else {
url.username = base2.username;
url.password = base2.password;
url.host = base2.host;
url.port = base2.port;
url.path = arraySlice(base2.path);
url.path.length--;
state = PATH;
continue;
}
break;
case RELATIVE_SLASH:
if (url.isSpecial() && (chr === "/" || chr === "\\")) {
state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
} else if (chr === "/") {
state = AUTHORITY;
} else {
url.username = base2.username;
url.password = base2.password;
url.host = base2.host;
url.port = base2.port;
state = PATH;
continue;
}
break;
case SPECIAL_AUTHORITY_SLASHES:
state = SPECIAL_AUTHORITY_IGNORE_SLASHES;
if (chr !== "/" || charAt(buffer, pointer + 1) !== "/")
continue;
pointer++;
break;
case SPECIAL_AUTHORITY_IGNORE_SLASHES:
if (chr !== "/" && chr !== "\\") {
state = AUTHORITY;
continue;
}
break;
case AUTHORITY:
if (chr === "@") {
if (seenAt)
buffer = "%40" + buffer;
seenAt = true;
bufferCodePoints = arrayFrom2(buffer);
for (var i5 = 0; i5 < bufferCodePoints.length; i5++) {
var codePoint = bufferCodePoints[i5];
if (codePoint === ":" && !seenPasswordToken) {
seenPasswordToken = true;
continue;
}
var encodedCodePoints = percentEncode(codePoint, userinfoPercentEncodeSet);
if (seenPasswordToken)
url.password += encodedCodePoints;
else
url.username += encodedCodePoints;
}
buffer = "";
} else if (chr === EOF || chr === "/" || chr === "?" || chr === "#" || chr === "\\" && url.isSpecial()) {
if (seenAt && buffer === "")
return INVALID_AUTHORITY;
pointer -= arrayFrom2(buffer).length + 1;
buffer = "";
state = HOST;
} else
buffer += chr;
break;
case HOST:
case HOSTNAME:
if (stateOverride && url.scheme === "file") {
state = FILE_HOST;
continue;
} else if (chr === ":" && !seenBracket) {
if (buffer === "")
return INVALID_HOST;
failure = url.parseHost(buffer);
if (failure)
return failure;
buffer = "";
state = PORT;
if (stateOverride === HOSTNAME)
return;
} else if (chr === EOF || chr === "/" || chr === "?" || chr === "#" || chr === "\\" && url.isSpecial()) {
if (url.isSpecial() && buffer === "")
return INVALID_HOST;
if (stateOverride && buffer === "" && (url.includesCredentials() || url.port !== null))
return;
failure = url.parseHost(buffer);
if (failure)
return failure;
buffer = "";
state = PATH_START;
if (stateOverride)
return;
continue;
} else {
if (chr === "[")
seenBracket = true;
else if (chr === "]")
seenBracket = false;
buffer += chr;
}
break;
case PORT:
if (exec(DIGIT2, chr)) {
buffer += chr;
} else if (chr === EOF || chr === "/" || chr === "?" || chr === "#" || chr === "\\" && url.isSpecial() || stateOverride) {
if (buffer !== "") {
var port = parseInt2(buffer, 10);
if (port > 65535)
return INVALID_PORT;
url.port = url.isSpecial() && port === specialSchemes[url.scheme] ? null : port;
buffer = "";
}
if (stateOverride)
return;
state = PATH_START;
continue;
} else
return INVALID_PORT;
break;
case FILE:
url.scheme = "file";
if (chr === "/" || chr === "\\")
state = FILE_SLASH;
else if (base2 && base2.scheme === "file") {
switch (chr) {
case EOF:
url.host = base2.host;
url.path = arraySlice(base2.path);
url.query = base2.query;
break;
case "?":
url.host = base2.host;
url.path = arraySlice(base2.path);
url.query = "";
state = QUERY2;
break;
case "#":
url.host = base2.host;
url.path = arraySlice(base2.path);
url.query = base2.query;
url.fragment = "";
state = FRAGMENT;
break;
default:
if (!startsWithWindowsDriveLetter(join3(arraySlice(codePoints, pointer), ""))) {
url.host = base2.host;
url.path = arraySlice(base2.path);
url.shortenPath();
}
state = PATH;
continue;
}
} else {
state = PATH;
continue;
}
break;
case FILE_SLASH:
if (chr === "/" || chr === "\\") {
state = FILE_HOST;
break;
}
if (base2 && base2.scheme === "file" && !startsWithWindowsDriveLetter(join3(arraySlice(codePoints, pointer), ""))) {
if (isWindowsDriveLetter(base2.path[0], true))
push(url.path, base2.path[0]);
else
url.host = base2.host;
}
state = PATH;
continue;
case FILE_HOST:
if (chr === EOF || chr === "/" || chr === "\\" || chr === "?" || chr === "#") {
if (!stateOverride && isWindowsDriveLetter(buffer)) {
state = PATH;
} else if (buffer === "") {
url.host = "";
if (stateOverride)
return;
state = PATH_START;
} else {
failure = url.parseHost(buffer);
if (failure)
return failure;
if (url.host === "localhost")
url.host = "";
if (stateOverride)
return;
buffer = "";
state = PATH_START;
}
continue;
} else
buffer += chr;
break;
case PATH_START:
if (url.isSpecial()) {
state = PATH;
if (chr !== "/" && chr !== "\\")
continue;
} else if (!stateOverride && chr === "?") {
url.query = "";
state = QUERY2;
} else if (!stateOverride && chr === "#") {
url.fragment = "";
state = FRAGMENT;
} else if (chr !== EOF) {
state = PATH;
if (chr !== "/")
continue;
}
break;
case PATH:
if (chr === EOF || chr === "/" || chr === "\\" && url.isSpecial() || !stateOverride && (chr === "?" || chr === "#")) {
if (isDoubleDot(buffer)) {
url.shortenPath();
if (chr !== "/" && !(chr === "\\" && url.isSpecial())) {
push(url.path, "");
}
} else if (isSingleDot(buffer)) {
if (chr !== "/" && !(chr === "\\" && url.isSpecial())) {
push(url.path, "");
}
} else {
if (url.scheme === "file" && !url.path.length && isWindowsDriveLetter(buffer)) {
if (url.host)
url.host = "";
buffer = charAt(buffer, 0) + ":";
}
push(url.path, buffer);
}
buffer = "";
if (url.scheme === "file" && (chr === EOF || chr === "?" || chr === "#")) {
while (url.path.length > 1 && url.path[0] === "") {
shift2(url.path);
}
}
if (chr === "?") {
url.query = "";
state = QUERY2;
} else if (chr === "#") {
url.fragment = "";
state = FRAGMENT;
}
} else {
buffer += percentEncode(chr, pathPercentEncodeSet);
}
break;
case CANNOT_BE_A_BASE_URL_PATH:
if (chr === "?") {
url.query = "";
state = QUERY2;
} else if (chr === "#") {
url.fragment = "";
state = FRAGMENT;
} else if (chr !== EOF) {
url.path[0] += percentEncode(chr, C0ControlPercentEncodeSet);
}
break;
case QUERY2:
if (!stateOverride && chr === "#") {
url.fragment = "";
state = FRAGMENT;
} else if (chr !== EOF) {
if (chr === "'" && url.isSpecial())
url.query += "%27";
else if (chr === "#")
url.query += "%23";
else
url.query += percentEncode(chr, C0ControlPercentEncodeSet);
}
break;
case FRAGMENT:
if (chr !== EOF)
url.fragment += percentEncode(chr, fragmentPercentEncodeSet);
break;
}
pointer++;
}
},
parseHost: function(input) {
var result, codePoints, index3;
if (charAt(input, 0) === "[") {
if (charAt(input, input.length - 1) !== "]")
return INVALID_HOST;
result = parseIPv6(stringSlice(input, 1, -1));
if (!result)
return INVALID_HOST;
this.host = result;
} else if (!this.isSpecial()) {
if (exec(FORBIDDEN_HOST_CODE_POINT_EXCLUDING_PERCENT, input))
return INVALID_HOST;
result = "";
codePoints = arrayFrom2(input);
for (index3 = 0; index3 < codePoints.length; index3++) {
result += percentEncode(codePoints[index3], C0ControlPercentEncodeSet);
}
this.host = result;
} else {
input = toASCII(input);
if (exec(FORBIDDEN_HOST_CODE_POINT, input))
return INVALID_HOST;
result = parseIPv4(input);
if (result === null)
return INVALID_HOST;
this.host = result;
}
},
cannotHaveUsernamePasswordPort: function() {
return !this.host || this.cannotBeABaseURL || this.scheme === "file";
},
includesCredentials: function() {
return this.username !== "" || this.password !== "";
},
isSpecial: function() {
return hasOwn(specialSchemes, this.scheme);
},
shortenPath: function() {
var path = this.path;
var pathSize = path.length;
if (pathSize && (this.scheme !== "file" || pathSize !== 1 || !isWindowsDriveLetter(path[0], true))) {
path.length--;
}
},
serialize: function() {
var url = this;
var scheme2 = url.scheme;
var username = url.username;
var password = url.password;
var host = url.host;
var port = url.port;
var path = url.path;
var query = url.query;
var fragment = url.fragment;
var output = scheme2 + ":";
if (host !== null) {
output += "//";
if (url.includesCredentials()) {
output += username + (password ? ":" + password : "") + "@";
}
output += serializeHost(host);
if (port !== null)
output += ":" + port;
} else if (scheme2 === "file")
output += "//";
output += url.cannotBeABaseURL ? path[0] : path.length ? "/" + join3(path, "/") : "";
if (query !== null)
output += "?" + query;
if (fragment !== null)
output += "#" + fragment;
return output;
},
setHref: function(href) {
var failure = this.parse(href);
if (failure)
throw new TypeError2(failure);
this.searchParams.update();
},
getOrigin: function() {
var scheme2 = this.scheme;
var port = this.port;
if (scheme2 === "blob")
try {
return new URLConstructor(scheme2.path[0]).origin;
} catch (error2) {
return "null";
}
if (scheme2 === "file" || !this.isSpecial())
return "null";
return scheme2 + "://" + serializeHost(this.host) + (port !== null ? ":" + port : "");
},
getProtocol: function() {
return this.scheme + ":";
},
setProtocol: function(protocol) {
this.parse($toString(protocol) + ":", SCHEME_START);
},
getUsername: function() {
return this.username;
},
setUsername: function(username) {
var codePoints = arrayFrom2($toString(username));
if (this.cannotHaveUsernamePasswordPort())
return;
this.username = "";
for (var i5 = 0; i5 < codePoints.length; i5++) {
this.username += percentEncode(codePoints[i5], userinfoPercentEncodeSet);
}
},
getPassword: function() {
return this.password;
},
setPassword: function(password) {
var codePoints = arrayFrom2($toString(password));
if (this.cannotHaveUsernamePasswordPort())
return;
this.password = "";
for (var i5 = 0; i5 < codePoints.length; i5++) {
this.password += percentEncode(codePoints[i5], userinfoPercentEncodeSet);
}
},
getHost: function() {
var host = this.host;
var port = this.port;
return host === null ? "" : port === null ? serializeHost(host) : serializeHost(host) + ":" + port;
},
setHost: function(host) {
if (this.cannotBeABaseURL)
return;
this.parse(host, HOST);
},
getHostname: function() {
var host = this.host;
return host === null ? "" : serializeHost(host);
},
setHostname: function(hostname) {
if (this.cannotBeABaseURL)
return;
this.parse(hostname, HOSTNAME);
},
getPort: function() {
var port = this.port;
return port === null ? "" : $toString(port);
},
setPort: function(port) {
if (this.cannotHaveUsernamePasswordPort())
return;
port = $toString(port);
if (port === "")
this.port = null;
else
this.parse(port, PORT);
},
getPathname: function() {
var path = this.path;
return this.cannotBeABaseURL ? path[0] : path.length ? "/" + join3(path, "/") : "";
},
setPathname: function(pathname) {
if (this.cannotBeABaseURL)
return;
this.path = [];
this.parse(pathname, PATH_START);
},
getSearch: function() {
var query = this.query;
return query ? "?" + query : "";
},
setSearch: function(search) {
search = $toString(search);
if (search === "") {
this.query = null;
} else {
if (charAt(search, 0) === "?")
search = stringSlice(search, 1);
this.query = "";
this.parse(search, QUERY2);
}
this.searchParams.update();
},
getSearchParams: function() {
return this.searchParams.facade;
},
getHash: function() {
var fragment = this.fragment;
return fragment ? "#" + fragment : "";
},
setHash: function(hash3) {
hash3 = $toString(hash3);
if (hash3 === "") {
this.fragment = null;
return;
}
if (charAt(hash3, 0) === "#")
hash3 = stringSlice(hash3, 1);
this.fragment = "";
this.parse(hash3, FRAGMENT);
},
update: function() {
this.query = this.searchParams.serialize() || null;
}
};
var URLConstructor = function URL2(url) {
var that = anInstance(this, URLPrototype);
var base2 = validateArgumentsLength(arguments.length, 1) > 1 ? arguments[1] : void 0;
var state = setInternalState(that, new URLState(url, false, base2));
if (!DESCRIPTORS) {
that.href = state.serialize();
that.origin = state.getOrigin();
that.protocol = state.getProtocol();
that.username = state.getUsername();
that.password = state.getPassword();
that.host = state.getHost();
that.hostname = state.getHostname();
that.port = state.getPort();
that.pathname = state.getPathname();
that.search = state.getSearch();
that.searchParams = state.getSearchParams();
that.hash = state.getHash();
}
};
var URLPrototype = URLConstructor.prototype;
var accessorDescriptor = function(getter, setter) {
return {
get: function() {
return getInternalURLState(this)[getter]();
},
set: setter && function(value) {
return getInternalURLState(this)[setter](value);
},
configurable: true,
enumerable: true
};
};
if (DESCRIPTORS) {
defineBuiltInAccessor(URLPrototype, "href", accessorDescriptor("serialize", "setHref"));
defineBuiltInAccessor(URLPrototype, "origin", accessorDescriptor("getOrigin"));
defineBuiltInAccessor(URLPrototype, "protocol", accessorDescriptor("getProtocol", "setProtocol"));
defineBuiltInAccessor(URLPrototype, "username", accessorDescriptor("getUsername", "setUsername"));
defineBuiltInAccessor(URLPrototype, "password", accessorDescriptor("getPassword", "setPassword"));
defineBuiltInAccessor(URLPrototype, "host", accessorDescriptor("getHost", "setHost"));
defineBuiltInAccessor(URLPrototype, "hostname", accessorDescriptor("getHostname", "setHostname"));
defineBuiltInAccessor(URLPrototype, "port", accessorDescriptor("getPort", "setPort"));
defineBuiltInAccessor(URLPrototype, "pathname", accessorDescriptor("getPathname", "setPathname"));
defineBuiltInAccessor(URLPrototype, "search", accessorDescriptor("getSearch", "setSearch"));
defineBuiltInAccessor(URLPrototype, "searchParams", accessorDescriptor("getSearchParams"));
defineBuiltInAccessor(URLPrototype, "hash", accessorDescriptor("getHash", "setHash"));
}
defineBuiltIn(URLPrototype, "toJSON", function toJSON() {
return getInternalURLState(this).serialize();
}, { enumerable: true });
defineBuiltIn(URLPrototype, "toString", function toString() {
return getInternalURLState(this).serialize();
}, { enumerable: true });
if (NativeURL) {
nativeCreateObjectURL = NativeURL.createObjectURL;
nativeRevokeObjectURL = NativeURL.revokeObjectURL;
if (nativeCreateObjectURL)
defineBuiltIn(URLConstructor, "createObjectURL", bind3(nativeCreateObjectURL, NativeURL));
if (nativeRevokeObjectURL)
defineBuiltIn(URLConstructor, "revokeObjectURL", bind3(nativeRevokeObjectURL, NativeURL));
}
var nativeCreateObjectURL;
var nativeRevokeObjectURL;
setToStringTag(URLConstructor, "URL");
$3({ global: true, constructor: true, forced: !USE_NATIVE_URL, sham: !DESCRIPTORS }, {
URL: URLConstructor
});
}
});
// node_modules/core-js/modules/web.url.js
var require_web_url = __commonJS({
"node_modules/core-js/modules/web.url.js"() {
"use strict";
require_web_url_constructor();
}
});
// node_modules/core-js/modules/web.url.can-parse.js
var require_web_url_can_parse = __commonJS({
"node_modules/core-js/modules/web.url.can-parse.js"() {
"use strict";
var $3 = require_export();
var getBuiltIn = require_get_built_in();
var fails = require_fails();
var validateArgumentsLength = require_validate_arguments_length();
var toString = require_to_string();
var USE_NATIVE_URL = require_url_constructor_detection();
var URL2 = getBuiltIn("URL");
var THROWS_WITHOUT_ARGUMENTS = USE_NATIVE_URL && fails(function() {
URL2.canParse();
});
var WRONG_ARITY = fails(function() {
return URL2.canParse.length !== 1;
});
$3({ target: "URL", stat: true, forced: !THROWS_WITHOUT_ARGUMENTS || WRONG_ARITY }, {
canParse: function canParse(url) {
var length = validateArgumentsLength(arguments.length, 1);
var urlString = toString(url);
var base2 = length < 2 || arguments[1] === void 0 ? void 0 : toString(arguments[1]);
try {
return !!new URL2(urlString, base2);
} catch (error2) {
return false;
}
}
});
}
});
// node_modules/core-js/modules/web.url.parse.js
var require_web_url_parse = __commonJS({
"node_modules/core-js/modules/web.url.parse.js"() {
"use strict";
var $3 = require_export();
var getBuiltIn = require_get_built_in();
var validateArgumentsLength = require_validate_arguments_length();
var toString = require_to_string();
var USE_NATIVE_URL = require_url_constructor_detection();
var URL2 = getBuiltIn("URL");
$3({ target: "URL", stat: true, forced: !USE_NATIVE_URL }, {
parse: function parse4(url) {
var length = validateArgumentsLength(arguments.length, 1);
var urlString = toString(url);
var base2 = length < 2 || arguments[1] === void 0 ? void 0 : toString(arguments[1]);
try {
return new URL2(urlString, base2);
} catch (error2) {
return null;
}
}
});
}
});
// node_modules/core-js/modules/web.url.to-json.js
var require_web_url_to_json = __commonJS({
"node_modules/core-js/modules/web.url.to-json.js"() {
"use strict";
var $3 = require_export();
var call = require_function_call();
$3({ target: "URL", proto: true, enumerable: true }, {
toJSON: function toJSON() {
return call(URL.prototype.toString, this);
}
});
}
});
// node_modules/core-js/modules/web.url-search-params.js
var require_web_url_search_params = __commonJS({
"node_modules/core-js/modules/web.url-search-params.js"() {
"use strict";
require_web_url_search_params_constructor();
}
});
// node_modules/core-js/modules/web.url-search-params.delete.js
var require_web_url_search_params_delete = __commonJS({
"node_modules/core-js/modules/web.url-search-params.delete.js"() {
"use strict";
var defineBuiltIn = require_define_built_in();
var uncurryThis = require_function_uncurry_this();
var toString = require_to_string();
var validateArgumentsLength = require_validate_arguments_length();
var $URLSearchParams = URLSearchParams;
var URLSearchParamsPrototype = $URLSearchParams.prototype;
var append = uncurryThis(URLSearchParamsPrototype.append);
var $delete = uncurryThis(URLSearchParamsPrototype["delete"]);
var forEach2 = uncurryThis(URLSearchParamsPrototype.forEach);
var push = uncurryThis([].push);
var params = new $URLSearchParams("a=1&a=2&b=3");
params["delete"]("a", 1);
params["delete"]("b", void 0);
if (params + "" !== "a=2") {
defineBuiltIn(URLSearchParamsPrototype, "delete", function(name) {
var length = arguments.length;
var $value = length < 2 ? void 0 : arguments[1];
if (length && $value === void 0)
return $delete(this, name);
var entries = [];
forEach2(this, function(v4, k4) {
push(entries, { key: k4, value: v4 });
});
validateArgumentsLength(length, 1);
var key = toString(name);
var value = toString($value);
var index3 = 0;
var dindex = 0;
var found2 = false;
var entriesLength = entries.length;
var entry;
while (index3 < entriesLength) {
entry = entries[index3++];
if (found2 || entry.key === key) {
found2 = true;
$delete(this, entry.key);
} else
dindex++;
}
while (dindex < entriesLength) {
entry = entries[dindex++];
if (!(entry.key === key && entry.value === value))
append(this, entry.key, entry.value);
}
}, { enumerable: true, unsafe: true });
}
}
});
// node_modules/core-js/modules/web.url-search-params.has.js
var require_web_url_search_params_has = __commonJS({
"node_modules/core-js/modules/web.url-search-params.has.js"() {
"use strict";
var defineBuiltIn = require_define_built_in();
var uncurryThis = require_function_uncurry_this();
var toString = require_to_string();
var validateArgumentsLength = require_validate_arguments_length();
var $URLSearchParams = URLSearchParams;
var URLSearchParamsPrototype = $URLSearchParams.prototype;
var getAll = uncurryThis(URLSearchParamsPrototype.getAll);
var $has = uncurryThis(URLSearchParamsPrototype.has);
var params = new $URLSearchParams("a=1");
if (params.has("a", 2) || !params.has("a", void 0)) {
defineBuiltIn(URLSearchParamsPrototype, "has", function has(name) {
var length = arguments.length;
var $value = length < 2 ? void 0 : arguments[1];
if (length && $value === void 0)
return $has(this, name);
var values = getAll(this, name);
validateArgumentsLength(length, 1);
var value = toString($value);
var index3 = 0;
while (index3 < values.length) {
if (values[index3++] === value)
return true;
}
return false;
}, { enumerable: true, unsafe: true });
}
}
});
// node_modules/core-js/modules/web.url-search-params.size.js
var require_web_url_search_params_size = __commonJS({
"node_modules/core-js/modules/web.url-search-params.size.js"() {
"use strict";
var DESCRIPTORS = require_descriptors();
var uncurryThis = require_function_uncurry_this();
var defineBuiltInAccessor = require_define_built_in_accessor();
var URLSearchParamsPrototype = URLSearchParams.prototype;
var forEach2 = uncurryThis(URLSearchParamsPrototype.forEach);
if (DESCRIPTORS && !("size" in URLSearchParamsPrototype)) {
defineBuiltInAccessor(URLSearchParamsPrototype, "size", {
get: function size() {
var count = 0;
forEach2(this, function() {
count++;
});
return count;
},
configurable: true,
enumerable: true
});
}
}
});
// node_modules/core-js/stable/index.js
var require_stable = __commonJS({
"node_modules/core-js/stable/index.js"(exports2, module2) {
"use strict";
require_es_symbol();
require_es_symbol_description();
require_es_symbol_async_iterator();
require_es_symbol_has_instance();
require_es_symbol_is_concat_spreadable();
require_es_symbol_iterator();
require_es_symbol_match();
require_es_symbol_match_all();
require_es_symbol_replace();
require_es_symbol_search();
require_es_symbol_species();
require_es_symbol_split();
require_es_symbol_to_primitive();
require_es_symbol_to_string_tag();
require_es_symbol_unscopables();
require_es_error_cause();
require_es_error_to_string();
require_es_aggregate_error();
require_es_aggregate_error_cause();
require_es_array_at();
require_es_array_concat();
require_es_array_copy_within();
require_es_array_every();
require_es_array_fill();
require_es_array_filter();
require_es_array_find();
require_es_array_find_index();
require_es_array_find_last();
require_es_array_find_last_index();
require_es_array_flat();
require_es_array_flat_map();
require_es_array_for_each();
require_es_array_from();
require_es_array_includes();
require_es_array_index_of();
require_es_array_is_array();
require_es_array_iterator();
require_es_array_join();
require_es_array_last_index_of();
require_es_array_map();
require_es_array_of();
require_es_array_push();
require_es_array_reduce();
require_es_array_reduce_right();
require_es_array_reverse();
require_es_array_slice();
require_es_array_some();
require_es_array_sort();
require_es_array_species();
require_es_array_splice();
require_es_array_to_reversed();
require_es_array_to_sorted();
require_es_array_to_spliced();
require_es_array_unscopables_flat();
require_es_array_unscopables_flat_map();
require_es_array_unshift();
require_es_array_with();
require_es_array_buffer_constructor();
require_es_array_buffer_is_view();
require_es_array_buffer_slice();
require_es_data_view();
require_es_array_buffer_detached();
require_es_array_buffer_transfer();
require_es_array_buffer_transfer_to_fixed_length();
require_es_date_get_year();
require_es_date_now();
require_es_date_set_year();
require_es_date_to_gmt_string();
require_es_date_to_iso_string();
require_es_date_to_json();
require_es_date_to_primitive();
require_es_date_to_string();
require_es_escape();
require_es_function_bind();
require_es_function_has_instance();
require_es_function_name();
require_es_global_this();
require_es_iterator_constructor();
require_es_iterator_drop();
require_es_iterator_every();
require_es_iterator_filter();
require_es_iterator_find();
require_es_iterator_flat_map();
require_es_iterator_for_each();
require_es_iterator_from();
require_es_iterator_map();
require_es_iterator_reduce();
require_es_iterator_some();
require_es_iterator_take();
require_es_iterator_to_array();
require_es_json_stringify();
require_es_json_to_string_tag();
require_es_map();
require_es_map_group_by();
require_es_math_acosh();
require_es_math_asinh();
require_es_math_atanh();
require_es_math_cbrt();
require_es_math_clz32();
require_es_math_cosh();
require_es_math_expm1();
require_es_math_fround();
require_es_math_hypot();
require_es_math_imul();
require_es_math_log10();
require_es_math_log1p();
require_es_math_log2();
require_es_math_sign();
require_es_math_sinh();
require_es_math_tanh();
require_es_math_to_string_tag();
require_es_math_trunc();
require_es_number_constructor();
require_es_number_epsilon();
require_es_number_is_finite();
require_es_number_is_integer();
require_es_number_is_nan();
require_es_number_is_safe_integer();
require_es_number_max_safe_integer();
require_es_number_min_safe_integer();
require_es_number_parse_float();
require_es_number_parse_int();
require_es_number_to_exponential();
require_es_number_to_fixed();
require_es_number_to_precision();
require_es_object_assign();
require_es_object_create();
require_es_object_define_getter();
require_es_object_define_properties();
require_es_object_define_property();
require_es_object_define_setter();
require_es_object_entries();
require_es_object_freeze();
require_es_object_from_entries();
require_es_object_get_own_property_descriptor();
require_es_object_get_own_property_descriptors();
require_es_object_get_own_property_names();
require_es_object_get_prototype_of();
require_es_object_group_by();
require_es_object_has_own();
require_es_object_is();
require_es_object_is_extensible();
require_es_object_is_frozen();
require_es_object_is_sealed();
require_es_object_keys();
require_es_object_lookup_getter();
require_es_object_lookup_setter();
require_es_object_prevent_extensions();
require_es_object_proto();
require_es_object_seal();
require_es_object_set_prototype_of();
require_es_object_to_string();
require_es_object_values();
require_es_parse_float();
require_es_parse_int();
require_es_promise();
require_es_promise_all_settled();
require_es_promise_any();
require_es_promise_finally();
require_es_promise_try();
require_es_promise_with_resolvers();
require_es_reflect_apply();
require_es_reflect_construct();
require_es_reflect_define_property();
require_es_reflect_delete_property();
require_es_reflect_get();
require_es_reflect_get_own_property_descriptor();
require_es_reflect_get_prototype_of();
require_es_reflect_has();
require_es_reflect_is_extensible();
require_es_reflect_own_keys();
require_es_reflect_prevent_extensions();
require_es_reflect_set();
require_es_reflect_set_prototype_of();
require_es_reflect_to_string_tag();
require_es_regexp_constructor();
require_es_regexp_dot_all();
require_es_regexp_exec();
require_es_regexp_flags();
require_es_regexp_sticky();
require_es_regexp_test();
require_es_regexp_to_string();
require_es_set();
require_es_set_difference_v2();
require_es_set_intersection_v2();
require_es_set_is_disjoint_from_v2();
require_es_set_is_subset_of_v2();
require_es_set_is_superset_of_v2();
require_es_set_symmetric_difference_v2();
require_es_set_union_v2();
require_es_string_at_alternative();
require_es_string_code_point_at();
require_es_string_ends_with();
require_es_string_from_code_point();
require_es_string_includes();
require_es_string_is_well_formed();
require_es_string_iterator();
require_es_string_match();
require_es_string_match_all();
require_es_string_pad_end();
require_es_string_pad_start();
require_es_string_raw();
require_es_string_repeat();
require_es_string_replace();
require_es_string_replace_all();
require_es_string_search();
require_es_string_split();
require_es_string_starts_with();
require_es_string_substr();
require_es_string_to_well_formed();
require_es_string_trim();
require_es_string_trim_end();
require_es_string_trim_start();
require_es_string_anchor();
require_es_string_big();
require_es_string_blink();
require_es_string_bold();
require_es_string_fixed();
require_es_string_fontcolor();
require_es_string_fontsize();
require_es_string_italics();
require_es_string_link();
require_es_string_small();
require_es_string_strike();
require_es_string_sub();
require_es_string_sup();
require_es_typed_array_float32_array();
require_es_typed_array_float64_array();
require_es_typed_array_int8_array();
require_es_typed_array_int16_array();
require_es_typed_array_int32_array();
require_es_typed_array_uint8_array();
require_es_typed_array_uint8_clamped_array();
require_es_typed_array_uint16_array();
require_es_typed_array_uint32_array();
require_es_typed_array_at();
require_es_typed_array_copy_within();
require_es_typed_array_every();
require_es_typed_array_fill();
require_es_typed_array_filter();
require_es_typed_array_find();
require_es_typed_array_find_index();
require_es_typed_array_find_last();
require_es_typed_array_find_last_index();
require_es_typed_array_for_each();
require_es_typed_array_from();
require_es_typed_array_includes();
require_es_typed_array_index_of();
require_es_typed_array_iterator();
require_es_typed_array_join();
require_es_typed_array_last_index_of();
require_es_typed_array_map();
require_es_typed_array_of();
require_es_typed_array_reduce();
require_es_typed_array_reduce_right();
require_es_typed_array_reverse();
require_es_typed_array_set();
require_es_typed_array_slice();
require_es_typed_array_some();
require_es_typed_array_sort();
require_es_typed_array_subarray();
require_es_typed_array_to_locale_string();
require_es_typed_array_to_reversed();
require_es_typed_array_to_sorted();
require_es_typed_array_to_string();
require_es_typed_array_with();
require_es_unescape();
require_es_weak_map();
require_es_weak_set();
require_web_atob();
require_web_btoa();
require_web_dom_collections_for_each();
require_web_dom_collections_iterator();
require_web_dom_exception_constructor();
require_web_dom_exception_stack();
require_web_dom_exception_to_string_tag();
require_web_immediate();
require_web_queue_microtask();
require_web_self();
require_web_structured_clone();
require_web_timers();
require_web_url();
require_web_url_can_parse();
require_web_url_parse();
require_web_url_to_json();
require_web_url_search_params();
require_web_url_search_params_delete();
require_web_url_search_params_has();
require_web_url_search_params_size();
module2.exports = require_path();
}
});
// node_modules/chartkick/dist/chartkick.js
var require_chartkick = __commonJS({
"node_modules/chartkick/dist/chartkick.js"(exports2, module2) {
(function(global2, factory) {
typeof exports2 === "object" && typeof module2 !== "undefined" ? module2.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.Chartkick = factory());
})(exports2, function() {
"use strict";
function isArray2(variable) {
return Object.prototype.toString.call(variable) === "[object Array]";
}
function isFunction3(variable) {
return variable instanceof Function;
}
function isPlainObject4(variable) {
return Object.prototype.toString.call(variable) === "[object Object]" && !isFunction3(variable) && variable instanceof Object;
}
function extend4(target, source) {
var key;
for (key in source) {
if (key === "__proto__") {
continue;
}
if (isPlainObject4(source[key]) || isArray2(source[key])) {
if (isPlainObject4(source[key]) && !isPlainObject4(target[key])) {
target[key] = {};
}
if (isArray2(source[key]) && !isArray2(target[key])) {
target[key] = [];
}
extend4(target[key], source[key]);
} else if (source[key] !== void 0) {
target[key] = source[key];
}
}
}
function merge3(obj1, obj2) {
var target = {};
extend4(target, obj1);
extend4(target, obj2);
return target;
}
var DATE_PATTERN = /^(\d\d\d\d)(-)?(\d\d)(-)?(\d\d)$/i;
function negativeValues(series) {
var i5, j4, data;
for (i5 = 0; i5 < series.length; i5++) {
data = series[i5].data;
for (j4 = 0; j4 < data.length; j4++) {
if (data[j4][1] < 0) {
return true;
}
}
}
return false;
}
function toStr(n7) {
return "" + n7;
}
function toFloat(n7) {
return parseFloat(n7);
}
function toDate2(n7) {
var matches3, year, month, day;
if (typeof n7 !== "object") {
if (typeof n7 === "number") {
n7 = new Date(n7 * 1e3);
} else {
n7 = toStr(n7);
if (matches3 = n7.match(DATE_PATTERN)) {
year = parseInt(matches3[1], 10);
month = parseInt(matches3[3], 10) - 1;
day = parseInt(matches3[5], 10);
return new Date(year, month, day);
} else {
var str = n7.replace(/ /, "T").replace(" ", "").replace("UTC", "Z");
n7 = new Date(Date.parse(str) || n7);
}
}
}
return n7;
}
function toArr(n7) {
if (!isArray2(n7)) {
var arr = [], i5;
for (i5 in n7) {
if (n7.hasOwnProperty(i5)) {
arr.push([i5, n7[i5]]);
}
}
n7 = arr;
}
return n7;
}
function jsOptionsFunc(defaultOptions3, hideLegend2, setTitle2, setMin2, setMax2, setStacked2, setXtitle2, setYtitle2) {
return function(chart, opts, chartOptions) {
var series = chart.data;
var options = merge3({}, defaultOptions3);
options = merge3(options, chartOptions || {});
if (chart.singleSeriesFormat || "legend" in opts) {
hideLegend2(options, opts.legend, chart.singleSeriesFormat);
}
if (opts.title) {
setTitle2(options, opts.title);
}
if ("min" in opts) {
setMin2(options, opts.min);
} else if (!negativeValues(series)) {
setMin2(options, 0);
}
if (opts.max) {
setMax2(options, opts.max);
}
if ("stacked" in opts) {
setStacked2(options, opts.stacked);
}
if (opts.colors) {
options.colors = opts.colors;
}
if (opts.xtitle) {
setXtitle2(options, opts.xtitle);
}
if (opts.ytitle) {
setYtitle2(options, opts.ytitle);
}
options = merge3(options, opts.library || {});
return options;
};
}
function sortByTime(a5, b4) {
return a5[0].getTime() - b4[0].getTime();
}
function sortByNumberSeries(a5, b4) {
return a5[0] - b4[0];
}
function sortByNumber(a5, b4) {
return a5 - b4;
}
function isMinute(d4) {
return d4.getMilliseconds() === 0 && d4.getSeconds() === 0;
}
function isHour(d4) {
return isMinute(d4) && d4.getMinutes() === 0;
}
function isDay(d4) {
return isHour(d4) && d4.getHours() === 0;
}
function isWeek(d4, dayOfWeek2) {
return isDay(d4) && d4.getDay() === dayOfWeek2;
}
function isMonth(d4) {
return isDay(d4) && d4.getDate() === 1;
}
function isYear(d4) {
return isMonth(d4) && d4.getMonth() === 0;
}
function isDate3(obj) {
return !isNaN(toDate2(obj)) && toStr(obj).length >= 6;
}
function isNumber4(obj) {
return typeof obj === "number";
}
var byteSuffixes = ["bytes", "KB", "MB", "GB", "TB", "PB", "EB"];
function formatValue(pre, value, options, axis) {
pre = pre || "";
if (options.prefix) {
if (value < 0) {
value = value * -1;
pre += "-";
}
pre += options.prefix;
}
var suffix = options.suffix || "";
var precision = options.precision;
var round3 = options.round;
if (options.byteScale) {
var suffixIdx;
var baseValue = axis ? options.byteScale : value;
if (baseValue >= 1152921504606847e3) {
value /= 1152921504606847e3;
suffixIdx = 6;
} else if (baseValue >= 1125899906842624) {
value /= 1125899906842624;
suffixIdx = 5;
} else if (baseValue >= 1099511627776) {
value /= 1099511627776;
suffixIdx = 4;
} else if (baseValue >= 1073741824) {
value /= 1073741824;
suffixIdx = 3;
} else if (baseValue >= 1048576) {
value /= 1048576;
suffixIdx = 2;
} else if (baseValue >= 1024) {
value /= 1024;
suffixIdx = 1;
} else {
suffixIdx = 0;
}
if (precision === void 0 && round3 === void 0) {
if (value >= 1023.5) {
if (suffixIdx < byteSuffixes.length - 1) {
value = 1;
suffixIdx += 1;
}
}
precision = value >= 1e3 ? 4 : 3;
}
suffix = " " + byteSuffixes[suffixIdx];
}
if (precision !== void 0 && round3 !== void 0) {
throw Error("Use either round or precision, not both");
}
if (!axis) {
if (precision !== void 0) {
value = value.toPrecision(precision);
if (!options.zeros) {
value = parseFloat(value);
}
}
if (round3 !== void 0) {
if (round3 < 0) {
var num = Math.pow(10, -1 * round3);
value = parseInt((1 * value / num).toFixed(0)) * num;
} else {
value = value.toFixed(round3);
if (!options.zeros) {
value = parseFloat(value);
}
}
}
}
if (options.thousands || options.decimal) {
value = toStr(value);
var parts = value.split(".");
value = parts[0];
if (options.thousands) {
value = value.replace(/\B(?=(\d{3})+(?!\d))/g, options.thousands);
}
if (parts.length > 1) {
value += (options.decimal || ".") + parts[1];
}
}
return pre + value + suffix;
}
function seriesOption(chart, series, option2) {
if (option2 in series) {
return series[option2];
} else if (option2 in chart.options) {
return chart.options[option2];
}
return null;
}
function allZeros(data) {
var i5, j4, d4;
for (i5 = 0; i5 < data.length; i5++) {
d4 = data[i5].data;
for (j4 = 0; j4 < d4.length; j4++) {
if (d4[j4][1] != 0) {
return false;
}
}
}
return true;
}
var baseOptions = {
maintainAspectRatio: false,
animation: false,
plugins: {
legend: {},
tooltip: {
displayColors: false,
callbacks: {}
},
title: {
font: {
size: 20
},
color: "#333"
}
},
interaction: {}
};
var defaultOptions$2 = {
scales: {
y: {
ticks: {
maxTicksLimit: 4
},
title: {
font: {
size: 16
},
color: "#333"
},
grid: {}
},
x: {
grid: {
drawOnChartArea: false
},
title: {
font: {
size: 16
},
color: "#333"
},
time: {},
ticks: {}
}
}
};
var defaultColors = [
"#3366CC",
"#DC3912",
"#FF9900",
"#109618",
"#990099",
"#3B3EAC",
"#0099C6",
"#DD4477",
"#66AA00",
"#B82E2E",
"#316395",
"#994499",
"#22AA99",
"#AAAA11",
"#6633CC",
"#E67300",
"#8B0707",
"#329262",
"#5574A6",
"#651067"
];
var hideLegend$2 = function(options, legend, hideLegend2) {
if (legend !== void 0) {
options.plugins.legend.display = !!legend;
if (legend && legend !== true) {
options.plugins.legend.position = legend;
}
} else if (hideLegend2) {
options.plugins.legend.display = false;
}
};
var setTitle$2 = function(options, title) {
options.plugins.title.display = true;
options.plugins.title.text = title;
};
var setMin$2 = function(options, min2) {
if (min2 !== null) {
options.scales.y.min = toFloat(min2);
}
};
var setMax$2 = function(options, max2) {
options.scales.y.max = toFloat(max2);
};
var setBarMin$1 = function(options, min2) {
if (min2 !== null) {
options.scales.x.min = toFloat(min2);
}
};
var setBarMax$1 = function(options, max2) {
options.scales.x.max = toFloat(max2);
};
var setStacked$2 = function(options, stacked) {
options.scales.x.stacked = !!stacked;
options.scales.y.stacked = !!stacked;
};
var setXtitle$2 = function(options, title) {
options.scales.x.title.display = true;
options.scales.x.title.text = title;
};
var setYtitle$2 = function(options, title) {
options.scales.y.title.display = true;
options.scales.y.title.text = title;
};
var addOpacity = function(hex2, opacity) {
var result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex2);
return result ? "rgba(" + parseInt(result[1], 16) + ", " + parseInt(result[2], 16) + ", " + parseInt(result[3], 16) + ", " + opacity + ")" : hex2;
};
var notnull = function(x4) {
return x4 != null;
};
var setLabelSize = function(chart, data, options) {
var maxLabelSize = Math.ceil(chart.element.offsetWidth / 4 / data.labels.length);
if (maxLabelSize > 25) {
maxLabelSize = 25;
} else if (maxLabelSize < 10) {
maxLabelSize = 10;
}
if (!options.scales.x.ticks.callback) {
options.scales.x.ticks.callback = function(value) {
value = toStr(this.getLabelForValue(value));
if (value.length > maxLabelSize) {
return value.substring(0, maxLabelSize - 2) + "...";
} else {
return value;
}
};
}
};
var setFormatOptions$1 = function(chart, options, chartType) {
var formatOptions = {
prefix: chart.options.prefix,
suffix: chart.options.suffix,
thousands: chart.options.thousands,
decimal: chart.options.decimal,
precision: chart.options.precision,
round: chart.options.round,
zeros: chart.options.zeros
};
if (chart.options.bytes) {
var series = chart.data;
if (chartType === "pie") {
series = [{ data: series }];
}
var max2 = 0;
for (var i5 = 0; i5 < series.length; i5++) {
var s6 = series[i5];
for (var j4 = 0; j4 < s6.data.length; j4++) {
if (s6.data[j4][1] > max2) {
max2 = s6.data[j4][1];
}
}
}
var scale = 1;
while (max2 >= 1024) {
scale *= 1024;
max2 /= 1024;
}
formatOptions.byteScale = scale;
}
if (chartType !== "pie") {
var axis = options.scales.y;
if (chartType === "bar") {
axis = options.scales.x;
}
if (formatOptions.byteScale) {
if (!axis.ticks.stepSize) {
axis.ticks.stepSize = formatOptions.byteScale / 2;
}
if (!axis.ticks.maxTicksLimit) {
axis.ticks.maxTicksLimit = 4;
}
}
if (!axis.ticks.callback) {
axis.ticks.callback = function(value) {
return formatValue("", value, formatOptions, true);
};
}
}
if (!options.plugins.tooltip.callbacks.label) {
if (chartType === "scatter") {
options.plugins.tooltip.callbacks.label = function(context) {
var label = context.dataset.label || "";
if (label) {
label += ": ";
}
return label + "(" + context.label + ", " + context.formattedValue + ")";
};
} else if (chartType === "bubble") {
options.plugins.tooltip.callbacks.label = function(context) {
var label = context.dataset.label || "";
if (label) {
label += ": ";
}
var dataPoint = context.raw;
return label + "(" + dataPoint.x + ", " + dataPoint.y + ", " + dataPoint.v + ")";
};
} else if (chartType === "pie") {
options.plugins.tooltip.callbacks.label = function(context) {
var dataLabel = context.label;
var value = ": ";
if (isArray2(dataLabel)) {
dataLabel = dataLabel.slice();
dataLabel[0] += value;
} else {
dataLabel += value;
}
return formatValue(dataLabel, context.parsed, formatOptions);
};
} else {
var valueLabel = chartType === "bar" ? "x" : "y";
options.plugins.tooltip.callbacks.label = function(context) {
if (context.parsed[valueLabel] === null) {
return;
}
var label = context.dataset.label || "";
if (label) {
label += ": ";
}
return formatValue(label, context.parsed[valueLabel], formatOptions);
};
}
}
};
var jsOptions$2 = jsOptionsFunc(merge3(baseOptions, defaultOptions$2), hideLegend$2, setTitle$2, setMin$2, setMax$2, setStacked$2, setXtitle$2, setYtitle$2);
var createDataTable = function(chart, options, chartType) {
var datasets = [];
var labels = [];
var colors2 = chart.options.colors || defaultColors;
var day = true;
var week = true;
var dayOfWeek2;
var month = true;
var year = true;
var hour = true;
var minute = true;
var series = chart.data;
var max2 = 0;
if (chartType === "bubble") {
for (var i$1 = 0; i$1 < series.length; i$1++) {
var s$1 = series[i$1];
for (var j$1 = 0; j$1 < s$1.data.length; j$1++) {
if (s$1.data[j$1][2] > max2) {
max2 = s$1.data[j$1][2];
}
}
}
}
var i5, j4, s6, d4, key, rows = [], rows2 = [];
if (chartType === "bar" || chartType === "column" || chart.xtype !== "number" && chart.xtype !== "bubble") {
var sortedLabels = [];
for (i5 = 0; i5 < series.length; i5++) {
s6 = series[i5];
for (j4 = 0; j4 < s6.data.length; j4++) {
d4 = s6.data[j4];
key = chart.xtype == "datetime" ? d4[0].getTime() : d4[0];
if (!rows[key]) {
rows[key] = new Array(series.length);
}
rows[key][i5] = toFloat(d4[1]);
if (sortedLabels.indexOf(key) === -1) {
sortedLabels.push(key);
}
}
}
if (chart.xtype === "datetime" || chart.xtype === "number") {
sortedLabels.sort(sortByNumber);
}
for (j4 = 0; j4 < series.length; j4++) {
rows2.push([]);
}
var value;
var k4;
for (k4 = 0; k4 < sortedLabels.length; k4++) {
i5 = sortedLabels[k4];
if (chart.xtype === "datetime") {
value = new Date(toFloat(i5));
day = day && isDay(value);
if (!dayOfWeek2) {
dayOfWeek2 = value.getDay();
}
week = week && isWeek(value, dayOfWeek2);
month = month && isMonth(value);
year = year && isYear(value);
hour = hour && isHour(value);
minute = minute && isMinute(value);
} else {
value = i5;
}
labels.push(value);
for (j4 = 0; j4 < series.length; j4++) {
rows2[j4].push(rows[i5][j4] === void 0 ? null : rows[i5][j4]);
}
}
} else {
for (var i$2 = 0; i$2 < series.length; i$2++) {
var s$2 = series[i$2];
var d$1 = [];
for (var j$2 = 0; j$2 < s$2.data.length; j$2++) {
var point = {
x: toFloat(s$2.data[j$2][0]),
y: toFloat(s$2.data[j$2][1])
};
if (chartType === "bubble") {
point.r = toFloat(s$2.data[j$2][2]) * 20 / max2;
point.v = s$2.data[j$2][2];
}
d$1.push(point);
}
rows2.push(d$1);
}
}
var color2;
var backgroundColor;
for (i5 = 0; i5 < series.length; i5++) {
s6 = series[i5];
if (chart.options.colors && chart.singleSeriesFormat && (chartType === "bar" || chartType === "column") && !s6.color && isArray2(chart.options.colors) && !isArray2(chart.options.colors[0])) {
color2 = colors2;
backgroundColor = [];
for (var j$3 = 0; j$3 < colors2.length; j$3++) {
backgroundColor[j$3] = addOpacity(color2[j$3], 0.5);
}
} else {
color2 = s6.color || colors2[i5];
backgroundColor = chartType !== "line" ? addOpacity(color2, 0.5) : color2;
}
var dataset = {
label: s6.name || "",
data: rows2[i5],
fill: chartType === "area",
borderColor: color2,
backgroundColor,
borderWidth: 2
};
var pointChart = chartType === "line" || chartType === "area" || chartType === "scatter" || chartType === "bubble";
if (pointChart) {
dataset.pointBackgroundColor = color2;
dataset.pointHoverBackgroundColor = color2;
dataset.pointHitRadius = 50;
}
if (chartType === "bubble") {
dataset.pointBackgroundColor = backgroundColor;
dataset.pointHoverBackgroundColor = backgroundColor;
dataset.pointHoverBorderWidth = 2;
}
if (s6.stack) {
dataset.stack = s6.stack;
}
var curve = seriesOption(chart, s6, "curve");
if (curve === false) {
dataset.tension = 0;
} else if (pointChart) {
dataset.tension = 0.4;
}
var points = seriesOption(chart, s6, "points");
if (points === false) {
dataset.pointRadius = 0;
dataset.pointHoverRadius = 0;
}
dataset = merge3(dataset, chart.options.dataset || {});
dataset = merge3(dataset, s6.library || {});
dataset = merge3(dataset, s6.dataset || {});
datasets.push(dataset);
}
var xmin = chart.options.xmin;
var xmax = chart.options.xmax;
if (chart.xtype === "datetime") {
if (notnull(xmin)) {
options.scales.x.min = toDate2(xmin).getTime();
}
if (notnull(xmax)) {
options.scales.x.max = toDate2(xmax).getTime();
}
} else if (chart.xtype === "number") {
if (notnull(xmin)) {
options.scales.x.min = xmin;
}
if (notnull(xmax)) {
options.scales.x.max = xmax;
}
}
if (chart.xtype === "datetime" && labels.length === 0) {
if (notnull(xmin)) {
labels.push(toDate2(xmin));
}
if (notnull(xmax)) {
labels.push(toDate2(xmax));
}
day = false;
week = false;
month = false;
year = false;
hour = false;
minute = false;
}
if (chart.xtype === "datetime" && labels.length > 0) {
var minTime2 = (notnull(xmin) ? toDate2(xmin) : labels[0]).getTime();
var maxTime2 = (notnull(xmax) ? toDate2(xmax) : labels[0]).getTime();
for (i5 = 1; i5 < labels.length; i5++) {
var value$1 = labels[i5].getTime();
if (value$1 < minTime2) {
minTime2 = value$1;
}
if (value$1 > maxTime2) {
maxTime2 = value$1;
}
}
var timeDiff = (maxTime2 - minTime2) / (86400 * 1e3);
if (!options.scales.x.time.unit) {
var step;
if (year || timeDiff > 365 * 10) {
options.scales.x.time.unit = "year";
step = 365;
} else if (month || timeDiff > 30 * 10) {
options.scales.x.time.unit = "month";
step = 30;
} else if (day || timeDiff > 10) {
options.scales.x.time.unit = "day";
step = 1;
} else if (hour || timeDiff > 0.5) {
options.scales.x.time.displayFormats = { hour: "MMM d, h a" };
options.scales.x.time.unit = "hour";
step = 1 / 24;
} else if (minute) {
options.scales.x.time.displayFormats = { minute: "h:mm a" };
options.scales.x.time.unit = "minute";
step = 1 / 24 / 60;
}
if (step && timeDiff > 0) {
var width = chart.element.offsetWidth;
if (width > 0) {
var unitStepSize = Math.ceil(timeDiff / step / (width / 100));
if (week && step === 1) {
unitStepSize = Math.ceil(unitStepSize / 7) * 7;
}
options.scales.x.time.stepSize = unitStepSize;
}
}
}
if (!options.scales.x.time.tooltipFormat) {
if (day) {
options.scales.x.time.tooltipFormat = "PP";
} else if (hour) {
options.scales.x.time.tooltipFormat = "MMM d, h a";
} else if (minute) {
options.scales.x.time.tooltipFormat = "h:mm a";
}
}
}
var data = {
labels,
datasets
};
return data;
};
var defaultExport$2 = function defaultExport2(library) {
this.name = "chartjs";
this.library = library;
};
defaultExport$2.prototype.renderLineChart = function renderLineChart(chart, chartType) {
var chartOptions = {};
if (!chart.options.max && allZeros(chart.data)) {
chartOptions.max = 1;
}
var options = jsOptions$2(chart, merge3(chartOptions, chart.options));
setFormatOptions$1(chart, options, chartType);
var data = createDataTable(chart, options, chartType || "line");
if (chart.xtype === "number") {
options.scales.x.type = options.scales.x.type || "linear";
options.scales.x.position = options.scales.x.position || "bottom";
} else {
options.scales.x.type = chart.xtype === "string" ? "category" : "time";
}
this.drawChart(chart, "line", data, options);
};
defaultExport$2.prototype.renderPieChart = function renderPieChart(chart) {
var options = merge3({}, baseOptions);
if (chart.options.donut) {
options.cutout = "50%";
}
if ("legend" in chart.options) {
hideLegend$2(options, chart.options.legend);
}
if (chart.options.title) {
setTitle$2(options, chart.options.title);
}
options = merge3(options, chart.options.library || {});
setFormatOptions$1(chart, options, "pie");
var labels = [];
var values = [];
for (var i5 = 0; i5 < chart.data.length; i5++) {
var point = chart.data[i5];
labels.push(point[0]);
values.push(point[1]);
}
var dataset = {
data: values,
backgroundColor: chart.options.colors || defaultColors
};
dataset = merge3(dataset, chart.options.dataset || {});
var data = {
labels,
datasets: [dataset]
};
this.drawChart(chart, "pie", data, options);
};
defaultExport$2.prototype.renderColumnChart = function renderColumnChart(chart, chartType) {
var options;
if (chartType === "bar") {
var barOptions = merge3(baseOptions, defaultOptions$2);
barOptions.indexAxis = "y";
barOptions.scales.x.grid.drawOnChartArea = true;
barOptions.scales.y.grid.drawOnChartArea = false;
delete barOptions.scales.y.ticks.maxTicksLimit;
options = jsOptionsFunc(barOptions, hideLegend$2, setTitle$2, setBarMin$1, setBarMax$1, setStacked$2, setXtitle$2, setYtitle$2)(chart, chart.options);
} else {
options = jsOptions$2(chart, chart.options);
}
setFormatOptions$1(chart, options, chartType);
var data = createDataTable(chart, options, "column");
if (chartType !== "bar") {
setLabelSize(chart, data, options);
}
this.drawChart(chart, "bar", data, options);
};
defaultExport$2.prototype.renderAreaChart = function renderAreaChart(chart) {
this.renderLineChart(chart, "area");
};
defaultExport$2.prototype.renderBarChart = function renderBarChart(chart) {
this.renderColumnChart(chart, "bar");
};
defaultExport$2.prototype.renderScatterChart = function renderScatterChart(chart, chartType) {
chartType = chartType || "scatter";
var options = jsOptions$2(chart, chart.options);
setFormatOptions$1(chart, options, chartType);
if (!("showLine" in options)) {
options.showLine = false;
}
var data = createDataTable(chart, options, chartType);
options.scales.x.type = options.scales.x.type || "linear";
options.scales.x.position = options.scales.x.position || "bottom";
if (!("mode" in options.interaction)) {
options.interaction.mode = "nearest";
}
this.drawChart(chart, chartType, data, options);
};
defaultExport$2.prototype.renderBubbleChart = function renderBubbleChart(chart) {
this.renderScatterChart(chart, "bubble");
};
defaultExport$2.prototype.destroy = function destroy2(chart) {
if (chart.chart) {
chart.chart.destroy();
}
};
defaultExport$2.prototype.drawChart = function drawChart(chart, type, data, options) {
this.destroy(chart);
if (chart.destroyed) {
return;
}
var chartOptions = {
type,
data,
options
};
if (chart.options.code) {
window.console.log("new Chart(ctx, " + JSON.stringify(chartOptions) + ");");
}
chart.element.innerHTML = "";
var ctx = chart.element.getElementsByTagName("CANVAS")[0];
chart.chart = new this.library(ctx, chartOptions);
};
var defaultOptions$1 = {
chart: {},
xAxis: {
title: {
text: null
},
labels: {
style: {
fontSize: "12px"
}
}
},
yAxis: {
title: {
text: null
},
labels: {
style: {
fontSize: "12px"
}
}
},
title: {
text: null
},
credits: {
enabled: false
},
legend: {
borderWidth: 0
},
tooltip: {
style: {
fontSize: "12px"
}
},
plotOptions: {
areaspline: {},
area: {},
series: {
marker: {}
}
},
time: {
useUTC: false
}
};
var hideLegend$1 = function(options, legend, hideLegend2) {
if (legend !== void 0) {
options.legend.enabled = !!legend;
if (legend && legend !== true) {
if (legend === "top" || legend === "bottom") {
options.legend.verticalAlign = legend;
} else {
options.legend.layout = "vertical";
options.legend.verticalAlign = "middle";
options.legend.align = legend;
}
}
} else if (hideLegend2) {
options.legend.enabled = false;
}
};
var setTitle$1 = function(options, title) {
options.title.text = title;
};
var setMin$1 = function(options, min2) {
options.yAxis.min = min2;
};
var setMax$1 = function(options, max2) {
options.yAxis.max = max2;
};
var setStacked$1 = function(options, stacked) {
var stackedValue = stacked ? stacked === true ? "normal" : stacked : null;
options.plotOptions.series.stacking = stackedValue;
options.plotOptions.area.stacking = stackedValue;
options.plotOptions.areaspline.stacking = stackedValue;
};
var setXtitle$1 = function(options, title) {
options.xAxis.title.text = title;
};
var setYtitle$1 = function(options, title) {
options.yAxis.title.text = title;
};
var jsOptions$1 = jsOptionsFunc(defaultOptions$1, hideLegend$1, setTitle$1, setMin$1, setMax$1, setStacked$1, setXtitle$1, setYtitle$1);
var setFormatOptions = function(chart, options, chartType) {
var formatOptions = {
prefix: chart.options.prefix,
suffix: chart.options.suffix,
thousands: chart.options.thousands,
decimal: chart.options.decimal,
precision: chart.options.precision,
round: chart.options.round,
zeros: chart.options.zeros
};
if (chartType !== "pie" && !isArray2(options.yAxis) && !options.yAxis.labels.formatter) {
options.yAxis.labels.formatter = function() {
return formatValue("", this.value, formatOptions);
};
}
if (!options.tooltip.pointFormatter && !options.tooltip.pointFormat) {
options.tooltip.pointFormatter = function() {
return '\u25CF ' + formatValue(this.series.name + ": ", this.y, formatOptions) + "
";
};
}
};
var defaultExport$1 = function defaultExport2(library) {
this.name = "highcharts";
this.library = library;
};
defaultExport$1.prototype.renderLineChart = function renderLineChart(chart, chartType) {
chartType = chartType || "spline";
var chartOptions = {};
if (chartType === "areaspline") {
chartOptions = {
plotOptions: {
areaspline: {
stacking: "normal"
},
area: {
stacking: "normal"
},
series: {
marker: {
enabled: false
}
}
}
};
}
if (chart.options.curve === false) {
if (chartType === "areaspline") {
chartType = "area";
} else if (chartType === "spline") {
chartType = "line";
}
}
var options = jsOptions$1(chart, chart.options, chartOptions), data, i5, j4;
if (chart.xtype === "number") {
options.xAxis.type = options.xAxis.type || "linear";
} else {
options.xAxis.type = chart.xtype === "string" ? "category" : "datetime";
}
if (!options.chart.type) {
options.chart.type = chartType;
}
setFormatOptions(chart, options, chartType);
var series = chart.data;
for (i5 = 0; i5 < series.length; i5++) {
series[i5].name = series[i5].name || "Value";
data = series[i5].data;
if (chart.xtype === "datetime") {
for (j4 = 0; j4 < data.length; j4++) {
data[j4][0] = data[j4][0].getTime();
}
}
series[i5].marker = { symbol: "circle" };
if (chart.options.points === false) {
series[i5].marker.enabled = false;
}
}
this.drawChart(chart, series, options);
};
defaultExport$1.prototype.renderScatterChart = function renderScatterChart(chart) {
var options = jsOptions$1(chart, chart.options, {});
options.chart.type = "scatter";
this.drawChart(chart, chart.data, options);
};
defaultExport$1.prototype.renderPieChart = function renderPieChart(chart) {
var chartOptions = merge3(defaultOptions$1, {});
if (chart.options.colors) {
chartOptions.colors = chart.options.colors;
}
if (chart.options.donut) {
chartOptions.plotOptions = { pie: { innerSize: "50%" } };
}
if ("legend" in chart.options) {
hideLegend$1(chartOptions, chart.options.legend);
}
if (chart.options.title) {
setTitle$1(chartOptions, chart.options.title);
}
var options = merge3(chartOptions, chart.options.library || {});
setFormatOptions(chart, options, "pie");
var series = [{
type: "pie",
name: chart.options.label || "Value",
data: chart.data
}];
this.drawChart(chart, series, options);
};
defaultExport$1.prototype.renderColumnChart = function renderColumnChart(chart, chartType) {
chartType = chartType || "column";
var series = chart.data;
var options = jsOptions$1(chart, chart.options), i5, j4, s6, d4, rows = [], categories = [];
options.chart.type = chartType;
setFormatOptions(chart, options, chartType);
for (i5 = 0; i5 < series.length; i5++) {
s6 = series[i5];
for (j4 = 0; j4 < s6.data.length; j4++) {
d4 = s6.data[j4];
if (!rows[d4[0]]) {
rows[d4[0]] = new Array(series.length);
categories.push(d4[0]);
}
rows[d4[0]][i5] = d4[1];
}
}
if (chart.xtype === "number") {
categories.sort(sortByNumber);
}
options.xAxis.categories = categories;
var newSeries = [], d22;
for (i5 = 0; i5 < series.length; i5++) {
d4 = [];
for (j4 = 0; j4 < categories.length; j4++) {
d4.push(rows[categories[j4]][i5] || 0);
}
d22 = {
name: series[i5].name || "Value",
data: d4
};
if (series[i5].stack) {
d22.stack = series[i5].stack;
}
newSeries.push(d22);
}
this.drawChart(chart, newSeries, options);
};
defaultExport$1.prototype.renderBarChart = function renderBarChart(chart) {
this.renderColumnChart(chart, "bar");
};
defaultExport$1.prototype.renderAreaChart = function renderAreaChart(chart) {
this.renderLineChart(chart, "areaspline");
};
defaultExport$1.prototype.destroy = function destroy2(chart) {
if (chart.chart) {
chart.chart.destroy();
}
};
defaultExport$1.prototype.drawChart = function drawChart(chart, data, options) {
this.destroy(chart);
if (chart.destroyed) {
return;
}
options.chart.renderTo = chart.element.id;
options.series = data;
if (chart.options.code) {
window.console.log("new Highcharts.Chart(" + JSON.stringify(options) + ");");
}
chart.chart = new this.library.Chart(options);
};
var loaded = {};
var callbacks = [];
var defaultOptions2 = {
chartArea: {},
fontName: "'Lucida Grande', 'Lucida Sans Unicode', Verdana, Arial, Helvetica, sans-serif",
pointSize: 6,
legend: {
textStyle: {
fontSize: 12,
color: "#444"
},
alignment: "center",
position: "right"
},
curveType: "function",
hAxis: {
textStyle: {
color: "#666",
fontSize: 12
},
titleTextStyle: {},
gridlines: {
color: "transparent"
},
baselineColor: "#ccc",
viewWindow: {}
},
vAxis: {
textStyle: {
color: "#666",
fontSize: 12
},
titleTextStyle: {},
baselineColor: "#ccc",
viewWindow: {}
},
tooltip: {
textStyle: {
color: "#666",
fontSize: 12
}
}
};
var hideLegend = function(options, legend, hideLegend2) {
if (legend !== void 0) {
var position;
if (!legend) {
position = "none";
} else if (legend === true) {
position = "right";
} else {
position = legend;
}
options.legend.position = position;
} else if (hideLegend2) {
options.legend.position = "none";
}
};
var setTitle = function(options, title) {
options.title = title;
options.titleTextStyle = { color: "#333", fontSize: "20px" };
};
var setMin = function(options, min2) {
options.vAxis.viewWindow.min = min2;
};
var setMax = function(options, max2) {
options.vAxis.viewWindow.max = max2;
};
var setBarMin = function(options, min2) {
options.hAxis.viewWindow.min = min2;
};
var setBarMax = function(options, max2) {
options.hAxis.viewWindow.max = max2;
};
var setStacked = function(options, stacked) {
options.isStacked = stacked ? stacked : false;
};
var setXtitle = function(options, title) {
options.hAxis.title = title;
options.hAxis.titleTextStyle.italic = false;
};
var setYtitle = function(options, title) {
options.vAxis.title = title;
options.vAxis.titleTextStyle.italic = false;
};
var jsOptions = jsOptionsFunc(defaultOptions2, hideLegend, setTitle, setMin, setMax, setStacked, setXtitle, setYtitle);
var resize = function(callback2) {
if (window.attachEvent) {
window.attachEvent("onresize", callback2);
} else if (window.addEventListener) {
window.addEventListener("resize", callback2, true);
}
callback2();
};
var defaultExport = function defaultExport2(library) {
this.name = "google";
this.library = library;
};
defaultExport.prototype.renderLineChart = function renderLineChart(chart) {
var this$1$1 = this;
this.waitForLoaded(chart, function() {
var chartOptions = {};
if (chart.options.curve === false) {
chartOptions.curveType = "none";
}
if (chart.options.points === false) {
chartOptions.pointSize = 0;
}
var options = jsOptions(chart, chart.options, chartOptions);
var data = this$1$1.createDataTable(chart.data, chart.xtype);
this$1$1.drawChart(chart, "LineChart", data, options);
});
};
defaultExport.prototype.renderPieChart = function renderPieChart(chart) {
var this$1$1 = this;
this.waitForLoaded(chart, function() {
var chartOptions = {
chartArea: {
top: "10%",
height: "80%"
},
legend: {}
};
if (chart.options.colors) {
chartOptions.colors = chart.options.colors;
}
if (chart.options.donut) {
chartOptions.pieHole = 0.5;
}
if ("legend" in chart.options) {
hideLegend(chartOptions, chart.options.legend);
}
if (chart.options.title) {
setTitle(chartOptions, chart.options.title);
}
var options = merge3(merge3(defaultOptions2, chartOptions), chart.options.library || {});
var data = new this$1$1.library.visualization.DataTable();
data.addColumn("string", "");
data.addColumn("number", "Value");
data.addRows(chart.data);
this$1$1.drawChart(chart, "PieChart", data, options);
});
};
defaultExport.prototype.renderColumnChart = function renderColumnChart(chart) {
var this$1$1 = this;
this.waitForLoaded(chart, function() {
var options = jsOptions(chart, chart.options);
var data = this$1$1.createDataTable(chart.data, chart.xtype);
this$1$1.drawChart(chart, "ColumnChart", data, options);
});
};
defaultExport.prototype.renderBarChart = function renderBarChart(chart) {
var this$1$1 = this;
this.waitForLoaded(chart, function() {
var chartOptions = {
hAxis: {
gridlines: {
color: "#ccc"
}
}
};
var options = jsOptionsFunc(defaultOptions2, hideLegend, setTitle, setBarMin, setBarMax, setStacked, setXtitle, setYtitle)(chart, chart.options, chartOptions);
var data = this$1$1.createDataTable(chart.data, chart.xtype);
this$1$1.drawChart(chart, "BarChart", data, options);
});
};
defaultExport.prototype.renderAreaChart = function renderAreaChart(chart) {
var this$1$1 = this;
this.waitForLoaded(chart, function() {
var chartOptions = {
isStacked: true,
pointSize: 0,
areaOpacity: 0.5
};
var options = jsOptions(chart, chart.options, chartOptions);
var data = this$1$1.createDataTable(chart.data, chart.xtype);
this$1$1.drawChart(chart, "AreaChart", data, options);
});
};
defaultExport.prototype.renderGeoChart = function renderGeoChart(chart) {
var this$1$1 = this;
this.waitForLoaded(chart, "geochart", function() {
var chartOptions = {
legend: "none",
colorAxis: {
colors: chart.options.colors || ["#f6c7b6", "#ce502d"]
}
};
var options = merge3(merge3(defaultOptions2, chartOptions), chart.options.library || {});
var data = new this$1$1.library.visualization.DataTable();
data.addColumn("string", "");
data.addColumn("number", chart.options.label || "Value");
data.addRows(chart.data);
this$1$1.drawChart(chart, "GeoChart", data, options);
});
};
defaultExport.prototype.renderScatterChart = function renderScatterChart(chart) {
var this$1$1 = this;
this.waitForLoaded(chart, function() {
var chartOptions = {};
var options = jsOptions(chart, chart.options, chartOptions);
var series = chart.data, rows2 = [], i5, j4, data, d4;
for (i5 = 0; i5 < series.length; i5++) {
series[i5].name = series[i5].name || "Value";
d4 = series[i5].data;
for (j4 = 0; j4 < d4.length; j4++) {
var row = new Array(series.length + 1);
row[0] = d4[j4][0];
row[i5 + 1] = d4[j4][1];
rows2.push(row);
}
}
data = new this$1$1.library.visualization.DataTable();
data.addColumn("number", "");
for (i5 = 0; i5 < series.length; i5++) {
data.addColumn("number", series[i5].name);
}
data.addRows(rows2);
this$1$1.drawChart(chart, "ScatterChart", data, options);
});
};
defaultExport.prototype.renderTimeline = function renderTimeline(chart) {
var this$1$1 = this;
this.waitForLoaded(chart, "timeline", function() {
var chartOptions = {
legend: "none"
};
if (chart.options.colors) {
chartOptions.colors = chart.options.colors;
}
var options = merge3(merge3(defaultOptions2, chartOptions), chart.options.library || {});
var data = new this$1$1.library.visualization.DataTable();
data.addColumn({ type: "string", id: "Name" });
data.addColumn({ type: "date", id: "Start" });
data.addColumn({ type: "date", id: "End" });
data.addRows(chart.data);
chart.element.style.lineHeight = "normal";
this$1$1.drawChart(chart, "Timeline", data, options);
});
};
defaultExport.prototype.destroy = function destroy2(chart) {
if (chart.chart) {
chart.chart.clearChart();
}
};
defaultExport.prototype.drawChart = function drawChart(chart, type, data, options) {
this.destroy(chart);
if (chart.destroyed) {
return;
}
if (chart.options.code) {
window.console.log("var data = new google.visualization.DataTable(" + data.toJSON() + ");\nvar chart = new google.visualization." + type + "(element);\nchart.draw(data, " + JSON.stringify(options) + ");");
}
chart.chart = new this.library.visualization[type](chart.element);
resize(function() {
chart.chart.draw(data, options);
});
};
defaultExport.prototype.waitForLoaded = function waitForLoaded(chart, pack, callback2) {
var this$1$1 = this;
if (!callback2) {
callback2 = pack;
pack = "corechart";
}
callbacks.push({ pack, callback: callback2 });
if (loaded[pack]) {
this.runCallbacks();
} else {
loaded[pack] = true;
var loadOptions = {
packages: [pack],
callback: function() {
this$1$1.runCallbacks();
}
};
var config3 = chart.__config();
if (config3.language) {
loadOptions.language = config3.language;
}
if (pack === "geochart" && config3.mapsApiKey) {
loadOptions.mapsApiKey = config3.mapsApiKey;
}
this.library.charts.load("current", loadOptions);
}
};
defaultExport.prototype.runCallbacks = function runCallbacks() {
var cb, call;
for (var i5 = 0; i5 < callbacks.length; i5++) {
cb = callbacks[i5];
call = this.library.visualization && (cb.pack === "corechart" && this.library.visualization.LineChart || cb.pack === "timeline" && this.library.visualization.Timeline || cb.pack === "geochart" && this.library.visualization.GeoChart);
if (call) {
cb.callback();
callbacks.splice(i5, 1);
i5--;
}
}
};
defaultExport.prototype.createDataTable = function createDataTable2(series, columnType) {
var i5, j4, s6, d4, key, rows = [], sortedLabels = [];
for (i5 = 0; i5 < series.length; i5++) {
s6 = series[i5];
series[i5].name = series[i5].name || "Value";
for (j4 = 0; j4 < s6.data.length; j4++) {
d4 = s6.data[j4];
key = columnType === "datetime" ? d4[0].getTime() : d4[0];
if (!rows[key]) {
rows[key] = new Array(series.length);
sortedLabels.push(key);
}
rows[key][i5] = toFloat(d4[1]);
}
}
var rows2 = [];
var day = true;
var value;
for (j4 = 0; j4 < sortedLabels.length; j4++) {
i5 = sortedLabels[j4];
if (columnType === "datetime") {
value = new Date(toFloat(i5));
day = day && isDay(value);
} else if (columnType === "number") {
value = toFloat(i5);
} else {
value = i5;
}
rows2.push([value].concat(rows[i5]));
}
if (columnType === "datetime") {
rows2.sort(sortByTime);
} else if (columnType === "number") {
rows2.sort(sortByNumberSeries);
for (i5 = 0; i5 < rows2.length; i5++) {
rows2[i5][0] = toStr(rows2[i5][0]);
}
columnType = "string";
}
var data = new this.library.visualization.DataTable();
columnType = columnType === "datetime" && day ? "date" : columnType;
data.addColumn(columnType, "");
for (i5 = 0; i5 < series.length; i5++) {
data.addColumn("number", series[i5].name);
}
data.addRows(rows2);
return data;
};
function formatSeriesData(data, keyType) {
var r6 = [], j4, keyFunc;
if (keyType === "number") {
keyFunc = toFloat;
} else if (keyType === "datetime") {
keyFunc = toDate2;
} else {
keyFunc = toStr;
}
if (keyType === "bubble") {
for (j4 = 0; j4 < data.length; j4++) {
r6.push([toFloat(data[j4][0]), toFloat(data[j4][1]), toFloat(data[j4][2])]);
}
} else {
for (j4 = 0; j4 < data.length; j4++) {
r6.push([keyFunc(data[j4][0]), toFloat(data[j4][1])]);
}
}
if (keyType === "datetime") {
r6.sort(sortByTime);
} else if (keyType === "number") {
r6.sort(sortByNumberSeries);
}
return r6;
}
function detectXType(series, noDatetime, options) {
if (dataEmpty(series)) {
if ((options.xmin || options.xmax) && (!options.xmin || isDate3(options.xmin)) && (!options.xmax || isDate3(options.xmax))) {
return "datetime";
} else {
return "number";
}
} else if (detectXTypeWithFunction(series, isNumber4)) {
return "number";
} else if (!noDatetime && detectXTypeWithFunction(series, isDate3)) {
return "datetime";
} else {
return "string";
}
}
function detectXTypeWithFunction(series, func) {
var i5, j4, data;
for (i5 = 0; i5 < series.length; i5++) {
data = toArr(series[i5].data);
for (j4 = 0; j4 < data.length; j4++) {
if (!func(data[j4][0])) {
return false;
}
}
}
return true;
}
function copySeries(series) {
var newSeries = [], i5, j4;
for (i5 = 0; i5 < series.length; i5++) {
var copy2 = {};
for (j4 in series[i5]) {
if (series[i5].hasOwnProperty(j4)) {
copy2[j4] = series[i5][j4];
}
}
newSeries.push(copy2);
}
return newSeries;
}
function processSeries(chart, keyType, noDatetime) {
var i5;
var opts = chart.options;
var series = chart.rawData;
chart.singleSeriesFormat = !isArray2(series) || typeof series[0] !== "object" || isArray2(series[0]);
if (chart.singleSeriesFormat) {
series = [{ name: opts.label, data: series }];
}
series = copySeries(series);
for (i5 = 0; i5 < series.length; i5++) {
series[i5].data = toArr(series[i5].data);
}
chart.xtype = keyType ? keyType : opts.discrete ? "string" : detectXType(series, noDatetime, opts);
for (i5 = 0; i5 < series.length; i5++) {
series[i5].data = formatSeriesData(series[i5].data, chart.xtype);
}
return series;
}
function processSimple(chart) {
var perfectData = toArr(chart.rawData), i5;
for (i5 = 0; i5 < perfectData.length; i5++) {
perfectData[i5] = [toStr(perfectData[i5][0]), toFloat(perfectData[i5][1])];
}
return perfectData;
}
function dataEmpty(data, chartType) {
if (chartType === "PieChart" || chartType === "GeoChart" || chartType === "Timeline") {
return data.length === 0;
} else {
for (var i5 = 0; i5 < data.length; i5++) {
if (data[i5].data.length > 0) {
return false;
}
}
return true;
}
}
function addDownloadButton(chart) {
var element = chart.element;
var link = document.createElement("a");
var download = chart.options.download;
if (download === true) {
download = {};
} else if (typeof download === "string") {
download = { filename: download };
}
link.download = download.filename || "chart.png";
link.style.position = "absolute";
link.style.top = "20px";
link.style.right = "20px";
link.style.zIndex = 1e3;
link.style.lineHeight = "20px";
link.target = "_blank";
var image = document.createElement("img");
image.alt = "Download";
image.style.border = "none";
image.src = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABCFBMVEUAAADMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMzMywEsqxAAAAV3RSTlMAAQIDBggJCgsMDQ4PERQaHB0eISIjJCouLzE0OTo/QUJHSUpLTU5PUllhYmltcHh5foWLjI+SlaCio6atr7S1t7m6vsHHyM7R2tze5Obo7fHz9ff5+/1hlxK2AAAA30lEQVQYGUXBhVYCQQBA0TdYWAt2d3d3YWAHyur7/z9xgD16Lw0DW+XKx+1GgX+FRzM3HWQWrHl5N/oapW5RPe0PkBu+UYeICvozTWZVK23Ao04B79oJrOsJDOoxkZoQPWgX29pHpCZEk7rEvQYiNSFq1UMqvlCjJkRBS1R8hb00Vb/TajtBL7nTHE1X1vyMQF732dQhyF2o6SAwrzP06iUQzvwsArlnzcOdrgBhJyHa1QOgO9U1GsKuvjUTjavliZYQ8nNPapG6sap/3nrIdJ6bOWzmX/fy0XVpfzZP3S8OJT3g9EEiJwAAAABJRU5ErkJggg==";
link.appendChild(image);
element.style.position = "relative";
chart.__downloadAttached = true;
chart.__enterEvent = addEvent2(element, "mouseover", function(e5) {
var related = e5.relatedTarget;
if ((!related || related !== this && !childOf(this, related)) && chart.options.download) {
link.href = chart.toImage(download);
element.appendChild(link);
}
});
chart.__leaveEvent = addEvent2(element, "mouseout", function(e5) {
var related = e5.relatedTarget;
if (!related || related !== this && !childOf(this, related)) {
if (link.parentNode) {
link.parentNode.removeChild(link);
}
}
});
}
function addEvent2(elem, event2, fn3) {
if (elem.addEventListener) {
elem.addEventListener(event2, fn3, false);
return fn3;
} else {
var fn22 = function() {
return fn3.call(elem, window.event);
};
elem.attachEvent("on" + event2, fn22);
return fn22;
}
}
function removeEvent(elem, event2, fn3) {
if (elem.removeEventListener) {
elem.removeEventListener(event2, fn3, false);
} else {
elem.detachEvent("on" + event2, fn3);
}
}
function childOf(p4, c4) {
if (p4 === c4) {
return false;
}
while (c4 && c4 !== p4) {
c4 = c4.parentNode;
}
return c4 === p4;
}
var pendingRequests = [], runningRequests = 0, maxRequests = 4;
function pushRequest(url, success, error2) {
pendingRequests.push([url, success, error2]);
runNext();
}
function runNext() {
if (runningRequests < maxRequests) {
var request = pendingRequests.shift();
if (request) {
runningRequests++;
getJSON(request[0], request[1], request[2]);
runNext();
}
}
}
function requestComplete() {
runningRequests--;
runNext();
}
function getJSON(url, success, error2) {
ajaxCall(url, success, function(jqXHR, textStatus, errorThrown) {
var message = typeof errorThrown === "string" ? errorThrown : errorThrown.message;
error2(message);
});
}
function ajaxCall(url, success, error2) {
var $3 = window.jQuery || window.Zepto || window.$;
if ($3 && $3.ajax) {
$3.ajax({
dataType: "json",
url,
success,
error: error2,
complete: requestComplete
});
} else {
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.onload = function() {
requestComplete();
if (xhr.status === 200) {
success(JSON.parse(xhr.responseText), xhr.statusText, xhr);
} else {
error2(xhr, "error", xhr.statusText);
}
};
xhr.send();
}
}
var config2 = {};
var adapters2 = [];
function setText(element, text) {
if (document.body.innerText) {
element.innerText = text;
} else {
element.textContent = text;
}
}
function chartError(element, message, noPrefix) {
if (!noPrefix) {
message = "Error Loading Chart: " + message;
}
setText(element, message);
element.style.color = "#ff0000";
}
function errorCatcher(chart) {
try {
chart.__render();
} catch (err) {
chartError(chart.element, err.message);
throw err;
}
}
function fetchDataSource(chart, dataSource, showLoading) {
if (showLoading && chart.options.loading && (typeof dataSource === "string" || typeof dataSource === "function")) {
setText(chart.element, chart.options.loading);
}
if (typeof dataSource === "string") {
pushRequest(dataSource, function(data) {
chart.rawData = data;
errorCatcher(chart);
}, function(message) {
chartError(chart.element, message);
});
} else if (typeof dataSource === "function") {
try {
dataSource(function(data) {
chart.rawData = data;
errorCatcher(chart);
}, function(message) {
chartError(chart.element, message, true);
});
} catch (err) {
chartError(chart.element, err, true);
}
} else {
chart.rawData = dataSource;
errorCatcher(chart);
}
}
function getAdapterType(library) {
if (library) {
if (library.product === "Highcharts") {
return defaultExport$1;
} else if (library.charts) {
return defaultExport;
} else if (isFunction3(library)) {
return defaultExport$2;
}
}
throw new Error("Unknown adapter");
}
function addAdapter(library) {
var adapterType = getAdapterType(library);
var adapter = new adapterType(library);
if (adapters2.indexOf(adapter) === -1) {
adapters2.push(adapter);
}
}
function loadAdapters() {
if ("Chart" in window) {
addAdapter(window.Chart);
}
if ("Highcharts" in window) {
addAdapter(window.Highcharts);
}
if (window.google && window.google.charts) {
addAdapter(window.google);
}
}
function renderChart(chartType, chart) {
if (dataEmpty(chart.data, chartType)) {
var message = chart.options.empty || chart.options.messages && chart.options.messages.empty || "No data";
setText(chart.element, message);
} else {
callAdapter(chartType, chart);
if (chart.options.download && !chart.__downloadAttached && chart.adapter === "chartjs") {
addDownloadButton(chart);
}
}
}
function callAdapter(chartType, chart) {
var i5, adapter, fnName, adapterName;
fnName = "render" + chartType;
adapterName = chart.options.adapter;
loadAdapters();
for (i5 = 0; i5 < adapters2.length; i5++) {
adapter = adapters2[i5];
if ((!adapterName || adapterName === adapter.name) && isFunction3(adapter[fnName])) {
chart.adapter = adapter.name;
chart.__adapterObject = adapter;
return adapter[fnName](chart);
}
}
if (adapters2.length > 0) {
throw new Error("No charting library found for " + chartType);
} else {
throw new Error("No charting libraries found - be sure to include one before your charts");
}
}
var Chart2 = function Chart3(element, dataSource, options) {
var elementId;
if (typeof element === "string") {
elementId = element;
element = document.getElementById(element);
if (!element) {
throw new Error("No element with id " + elementId);
}
}
this.element = element;
this.options = merge3(Chartkick2.options, options || {});
this.dataSource = dataSource;
Chartkick2.charts[element.id] = this;
fetchDataSource(this, dataSource, true);
if (this.options.refresh) {
this.startRefresh();
}
};
Chart2.prototype.getElement = function getElement() {
return this.element;
};
Chart2.prototype.getDataSource = function getDataSource() {
return this.dataSource;
};
Chart2.prototype.getData = function getData() {
return this.data;
};
Chart2.prototype.getOptions = function getOptions2() {
return this.options;
};
Chart2.prototype.getChartObject = function getChartObject() {
return this.chart;
};
Chart2.prototype.getAdapter = function getAdapter() {
return this.adapter;
};
Chart2.prototype.updateData = function updateData(dataSource, options) {
this.dataSource = dataSource;
if (options) {
this.__updateOptions(options);
}
fetchDataSource(this, dataSource, true);
};
Chart2.prototype.setOptions = function setOptions(options) {
this.__updateOptions(options);
this.redraw();
};
Chart2.prototype.redraw = function redraw() {
fetchDataSource(this, this.rawData);
};
Chart2.prototype.refreshData = function refreshData() {
if (typeof this.dataSource === "string") {
var sep = this.dataSource.indexOf("?") === -1 ? "?" : "&";
var url = this.dataSource + sep + "_=" + new Date().getTime();
fetchDataSource(this, url);
} else if (typeof this.dataSource === "function") {
fetchDataSource(this, this.dataSource);
}
};
Chart2.prototype.startRefresh = function startRefresh() {
var this$1$1 = this;
var refresh = this.options.refresh;
if (refresh && typeof this.dataSource !== "string" && typeof this.dataSource !== "function") {
throw new Error("Data source must be a URL or callback for refresh");
}
if (!this.intervalId) {
if (refresh) {
this.intervalId = setInterval(function() {
this$1$1.refreshData();
}, refresh * 1e3);
} else {
throw new Error("No refresh interval");
}
}
};
Chart2.prototype.stopRefresh = function stopRefresh() {
if (this.intervalId) {
clearInterval(this.intervalId);
this.intervalId = null;
}
};
Chart2.prototype.toImage = function toImage(download) {
if (this.adapter === "chartjs") {
if (download && download.background && download.background !== "transparent") {
var canvas = this.chart.canvas;
var ctx = this.chart.ctx;
var tmpCanvas = document.createElement("canvas");
var tmpCtx = tmpCanvas.getContext("2d");
tmpCanvas.width = ctx.canvas.width;
tmpCanvas.height = ctx.canvas.height;
tmpCtx.fillStyle = download.background;
tmpCtx.fillRect(0, 0, tmpCanvas.width, tmpCanvas.height);
tmpCtx.drawImage(canvas, 0, 0);
return tmpCanvas.toDataURL("image/png");
} else {
return this.chart.toBase64Image();
}
} else {
throw new Error("Feature only available for Chart.js");
}
};
Chart2.prototype.destroy = function destroy2() {
this.destroyed = true;
this.stopRefresh();
if (this.__adapterObject) {
this.__adapterObject.destroy(this);
}
if (this.__enterEvent) {
removeEvent(this.element, "mouseover", this.__enterEvent);
}
if (this.__leaveEvent) {
removeEvent(this.element, "mouseout", this.__leaveEvent);
}
};
Chart2.prototype.__updateOptions = function __updateOptions(options) {
var updateRefresh = options.refresh && options.refresh !== this.options.refresh;
this.options = merge3(Chartkick2.options, options);
if (updateRefresh) {
this.stopRefresh();
this.startRefresh();
}
};
Chart2.prototype.__render = function __render() {
this.data = this.__processData();
renderChart(this.__chartName(), this);
};
Chart2.prototype.__config = function __config() {
return config2;
};
var LineChart = /* @__PURE__ */ function(Chart3) {
function LineChart2() {
Chart3.apply(this, arguments);
}
if (Chart3)
LineChart2.__proto__ = Chart3;
LineChart2.prototype = Object.create(Chart3 && Chart3.prototype);
LineChart2.prototype.constructor = LineChart2;
LineChart2.prototype.__processData = function __processData() {
return processSeries(this);
};
LineChart2.prototype.__chartName = function __chartName() {
return "LineChart";
};
return LineChart2;
}(Chart2);
var PieChart = /* @__PURE__ */ function(Chart3) {
function PieChart2() {
Chart3.apply(this, arguments);
}
if (Chart3)
PieChart2.__proto__ = Chart3;
PieChart2.prototype = Object.create(Chart3 && Chart3.prototype);
PieChart2.prototype.constructor = PieChart2;
PieChart2.prototype.__processData = function __processData() {
return processSimple(this);
};
PieChart2.prototype.__chartName = function __chartName() {
return "PieChart";
};
return PieChart2;
}(Chart2);
var ColumnChart = /* @__PURE__ */ function(Chart3) {
function ColumnChart2() {
Chart3.apply(this, arguments);
}
if (Chart3)
ColumnChart2.__proto__ = Chart3;
ColumnChart2.prototype = Object.create(Chart3 && Chart3.prototype);
ColumnChart2.prototype.constructor = ColumnChart2;
ColumnChart2.prototype.__processData = function __processData() {
return processSeries(this, null, true);
};
ColumnChart2.prototype.__chartName = function __chartName() {
return "ColumnChart";
};
return ColumnChart2;
}(Chart2);
var BarChart = /* @__PURE__ */ function(Chart3) {
function BarChart2() {
Chart3.apply(this, arguments);
}
if (Chart3)
BarChart2.__proto__ = Chart3;
BarChart2.prototype = Object.create(Chart3 && Chart3.prototype);
BarChart2.prototype.constructor = BarChart2;
BarChart2.prototype.__processData = function __processData() {
return processSeries(this, null, true);
};
BarChart2.prototype.__chartName = function __chartName() {
return "BarChart";
};
return BarChart2;
}(Chart2);
var AreaChart = /* @__PURE__ */ function(Chart3) {
function AreaChart2() {
Chart3.apply(this, arguments);
}
if (Chart3)
AreaChart2.__proto__ = Chart3;
AreaChart2.prototype = Object.create(Chart3 && Chart3.prototype);
AreaChart2.prototype.constructor = AreaChart2;
AreaChart2.prototype.__processData = function __processData() {
return processSeries(this);
};
AreaChart2.prototype.__chartName = function __chartName() {
return "AreaChart";
};
return AreaChart2;
}(Chart2);
var GeoChart = /* @__PURE__ */ function(Chart3) {
function GeoChart2() {
Chart3.apply(this, arguments);
}
if (Chart3)
GeoChart2.__proto__ = Chart3;
GeoChart2.prototype = Object.create(Chart3 && Chart3.prototype);
GeoChart2.prototype.constructor = GeoChart2;
GeoChart2.prototype.__processData = function __processData() {
return processSimple(this);
};
GeoChart2.prototype.__chartName = function __chartName() {
return "GeoChart";
};
return GeoChart2;
}(Chart2);
var ScatterChart = /* @__PURE__ */ function(Chart3) {
function ScatterChart2() {
Chart3.apply(this, arguments);
}
if (Chart3)
ScatterChart2.__proto__ = Chart3;
ScatterChart2.prototype = Object.create(Chart3 && Chart3.prototype);
ScatterChart2.prototype.constructor = ScatterChart2;
ScatterChart2.prototype.__processData = function __processData() {
return processSeries(this, "number");
};
ScatterChart2.prototype.__chartName = function __chartName() {
return "ScatterChart";
};
return ScatterChart2;
}(Chart2);
var BubbleChart = /* @__PURE__ */ function(Chart3) {
function BubbleChart2() {
Chart3.apply(this, arguments);
}
if (Chart3)
BubbleChart2.__proto__ = Chart3;
BubbleChart2.prototype = Object.create(Chart3 && Chart3.prototype);
BubbleChart2.prototype.constructor = BubbleChart2;
BubbleChart2.prototype.__processData = function __processData() {
return processSeries(this, "bubble");
};
BubbleChart2.prototype.__chartName = function __chartName() {
return "BubbleChart";
};
return BubbleChart2;
}(Chart2);
var Timeline = /* @__PURE__ */ function(Chart3) {
function Timeline2() {
Chart3.apply(this, arguments);
}
if (Chart3)
Timeline2.__proto__ = Chart3;
Timeline2.prototype = Object.create(Chart3 && Chart3.prototype);
Timeline2.prototype.constructor = Timeline2;
Timeline2.prototype.__processData = function __processData() {
var i5, data = this.rawData;
for (i5 = 0; i5 < data.length; i5++) {
data[i5][1] = toDate2(data[i5][1]);
data[i5][2] = toDate2(data[i5][2]);
}
return data;
};
Timeline2.prototype.__chartName = function __chartName() {
return "Timeline";
};
return Timeline2;
}(Chart2);
var Chartkick2 = {
LineChart,
PieChart,
ColumnChart,
BarChart,
AreaChart,
GeoChart,
ScatterChart,
BubbleChart,
Timeline,
charts: {},
configure: function(options) {
for (var key in options) {
if (options.hasOwnProperty(key)) {
config2[key] = options[key];
}
}
},
setDefaultOptions: function(opts) {
Chartkick2.options = opts;
},
eachChart: function(callback2) {
for (var chartId in Chartkick2.charts) {
if (Chartkick2.charts.hasOwnProperty(chartId)) {
callback2(Chartkick2.charts[chartId]);
}
}
},
destroyAll: function() {
for (var chartId in Chartkick2.charts) {
if (Chartkick2.charts.hasOwnProperty(chartId)) {
Chartkick2.charts[chartId].destroy();
delete Chartkick2.charts[chartId];
}
}
},
config: config2,
options: {},
adapters: adapters2,
addAdapter,
use: function(adapter) {
addAdapter(adapter);
return Chartkick2;
}
};
if (typeof window !== "undefined" && !window.Chartkick) {
window.Chartkick = Chartkick2;
document.addEventListener("turbolinks:before-render", function() {
if (config2.autoDestroy !== false) {
Chartkick2.destroyAll();
}
});
document.addEventListener("turbo:before-render", function() {
if (config2.autoDestroy !== false) {
Chartkick2.destroyAll();
}
});
setTimeout(function() {
window.dispatchEvent(new Event("chartkick:load"));
}, 0);
}
Chartkick2.default = Chartkick2;
return Chartkick2;
});
}
});
// node_modules/chartkick/node_modules/chart.js/dist/chunks/helpers.segment.js
function throttled(fn3, thisArg, updateFn) {
const updateArgs = updateFn || ((args2) => Array.prototype.slice.call(args2));
let ticking = false;
let args = [];
return function(...rest) {
args = updateArgs(rest);
if (!ticking) {
ticking = true;
requestAnimFrame.call(window, () => {
ticking = false;
fn3.apply(thisArg, args);
});
}
};
}
function debounce(fn3, delay) {
let timeout;
return function(...args) {
if (delay) {
clearTimeout(timeout);
timeout = setTimeout(fn3, delay, args);
} else {
fn3.apply(this, args);
}
return delay;
};
}
function noop() {
}
function isNullOrUndef(value) {
return value === null || typeof value === "undefined";
}
function isArray(value) {
if (Array.isArray && Array.isArray(value)) {
return true;
}
const type = Object.prototype.toString.call(value);
if (type.substr(0, 7) === "[object" && type.substr(-6) === "Array]") {
return true;
}
return false;
}
function isObject(value) {
return value !== null && Object.prototype.toString.call(value) === "[object Object]";
}
function finiteOrDefault(value, defaultValue) {
return isNumberFinite(value) ? value : defaultValue;
}
function valueOrDefault(value, defaultValue) {
return typeof value === "undefined" ? defaultValue : value;
}
function callback(fn3, args, thisArg) {
if (fn3 && typeof fn3.call === "function") {
return fn3.apply(thisArg, args);
}
}
function each(loopable, fn3, thisArg, reverse) {
let i5, len, keys2;
if (isArray(loopable)) {
len = loopable.length;
if (reverse) {
for (i5 = len - 1; i5 >= 0; i5--) {
fn3.call(thisArg, loopable[i5], i5);
}
} else {
for (i5 = 0; i5 < len; i5++) {
fn3.call(thisArg, loopable[i5], i5);
}
}
} else if (isObject(loopable)) {
keys2 = Object.keys(loopable);
len = keys2.length;
for (i5 = 0; i5 < len; i5++) {
fn3.call(thisArg, loopable[keys2[i5]], keys2[i5]);
}
}
}
function _elementsEqual(a0, a1) {
let i5, ilen, v0, v1;
if (!a0 || !a1 || a0.length !== a1.length) {
return false;
}
for (i5 = 0, ilen = a0.length; i5 < ilen; ++i5) {
v0 = a0[i5];
v1 = a1[i5];
if (v0.datasetIndex !== v1.datasetIndex || v0.index !== v1.index) {
return false;
}
}
return true;
}
function clone$1(source) {
if (isArray(source)) {
return source.map(clone$1);
}
if (isObject(source)) {
const target = /* @__PURE__ */ Object.create(null);
const keys2 = Object.keys(source);
const klen = keys2.length;
let k4 = 0;
for (; k4 < klen; ++k4) {
target[keys2[k4]] = clone$1(source[keys2[k4]]);
}
return target;
}
return source;
}
function isValidKey(key) {
return ["__proto__", "prototype", "constructor"].indexOf(key) === -1;
}
function _merger(key, target, source, options) {
if (!isValidKey(key)) {
return;
}
const tval = target[key];
const sval = source[key];
if (isObject(tval) && isObject(sval)) {
merge(tval, sval, options);
} else {
target[key] = clone$1(sval);
}
}
function merge(target, source, options) {
const sources = isArray(source) ? source : [source];
const ilen = sources.length;
if (!isObject(target)) {
return target;
}
options = options || {};
const merger = options.merger || _merger;
for (let i5 = 0; i5 < ilen; ++i5) {
source = sources[i5];
if (!isObject(source)) {
continue;
}
const keys2 = Object.keys(source);
for (let k4 = 0, klen = keys2.length; k4 < klen; ++k4) {
merger(keys2[k4], target, source, options);
}
}
return target;
}
function mergeIf(target, source) {
return merge(target, source, { merger: _mergerIf });
}
function _mergerIf(key, target, source) {
if (!isValidKey(key)) {
return;
}
const tval = target[key];
const sval = source[key];
if (isObject(tval) && isObject(sval)) {
mergeIf(tval, sval);
} else if (!Object.prototype.hasOwnProperty.call(target, key)) {
target[key] = clone$1(sval);
}
}
function indexOfDotOrLength(key, start3) {
const idx = key.indexOf(dot, start3);
return idx === -1 ? key.length : idx;
}
function resolveObjectKey(obj, key) {
if (key === emptyString) {
return obj;
}
let pos = 0;
let idx = indexOfDotOrLength(key, pos);
while (obj && idx > pos) {
obj = obj[key.substr(pos, idx - pos)];
pos = idx + 1;
idx = indexOfDotOrLength(key, pos);
}
return obj;
}
function _capitalize(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
}
function _isClickEvent(e5) {
return e5.type === "mouseup" || e5.type === "click" || e5.type === "contextmenu";
}
function niceNum(range2) {
const roundedRange = Math.round(range2);
range2 = almostEquals(range2, roundedRange, range2 / 1e3) ? roundedRange : range2;
const niceRange = Math.pow(10, Math.floor(log10(range2)));
const fraction = range2 / niceRange;
const niceFraction = fraction <= 1 ? 1 : fraction <= 2 ? 2 : fraction <= 5 ? 5 : 10;
return niceFraction * niceRange;
}
function _factorize(value) {
const result = [];
const sqrt = Math.sqrt(value);
let i5;
for (i5 = 1; i5 < sqrt; i5++) {
if (value % i5 === 0) {
result.push(i5);
result.push(value / i5);
}
}
if (sqrt === (sqrt | 0)) {
result.push(sqrt);
}
result.sort((a5, b4) => a5 - b4).pop();
return result;
}
function isNumber(n7) {
return !isNaN(parseFloat(n7)) && isFinite(n7);
}
function almostEquals(x4, y4, epsilon) {
return Math.abs(x4 - y4) < epsilon;
}
function almostWhole(x4, epsilon) {
const rounded = Math.round(x4);
return rounded - epsilon <= x4 && rounded + epsilon >= x4;
}
function _setMinAndMaxByKey(array, target, property) {
let i5, ilen, value;
for (i5 = 0, ilen = array.length; i5 < ilen; i5++) {
value = array[i5][property];
if (!isNaN(value)) {
target.min = Math.min(target.min, value);
target.max = Math.max(target.max, value);
}
}
}
function toRadians(degrees) {
return degrees * (PI / 180);
}
function toDegrees(radians) {
return radians * (180 / PI);
}
function _decimalPlaces(x4) {
if (!isNumberFinite(x4)) {
return;
}
let e5 = 1;
let p4 = 0;
while (Math.round(x4 * e5) / e5 !== x4) {
e5 *= 10;
p4++;
}
return p4;
}
function getAngleFromPoint(centrePoint, anglePoint) {
const distanceFromXCenter = anglePoint.x - centrePoint.x;
const distanceFromYCenter = anglePoint.y - centrePoint.y;
const radialDistanceFromCenter = Math.sqrt(distanceFromXCenter * distanceFromXCenter + distanceFromYCenter * distanceFromYCenter);
let angle = Math.atan2(distanceFromYCenter, distanceFromXCenter);
if (angle < -0.5 * PI) {
angle += TAU;
}
return {
angle,
distance: radialDistanceFromCenter
};
}
function distanceBetweenPoints(pt1, pt2) {
return Math.sqrt(Math.pow(pt2.x - pt1.x, 2) + Math.pow(pt2.y - pt1.y, 2));
}
function _angleDiff(a5, b4) {
return (a5 - b4 + PITAU) % TAU - PI;
}
function _normalizeAngle(a5) {
return (a5 % TAU + TAU) % TAU;
}
function _angleBetween(angle, start3, end2, sameAngleIsFullCircle) {
const a5 = _normalizeAngle(angle);
const s6 = _normalizeAngle(start3);
const e5 = _normalizeAngle(end2);
const angleToStart = _normalizeAngle(s6 - a5);
const angleToEnd = _normalizeAngle(e5 - a5);
const startToAngle = _normalizeAngle(a5 - s6);
const endToAngle = _normalizeAngle(a5 - e5);
return a5 === s6 || a5 === e5 || sameAngleIsFullCircle && s6 === e5 || angleToStart > angleToEnd && startToAngle < endToAngle;
}
function _limitValue(value, min2, max2) {
return Math.max(min2, Math.min(max2, value));
}
function _int16Range(value) {
return _limitValue(value, -32768, 32767);
}
function _isBetween(value, start3, end2, epsilon = 1e-6) {
return value >= Math.min(start3, end2) - epsilon && value <= Math.max(start3, end2) + epsilon;
}
function isShort(v4) {
return eq(v4.r) && eq(v4.g) && eq(v4.b) && eq(v4.a);
}
function hexParse(str) {
var len = str.length;
var ret;
if (str[0] === "#") {
if (len === 4 || len === 5) {
ret = {
r: 255 & map[str[1]] * 17,
g: 255 & map[str[2]] * 17,
b: 255 & map[str[3]] * 17,
a: len === 5 ? map[str[4]] * 17 : 255
};
} else if (len === 7 || len === 9) {
ret = {
r: map[str[1]] << 4 | map[str[2]],
g: map[str[3]] << 4 | map[str[4]],
b: map[str[5]] << 4 | map[str[6]],
a: len === 9 ? map[str[7]] << 4 | map[str[8]] : 255
};
}
}
return ret;
}
function hexString(v4) {
var f4 = isShort(v4) ? h1 : h2;
return v4 ? "#" + f4(v4.r) + f4(v4.g) + f4(v4.b) + (v4.a < 255 ? f4(v4.a) : "") : v4;
}
function round(v4) {
return v4 + 0.5 | 0;
}
function p2b(v4) {
return lim(round(v4 * 2.55), 0, 255);
}
function n2b(v4) {
return lim(round(v4 * 255), 0, 255);
}
function b2n(v4) {
return lim(round(v4 / 2.55) / 100, 0, 1);
}
function n2p(v4) {
return lim(round(v4 * 100), 0, 100);
}
function rgbParse(str) {
const m4 = RGB_RE.exec(str);
let a5 = 255;
let r6, g4, b4;
if (!m4) {
return;
}
if (m4[7] !== r6) {
const v4 = +m4[7];
a5 = 255 & (m4[8] ? p2b(v4) : v4 * 255);
}
r6 = +m4[1];
g4 = +m4[3];
b4 = +m4[5];
r6 = 255 & (m4[2] ? p2b(r6) : r6);
g4 = 255 & (m4[4] ? p2b(g4) : g4);
b4 = 255 & (m4[6] ? p2b(b4) : b4);
return {
r: r6,
g: g4,
b: b4,
a: a5
};
}
function rgbString(v4) {
return v4 && (v4.a < 255 ? `rgba(${v4.r}, ${v4.g}, ${v4.b}, ${b2n(v4.a)})` : `rgb(${v4.r}, ${v4.g}, ${v4.b})`);
}
function hsl2rgbn(h6, s6, l7) {
const a5 = s6 * Math.min(l7, 1 - l7);
const f4 = (n7, k4 = (n7 + h6 / 30) % 12) => l7 - a5 * Math.max(Math.min(k4 - 3, 9 - k4, 1), -1);
return [f4(0), f4(8), f4(4)];
}
function hsv2rgbn(h6, s6, v4) {
const f4 = (n7, k4 = (n7 + h6 / 60) % 6) => v4 - v4 * s6 * Math.max(Math.min(k4, 4 - k4, 1), 0);
return [f4(5), f4(3), f4(1)];
}
function hwb2rgbn(h6, w4, b4) {
const rgb = hsl2rgbn(h6, 1, 0.5);
let i5;
if (w4 + b4 > 1) {
i5 = 1 / (w4 + b4);
w4 *= i5;
b4 *= i5;
}
for (i5 = 0; i5 < 3; i5++) {
rgb[i5] *= 1 - w4 - b4;
rgb[i5] += w4;
}
return rgb;
}
function rgb2hsl(v4) {
const range2 = 255;
const r6 = v4.r / range2;
const g4 = v4.g / range2;
const b4 = v4.b / range2;
const max2 = Math.max(r6, g4, b4);
const min2 = Math.min(r6, g4, b4);
const l7 = (max2 + min2) / 2;
let h6, s6, d4;
if (max2 !== min2) {
d4 = max2 - min2;
s6 = l7 > 0.5 ? d4 / (2 - max2 - min2) : d4 / (max2 + min2);
h6 = max2 === r6 ? (g4 - b4) / d4 + (g4 < b4 ? 6 : 0) : max2 === g4 ? (b4 - r6) / d4 + 2 : (r6 - g4) / d4 + 4;
h6 = h6 * 60 + 0.5;
}
return [h6 | 0, s6 || 0, l7];
}
function calln(f4, a5, b4, c4) {
return (Array.isArray(a5) ? f4(a5[0], a5[1], a5[2]) : f4(a5, b4, c4)).map(n2b);
}
function hsl2rgb(h6, s6, l7) {
return calln(hsl2rgbn, h6, s6, l7);
}
function hwb2rgb(h6, w4, b4) {
return calln(hwb2rgbn, h6, w4, b4);
}
function hsv2rgb(h6, s6, v4) {
return calln(hsv2rgbn, h6, s6, v4);
}
function hue(h6) {
return (h6 % 360 + 360) % 360;
}
function hueParse(str) {
const m4 = HUE_RE.exec(str);
let a5 = 255;
let v4;
if (!m4) {
return;
}
if (m4[5] !== v4) {
a5 = m4[6] ? p2b(+m4[5]) : n2b(+m4[5]);
}
const h6 = hue(+m4[2]);
const p1 = +m4[3] / 100;
const p22 = +m4[4] / 100;
if (m4[1] === "hwb") {
v4 = hwb2rgb(h6, p1, p22);
} else if (m4[1] === "hsv") {
v4 = hsv2rgb(h6, p1, p22);
} else {
v4 = hsl2rgb(h6, p1, p22);
}
return {
r: v4[0],
g: v4[1],
b: v4[2],
a: a5
};
}
function rotate(v4, deg) {
var h6 = rgb2hsl(v4);
h6[0] = hue(h6[0] + deg);
h6 = hsl2rgb(h6);
v4.r = h6[0];
v4.g = h6[1];
v4.b = h6[2];
}
function hslString(v4) {
if (!v4) {
return;
}
const a5 = rgb2hsl(v4);
const h6 = a5[0];
const s6 = n2p(a5[1]);
const l7 = n2p(a5[2]);
return v4.a < 255 ? `hsla(${h6}, ${s6}%, ${l7}%, ${b2n(v4.a)})` : `hsl(${h6}, ${s6}%, ${l7}%)`;
}
function unpack() {
const unpacked = {};
const keys2 = Object.keys(names);
const tkeys = Object.keys(map$1);
let i5, j4, k4, ok, nk;
for (i5 = 0; i5 < keys2.length; i5++) {
ok = nk = keys2[i5];
for (j4 = 0; j4 < tkeys.length; j4++) {
k4 = tkeys[j4];
nk = nk.replace(k4, map$1[k4]);
}
k4 = parseInt(names[ok], 16);
unpacked[nk] = [k4 >> 16 & 255, k4 >> 8 & 255, k4 & 255];
}
return unpacked;
}
function nameParse(str) {
if (!names$1) {
names$1 = unpack();
names$1.transparent = [0, 0, 0, 0];
}
const a5 = names$1[str.toLowerCase()];
return a5 && {
r: a5[0],
g: a5[1],
b: a5[2],
a: a5.length === 4 ? a5[3] : 255
};
}
function modHSL(v4, i5, ratio) {
if (v4) {
let tmp = rgb2hsl(v4);
tmp[i5] = Math.max(0, Math.min(tmp[i5] + tmp[i5] * ratio, i5 === 0 ? 360 : 1));
tmp = hsl2rgb(tmp);
v4.r = tmp[0];
v4.g = tmp[1];
v4.b = tmp[2];
}
}
function clone(v4, proto) {
return v4 ? Object.assign(proto || {}, v4) : v4;
}
function fromObject(input) {
var v4 = { r: 0, g: 0, b: 0, a: 255 };
if (Array.isArray(input)) {
if (input.length >= 3) {
v4 = { r: input[0], g: input[1], b: input[2], a: 255 };
if (input.length > 3) {
v4.a = n2b(input[3]);
}
}
} else {
v4 = clone(input, { r: 0, g: 0, b: 0, a: 1 });
v4.a = n2b(v4.a);
}
return v4;
}
function functionParse(str) {
if (str.charAt(0) === "r") {
return rgbParse(str);
}
return hueParse(str);
}
function index_esm(input) {
return new Color(input);
}
function color(value) {
return isPatternOrGradient(value) ? value : index_esm(value);
}
function getHoverColor(value) {
return isPatternOrGradient(value) ? value : index_esm(value).saturate(0.5).darken(0.1).hexString();
}
function getScope$1(node, key) {
if (!key) {
return node;
}
const keys2 = key.split(".");
for (let i5 = 0, n7 = keys2.length; i5 < n7; ++i5) {
const k4 = keys2[i5];
node = node[k4] || (node[k4] = /* @__PURE__ */ Object.create(null));
}
return node;
}
function set(root, scope, values) {
if (typeof scope === "string") {
return merge(getScope$1(root, scope), values);
}
return merge(getScope$1(root, ""), scope);
}
function toFontString(font) {
if (!font || isNullOrUndef(font.size) || isNullOrUndef(font.family)) {
return null;
}
return (font.style ? font.style + " " : "") + (font.weight ? font.weight + " " : "") + font.size + "px " + font.family;
}
function _measureText(ctx, data, gc, longest, string) {
let textWidth = data[string];
if (!textWidth) {
textWidth = data[string] = ctx.measureText(string).width;
gc.push(string);
}
if (textWidth > longest) {
longest = textWidth;
}
return longest;
}
function _longestText(ctx, font, arrayOfThings, cache2) {
cache2 = cache2 || {};
let data = cache2.data = cache2.data || {};
let gc = cache2.garbageCollect = cache2.garbageCollect || [];
if (cache2.font !== font) {
data = cache2.data = {};
gc = cache2.garbageCollect = [];
cache2.font = font;
}
ctx.save();
ctx.font = font;
let longest = 0;
const ilen = arrayOfThings.length;
let i5, j4, jlen, thing, nestedThing;
for (i5 = 0; i5 < ilen; i5++) {
thing = arrayOfThings[i5];
if (thing !== void 0 && thing !== null && isArray(thing) !== true) {
longest = _measureText(ctx, data, gc, longest, thing);
} else if (isArray(thing)) {
for (j4 = 0, jlen = thing.length; j4 < jlen; j4++) {
nestedThing = thing[j4];
if (nestedThing !== void 0 && nestedThing !== null && !isArray(nestedThing)) {
longest = _measureText(ctx, data, gc, longest, nestedThing);
}
}
}
}
ctx.restore();
const gcLen = gc.length / 2;
if (gcLen > arrayOfThings.length) {
for (i5 = 0; i5 < gcLen; i5++) {
delete data[gc[i5]];
}
gc.splice(0, gcLen);
}
return longest;
}
function _alignPixel(chart, pixel, width) {
const devicePixelRatio = chart.currentDevicePixelRatio;
const halfWidth = width !== 0 ? Math.max(width / 2, 0.5) : 0;
return Math.round((pixel - halfWidth) * devicePixelRatio) / devicePixelRatio + halfWidth;
}
function clearCanvas(canvas, ctx) {
ctx = ctx || canvas.getContext("2d");
ctx.save();
ctx.resetTransform();
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.restore();
}
function drawPoint(ctx, options, x4, y4) {
let type, xOffset, yOffset, size, cornerRadius;
const style2 = options.pointStyle;
const rotation = options.rotation;
const radius = options.radius;
let rad = (rotation || 0) * RAD_PER_DEG;
if (style2 && typeof style2 === "object") {
type = style2.toString();
if (type === "[object HTMLImageElement]" || type === "[object HTMLCanvasElement]") {
ctx.save();
ctx.translate(x4, y4);
ctx.rotate(rad);
ctx.drawImage(style2, -style2.width / 2, -style2.height / 2, style2.width, style2.height);
ctx.restore();
return;
}
}
if (isNaN(radius) || radius <= 0) {
return;
}
ctx.beginPath();
switch (style2) {
default:
ctx.arc(x4, y4, radius, 0, TAU);
ctx.closePath();
break;
case "triangle":
ctx.moveTo(x4 + Math.sin(rad) * radius, y4 - Math.cos(rad) * radius);
rad += TWO_THIRDS_PI;
ctx.lineTo(x4 + Math.sin(rad) * radius, y4 - Math.cos(rad) * radius);
rad += TWO_THIRDS_PI;
ctx.lineTo(x4 + Math.sin(rad) * radius, y4 - Math.cos(rad) * radius);
ctx.closePath();
break;
case "rectRounded":
cornerRadius = radius * 0.516;
size = radius - cornerRadius;
xOffset = Math.cos(rad + QUARTER_PI) * size;
yOffset = Math.sin(rad + QUARTER_PI) * size;
ctx.arc(x4 - xOffset, y4 - yOffset, cornerRadius, rad - PI, rad - HALF_PI);
ctx.arc(x4 + yOffset, y4 - xOffset, cornerRadius, rad - HALF_PI, rad);
ctx.arc(x4 + xOffset, y4 + yOffset, cornerRadius, rad, rad + HALF_PI);
ctx.arc(x4 - yOffset, y4 + xOffset, cornerRadius, rad + HALF_PI, rad + PI);
ctx.closePath();
break;
case "rect":
if (!rotation) {
size = Math.SQRT1_2 * radius;
ctx.rect(x4 - size, y4 - size, 2 * size, 2 * size);
break;
}
rad += QUARTER_PI;
case "rectRot":
xOffset = Math.cos(rad) * radius;
yOffset = Math.sin(rad) * radius;
ctx.moveTo(x4 - xOffset, y4 - yOffset);
ctx.lineTo(x4 + yOffset, y4 - xOffset);
ctx.lineTo(x4 + xOffset, y4 + yOffset);
ctx.lineTo(x4 - yOffset, y4 + xOffset);
ctx.closePath();
break;
case "crossRot":
rad += QUARTER_PI;
case "cross":
xOffset = Math.cos(rad) * radius;
yOffset = Math.sin(rad) * radius;
ctx.moveTo(x4 - xOffset, y4 - yOffset);
ctx.lineTo(x4 + xOffset, y4 + yOffset);
ctx.moveTo(x4 + yOffset, y4 - xOffset);
ctx.lineTo(x4 - yOffset, y4 + xOffset);
break;
case "star":
xOffset = Math.cos(rad) * radius;
yOffset = Math.sin(rad) * radius;
ctx.moveTo(x4 - xOffset, y4 - yOffset);
ctx.lineTo(x4 + xOffset, y4 + yOffset);
ctx.moveTo(x4 + yOffset, y4 - xOffset);
ctx.lineTo(x4 - yOffset, y4 + xOffset);
rad += QUARTER_PI;
xOffset = Math.cos(rad) * radius;
yOffset = Math.sin(rad) * radius;
ctx.moveTo(x4 - xOffset, y4 - yOffset);
ctx.lineTo(x4 + xOffset, y4 + yOffset);
ctx.moveTo(x4 + yOffset, y4 - xOffset);
ctx.lineTo(x4 - yOffset, y4 + xOffset);
break;
case "line":
xOffset = Math.cos(rad) * radius;
yOffset = Math.sin(rad) * radius;
ctx.moveTo(x4 - xOffset, y4 - yOffset);
ctx.lineTo(x4 + xOffset, y4 + yOffset);
break;
case "dash":
ctx.moveTo(x4, y4);
ctx.lineTo(x4 + Math.cos(rad) * radius, y4 + Math.sin(rad) * radius);
break;
}
ctx.fill();
if (options.borderWidth > 0) {
ctx.stroke();
}
}
function _isPointInArea(point, area, margin) {
margin = margin || 0.5;
return !area || point && point.x > area.left - margin && point.x < area.right + margin && point.y > area.top - margin && point.y < area.bottom + margin;
}
function clipArea(ctx, area) {
ctx.save();
ctx.beginPath();
ctx.rect(area.left, area.top, area.right - area.left, area.bottom - area.top);
ctx.clip();
}
function unclipArea(ctx) {
ctx.restore();
}
function _steppedLineTo(ctx, previous, target, flip2, mode) {
if (!previous) {
return ctx.lineTo(target.x, target.y);
}
if (mode === "middle") {
const midpoint = (previous.x + target.x) / 2;
ctx.lineTo(midpoint, previous.y);
ctx.lineTo(midpoint, target.y);
} else if (mode === "after" !== !!flip2) {
ctx.lineTo(previous.x, target.y);
} else {
ctx.lineTo(target.x, previous.y);
}
ctx.lineTo(target.x, target.y);
}
function _bezierCurveTo(ctx, previous, target, flip2) {
if (!previous) {
return ctx.lineTo(target.x, target.y);
}
ctx.bezierCurveTo(
flip2 ? previous.cp1x : previous.cp2x,
flip2 ? previous.cp1y : previous.cp2y,
flip2 ? target.cp2x : target.cp1x,
flip2 ? target.cp2y : target.cp1y,
target.x,
target.y
);
}
function renderText(ctx, text, x4, y4, font, opts = {}) {
const lines = isArray(text) ? text : [text];
const stroke = opts.strokeWidth > 0 && opts.strokeColor !== "";
let i5, line;
ctx.save();
ctx.font = font.string;
setRenderOpts(ctx, opts);
for (i5 = 0; i5 < lines.length; ++i5) {
line = lines[i5];
if (stroke) {
if (opts.strokeColor) {
ctx.strokeStyle = opts.strokeColor;
}
if (!isNullOrUndef(opts.strokeWidth)) {
ctx.lineWidth = opts.strokeWidth;
}
ctx.strokeText(line, x4, y4, opts.maxWidth);
}
ctx.fillText(line, x4, y4, opts.maxWidth);
decorateText(ctx, x4, y4, line, opts);
y4 += font.lineHeight;
}
ctx.restore();
}
function setRenderOpts(ctx, opts) {
if (opts.translation) {
ctx.translate(opts.translation[0], opts.translation[1]);
}
if (!isNullOrUndef(opts.rotation)) {
ctx.rotate(opts.rotation);
}
if (opts.color) {
ctx.fillStyle = opts.color;
}
if (opts.textAlign) {
ctx.textAlign = opts.textAlign;
}
if (opts.textBaseline) {
ctx.textBaseline = opts.textBaseline;
}
}
function decorateText(ctx, x4, y4, line, opts) {
if (opts.strikethrough || opts.underline) {
const metrics = ctx.measureText(line);
const left2 = x4 - metrics.actualBoundingBoxLeft;
const right2 = x4 + metrics.actualBoundingBoxRight;
const top2 = y4 - metrics.actualBoundingBoxAscent;
const bottom2 = y4 + metrics.actualBoundingBoxDescent;
const yDecoration = opts.strikethrough ? (top2 + bottom2) / 2 : bottom2;
ctx.strokeStyle = ctx.fillStyle;
ctx.beginPath();
ctx.lineWidth = opts.decorationWidth || 2;
ctx.moveTo(left2, yDecoration);
ctx.lineTo(right2, yDecoration);
ctx.stroke();
}
}
function addRoundedRectPath(ctx, rect) {
const { x: x4, y: y4, w: w4, h: h6, radius } = rect;
ctx.arc(x4 + radius.topLeft, y4 + radius.topLeft, radius.topLeft, -HALF_PI, PI, true);
ctx.lineTo(x4, y4 + h6 - radius.bottomLeft);
ctx.arc(x4 + radius.bottomLeft, y4 + h6 - radius.bottomLeft, radius.bottomLeft, PI, HALF_PI, true);
ctx.lineTo(x4 + w4 - radius.bottomRight, y4 + h6);
ctx.arc(x4 + w4 - radius.bottomRight, y4 + h6 - radius.bottomRight, radius.bottomRight, HALF_PI, 0, true);
ctx.lineTo(x4 + w4, y4 + radius.topRight);
ctx.arc(x4 + w4 - radius.topRight, y4 + radius.topRight, radius.topRight, 0, -HALF_PI, true);
ctx.lineTo(x4 + radius.topLeft, y4);
}
function toLineHeight(value, size) {
const matches3 = ("" + value).match(LINE_HEIGHT);
if (!matches3 || matches3[1] === "normal") {
return size * 1.2;
}
value = +matches3[2];
switch (matches3[3]) {
case "px":
return value;
case "%":
value /= 100;
break;
}
return size * value;
}
function _readValueToProps(value, props) {
const ret = {};
const objProps = isObject(props);
const keys2 = objProps ? Object.keys(props) : props;
const read2 = isObject(value) ? objProps ? (prop) => valueOrDefault(value[prop], value[props[prop]]) : (prop) => value[prop] : () => value;
for (const prop of keys2) {
ret[prop] = numberOrZero(read2(prop));
}
return ret;
}
function toTRBL(value) {
return _readValueToProps(value, { top: "y", right: "x", bottom: "y", left: "x" });
}
function toTRBLCorners(value) {
return _readValueToProps(value, ["topLeft", "topRight", "bottomLeft", "bottomRight"]);
}
function toPadding(value) {
const obj = toTRBL(value);
obj.width = obj.left + obj.right;
obj.height = obj.top + obj.bottom;
return obj;
}
function toFont(options, fallback) {
options = options || {};
fallback = fallback || defaults.font;
let size = valueOrDefault(options.size, fallback.size);
if (typeof size === "string") {
size = parseInt(size, 10);
}
let style2 = valueOrDefault(options.style, fallback.style);
if (style2 && !("" + style2).match(FONT_STYLE)) {
console.warn('Invalid font style specified: "' + style2 + '"');
style2 = "";
}
const font = {
family: valueOrDefault(options.family, fallback.family),
lineHeight: toLineHeight(valueOrDefault(options.lineHeight, fallback.lineHeight), size),
size,
style: style2,
weight: valueOrDefault(options.weight, fallback.weight),
string: ""
};
font.string = toFontString(font);
return font;
}
function resolve(inputs, context, index3, info) {
let cacheable = true;
let i5, ilen, value;
for (i5 = 0, ilen = inputs.length; i5 < ilen; ++i5) {
value = inputs[i5];
if (value === void 0) {
continue;
}
if (context !== void 0 && typeof value === "function") {
value = value(context);
cacheable = false;
}
if (index3 !== void 0 && isArray(value)) {
value = value[index3 % value.length];
cacheable = false;
}
if (value !== void 0) {
if (info && !cacheable) {
info.cacheable = false;
}
return value;
}
}
}
function _addGrace(minmax, grace, beginAtZero) {
const { min: min2, max: max2 } = minmax;
const change = toDimension(grace, (max2 - min2) / 2);
const keepZero = (value, add2) => beginAtZero && value === 0 ? 0 : value + add2;
return {
min: keepZero(min2, -Math.abs(change)),
max: keepZero(max2, change)
};
}
function createContext(parentContext, context) {
return Object.assign(Object.create(parentContext), context);
}
function _lookup(table, value, cmp2) {
cmp2 = cmp2 || ((index3) => table[index3] < value);
let hi2 = table.length - 1;
let lo = 0;
let mid;
while (hi2 - lo > 1) {
mid = lo + hi2 >> 1;
if (cmp2(mid)) {
lo = mid;
} else {
hi2 = mid;
}
}
return { lo, hi: hi2 };
}
function _filterBetween(values, min2, max2) {
let start3 = 0;
let end2 = values.length;
while (start3 < end2 && values[start3] < min2) {
start3++;
}
while (end2 > start3 && values[end2 - 1] > max2) {
end2--;
}
return start3 > 0 || end2 < values.length ? values.slice(start3, end2) : values;
}
function listenArrayEvents(array, listener) {
if (array._chartjs) {
array._chartjs.listeners.push(listener);
return;
}
Object.defineProperty(array, "_chartjs", {
configurable: true,
enumerable: false,
value: {
listeners: [listener]
}
});
arrayEvents.forEach((key) => {
const method = "_onData" + _capitalize(key);
const base2 = array[key];
Object.defineProperty(array, key, {
configurable: true,
enumerable: false,
value(...args) {
const res = base2.apply(this, args);
array._chartjs.listeners.forEach((object) => {
if (typeof object[method] === "function") {
object[method](...args);
}
});
return res;
}
});
});
}
function unlistenArrayEvents(array, listener) {
const stub = array._chartjs;
if (!stub) {
return;
}
const listeners = stub.listeners;
const index3 = listeners.indexOf(listener);
if (index3 !== -1) {
listeners.splice(index3, 1);
}
if (listeners.length > 0) {
return;
}
arrayEvents.forEach((key) => {
delete array[key];
});
delete array._chartjs;
}
function _arrayUnique(items) {
const set2 = /* @__PURE__ */ new Set();
let i5, ilen;
for (i5 = 0, ilen = items.length; i5 < ilen; ++i5) {
set2.add(items[i5]);
}
if (set2.size === ilen) {
return items;
}
return Array.from(set2);
}
function _createResolver(scopes, prefixes = [""], rootScopes = scopes, fallback, getTarget2 = () => scopes[0]) {
if (!defined(fallback)) {
fallback = _resolve("_fallback", scopes);
}
const cache2 = {
[Symbol.toStringTag]: "Object",
_cacheable: true,
_scopes: scopes,
_rootScopes: rootScopes,
_fallback: fallback,
_getTarget: getTarget2,
override: (scope) => _createResolver([scope, ...scopes], prefixes, rootScopes, fallback)
};
return new Proxy(cache2, {
deleteProperty(target, prop) {
delete target[prop];
delete target._keys;
delete scopes[0][prop];
return true;
},
get(target, prop) {
return _cached(
target,
prop,
() => _resolveWithPrefixes(prop, prefixes, scopes, target)
);
},
getOwnPropertyDescriptor(target, prop) {
return Reflect.getOwnPropertyDescriptor(target._scopes[0], prop);
},
getPrototypeOf() {
return Reflect.getPrototypeOf(scopes[0]);
},
has(target, prop) {
return getKeysFromAllScopes(target).includes(prop);
},
ownKeys(target) {
return getKeysFromAllScopes(target);
},
set(target, prop, value) {
const storage2 = target._storage || (target._storage = getTarget2());
target[prop] = storage2[prop] = value;
delete target._keys;
return true;
}
});
}
function _attachContext(proxy, context, subProxy, descriptorDefaults) {
const cache2 = {
_cacheable: false,
_proxy: proxy,
_context: context,
_subProxy: subProxy,
_stack: /* @__PURE__ */ new Set(),
_descriptors: _descriptors(proxy, descriptorDefaults),
setContext: (ctx) => _attachContext(proxy, ctx, subProxy, descriptorDefaults),
override: (scope) => _attachContext(proxy.override(scope), context, subProxy, descriptorDefaults)
};
return new Proxy(cache2, {
deleteProperty(target, prop) {
delete target[prop];
delete proxy[prop];
return true;
},
get(target, prop, receiver) {
return _cached(
target,
prop,
() => _resolveWithContext(target, prop, receiver)
);
},
getOwnPropertyDescriptor(target, prop) {
return target._descriptors.allKeys ? Reflect.has(proxy, prop) ? { enumerable: true, configurable: true } : void 0 : Reflect.getOwnPropertyDescriptor(proxy, prop);
},
getPrototypeOf() {
return Reflect.getPrototypeOf(proxy);
},
has(target, prop) {
return Reflect.has(proxy, prop);
},
ownKeys() {
return Reflect.ownKeys(proxy);
},
set(target, prop, value) {
proxy[prop] = value;
delete target[prop];
return true;
}
});
}
function _descriptors(proxy, defaults5 = { scriptable: true, indexable: true }) {
const { _scriptable = defaults5.scriptable, _indexable = defaults5.indexable, _allKeys = defaults5.allKeys } = proxy;
return {
allKeys: _allKeys,
scriptable: _scriptable,
indexable: _indexable,
isScriptable: isFunction(_scriptable) ? _scriptable : () => _scriptable,
isIndexable: isFunction(_indexable) ? _indexable : () => _indexable
};
}
function _cached(target, prop, resolve3) {
if (Object.prototype.hasOwnProperty.call(target, prop)) {
return target[prop];
}
const value = resolve3();
target[prop] = value;
return value;
}
function _resolveWithContext(target, prop, receiver) {
const { _proxy, _context, _subProxy, _descriptors: descriptors2 } = target;
let value = _proxy[prop];
if (isFunction(value) && descriptors2.isScriptable(prop)) {
value = _resolveScriptable(prop, value, target, receiver);
}
if (isArray(value) && value.length) {
value = _resolveArray(prop, value, target, descriptors2.isIndexable);
}
if (needsSubResolver(prop, value)) {
value = _attachContext(value, _context, _subProxy && _subProxy[prop], descriptors2);
}
return value;
}
function _resolveScriptable(prop, value, target, receiver) {
const { _proxy, _context, _subProxy, _stack } = target;
if (_stack.has(prop)) {
throw new Error("Recursion detected: " + Array.from(_stack).join("->") + "->" + prop);
}
_stack.add(prop);
value = value(_context, _subProxy || receiver);
_stack.delete(prop);
if (needsSubResolver(prop, value)) {
value = createSubResolver(_proxy._scopes, _proxy, prop, value);
}
return value;
}
function _resolveArray(prop, value, target, isIndexable) {
const { _proxy, _context, _subProxy, _descriptors: descriptors2 } = target;
if (defined(_context.index) && isIndexable(prop)) {
value = value[_context.index % value.length];
} else if (isObject(value[0])) {
const arr = value;
const scopes = _proxy._scopes.filter((s6) => s6 !== arr);
value = [];
for (const item of arr) {
const resolver = createSubResolver(scopes, _proxy, prop, item);
value.push(_attachContext(resolver, _context, _subProxy && _subProxy[prop], descriptors2));
}
}
return value;
}
function resolveFallback(fallback, prop, value) {
return isFunction(fallback) ? fallback(prop, value) : fallback;
}
function addScopes(set2, parentScopes, key, parentFallback, value) {
for (const parent of parentScopes) {
const scope = getScope(key, parent);
if (scope) {
set2.add(scope);
const fallback = resolveFallback(scope._fallback, key, value);
if (defined(fallback) && fallback !== key && fallback !== parentFallback) {
return fallback;
}
} else if (scope === false && defined(parentFallback) && key !== parentFallback) {
return null;
}
}
return false;
}
function createSubResolver(parentScopes, resolver, prop, value) {
const rootScopes = resolver._rootScopes;
const fallback = resolveFallback(resolver._fallback, prop, value);
const allScopes = [...parentScopes, ...rootScopes];
const set2 = /* @__PURE__ */ new Set();
set2.add(value);
let key = addScopesFromKey(set2, allScopes, prop, fallback || prop, value);
if (key === null) {
return false;
}
if (defined(fallback) && fallback !== prop) {
key = addScopesFromKey(set2, allScopes, fallback, key, value);
if (key === null) {
return false;
}
}
return _createResolver(
Array.from(set2),
[""],
rootScopes,
fallback,
() => subGetTarget(resolver, prop, value)
);
}
function addScopesFromKey(set2, allScopes, key, fallback, item) {
while (key) {
key = addScopes(set2, allScopes, key, fallback, item);
}
return key;
}
function subGetTarget(resolver, prop, value) {
const parent = resolver._getTarget();
if (!(prop in parent)) {
parent[prop] = {};
}
const target = parent[prop];
if (isArray(target) && isObject(value)) {
return value;
}
return target;
}
function _resolveWithPrefixes(prop, prefixes, scopes, proxy) {
let value;
for (const prefix of prefixes) {
value = _resolve(readKey(prefix, prop), scopes);
if (defined(value)) {
return needsSubResolver(prop, value) ? createSubResolver(scopes, proxy, prop, value) : value;
}
}
}
function _resolve(key, scopes) {
for (const scope of scopes) {
if (!scope) {
continue;
}
const value = scope[key];
if (defined(value)) {
return value;
}
}
}
function getKeysFromAllScopes(target) {
let keys2 = target._keys;
if (!keys2) {
keys2 = target._keys = resolveKeysFromAllScopes(target._scopes);
}
return keys2;
}
function resolveKeysFromAllScopes(scopes) {
const set2 = /* @__PURE__ */ new Set();
for (const scope of scopes) {
for (const key of Object.keys(scope).filter((k4) => !k4.startsWith("_"))) {
set2.add(key);
}
}
return Array.from(set2);
}
function splineCurve(firstPoint, middlePoint, afterPoint, t5) {
const previous = firstPoint.skip ? middlePoint : firstPoint;
const current = middlePoint;
const next = afterPoint.skip ? middlePoint : afterPoint;
const d01 = distanceBetweenPoints(current, previous);
const d12 = distanceBetweenPoints(next, current);
let s01 = d01 / (d01 + d12);
let s12 = d12 / (d01 + d12);
s01 = isNaN(s01) ? 0 : s01;
s12 = isNaN(s12) ? 0 : s12;
const fa = t5 * s01;
const fb = t5 * s12;
return {
previous: {
x: current.x - fa * (next.x - previous.x),
y: current.y - fa * (next.y - previous.y)
},
next: {
x: current.x + fb * (next.x - previous.x),
y: current.y + fb * (next.y - previous.y)
}
};
}
function monotoneAdjust(points, deltaK, mK) {
const pointsLen = points.length;
let alphaK, betaK, tauK, squaredMagnitude, pointCurrent;
let pointAfter = getPoint(points, 0);
for (let i5 = 0; i5 < pointsLen - 1; ++i5) {
pointCurrent = pointAfter;
pointAfter = getPoint(points, i5 + 1);
if (!pointCurrent || !pointAfter) {
continue;
}
if (almostEquals(deltaK[i5], 0, EPSILON)) {
mK[i5] = mK[i5 + 1] = 0;
continue;
}
alphaK = mK[i5] / deltaK[i5];
betaK = mK[i5 + 1] / deltaK[i5];
squaredMagnitude = Math.pow(alphaK, 2) + Math.pow(betaK, 2);
if (squaredMagnitude <= 9) {
continue;
}
tauK = 3 / Math.sqrt(squaredMagnitude);
mK[i5] = alphaK * tauK * deltaK[i5];
mK[i5 + 1] = betaK * tauK * deltaK[i5];
}
}
function monotoneCompute(points, mK, indexAxis = "x") {
const valueAxis = getValueAxis(indexAxis);
const pointsLen = points.length;
let delta, pointBefore, pointCurrent;
let pointAfter = getPoint(points, 0);
for (let i5 = 0; i5 < pointsLen; ++i5) {
pointBefore = pointCurrent;
pointCurrent = pointAfter;
pointAfter = getPoint(points, i5 + 1);
if (!pointCurrent) {
continue;
}
const iPixel = pointCurrent[indexAxis];
const vPixel = pointCurrent[valueAxis];
if (pointBefore) {
delta = (iPixel - pointBefore[indexAxis]) / 3;
pointCurrent[`cp1${indexAxis}`] = iPixel - delta;
pointCurrent[`cp1${valueAxis}`] = vPixel - delta * mK[i5];
}
if (pointAfter) {
delta = (pointAfter[indexAxis] - iPixel) / 3;
pointCurrent[`cp2${indexAxis}`] = iPixel + delta;
pointCurrent[`cp2${valueAxis}`] = vPixel + delta * mK[i5];
}
}
}
function splineCurveMonotone(points, indexAxis = "x") {
const valueAxis = getValueAxis(indexAxis);
const pointsLen = points.length;
const deltaK = Array(pointsLen).fill(0);
const mK = Array(pointsLen);
let i5, pointBefore, pointCurrent;
let pointAfter = getPoint(points, 0);
for (i5 = 0; i5 < pointsLen; ++i5) {
pointBefore = pointCurrent;
pointCurrent = pointAfter;
pointAfter = getPoint(points, i5 + 1);
if (!pointCurrent) {
continue;
}
if (pointAfter) {
const slopeDelta = pointAfter[indexAxis] - pointCurrent[indexAxis];
deltaK[i5] = slopeDelta !== 0 ? (pointAfter[valueAxis] - pointCurrent[valueAxis]) / slopeDelta : 0;
}
mK[i5] = !pointBefore ? deltaK[i5] : !pointAfter ? deltaK[i5 - 1] : sign(deltaK[i5 - 1]) !== sign(deltaK[i5]) ? 0 : (deltaK[i5 - 1] + deltaK[i5]) / 2;
}
monotoneAdjust(points, deltaK, mK);
monotoneCompute(points, mK, indexAxis);
}
function capControlPoint(pt2, min2, max2) {
return Math.max(Math.min(pt2, max2), min2);
}
function capBezierPoints(points, area) {
let i5, ilen, point, inArea, inAreaPrev;
let inAreaNext = _isPointInArea(points[0], area);
for (i5 = 0, ilen = points.length; i5 < ilen; ++i5) {
inAreaPrev = inArea;
inArea = inAreaNext;
inAreaNext = i5 < ilen - 1 && _isPointInArea(points[i5 + 1], area);
if (!inArea) {
continue;
}
point = points[i5];
if (inAreaPrev) {
point.cp1x = capControlPoint(point.cp1x, area.left, area.right);
point.cp1y = capControlPoint(point.cp1y, area.top, area.bottom);
}
if (inAreaNext) {
point.cp2x = capControlPoint(point.cp2x, area.left, area.right);
point.cp2y = capControlPoint(point.cp2y, area.top, area.bottom);
}
}
}
function _updateBezierControlPoints(points, options, area, loop, indexAxis) {
let i5, ilen, point, controlPoints;
if (options.spanGaps) {
points = points.filter((pt2) => !pt2.skip);
}
if (options.cubicInterpolationMode === "monotone") {
splineCurveMonotone(points, indexAxis);
} else {
let prev = loop ? points[points.length - 1] : points[0];
for (i5 = 0, ilen = points.length; i5 < ilen; ++i5) {
point = points[i5];
controlPoints = splineCurve(
prev,
point,
points[Math.min(i5 + 1, ilen - (loop ? 0 : 1)) % ilen],
options.tension
);
point.cp1x = controlPoints.previous.x;
point.cp1y = controlPoints.previous.y;
point.cp2x = controlPoints.next.x;
point.cp2y = controlPoints.next.y;
prev = point;
}
}
if (options.capBezierPoints) {
capBezierPoints(points, area);
}
}
function _isDomSupported() {
return typeof window !== "undefined" && typeof document !== "undefined";
}
function _getParentNode(domNode) {
let parent = domNode.parentNode;
if (parent && parent.toString() === "[object ShadowRoot]") {
parent = parent.host;
}
return parent;
}
function parseMaxStyle(styleValue, node, parentProperty) {
let valueInPixels;
if (typeof styleValue === "string") {
valueInPixels = parseInt(styleValue, 10);
if (styleValue.indexOf("%") !== -1) {
valueInPixels = valueInPixels / 100 * node.parentNode[parentProperty];
}
} else {
valueInPixels = styleValue;
}
return valueInPixels;
}
function getStyle(el, property) {
return getComputedStyle2(el).getPropertyValue(property);
}
function getPositionedStyle(styles, style2, suffix) {
const result = {};
suffix = suffix ? "-" + suffix : "";
for (let i5 = 0; i5 < 4; i5++) {
const pos = positions[i5];
result[pos] = parseFloat(styles[style2 + "-" + pos + suffix]) || 0;
}
result.width = result.left + result.right;
result.height = result.top + result.bottom;
return result;
}
function getCanvasPosition(evt, canvas) {
const e5 = evt.native || evt;
const touches = e5.touches;
const source = touches && touches.length ? touches[0] : e5;
const { offsetX, offsetY } = source;
let box = false;
let x4, y4;
if (useOffsetPos(offsetX, offsetY, e5.target)) {
x4 = offsetX;
y4 = offsetY;
} else {
const rect = canvas.getBoundingClientRect();
x4 = source.clientX - rect.left;
y4 = source.clientY - rect.top;
box = true;
}
return { x: x4, y: y4, box };
}
function getRelativePosition(evt, chart) {
const { canvas, currentDevicePixelRatio } = chart;
const style2 = getComputedStyle2(canvas);
const borderBox = style2.boxSizing === "border-box";
const paddings = getPositionedStyle(style2, "padding");
const borders = getPositionedStyle(style2, "border", "width");
const { x: x4, y: y4, box } = getCanvasPosition(evt, canvas);
const xOffset = paddings.left + (box && borders.left);
const yOffset = paddings.top + (box && borders.top);
let { width, height } = chart;
if (borderBox) {
width -= paddings.width + borders.width;
height -= paddings.height + borders.height;
}
return {
x: Math.round((x4 - xOffset) / width * canvas.width / currentDevicePixelRatio),
y: Math.round((y4 - yOffset) / height * canvas.height / currentDevicePixelRatio)
};
}
function getContainerSize(canvas, width, height) {
let maxWidth, maxHeight;
if (width === void 0 || height === void 0) {
const container = _getParentNode(canvas);
if (!container) {
width = canvas.clientWidth;
height = canvas.clientHeight;
} else {
const rect = container.getBoundingClientRect();
const containerStyle = getComputedStyle2(container);
const containerBorder = getPositionedStyle(containerStyle, "border", "width");
const containerPadding = getPositionedStyle(containerStyle, "padding");
width = rect.width - containerPadding.width - containerBorder.width;
height = rect.height - containerPadding.height - containerBorder.height;
maxWidth = parseMaxStyle(containerStyle.maxWidth, container, "clientWidth");
maxHeight = parseMaxStyle(containerStyle.maxHeight, container, "clientHeight");
}
}
return {
width,
height,
maxWidth: maxWidth || INFINITY,
maxHeight: maxHeight || INFINITY
};
}
function getMaximumSize(canvas, bbWidth, bbHeight, aspectRatio) {
const style2 = getComputedStyle2(canvas);
const margins = getPositionedStyle(style2, "margin");
const maxWidth = parseMaxStyle(style2.maxWidth, canvas, "clientWidth") || INFINITY;
const maxHeight = parseMaxStyle(style2.maxHeight, canvas, "clientHeight") || INFINITY;
const containerSize = getContainerSize(canvas, bbWidth, bbHeight);
let { width, height } = containerSize;
if (style2.boxSizing === "content-box") {
const borders = getPositionedStyle(style2, "border", "width");
const paddings = getPositionedStyle(style2, "padding");
width -= paddings.width + borders.width;
height -= paddings.height + borders.height;
}
width = Math.max(0, width - margins.width);
height = Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height - margins.height);
width = round1(Math.min(width, maxWidth, containerSize.maxWidth));
height = round1(Math.min(height, maxHeight, containerSize.maxHeight));
if (width && !height) {
height = round1(width / 2);
}
return {
width,
height
};
}
function retinaScale(chart, forceRatio, forceStyle) {
const pixelRatio = forceRatio || 1;
const deviceHeight = Math.floor(chart.height * pixelRatio);
const deviceWidth = Math.floor(chart.width * pixelRatio);
chart.height = deviceHeight / pixelRatio;
chart.width = deviceWidth / pixelRatio;
const canvas = chart.canvas;
if (canvas.style && (forceStyle || !canvas.style.height && !canvas.style.width)) {
canvas.style.height = `${chart.height}px`;
canvas.style.width = `${chart.width}px`;
}
if (chart.currentDevicePixelRatio !== pixelRatio || canvas.height !== deviceHeight || canvas.width !== deviceWidth) {
chart.currentDevicePixelRatio = pixelRatio;
canvas.height = deviceHeight;
canvas.width = deviceWidth;
chart.ctx.setTransform(pixelRatio, 0, 0, pixelRatio, 0, 0);
return true;
}
return false;
}
function readUsedSize(element, property) {
const value = getStyle(element, property);
const matches3 = value && value.match(/^(\d+)(\.\d+)?px$/);
return matches3 ? +matches3[1] : void 0;
}
function _pointInLine(p1, p22, t5, mode) {
return {
x: p1.x + t5 * (p22.x - p1.x),
y: p1.y + t5 * (p22.y - p1.y)
};
}
function _steppedInterpolation(p1, p22, t5, mode) {
return {
x: p1.x + t5 * (p22.x - p1.x),
y: mode === "middle" ? t5 < 0.5 ? p1.y : p22.y : mode === "after" ? t5 < 1 ? p1.y : p22.y : t5 > 0 ? p22.y : p1.y
};
}
function _bezierInterpolation(p1, p22, t5, mode) {
const cp1 = { x: p1.cp2x, y: p1.cp2y };
const cp2 = { x: p22.cp1x, y: p22.cp1y };
const a5 = _pointInLine(p1, cp1, t5);
const b4 = _pointInLine(cp1, cp2, t5);
const c4 = _pointInLine(cp2, p22, t5);
const d4 = _pointInLine(a5, b4, t5);
const e5 = _pointInLine(b4, c4, t5);
return _pointInLine(d4, e5, t5);
}
function getNumberFormat(locale2, options) {
options = options || {};
const cacheKey = locale2 + JSON.stringify(options);
let formatter = intlCache.get(cacheKey);
if (!formatter) {
formatter = new Intl.NumberFormat(locale2, options);
intlCache.set(cacheKey, formatter);
}
return formatter;
}
function formatNumber(num, locale2, options) {
return getNumberFormat(locale2, options).format(num);
}
function getRtlAdapter(rtl, rectX, width) {
return rtl ? getRightToLeftAdapter(rectX, width) : getLeftToRightAdapter();
}
function overrideTextDirection(ctx, direction) {
let style2, original;
if (direction === "ltr" || direction === "rtl") {
style2 = ctx.canvas.style;
original = [
style2.getPropertyValue("direction"),
style2.getPropertyPriority("direction")
];
style2.setProperty("direction", direction, "important");
ctx.prevTextDirection = original;
}
}
function restoreTextDirection(ctx, original) {
if (original !== void 0) {
delete ctx.prevTextDirection;
ctx.canvas.style.setProperty("direction", original[0], original[1]);
}
}
function propertyFn(property) {
if (property === "angle") {
return {
between: _angleBetween,
compare: _angleDiff,
normalize: _normalizeAngle
};
}
return {
between: _isBetween,
compare: (a5, b4) => a5 - b4,
normalize: (x4) => x4
};
}
function normalizeSegment({ start: start3, end: end2, count, loop, style: style2 }) {
return {
start: start3 % count,
end: end2 % count,
loop: loop && (end2 - start3 + 1) % count === 0,
style: style2
};
}
function getSegment(segment, points, bounds) {
const { property, start: startBound, end: endBound } = bounds;
const { between, normalize: normalize2 } = propertyFn(property);
const count = points.length;
let { start: start3, end: end2, loop } = segment;
let i5, ilen;
if (loop) {
start3 += count;
end2 += count;
for (i5 = 0, ilen = count; i5 < ilen; ++i5) {
if (!between(normalize2(points[start3 % count][property]), startBound, endBound)) {
break;
}
start3--;
end2--;
}
start3 %= count;
end2 %= count;
}
if (end2 < start3) {
end2 += count;
}
return { start: start3, end: end2, loop, style: segment.style };
}
function _boundSegment(segment, points, bounds) {
if (!bounds) {
return [segment];
}
const { property, start: startBound, end: endBound } = bounds;
const count = points.length;
const { compare, between, normalize: normalize2 } = propertyFn(property);
const { start: start3, end: end2, loop, style: style2 } = getSegment(segment, points, bounds);
const result = [];
let inside = false;
let subStart = null;
let value, point, prevValue;
const startIsBefore = () => between(startBound, prevValue, value) && compare(startBound, prevValue) !== 0;
const endIsBefore = () => compare(endBound, value) === 0 || between(endBound, prevValue, value);
const shouldStart = () => inside || startIsBefore();
const shouldStop = () => !inside || endIsBefore();
for (let i5 = start3, prev = start3; i5 <= end2; ++i5) {
point = points[i5 % count];
if (point.skip) {
continue;
}
value = normalize2(point[property]);
if (value === prevValue) {
continue;
}
inside = between(value, startBound, endBound);
if (subStart === null && shouldStart()) {
subStart = compare(value, startBound) === 0 ? i5 : prev;
}
if (subStart !== null && shouldStop()) {
result.push(normalizeSegment({ start: subStart, end: i5, loop, count, style: style2 }));
subStart = null;
}
prev = i5;
prevValue = value;
}
if (subStart !== null) {
result.push(normalizeSegment({ start: subStart, end: end2, loop, count, style: style2 }));
}
return result;
}
function _boundSegments(line, bounds) {
const result = [];
const segments = line.segments;
for (let i5 = 0; i5 < segments.length; i5++) {
const sub = _boundSegment(segments[i5], line.points, bounds);
if (sub.length) {
result.push(...sub);
}
}
return result;
}
function findStartAndEnd(points, count, loop, spanGaps) {
let start3 = 0;
let end2 = count - 1;
if (loop && !spanGaps) {
while (start3 < count && !points[start3].skip) {
start3++;
}
}
while (start3 < count && points[start3].skip) {
start3++;
}
start3 %= count;
if (loop) {
end2 += start3;
}
while (end2 > start3 && points[end2 % count].skip) {
end2--;
}
end2 %= count;
return { start: start3, end: end2 };
}
function solidSegments(points, start3, max2, loop) {
const count = points.length;
const result = [];
let last = start3;
let prev = points[start3];
let end2;
for (end2 = start3 + 1; end2 <= max2; ++end2) {
const cur = points[end2 % count];
if (cur.skip || cur.stop) {
if (!prev.skip) {
loop = false;
result.push({ start: start3 % count, end: (end2 - 1) % count, loop });
start3 = last = cur.stop ? end2 : null;
}
} else {
last = end2;
if (prev.skip) {
start3 = end2;
}
}
prev = cur;
}
if (last !== null) {
result.push({ start: start3 % count, end: last % count, loop });
}
return result;
}
function _computeSegments(line, segmentOptions) {
const points = line.points;
const spanGaps = line.options.spanGaps;
const count = points.length;
if (!count) {
return [];
}
const loop = !!line._loop;
const { start: start3, end: end2 } = findStartAndEnd(points, count, loop, spanGaps);
if (spanGaps === true) {
return splitByStyles(line, [{ start: start3, end: end2, loop }], points, segmentOptions);
}
const max2 = end2 < start3 ? end2 + count : end2;
const completeLoop = !!line._fullLoop && start3 === 0 && end2 === count - 1;
return splitByStyles(line, solidSegments(points, start3, max2, completeLoop), points, segmentOptions);
}
function splitByStyles(line, segments, points, segmentOptions) {
if (!segmentOptions || !segmentOptions.setContext || !points) {
return segments;
}
return doSplitByStyles(line, segments, points, segmentOptions);
}
function doSplitByStyles(line, segments, points, segmentOptions) {
const chartContext = line._chart.getContext();
const baseStyle = readStyle(line.options);
const { _datasetIndex: datasetIndex, options: { spanGaps } } = line;
const count = points.length;
const result = [];
let prevStyle = baseStyle;
let start3 = segments[0].start;
let i5 = start3;
function addStyle(s6, e5, l7, st2) {
const dir = spanGaps ? -1 : 1;
if (s6 === e5) {
return;
}
s6 += count;
while (points[s6 % count].skip) {
s6 -= dir;
}
while (points[e5 % count].skip) {
e5 += dir;
}
if (s6 % count !== e5 % count) {
result.push({ start: s6 % count, end: e5 % count, loop: l7, style: st2 });
prevStyle = st2;
start3 = e5 % count;
}
}
for (const segment of segments) {
start3 = spanGaps ? start3 : segment.start;
let prev = points[start3 % count];
let style2;
for (i5 = start3 + 1; i5 <= segment.end; i5++) {
const pt2 = points[i5 % count];
style2 = readStyle(segmentOptions.setContext(createContext(chartContext, {
type: "segment",
p0: prev,
p1: pt2,
p0DataIndex: (i5 - 1) % count,
p1DataIndex: i5 % count,
datasetIndex
})));
if (styleChanged(style2, prevStyle)) {
addStyle(start3, i5 - 1, segment.loop, prevStyle);
}
prev = pt2;
prevStyle = style2;
}
if (start3 < i5 - 1) {
addStyle(start3, i5 - 1, segment.loop, prevStyle);
}
}
return result;
}
function readStyle(options) {
return {
backgroundColor: options.backgroundColor,
borderCapStyle: options.borderCapStyle,
borderDash: options.borderDash,
borderDashOffset: options.borderDashOffset,
borderJoinStyle: options.borderJoinStyle,
borderWidth: options.borderWidth,
borderColor: options.borderColor
};
}
function styleChanged(style2, prevStyle) {
return prevStyle && JSON.stringify(style2) !== JSON.stringify(prevStyle);
}
var requestAnimFrame, _toLeftRightCenter, _alignStartEnd, _textX, uid, isNumberFinite, toPercentage, toDimension, emptyString, dot, defined, isFunction, setsEqual, PI, TAU, PITAU, INFINITY, RAD_PER_DEG, HALF_PI, QUARTER_PI, TWO_THIRDS_PI, log10, sign, atEdge, elasticIn, elasticOut, effects, map, hex, h1, h2, eq, lim, RGB_RE, HUE_RE, map$1, names, names$1, Color, isPatternOrGradient, overrides, descriptors, Defaults, defaults, LINE_HEIGHT, FONT_STYLE, numberOrZero, _lookupByKey, _rlookupByKey, arrayEvents, readKey, needsSubResolver, getScope, EPSILON, getPoint, getValueAxis, getComputedStyle2, positions, useOffsetPos, round1, supportsEventListenerOptions, intlCache, getRightToLeftAdapter, getLeftToRightAdapter;
var init_helpers_segment = __esm({
"node_modules/chartkick/node_modules/chart.js/dist/chunks/helpers.segment.js"() {
requestAnimFrame = function() {
if (typeof window === "undefined") {
return function(callback2) {
return callback2();
};
}
return window.requestAnimationFrame;
}();
_toLeftRightCenter = (align) => align === "start" ? "left" : align === "end" ? "right" : "center";
_alignStartEnd = (align, start3, end2) => align === "start" ? start3 : align === "end" ? end2 : (start3 + end2) / 2;
_textX = (align, left2, right2, rtl) => {
const check = rtl ? "left" : "right";
return align === check ? right2 : align === "center" ? (left2 + right2) / 2 : left2;
};
uid = function() {
let id = 0;
return function() {
return id++;
};
}();
isNumberFinite = (value) => (typeof value === "number" || value instanceof Number) && isFinite(+value);
toPercentage = (value, dimension) => typeof value === "string" && value.endsWith("%") ? parseFloat(value) / 100 : value / dimension;
toDimension = (value, dimension) => typeof value === "string" && value.endsWith("%") ? parseFloat(value) / 100 * dimension : +value;
emptyString = "";
dot = ".";
defined = (value) => typeof value !== "undefined";
isFunction = (value) => typeof value === "function";
setsEqual = (a5, b4) => {
if (a5.size !== b4.size) {
return false;
}
for (const item of a5) {
if (!b4.has(item)) {
return false;
}
}
return true;
};
PI = Math.PI;
TAU = 2 * PI;
PITAU = TAU + PI;
INFINITY = Number.POSITIVE_INFINITY;
RAD_PER_DEG = PI / 180;
HALF_PI = PI / 2;
QUARTER_PI = PI / 4;
TWO_THIRDS_PI = PI * 2 / 3;
log10 = Math.log10;
sign = Math.sign;
atEdge = (t5) => t5 === 0 || t5 === 1;
elasticIn = (t5, s6, p4) => -(Math.pow(2, 10 * (t5 -= 1)) * Math.sin((t5 - s6) * TAU / p4));
elasticOut = (t5, s6, p4) => Math.pow(2, -10 * t5) * Math.sin((t5 - s6) * TAU / p4) + 1;
effects = {
linear: (t5) => t5,
easeInQuad: (t5) => t5 * t5,
easeOutQuad: (t5) => -t5 * (t5 - 2),
easeInOutQuad: (t5) => (t5 /= 0.5) < 1 ? 0.5 * t5 * t5 : -0.5 * (--t5 * (t5 - 2) - 1),
easeInCubic: (t5) => t5 * t5 * t5,
easeOutCubic: (t5) => (t5 -= 1) * t5 * t5 + 1,
easeInOutCubic: (t5) => (t5 /= 0.5) < 1 ? 0.5 * t5 * t5 * t5 : 0.5 * ((t5 -= 2) * t5 * t5 + 2),
easeInQuart: (t5) => t5 * t5 * t5 * t5,
easeOutQuart: (t5) => -((t5 -= 1) * t5 * t5 * t5 - 1),
easeInOutQuart: (t5) => (t5 /= 0.5) < 1 ? 0.5 * t5 * t5 * t5 * t5 : -0.5 * ((t5 -= 2) * t5 * t5 * t5 - 2),
easeInQuint: (t5) => t5 * t5 * t5 * t5 * t5,
easeOutQuint: (t5) => (t5 -= 1) * t5 * t5 * t5 * t5 + 1,
easeInOutQuint: (t5) => (t5 /= 0.5) < 1 ? 0.5 * t5 * t5 * t5 * t5 * t5 : 0.5 * ((t5 -= 2) * t5 * t5 * t5 * t5 + 2),
easeInSine: (t5) => -Math.cos(t5 * HALF_PI) + 1,
easeOutSine: (t5) => Math.sin(t5 * HALF_PI),
easeInOutSine: (t5) => -0.5 * (Math.cos(PI * t5) - 1),
easeInExpo: (t5) => t5 === 0 ? 0 : Math.pow(2, 10 * (t5 - 1)),
easeOutExpo: (t5) => t5 === 1 ? 1 : -Math.pow(2, -10 * t5) + 1,
easeInOutExpo: (t5) => atEdge(t5) ? t5 : t5 < 0.5 ? 0.5 * Math.pow(2, 10 * (t5 * 2 - 1)) : 0.5 * (-Math.pow(2, -10 * (t5 * 2 - 1)) + 2),
easeInCirc: (t5) => t5 >= 1 ? t5 : -(Math.sqrt(1 - t5 * t5) - 1),
easeOutCirc: (t5) => Math.sqrt(1 - (t5 -= 1) * t5),
easeInOutCirc: (t5) => (t5 /= 0.5) < 1 ? -0.5 * (Math.sqrt(1 - t5 * t5) - 1) : 0.5 * (Math.sqrt(1 - (t5 -= 2) * t5) + 1),
easeInElastic: (t5) => atEdge(t5) ? t5 : elasticIn(t5, 0.075, 0.3),
easeOutElastic: (t5) => atEdge(t5) ? t5 : elasticOut(t5, 0.075, 0.3),
easeInOutElastic(t5) {
const s6 = 0.1125;
const p4 = 0.45;
return atEdge(t5) ? t5 : t5 < 0.5 ? 0.5 * elasticIn(t5 * 2, s6, p4) : 0.5 + 0.5 * elasticOut(t5 * 2 - 1, s6, p4);
},
easeInBack(t5) {
const s6 = 1.70158;
return t5 * t5 * ((s6 + 1) * t5 - s6);
},
easeOutBack(t5) {
const s6 = 1.70158;
return (t5 -= 1) * t5 * ((s6 + 1) * t5 + s6) + 1;
},
easeInOutBack(t5) {
let s6 = 1.70158;
if ((t5 /= 0.5) < 1) {
return 0.5 * (t5 * t5 * (((s6 *= 1.525) + 1) * t5 - s6));
}
return 0.5 * ((t5 -= 2) * t5 * (((s6 *= 1.525) + 1) * t5 + s6) + 2);
},
easeInBounce: (t5) => 1 - effects.easeOutBounce(1 - t5),
easeOutBounce(t5) {
const m4 = 7.5625;
const d4 = 2.75;
if (t5 < 1 / d4) {
return m4 * t5 * t5;
}
if (t5 < 2 / d4) {
return m4 * (t5 -= 1.5 / d4) * t5 + 0.75;
}
if (t5 < 2.5 / d4) {
return m4 * (t5 -= 2.25 / d4) * t5 + 0.9375;
}
return m4 * (t5 -= 2.625 / d4) * t5 + 0.984375;
},
easeInOutBounce: (t5) => t5 < 0.5 ? effects.easeInBounce(t5 * 2) * 0.5 : effects.easeOutBounce(t5 * 2 - 1) * 0.5 + 0.5
};
map = { 0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9, A: 10, B: 11, C: 12, D: 13, E: 14, F: 15, a: 10, b: 11, c: 12, d: 13, e: 14, f: 15 };
hex = "0123456789ABCDEF";
h1 = (b4) => hex[b4 & 15];
h2 = (b4) => hex[(b4 & 240) >> 4] + hex[b4 & 15];
eq = (b4) => (b4 & 240) >> 4 === (b4 & 15);
lim = (v4, l7, h6) => Math.max(Math.min(v4, h6), l7);
RGB_RE = /^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;
HUE_RE = /^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;
map$1 = {
x: "dark",
Z: "light",
Y: "re",
X: "blu",
W: "gr",
V: "medium",
U: "slate",
A: "ee",
T: "ol",
S: "or",
B: "ra",
C: "lateg",
D: "ights",
R: "in",
Q: "turquois",
E: "hi",
P: "ro",
O: "al",
N: "le",
M: "de",
L: "yello",
F: "en",
K: "ch",
G: "arks",
H: "ea",
I: "ightg",
J: "wh"
};
names = {
OiceXe: "f0f8ff",
antiquewEte: "faebd7",
aqua: "ffff",
aquamarRe: "7fffd4",
azuY: "f0ffff",
beige: "f5f5dc",
bisque: "ffe4c4",
black: "0",
blanKedOmond: "ffebcd",
Xe: "ff",
XeviTet: "8a2be2",
bPwn: "a52a2a",
burlywood: "deb887",
caMtXe: "5f9ea0",
KartYuse: "7fff00",
KocTate: "d2691e",
cSO: "ff7f50",
cSnflowerXe: "6495ed",
cSnsilk: "fff8dc",
crimson: "dc143c",
cyan: "ffff",
xXe: "8b",
xcyan: "8b8b",
xgTMnPd: "b8860b",
xWay: "a9a9a9",
xgYF: "6400",
xgYy: "a9a9a9",
xkhaki: "bdb76b",
xmagFta: "8b008b",
xTivegYF: "556b2f",
xSange: "ff8c00",
xScEd: "9932cc",
xYd: "8b0000",
xsOmon: "e9967a",
xsHgYF: "8fbc8f",
xUXe: "483d8b",
xUWay: "2f4f4f",
xUgYy: "2f4f4f",
xQe: "ced1",
xviTet: "9400d3",
dAppRk: "ff1493",
dApskyXe: "bfff",
dimWay: "696969",
dimgYy: "696969",
dodgerXe: "1e90ff",
fiYbrick: "b22222",
flSOwEte: "fffaf0",
foYstWAn: "228b22",
fuKsia: "ff00ff",
gaRsbSo: "dcdcdc",
ghostwEte: "f8f8ff",
gTd: "ffd700",
gTMnPd: "daa520",
Way: "808080",
gYF: "8000",
gYFLw: "adff2f",
gYy: "808080",
honeyMw: "f0fff0",
hotpRk: "ff69b4",
RdianYd: "cd5c5c",
Rdigo: "4b0082",
ivSy: "fffff0",
khaki: "f0e68c",
lavFMr: "e6e6fa",
lavFMrXsh: "fff0f5",
lawngYF: "7cfc00",
NmoncEffon: "fffacd",
ZXe: "add8e6",
ZcSO: "f08080",
Zcyan: "e0ffff",
ZgTMnPdLw: "fafad2",
ZWay: "d3d3d3",
ZgYF: "90ee90",
ZgYy: "d3d3d3",
ZpRk: "ffb6c1",
ZsOmon: "ffa07a",
ZsHgYF: "20b2aa",
ZskyXe: "87cefa",
ZUWay: "778899",
ZUgYy: "778899",
ZstAlXe: "b0c4de",
ZLw: "ffffe0",
lime: "ff00",
limegYF: "32cd32",
lRF: "faf0e6",
magFta: "ff00ff",
maPon: "800000",
VaquamarRe: "66cdaa",
VXe: "cd",
VScEd: "ba55d3",
VpurpN: "9370db",
VsHgYF: "3cb371",
VUXe: "7b68ee",
VsprRggYF: "fa9a",
VQe: "48d1cc",
VviTetYd: "c71585",
midnightXe: "191970",
mRtcYam: "f5fffa",
mistyPse: "ffe4e1",
moccasR: "ffe4b5",
navajowEte: "ffdead",
navy: "80",
Tdlace: "fdf5e6",
Tive: "808000",
TivedBb: "6b8e23",
Sange: "ffa500",
SangeYd: "ff4500",
ScEd: "da70d6",
pOegTMnPd: "eee8aa",
pOegYF: "98fb98",
pOeQe: "afeeee",
pOeviTetYd: "db7093",
papayawEp: "ffefd5",
pHKpuff: "ffdab9",
peru: "cd853f",
pRk: "ffc0cb",
plum: "dda0dd",
powMrXe: "b0e0e6",
purpN: "800080",
YbeccapurpN: "663399",
Yd: "ff0000",
Psybrown: "bc8f8f",
PyOXe: "4169e1",
saddNbPwn: "8b4513",
sOmon: "fa8072",
sandybPwn: "f4a460",
sHgYF: "2e8b57",
sHshell: "fff5ee",
siFna: "a0522d",
silver: "c0c0c0",
skyXe: "87ceeb",
UXe: "6a5acd",
UWay: "708090",
UgYy: "708090",
snow: "fffafa",
sprRggYF: "ff7f",
stAlXe: "4682b4",
tan: "d2b48c",
teO: "8080",
tEstN: "d8bfd8",
tomato: "ff6347",
Qe: "40e0d0",
viTet: "ee82ee",
JHt: "f5deb3",
wEte: "ffffff",
wEtesmoke: "f5f5f5",
Lw: "ffff00",
LwgYF: "9acd32"
};
Color = class {
constructor(input) {
if (input instanceof Color) {
return input;
}
const type = typeof input;
let v4;
if (type === "object") {
v4 = fromObject(input);
} else if (type === "string") {
v4 = hexParse(input) || nameParse(input) || functionParse(input);
}
this._rgb = v4;
this._valid = !!v4;
}
get valid() {
return this._valid;
}
get rgb() {
var v4 = clone(this._rgb);
if (v4) {
v4.a = b2n(v4.a);
}
return v4;
}
set rgb(obj) {
this._rgb = fromObject(obj);
}
rgbString() {
return this._valid ? rgbString(this._rgb) : this._rgb;
}
hexString() {
return this._valid ? hexString(this._rgb) : this._rgb;
}
hslString() {
return this._valid ? hslString(this._rgb) : this._rgb;
}
mix(color2, weight) {
const me2 = this;
if (color2) {
const c1 = me2.rgb;
const c22 = color2.rgb;
let w22;
const p4 = weight === w22 ? 0.5 : weight;
const w4 = 2 * p4 - 1;
const a5 = c1.a - c22.a;
const w1 = ((w4 * a5 === -1 ? w4 : (w4 + a5) / (1 + w4 * a5)) + 1) / 2;
w22 = 1 - w1;
c1.r = 255 & w1 * c1.r + w22 * c22.r + 0.5;
c1.g = 255 & w1 * c1.g + w22 * c22.g + 0.5;
c1.b = 255 & w1 * c1.b + w22 * c22.b + 0.5;
c1.a = p4 * c1.a + (1 - p4) * c22.a;
me2.rgb = c1;
}
return me2;
}
clone() {
return new Color(this.rgb);
}
alpha(a5) {
this._rgb.a = n2b(a5);
return this;
}
clearer(ratio) {
const rgb = this._rgb;
rgb.a *= 1 - ratio;
return this;
}
greyscale() {
const rgb = this._rgb;
const val = round(rgb.r * 0.3 + rgb.g * 0.59 + rgb.b * 0.11);
rgb.r = rgb.g = rgb.b = val;
return this;
}
opaquer(ratio) {
const rgb = this._rgb;
rgb.a *= 1 + ratio;
return this;
}
negate() {
const v4 = this._rgb;
v4.r = 255 - v4.r;
v4.g = 255 - v4.g;
v4.b = 255 - v4.b;
return this;
}
lighten(ratio) {
modHSL(this._rgb, 2, ratio);
return this;
}
darken(ratio) {
modHSL(this._rgb, 2, -ratio);
return this;
}
saturate(ratio) {
modHSL(this._rgb, 1, ratio);
return this;
}
desaturate(ratio) {
modHSL(this._rgb, 1, -ratio);
return this;
}
rotate(deg) {
rotate(this._rgb, deg);
return this;
}
};
isPatternOrGradient = (value) => value instanceof CanvasGradient || value instanceof CanvasPattern;
overrides = /* @__PURE__ */ Object.create(null);
descriptors = /* @__PURE__ */ Object.create(null);
Defaults = class {
constructor(_descriptors2) {
this.animation = void 0;
this.backgroundColor = "rgba(0,0,0,0.1)";
this.borderColor = "rgba(0,0,0,0.1)";
this.color = "#666";
this.datasets = {};
this.devicePixelRatio = (context) => context.chart.platform.getDevicePixelRatio();
this.elements = {};
this.events = [
"mousemove",
"mouseout",
"click",
"touchstart",
"touchmove"
];
this.font = {
family: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",
size: 12,
style: "normal",
lineHeight: 1.2,
weight: null
};
this.hover = {};
this.hoverBackgroundColor = (ctx, options) => getHoverColor(options.backgroundColor);
this.hoverBorderColor = (ctx, options) => getHoverColor(options.borderColor);
this.hoverColor = (ctx, options) => getHoverColor(options.color);
this.indexAxis = "x";
this.interaction = {
mode: "nearest",
intersect: true
};
this.maintainAspectRatio = true;
this.onHover = null;
this.onClick = null;
this.parsing = true;
this.plugins = {};
this.responsive = true;
this.scale = void 0;
this.scales = {};
this.showLine = true;
this.drawActiveElementsOnTop = true;
this.describe(_descriptors2);
}
set(scope, values) {
return set(this, scope, values);
}
get(scope) {
return getScope$1(this, scope);
}
describe(scope, values) {
return set(descriptors, scope, values);
}
override(scope, values) {
return set(overrides, scope, values);
}
route(scope, name, targetScope, targetName) {
const scopeObject = getScope$1(this, scope);
const targetScopeObject = getScope$1(this, targetScope);
const privateName = "_" + name;
Object.defineProperties(scopeObject, {
[privateName]: {
value: scopeObject[name],
writable: true
},
[name]: {
enumerable: true,
get() {
const local = this[privateName];
const target = targetScopeObject[targetName];
if (isObject(local)) {
return Object.assign({}, target, local);
}
return valueOrDefault(local, target);
},
set(value) {
this[privateName] = value;
}
}
});
}
};
defaults = new Defaults({
_scriptable: (name) => !name.startsWith("on"),
_indexable: (name) => name !== "events",
hover: {
_fallback: "interaction"
},
interaction: {
_scriptable: false,
_indexable: false
}
});
LINE_HEIGHT = new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/);
FONT_STYLE = new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);
numberOrZero = (v4) => +v4 || 0;
_lookupByKey = (table, key, value) => _lookup(table, value, (index3) => table[index3][key] < value);
_rlookupByKey = (table, key, value) => _lookup(table, value, (index3) => table[index3][key] >= value);
arrayEvents = ["push", "pop", "shift", "splice", "unshift"];
readKey = (prefix, name) => prefix ? prefix + _capitalize(name) : name;
needsSubResolver = (prop, value) => isObject(value) && prop !== "adapters" && (Object.getPrototypeOf(value) === null || value.constructor === Object);
getScope = (key, parent) => key === true ? parent : typeof key === "string" ? resolveObjectKey(parent, key) : void 0;
EPSILON = Number.EPSILON || 1e-14;
getPoint = (points, i5) => i5 < points.length && !points[i5].skip && points[i5];
getValueAxis = (indexAxis) => indexAxis === "x" ? "y" : "x";
getComputedStyle2 = (element) => window.getComputedStyle(element, null);
positions = ["top", "right", "bottom", "left"];
useOffsetPos = (x4, y4, target) => (x4 > 0 || y4 > 0) && (!target || !target.shadowRoot);
round1 = (v4) => Math.round(v4 * 10) / 10;
supportsEventListenerOptions = function() {
let passiveSupported = false;
try {
const options = {
get passive() {
passiveSupported = true;
return false;
}
};
window.addEventListener("test", null, options);
window.removeEventListener("test", null, options);
} catch (e5) {
}
return passiveSupported;
}();
intlCache = /* @__PURE__ */ new Map();
getRightToLeftAdapter = function(rectX, width) {
return {
x(x4) {
return rectX + rectX + width - x4;
},
setWidth(w4) {
width = w4;
},
textAlign(align) {
if (align === "center") {
return align;
}
return align === "right" ? "left" : "right";
},
xPlus(x4, value) {
return x4 - value;
},
leftForLtr(x4, itemWidth) {
return x4 - itemWidth;
}
};
};
getLeftToRightAdapter = function() {
return {
x(x4) {
return x4;
},
setWidth(w4) {
},
textAlign(align) {
return align;
},
xPlus(x4, value) {
return x4 + value;
},
leftForLtr(x4, _itemWidth) {
return x4;
}
};
};
}
});
// node_modules/chartkick/node_modules/chart.js/dist/chart.esm.js
function awaitAll(animations, properties) {
const running = [];
const keys2 = Object.keys(properties);
for (let i5 = 0; i5 < keys2.length; i5++) {
const anim = animations[keys2[i5]];
if (anim && anim.active()) {
running.push(anim.wait());
}
}
return Promise.all(running);
}
function resolveTargetOptions(target, newOptions) {
if (!newOptions) {
return;
}
let options = target.options;
if (!options) {
target.options = newOptions;
return;
}
if (options.$shared) {
target.options = options = Object.assign({}, options, { $shared: false, $animations: {} });
}
return options;
}
function scaleClip(scale, allowedOverflow) {
const opts = scale && scale.options || {};
const reverse = opts.reverse;
const min2 = opts.min === void 0 ? allowedOverflow : 0;
const max2 = opts.max === void 0 ? allowedOverflow : 0;
return {
start: reverse ? max2 : min2,
end: reverse ? min2 : max2
};
}
function defaultClip(xScale, yScale, allowedOverflow) {
if (allowedOverflow === false) {
return false;
}
const x4 = scaleClip(xScale, allowedOverflow);
const y4 = scaleClip(yScale, allowedOverflow);
return {
top: y4.end,
right: x4.end,
bottom: y4.start,
left: x4.start
};
}
function toClip(value) {
let t5, r6, b4, l7;
if (isObject(value)) {
t5 = value.top;
r6 = value.right;
b4 = value.bottom;
l7 = value.left;
} else {
t5 = r6 = b4 = l7 = value;
}
return {
top: t5,
right: r6,
bottom: b4,
left: l7,
disabled: value === false
};
}
function getSortedDatasetIndices(chart, filterVisible) {
const keys2 = [];
const metasets = chart._getSortedDatasetMetas(filterVisible);
let i5, ilen;
for (i5 = 0, ilen = metasets.length; i5 < ilen; ++i5) {
keys2.push(metasets[i5].index);
}
return keys2;
}
function applyStack(stack, value, dsIndex, options = {}) {
const keys2 = stack.keys;
const singleMode = options.mode === "single";
let i5, ilen, datasetIndex, otherValue;
if (value === null) {
return;
}
for (i5 = 0, ilen = keys2.length; i5 < ilen; ++i5) {
datasetIndex = +keys2[i5];
if (datasetIndex === dsIndex) {
if (options.all) {
continue;
}
break;
}
otherValue = stack.values[datasetIndex];
if (isNumberFinite(otherValue) && (singleMode || (value === 0 || sign(value) === sign(otherValue)))) {
value += otherValue;
}
}
return value;
}
function convertObjectDataToArray(data) {
const keys2 = Object.keys(data);
const adata = new Array(keys2.length);
let i5, ilen, key;
for (i5 = 0, ilen = keys2.length; i5 < ilen; ++i5) {
key = keys2[i5];
adata[i5] = {
x: key,
y: data[key]
};
}
return adata;
}
function isStacked(scale, meta) {
const stacked = scale && scale.options.stacked;
return stacked || stacked === void 0 && meta.stack !== void 0;
}
function getStackKey(indexScale, valueScale, meta) {
return `${indexScale.id}.${valueScale.id}.${meta.stack || meta.type}`;
}
function getUserBounds(scale) {
const { min: min2, max: max2, minDefined, maxDefined } = scale.getUserBounds();
return {
min: minDefined ? min2 : Number.NEGATIVE_INFINITY,
max: maxDefined ? max2 : Number.POSITIVE_INFINITY
};
}
function getOrCreateStack(stacks, stackKey, indexValue) {
const subStack = stacks[stackKey] || (stacks[stackKey] = {});
return subStack[indexValue] || (subStack[indexValue] = {});
}
function getLastIndexInStack(stack, vScale, positive, type) {
for (const meta of vScale.getMatchingVisibleMetas(type).reverse()) {
const value = stack[meta.index];
if (positive && value > 0 || !positive && value < 0) {
return meta.index;
}
}
return null;
}
function updateStacks(controller, parsed) {
const { chart, _cachedMeta: meta } = controller;
const stacks = chart._stacks || (chart._stacks = {});
const { iScale, vScale, index: datasetIndex } = meta;
const iAxis = iScale.axis;
const vAxis = vScale.axis;
const key = getStackKey(iScale, vScale, meta);
const ilen = parsed.length;
let stack;
for (let i5 = 0; i5 < ilen; ++i5) {
const item = parsed[i5];
const { [iAxis]: index3, [vAxis]: value } = item;
const itemStacks = item._stacks || (item._stacks = {});
stack = itemStacks[vAxis] = getOrCreateStack(stacks, key, index3);
stack[datasetIndex] = value;
stack._top = getLastIndexInStack(stack, vScale, true, meta.type);
stack._bottom = getLastIndexInStack(stack, vScale, false, meta.type);
}
}
function getFirstScaleId(chart, axis) {
const scales2 = chart.scales;
return Object.keys(scales2).filter((key) => scales2[key].axis === axis).shift();
}
function createDatasetContext(parent, index3) {
return createContext(
parent,
{
active: false,
dataset: void 0,
datasetIndex: index3,
index: index3,
mode: "default",
type: "dataset"
}
);
}
function createDataContext(parent, index3, element) {
return createContext(parent, {
active: false,
dataIndex: index3,
parsed: void 0,
raw: void 0,
element,
index: index3,
mode: "default",
type: "data"
});
}
function clearStacks(meta, items) {
const datasetIndex = meta.controller.index;
const axis = meta.vScale && meta.vScale.axis;
if (!axis) {
return;
}
items = items || meta._parsed;
for (const parsed of items) {
const stacks = parsed._stacks;
if (!stacks || stacks[axis] === void 0 || stacks[axis][datasetIndex] === void 0) {
return;
}
delete stacks[axis][datasetIndex];
}
}
function getAllScaleValues(scale, type) {
if (!scale._cache.$bar) {
const visibleMetas = scale.getMatchingVisibleMetas(type);
let values = [];
for (let i5 = 0, ilen = visibleMetas.length; i5 < ilen; i5++) {
values = values.concat(visibleMetas[i5].controller.getAllParsedValues(scale));
}
scale._cache.$bar = _arrayUnique(values.sort((a5, b4) => a5 - b4));
}
return scale._cache.$bar;
}
function computeMinSampleSize(meta) {
const scale = meta.iScale;
const values = getAllScaleValues(scale, meta.type);
let min2 = scale._length;
let i5, ilen, curr, prev;
const updateMinAndPrev = () => {
if (curr === 32767 || curr === -32768) {
return;
}
if (defined(prev)) {
min2 = Math.min(min2, Math.abs(curr - prev) || min2);
}
prev = curr;
};
for (i5 = 0, ilen = values.length; i5 < ilen; ++i5) {
curr = scale.getPixelForValue(values[i5]);
updateMinAndPrev();
}
prev = void 0;
for (i5 = 0, ilen = scale.ticks.length; i5 < ilen; ++i5) {
curr = scale.getPixelForTick(i5);
updateMinAndPrev();
}
return min2;
}
function computeFitCategoryTraits(index3, ruler, options, stackCount) {
const thickness = options.barThickness;
let size, ratio;
if (isNullOrUndef(thickness)) {
size = ruler.min * options.categoryPercentage;
ratio = options.barPercentage;
} else {
size = thickness * stackCount;
ratio = 1;
}
return {
chunk: size / stackCount,
ratio,
start: ruler.pixels[index3] - size / 2
};
}
function computeFlexCategoryTraits(index3, ruler, options, stackCount) {
const pixels = ruler.pixels;
const curr = pixels[index3];
let prev = index3 > 0 ? pixels[index3 - 1] : null;
let next = index3 < pixels.length - 1 ? pixels[index3 + 1] : null;
const percent = options.categoryPercentage;
if (prev === null) {
prev = curr - (next === null ? ruler.end - ruler.start : next - curr);
}
if (next === null) {
next = curr + curr - prev;
}
const start3 = curr - (curr - Math.min(prev, next)) / 2 * percent;
const size = Math.abs(next - prev) / 2 * percent;
return {
chunk: size / stackCount,
ratio: options.barPercentage,
start: start3
};
}
function parseFloatBar(entry, item, vScale, i5) {
const startValue = vScale.parse(entry[0], i5);
const endValue = vScale.parse(entry[1], i5);
const min2 = Math.min(startValue, endValue);
const max2 = Math.max(startValue, endValue);
let barStart = min2;
let barEnd = max2;
if (Math.abs(min2) > Math.abs(max2)) {
barStart = max2;
barEnd = min2;
}
item[vScale.axis] = barEnd;
item._custom = {
barStart,
barEnd,
start: startValue,
end: endValue,
min: min2,
max: max2
};
}
function parseValue(entry, item, vScale, i5) {
if (isArray(entry)) {
parseFloatBar(entry, item, vScale, i5);
} else {
item[vScale.axis] = vScale.parse(entry, i5);
}
return item;
}
function parseArrayOrPrimitive(meta, data, start3, count) {
const iScale = meta.iScale;
const vScale = meta.vScale;
const labels = iScale.getLabels();
const singleScale = iScale === vScale;
const parsed = [];
let i5, ilen, item, entry;
for (i5 = start3, ilen = start3 + count; i5 < ilen; ++i5) {
entry = data[i5];
item = {};
item[iScale.axis] = singleScale || iScale.parse(labels[i5], i5);
parsed.push(parseValue(entry, item, vScale, i5));
}
return parsed;
}
function isFloatBar(custom) {
return custom && custom.barStart !== void 0 && custom.barEnd !== void 0;
}
function barSign(size, vScale, actualBase) {
if (size !== 0) {
return sign(size);
}
return (vScale.isHorizontal() ? 1 : -1) * (vScale.min >= actualBase ? 1 : -1);
}
function borderProps(properties) {
let reverse, start3, end2, top2, bottom2;
if (properties.horizontal) {
reverse = properties.base > properties.x;
start3 = "left";
end2 = "right";
} else {
reverse = properties.base < properties.y;
start3 = "bottom";
end2 = "top";
}
if (reverse) {
top2 = "end";
bottom2 = "start";
} else {
top2 = "start";
bottom2 = "end";
}
return { start: start3, end: end2, reverse, top: top2, bottom: bottom2 };
}
function setBorderSkipped(properties, options, stack, index3) {
let edge = options.borderSkipped;
const res = {};
if (!edge) {
properties.borderSkipped = res;
return;
}
const { start: start3, end: end2, reverse, top: top2, bottom: bottom2 } = borderProps(properties);
if (edge === "middle" && stack) {
properties.enableBorderRadius = true;
if ((stack._top || 0) === index3) {
edge = top2;
} else if ((stack._bottom || 0) === index3) {
edge = bottom2;
} else {
res[parseEdge(bottom2, start3, end2, reverse)] = true;
edge = top2;
}
}
res[parseEdge(edge, start3, end2, reverse)] = true;
properties.borderSkipped = res;
}
function parseEdge(edge, a5, b4, reverse) {
if (reverse) {
edge = swap(edge, a5, b4);
edge = startEnd(edge, b4, a5);
} else {
edge = startEnd(edge, a5, b4);
}
return edge;
}
function swap(orig, v1, v22) {
return orig === v1 ? v22 : orig === v22 ? v1 : orig;
}
function startEnd(v4, start3, end2) {
return v4 === "start" ? start3 : v4 === "end" ? end2 : v4;
}
function setInflateAmount(properties, { inflateAmount }, ratio) {
properties.inflateAmount = inflateAmount === "auto" ? ratio === 1 ? 0.33 : 0 : inflateAmount;
}
function getRatioAndOffset(rotation, circumference, cutout) {
let ratioX = 1;
let ratioY = 1;
let offsetX = 0;
let offsetY = 0;
if (circumference < TAU) {
const startAngle = rotation;
const endAngle = startAngle + circumference;
const startX = Math.cos(startAngle);
const startY = Math.sin(startAngle);
const endX = Math.cos(endAngle);
const endY = Math.sin(endAngle);
const calcMax = (angle, a5, b4) => _angleBetween(angle, startAngle, endAngle, true) ? 1 : Math.max(a5, a5 * cutout, b4, b4 * cutout);
const calcMin = (angle, a5, b4) => _angleBetween(angle, startAngle, endAngle, true) ? -1 : Math.min(a5, a5 * cutout, b4, b4 * cutout);
const maxX = calcMax(0, startX, endX);
const maxY = calcMax(HALF_PI, startY, endY);
const minX = calcMin(PI, startX, endX);
const minY = calcMin(PI + HALF_PI, startY, endY);
ratioX = (maxX - minX) / 2;
ratioY = (maxY - minY) / 2;
offsetX = -(maxX + minX) / 2;
offsetY = -(maxY + minY) / 2;
}
return { ratioX, ratioY, offsetX, offsetY };
}
function getStartAndCountOfVisiblePoints(meta, points, animationsDisabled) {
const pointCount = points.length;
let start3 = 0;
let count = pointCount;
if (meta._sorted) {
const { iScale, _parsed } = meta;
const axis = iScale.axis;
const { min: min2, max: max2, minDefined, maxDefined } = iScale.getUserBounds();
if (minDefined) {
start3 = _limitValue(
Math.min(
_lookupByKey(_parsed, iScale.axis, min2).lo,
animationsDisabled ? pointCount : _lookupByKey(points, axis, iScale.getPixelForValue(min2)).lo
),
0,
pointCount - 1
);
}
if (maxDefined) {
count = _limitValue(
Math.max(
_lookupByKey(_parsed, iScale.axis, max2).hi + 1,
animationsDisabled ? 0 : _lookupByKey(points, axis, iScale.getPixelForValue(max2)).hi + 1
),
start3,
pointCount
) - start3;
} else {
count = pointCount - start3;
}
}
return { start: start3, count };
}
function scaleRangesChanged(meta) {
const { xScale, yScale, _scaleRanges } = meta;
const newRanges = {
xmin: xScale.min,
xmax: xScale.max,
ymin: yScale.min,
ymax: yScale.max
};
if (!_scaleRanges) {
meta._scaleRanges = newRanges;
return true;
}
const changed = _scaleRanges.xmin !== xScale.min || _scaleRanges.xmax !== xScale.max || _scaleRanges.ymin !== yScale.min || _scaleRanges.ymax !== yScale.max;
Object.assign(_scaleRanges, newRanges);
return changed;
}
function abstract() {
throw new Error("This method is not implemented: Check that a complete date adapter is provided.");
}
function getRelativePosition2(e5, chart) {
if ("native" in e5) {
return {
x: e5.x,
y: e5.y
};
}
return getRelativePosition(e5, chart);
}
function evaluateAllVisibleItems(chart, handler) {
const metasets = chart.getSortedVisibleDatasetMetas();
let index3, data, element;
for (let i5 = 0, ilen = metasets.length; i5 < ilen; ++i5) {
({ index: index3, data } = metasets[i5]);
for (let j4 = 0, jlen = data.length; j4 < jlen; ++j4) {
element = data[j4];
if (!element.skip) {
handler(element, index3, j4);
}
}
}
}
function binarySearch(metaset, axis, value, intersect) {
const { controller, data, _sorted } = metaset;
const iScale = controller._cachedMeta.iScale;
if (iScale && axis === iScale.axis && axis !== "r" && _sorted && data.length) {
const lookupMethod = iScale._reversePixels ? _rlookupByKey : _lookupByKey;
if (!intersect) {
return lookupMethod(data, axis, value);
} else if (controller._sharedOptions) {
const el = data[0];
const range2 = typeof el.getRange === "function" && el.getRange(axis);
if (range2) {
const start3 = lookupMethod(data, axis, value - range2);
const end2 = lookupMethod(data, axis, value + range2);
return { lo: start3.lo, hi: end2.hi };
}
}
}
return { lo: 0, hi: data.length - 1 };
}
function optimizedEvaluateItems(chart, axis, position, handler, intersect) {
const metasets = chart.getSortedVisibleDatasetMetas();
const value = position[axis];
for (let i5 = 0, ilen = metasets.length; i5 < ilen; ++i5) {
const { index: index3, data } = metasets[i5];
const { lo, hi: hi2 } = binarySearch(metasets[i5], axis, value, intersect);
for (let j4 = lo; j4 <= hi2; ++j4) {
const element = data[j4];
if (!element.skip) {
handler(element, index3, j4);
}
}
}
}
function getDistanceMetricForAxis(axis) {
const useX = axis.indexOf("x") !== -1;
const useY = axis.indexOf("y") !== -1;
return function(pt1, pt2) {
const deltaX = useX ? Math.abs(pt1.x - pt2.x) : 0;
const deltaY = useY ? Math.abs(pt1.y - pt2.y) : 0;
return Math.sqrt(Math.pow(deltaX, 2) + Math.pow(deltaY, 2));
};
}
function getIntersectItems(chart, position, axis, useFinalPosition) {
const items = [];
if (!_isPointInArea(position, chart.chartArea, chart._minPadding)) {
return items;
}
const evaluationFunc = function(element, datasetIndex, index3) {
if (element.inRange(position.x, position.y, useFinalPosition)) {
items.push({ element, datasetIndex, index: index3 });
}
};
optimizedEvaluateItems(chart, axis, position, evaluationFunc, true);
return items;
}
function getNearestRadialItems(chart, position, axis, useFinalPosition) {
let items = [];
function evaluationFunc(element, datasetIndex, index3) {
const { startAngle, endAngle } = element.getProps(["startAngle", "endAngle"], useFinalPosition);
const { angle } = getAngleFromPoint(element, { x: position.x, y: position.y });
if (_angleBetween(angle, startAngle, endAngle)) {
items.push({ element, datasetIndex, index: index3 });
}
}
optimizedEvaluateItems(chart, axis, position, evaluationFunc);
return items;
}
function getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition) {
let items = [];
const distanceMetric = getDistanceMetricForAxis(axis);
let minDistance = Number.POSITIVE_INFINITY;
function evaluationFunc(element, datasetIndex, index3) {
const inRange2 = element.inRange(position.x, position.y, useFinalPosition);
if (intersect && !inRange2) {
return;
}
const center = element.getCenterPoint(useFinalPosition);
const pointInArea = _isPointInArea(center, chart.chartArea, chart._minPadding);
if (!pointInArea && !inRange2) {
return;
}
const distance = distanceMetric(position, center);
if (distance < minDistance) {
items = [{ element, datasetIndex, index: index3 }];
minDistance = distance;
} else if (distance === minDistance) {
items.push({ element, datasetIndex, index: index3 });
}
}
optimizedEvaluateItems(chart, axis, position, evaluationFunc);
return items;
}
function getNearestItems(chart, position, axis, intersect, useFinalPosition) {
if (!_isPointInArea(position, chart.chartArea, chart._minPadding)) {
return [];
}
return axis === "r" && !intersect ? getNearestRadialItems(chart, position, axis, useFinalPosition) : getNearestCartesianItems(chart, position, axis, intersect, useFinalPosition);
}
function getAxisItems(chart, e5, options, useFinalPosition) {
const position = getRelativePosition2(e5, chart);
const items = [];
const axis = options.axis;
const rangeMethod = axis === "x" ? "inXRange" : "inYRange";
let intersectsItem = false;
evaluateAllVisibleItems(chart, (element, datasetIndex, index3) => {
if (element[rangeMethod](position[axis], useFinalPosition)) {
items.push({ element, datasetIndex, index: index3 });
}
if (element.inRange(position.x, position.y, useFinalPosition)) {
intersectsItem = true;
}
});
if (options.intersect && !intersectsItem) {
return [];
}
return items;
}
function filterByPosition(array, position) {
return array.filter((v4) => v4.pos === position);
}
function filterDynamicPositionByAxis(array, axis) {
return array.filter((v4) => STATIC_POSITIONS.indexOf(v4.pos) === -1 && v4.box.axis === axis);
}
function sortByWeight(array, reverse) {
return array.sort((a5, b4) => {
const v0 = reverse ? b4 : a5;
const v1 = reverse ? a5 : b4;
return v0.weight === v1.weight ? v0.index - v1.index : v0.weight - v1.weight;
});
}
function wrapBoxes(boxes) {
const layoutBoxes = [];
let i5, ilen, box, pos, stack, stackWeight;
for (i5 = 0, ilen = (boxes || []).length; i5 < ilen; ++i5) {
box = boxes[i5];
({ position: pos, options: { stack, stackWeight = 1 } } = box);
layoutBoxes.push({
index: i5,
box,
pos,
horizontal: box.isHorizontal(),
weight: box.weight,
stack: stack && pos + stack,
stackWeight
});
}
return layoutBoxes;
}
function buildStacks(layouts2) {
const stacks = {};
for (const wrap3 of layouts2) {
const { stack, pos, stackWeight } = wrap3;
if (!stack || !STATIC_POSITIONS.includes(pos)) {
continue;
}
const _stack = stacks[stack] || (stacks[stack] = { count: 0, placed: 0, weight: 0, size: 0 });
_stack.count++;
_stack.weight += stackWeight;
}
return stacks;
}
function setLayoutDims(layouts2, params) {
const stacks = buildStacks(layouts2);
const { vBoxMaxWidth, hBoxMaxHeight } = params;
let i5, ilen, layout;
for (i5 = 0, ilen = layouts2.length; i5 < ilen; ++i5) {
layout = layouts2[i5];
const { fullSize } = layout.box;
const stack = stacks[layout.stack];
const factor = stack && layout.stackWeight / stack.weight;
if (layout.horizontal) {
layout.width = factor ? factor * vBoxMaxWidth : fullSize && params.availableWidth;
layout.height = hBoxMaxHeight;
} else {
layout.width = vBoxMaxWidth;
layout.height = factor ? factor * hBoxMaxHeight : fullSize && params.availableHeight;
}
}
return stacks;
}
function buildLayoutBoxes(boxes) {
const layoutBoxes = wrapBoxes(boxes);
const fullSize = sortByWeight(layoutBoxes.filter((wrap3) => wrap3.box.fullSize), true);
const left2 = sortByWeight(filterByPosition(layoutBoxes, "left"), true);
const right2 = sortByWeight(filterByPosition(layoutBoxes, "right"));
const top2 = sortByWeight(filterByPosition(layoutBoxes, "top"), true);
const bottom2 = sortByWeight(filterByPosition(layoutBoxes, "bottom"));
const centerHorizontal = filterDynamicPositionByAxis(layoutBoxes, "x");
const centerVertical = filterDynamicPositionByAxis(layoutBoxes, "y");
return {
fullSize,
leftAndTop: left2.concat(top2),
rightAndBottom: right2.concat(centerVertical).concat(bottom2).concat(centerHorizontal),
chartArea: filterByPosition(layoutBoxes, "chartArea"),
vertical: left2.concat(right2).concat(centerVertical),
horizontal: top2.concat(bottom2).concat(centerHorizontal)
};
}
function getCombinedMax(maxPadding, chartArea, a5, b4) {
return Math.max(maxPadding[a5], chartArea[a5]) + Math.max(maxPadding[b4], chartArea[b4]);
}
function updateMaxPadding(maxPadding, boxPadding) {
maxPadding.top = Math.max(maxPadding.top, boxPadding.top);
maxPadding.left = Math.max(maxPadding.left, boxPadding.left);
maxPadding.bottom = Math.max(maxPadding.bottom, boxPadding.bottom);
maxPadding.right = Math.max(maxPadding.right, boxPadding.right);
}
function updateDims(chartArea, params, layout, stacks) {
const { pos, box } = layout;
const maxPadding = chartArea.maxPadding;
if (!isObject(pos)) {
if (layout.size) {
chartArea[pos] -= layout.size;
}
const stack = stacks[layout.stack] || { size: 0, count: 1 };
stack.size = Math.max(stack.size, layout.horizontal ? box.height : box.width);
layout.size = stack.size / stack.count;
chartArea[pos] += layout.size;
}
if (box.getPadding) {
updateMaxPadding(maxPadding, box.getPadding());
}
const newWidth = Math.max(0, params.outerWidth - getCombinedMax(maxPadding, chartArea, "left", "right"));
const newHeight = Math.max(0, params.outerHeight - getCombinedMax(maxPadding, chartArea, "top", "bottom"));
const widthChanged = newWidth !== chartArea.w;
const heightChanged = newHeight !== chartArea.h;
chartArea.w = newWidth;
chartArea.h = newHeight;
return layout.horizontal ? { same: widthChanged, other: heightChanged } : { same: heightChanged, other: widthChanged };
}
function handleMaxPadding(chartArea) {
const maxPadding = chartArea.maxPadding;
function updatePos(pos) {
const change = Math.max(maxPadding[pos] - chartArea[pos], 0);
chartArea[pos] += change;
return change;
}
chartArea.y += updatePos("top");
chartArea.x += updatePos("left");
updatePos("right");
updatePos("bottom");
}
function getMargins(horizontal, chartArea) {
const maxPadding = chartArea.maxPadding;
function marginForPositions(positions2) {
const margin = { left: 0, top: 0, right: 0, bottom: 0 };
positions2.forEach((pos) => {
margin[pos] = Math.max(chartArea[pos], maxPadding[pos]);
});
return margin;
}
return horizontal ? marginForPositions(["left", "right"]) : marginForPositions(["top", "bottom"]);
}
function fitBoxes(boxes, chartArea, params, stacks) {
const refitBoxes = [];
let i5, ilen, layout, box, refit, changed;
for (i5 = 0, ilen = boxes.length, refit = 0; i5 < ilen; ++i5) {
layout = boxes[i5];
box = layout.box;
box.update(
layout.width || chartArea.w,
layout.height || chartArea.h,
getMargins(layout.horizontal, chartArea)
);
const { same, other } = updateDims(chartArea, params, layout, stacks);
refit |= same && refitBoxes.length;
changed = changed || other;
if (!box.fullSize) {
refitBoxes.push(layout);
}
}
return refit && fitBoxes(refitBoxes, chartArea, params, stacks) || changed;
}
function setBoxDims(box, left2, top2, width, height) {
box.top = top2;
box.left = left2;
box.right = left2 + width;
box.bottom = top2 + height;
box.width = width;
box.height = height;
}
function placeBoxes(boxes, chartArea, params, stacks) {
const userPadding = params.padding;
let { x: x4, y: y4 } = chartArea;
for (const layout of boxes) {
const box = layout.box;
const stack = stacks[layout.stack] || { count: 1, placed: 0, weight: 1 };
const weight = layout.stackWeight / stack.weight || 1;
if (layout.horizontal) {
const width = chartArea.w * weight;
const height = stack.size || box.height;
if (defined(stack.start)) {
y4 = stack.start;
}
if (box.fullSize) {
setBoxDims(box, userPadding.left, y4, params.outerWidth - userPadding.right - userPadding.left, height);
} else {
setBoxDims(box, chartArea.left + stack.placed, y4, width, height);
}
stack.start = y4;
stack.placed += width;
y4 = box.bottom;
} else {
const height = chartArea.h * weight;
const width = stack.size || box.width;
if (defined(stack.start)) {
x4 = stack.start;
}
if (box.fullSize) {
setBoxDims(box, x4, userPadding.top, width, params.outerHeight - userPadding.bottom - userPadding.top);
} else {
setBoxDims(box, x4, chartArea.top + stack.placed, width, height);
}
stack.start = x4;
stack.placed += height;
x4 = box.right;
}
}
chartArea.x = x4;
chartArea.y = y4;
}
function initCanvas(canvas, aspectRatio) {
const style2 = canvas.style;
const renderHeight = canvas.getAttribute("height");
const renderWidth = canvas.getAttribute("width");
canvas[EXPANDO_KEY] = {
initial: {
height: renderHeight,
width: renderWidth,
style: {
display: style2.display,
height: style2.height,
width: style2.width
}
}
};
style2.display = style2.display || "block";
style2.boxSizing = style2.boxSizing || "border-box";
if (isNullOrEmpty(renderWidth)) {
const displayWidth = readUsedSize(canvas, "width");
if (displayWidth !== void 0) {
canvas.width = displayWidth;
}
}
if (isNullOrEmpty(renderHeight)) {
if (canvas.style.height === "") {
canvas.height = canvas.width / (aspectRatio || 2);
} else {
const displayHeight = readUsedSize(canvas, "height");
if (displayHeight !== void 0) {
canvas.height = displayHeight;
}
}
}
return canvas;
}
function addListener(node, type, listener) {
node.addEventListener(type, listener, eventListenerOptions);
}
function removeListener(chart, type, listener) {
chart.canvas.removeEventListener(type, listener, eventListenerOptions);
}
function fromNativeEvent(event2, chart) {
const type = EVENT_TYPES[event2.type] || event2.type;
const { x: x4, y: y4 } = getRelativePosition(event2, chart);
return {
type,
chart,
native: event2,
x: x4 !== void 0 ? x4 : null,
y: y4 !== void 0 ? y4 : null
};
}
function nodeListContains(nodeList, canvas) {
for (const node of nodeList) {
if (node === canvas || node.contains(canvas)) {
return true;
}
}
}
function createAttachObserver(chart, type, listener) {
const canvas = chart.canvas;
const observer = new MutationObserver((entries) => {
let trigger = false;
for (const entry of entries) {
trigger = trigger || nodeListContains(entry.addedNodes, canvas);
trigger = trigger && !nodeListContains(entry.removedNodes, canvas);
}
if (trigger) {
listener();
}
});
observer.observe(document, { childList: true, subtree: true });
return observer;
}
function createDetachObserver(chart, type, listener) {
const canvas = chart.canvas;
const observer = new MutationObserver((entries) => {
let trigger = false;
for (const entry of entries) {
trigger = trigger || nodeListContains(entry.removedNodes, canvas);
trigger = trigger && !nodeListContains(entry.addedNodes, canvas);
}
if (trigger) {
listener();
}
});
observer.observe(document, { childList: true, subtree: true });
return observer;
}
function onWindowResize() {
const dpr = window.devicePixelRatio;
if (dpr === oldDevicePixelRatio) {
return;
}
oldDevicePixelRatio = dpr;
drpListeningCharts.forEach((resize, chart) => {
if (chart.currentDevicePixelRatio !== dpr) {
resize();
}
});
}
function listenDevicePixelRatioChanges(chart, resize) {
if (!drpListeningCharts.size) {
window.addEventListener("resize", onWindowResize);
}
drpListeningCharts.set(chart, resize);
}
function unlistenDevicePixelRatioChanges(chart) {
drpListeningCharts.delete(chart);
if (!drpListeningCharts.size) {
window.removeEventListener("resize", onWindowResize);
}
}
function createResizeObserver(chart, type, listener) {
const canvas = chart.canvas;
const container = canvas && _getParentNode(canvas);
if (!container) {
return;
}
const resize = throttled((width, height) => {
const w4 = container.clientWidth;
listener(width, height);
if (w4 < container.clientWidth) {
listener();
}
}, window);
const observer = new ResizeObserver((entries) => {
const entry = entries[0];
const width = entry.contentRect.width;
const height = entry.contentRect.height;
if (width === 0 && height === 0) {
return;
}
resize(width, height);
});
observer.observe(container);
listenDevicePixelRatioChanges(chart, resize);
return observer;
}
function releaseObserver(chart, type, observer) {
if (observer) {
observer.disconnect();
}
if (type === "resize") {
unlistenDevicePixelRatioChanges(chart);
}
}
function createProxyAndListen(chart, type, listener) {
const canvas = chart.canvas;
const proxy = throttled((event2) => {
if (chart.ctx !== null) {
listener(fromNativeEvent(event2, chart));
}
}, chart, (args) => {
const event2 = args[0];
return [event2, event2.offsetX, event2.offsetY];
});
addListener(canvas, type, proxy);
return proxy;
}
function _detectPlatform(canvas) {
if (!_isDomSupported() || typeof OffscreenCanvas !== "undefined" && canvas instanceof OffscreenCanvas) {
return BasicPlatform;
}
return DomPlatform;
}
function calculateDelta(tickValue, ticks) {
let delta = ticks.length > 3 ? ticks[2].value - ticks[1].value : ticks[1].value - ticks[0].value;
if (Math.abs(delta) >= 1 && tickValue !== Math.floor(tickValue)) {
delta = tickValue - Math.floor(tickValue);
}
return delta;
}
function autoSkip(scale, ticks) {
const tickOpts = scale.options.ticks;
const ticksLimit = tickOpts.maxTicksLimit || determineMaxTicks(scale);
const majorIndices = tickOpts.major.enabled ? getMajorIndices(ticks) : [];
const numMajorIndices = majorIndices.length;
const first3 = majorIndices[0];
const last = majorIndices[numMajorIndices - 1];
const newTicks = [];
if (numMajorIndices > ticksLimit) {
skipMajors(ticks, newTicks, majorIndices, numMajorIndices / ticksLimit);
return newTicks;
}
const spacing = calculateSpacing(majorIndices, ticks, ticksLimit);
if (numMajorIndices > 0) {
let i5, ilen;
const avgMajorSpacing = numMajorIndices > 1 ? Math.round((last - first3) / (numMajorIndices - 1)) : null;
skip(ticks, newTicks, spacing, isNullOrUndef(avgMajorSpacing) ? 0 : first3 - avgMajorSpacing, first3);
for (i5 = 0, ilen = numMajorIndices - 1; i5 < ilen; i5++) {
skip(ticks, newTicks, spacing, majorIndices[i5], majorIndices[i5 + 1]);
}
skip(ticks, newTicks, spacing, last, isNullOrUndef(avgMajorSpacing) ? ticks.length : last + avgMajorSpacing);
return newTicks;
}
skip(ticks, newTicks, spacing);
return newTicks;
}
function determineMaxTicks(scale) {
const offset3 = scale.options.offset;
const tickLength = scale._tickSize();
const maxScale = scale._length / tickLength + (offset3 ? 0 : 1);
const maxChart = scale._maxLength / tickLength;
return Math.floor(Math.min(maxScale, maxChart));
}
function calculateSpacing(majorIndices, ticks, ticksLimit) {
const evenMajorSpacing = getEvenSpacing(majorIndices);
const spacing = ticks.length / ticksLimit;
if (!evenMajorSpacing) {
return Math.max(spacing, 1);
}
const factors = _factorize(evenMajorSpacing);
for (let i5 = 0, ilen = factors.length - 1; i5 < ilen; i5++) {
const factor = factors[i5];
if (factor > spacing) {
return factor;
}
}
return Math.max(spacing, 1);
}
function getMajorIndices(ticks) {
const result = [];
let i5, ilen;
for (i5 = 0, ilen = ticks.length; i5 < ilen; i5++) {
if (ticks[i5].major) {
result.push(i5);
}
}
return result;
}
function skipMajors(ticks, newTicks, majorIndices, spacing) {
let count = 0;
let next = majorIndices[0];
let i5;
spacing = Math.ceil(spacing);
for (i5 = 0; i5 < ticks.length; i5++) {
if (i5 === next) {
newTicks.push(ticks[i5]);
count++;
next = majorIndices[count * spacing];
}
}
}
function skip(ticks, newTicks, spacing, majorStart, majorEnd) {
const start3 = valueOrDefault(majorStart, 0);
const end2 = Math.min(valueOrDefault(majorEnd, ticks.length), ticks.length);
let count = 0;
let length, i5, next;
spacing = Math.ceil(spacing);
if (majorEnd) {
length = majorEnd - majorStart;
spacing = length / Math.floor(length / spacing);
}
next = start3;
while (next < 0) {
count++;
next = Math.round(start3 + count * spacing);
}
for (i5 = Math.max(start3, 0); i5 < end2; i5++) {
if (i5 === next) {
newTicks.push(ticks[i5]);
count++;
next = Math.round(start3 + count * spacing);
}
}
}
function getEvenSpacing(arr) {
const len = arr.length;
let i5, diff;
if (len < 2) {
return false;
}
for (diff = arr[0], i5 = 1; i5 < len; ++i5) {
if (arr[i5] - arr[i5 - 1] !== diff) {
return false;
}
}
return diff;
}
function sample(arr, numItems) {
const result = [];
const increment = arr.length / numItems;
const len = arr.length;
let i5 = 0;
for (; i5 < len; i5 += increment) {
result.push(arr[Math.floor(i5)]);
}
return result;
}
function getPixelForGridLine(scale, index3, offsetGridLines) {
const length = scale.ticks.length;
const validIndex2 = Math.min(index3, length - 1);
const start3 = scale._startPixel;
const end2 = scale._endPixel;
const epsilon = 1e-6;
let lineValue = scale.getPixelForTick(validIndex2);
let offset3;
if (offsetGridLines) {
if (length === 1) {
offset3 = Math.max(lineValue - start3, end2 - lineValue);
} else if (index3 === 0) {
offset3 = (scale.getPixelForTick(1) - lineValue) / 2;
} else {
offset3 = (lineValue - scale.getPixelForTick(validIndex2 - 1)) / 2;
}
lineValue += validIndex2 < index3 ? offset3 : -offset3;
if (lineValue < start3 - epsilon || lineValue > end2 + epsilon) {
return;
}
}
return lineValue;
}
function garbageCollect(caches, length) {
each(caches, (cache2) => {
const gc = cache2.gc;
const gcLen = gc.length / 2;
let i5;
if (gcLen > length) {
for (i5 = 0; i5 < gcLen; ++i5) {
delete cache2.data[gc[i5]];
}
gc.splice(0, gcLen);
}
});
}
function getTickMarkLength(options) {
return options.drawTicks ? options.tickLength : 0;
}
function getTitleHeight(options, fallback) {
if (!options.display) {
return 0;
}
const font = toFont(options.font, fallback);
const padding = toPadding(options.padding);
const lines = isArray(options.text) ? options.text.length : 1;
return lines * font.lineHeight + padding.height;
}
function createScaleContext(parent, scale) {
return createContext(parent, {
scale,
type: "scale"
});
}
function createTickContext(parent, index3, tick) {
return createContext(parent, {
tick,
index: index3,
type: "tick"
});
}
function titleAlign(align, position, reverse) {
let ret = _toLeftRightCenter(align);
if (reverse && position !== "right" || !reverse && position === "right") {
ret = reverseAlign(ret);
}
return ret;
}
function titleArgs(scale, offset3, position, align) {
const { top: top2, left: left2, bottom: bottom2, right: right2, chart } = scale;
const { chartArea, scales: scales2 } = chart;
let rotation = 0;
let maxWidth, titleX, titleY;
const height = bottom2 - top2;
const width = right2 - left2;
if (scale.isHorizontal()) {
titleX = _alignStartEnd(align, left2, right2);
if (isObject(position)) {
const positionAxisID = Object.keys(position)[0];
const value = position[positionAxisID];
titleY = scales2[positionAxisID].getPixelForValue(value) + height - offset3;
} else if (position === "center") {
titleY = (chartArea.bottom + chartArea.top) / 2 + height - offset3;
} else {
titleY = offsetFromEdge(scale, position, offset3);
}
maxWidth = right2 - left2;
} else {
if (isObject(position)) {
const positionAxisID = Object.keys(position)[0];
const value = position[positionAxisID];
titleX = scales2[positionAxisID].getPixelForValue(value) - width + offset3;
} else if (position === "center") {
titleX = (chartArea.left + chartArea.right) / 2 - width + offset3;
} else {
titleX = offsetFromEdge(scale, position, offset3);
}
titleY = _alignStartEnd(align, bottom2, top2);
rotation = position === "left" ? -HALF_PI : HALF_PI;
}
return { titleX, titleY, maxWidth, rotation };
}
function registerDefaults(item, scope, parentScope) {
const itemDefaults = merge(/* @__PURE__ */ Object.create(null), [
parentScope ? defaults.get(parentScope) : {},
defaults.get(scope),
item.defaults
]);
defaults.set(scope, itemDefaults);
if (item.defaultRoutes) {
routeDefaults(scope, item.defaultRoutes);
}
if (item.descriptors) {
defaults.describe(scope, item.descriptors);
}
}
function routeDefaults(scope, routes) {
Object.keys(routes).forEach((property) => {
const propertyParts = property.split(".");
const sourceName = propertyParts.pop();
const sourceScope = [scope].concat(propertyParts).join(".");
const parts = routes[property].split(".");
const targetName = parts.pop();
const targetScope = parts.join(".");
defaults.route(sourceScope, sourceName, targetScope, targetName);
});
}
function isIChartComponent(proto) {
return "id" in proto && "defaults" in proto;
}
function allPlugins(config2) {
const plugins3 = [];
const keys2 = Object.keys(registry.plugins.items);
for (let i5 = 0; i5 < keys2.length; i5++) {
plugins3.push(registry.getPlugin(keys2[i5]));
}
const local = config2.plugins || [];
for (let i5 = 0; i5 < local.length; i5++) {
const plugin = local[i5];
if (plugins3.indexOf(plugin) === -1) {
plugins3.push(plugin);
}
}
return plugins3;
}
function getOpts(options, all) {
if (!all && options === false) {
return null;
}
if (options === true) {
return {};
}
return options;
}
function createDescriptors(chart, plugins3, options, all) {
const result = [];
const context = chart.getContext();
for (let i5 = 0; i5 < plugins3.length; i5++) {
const plugin = plugins3[i5];
const id = plugin.id;
const opts = getOpts(options[id], all);
if (opts === null) {
continue;
}
result.push({
plugin,
options: pluginOpts(chart.config, plugin, opts, context)
});
}
return result;
}
function pluginOpts(config2, plugin, opts, context) {
const keys2 = config2.pluginScopeKeys(plugin);
const scopes = config2.getOptionScopes(opts, keys2);
return config2.createResolver(scopes, context, [""], { scriptable: false, indexable: false, allKeys: true });
}
function getIndexAxis(type, options) {
const datasetDefaults = defaults.datasets[type] || {};
const datasetOptions = (options.datasets || {})[type] || {};
return datasetOptions.indexAxis || options.indexAxis || datasetDefaults.indexAxis || "x";
}
function getAxisFromDefaultScaleID(id, indexAxis) {
let axis = id;
if (id === "_index_") {
axis = indexAxis;
} else if (id === "_value_") {
axis = indexAxis === "x" ? "y" : "x";
}
return axis;
}
function getDefaultScaleIDFromAxis(axis, indexAxis) {
return axis === indexAxis ? "_index_" : "_value_";
}
function axisFromPosition(position) {
if (position === "top" || position === "bottom") {
return "x";
}
if (position === "left" || position === "right") {
return "y";
}
}
function determineAxis(id, scaleOptions) {
if (id === "x" || id === "y") {
return id;
}
return scaleOptions.axis || axisFromPosition(scaleOptions.position) || id.charAt(0).toLowerCase();
}
function mergeScaleConfig(config2, options) {
const chartDefaults = overrides[config2.type] || { scales: {} };
const configScales = options.scales || {};
const chartIndexAxis = getIndexAxis(config2.type, options);
const firstIDs = /* @__PURE__ */ Object.create(null);
const scales2 = /* @__PURE__ */ Object.create(null);
Object.keys(configScales).forEach((id) => {
const scaleConf = configScales[id];
if (!isObject(scaleConf)) {
return console.error(`Invalid scale configuration for scale: ${id}`);
}
if (scaleConf._proxy) {
return console.warn(`Ignoring resolver passed as options for scale: ${id}`);
}
const axis = determineAxis(id, scaleConf);
const defaultId = getDefaultScaleIDFromAxis(axis, chartIndexAxis);
const defaultScaleOptions = chartDefaults.scales || {};
firstIDs[axis] = firstIDs[axis] || id;
scales2[id] = mergeIf(/* @__PURE__ */ Object.create(null), [{ axis }, scaleConf, defaultScaleOptions[axis], defaultScaleOptions[defaultId]]);
});
config2.data.datasets.forEach((dataset) => {
const type = dataset.type || config2.type;
const indexAxis = dataset.indexAxis || getIndexAxis(type, options);
const datasetDefaults = overrides[type] || {};
const defaultScaleOptions = datasetDefaults.scales || {};
Object.keys(defaultScaleOptions).forEach((defaultID) => {
const axis = getAxisFromDefaultScaleID(defaultID, indexAxis);
const id = dataset[axis + "AxisID"] || firstIDs[axis] || axis;
scales2[id] = scales2[id] || /* @__PURE__ */ Object.create(null);
mergeIf(scales2[id], [{ axis }, configScales[id], defaultScaleOptions[defaultID]]);
});
});
Object.keys(scales2).forEach((key) => {
const scale = scales2[key];
mergeIf(scale, [defaults.scales[scale.type], defaults.scale]);
});
return scales2;
}
function initOptions(config2) {
const options = config2.options || (config2.options = {});
options.plugins = valueOrDefault(options.plugins, {});
options.scales = mergeScaleConfig(config2, options);
}
function initData(data) {
data = data || {};
data.datasets = data.datasets || [];
data.labels = data.labels || [];
return data;
}
function initConfig(config2) {
config2 = config2 || {};
config2.data = initData(config2.data);
initOptions(config2);
return config2;
}
function cachedKeys(cacheKey, generate) {
let keys2 = keyCache.get(cacheKey);
if (!keys2) {
keys2 = generate();
keyCache.set(cacheKey, keys2);
keysCached.add(keys2);
}
return keys2;
}
function getResolver(resolverCache, scopes, prefixes) {
let cache2 = resolverCache.get(scopes);
if (!cache2) {
cache2 = /* @__PURE__ */ new Map();
resolverCache.set(scopes, cache2);
}
const cacheKey = prefixes.join();
let cached = cache2.get(cacheKey);
if (!cached) {
const resolver = _createResolver(scopes, prefixes);
cached = {
resolver,
subPrefixes: prefixes.filter((p4) => !p4.toLowerCase().includes("hover"))
};
cache2.set(cacheKey, cached);
}
return cached;
}
function needContext(proxy, names2) {
const { isScriptable, isIndexable } = _descriptors(proxy);
for (const prop of names2) {
const scriptable = isScriptable(prop);
const indexable = isIndexable(prop);
const value = (indexable || scriptable) && proxy[prop];
if (scriptable && (isFunction(value) || hasFunction(value)) || indexable && isArray(value)) {
return true;
}
}
return false;
}
function positionIsHorizontal(position, axis) {
return position === "top" || position === "bottom" || KNOWN_POSITIONS.indexOf(position) === -1 && axis === "x";
}
function compare2Level(l1, l22) {
return function(a5, b4) {
return a5[l1] === b4[l1] ? a5[l22] - b4[l22] : a5[l1] - b4[l1];
};
}
function onAnimationsComplete(context) {
const chart = context.chart;
const animationOptions2 = chart.options.animation;
chart.notifyPlugins("afterRender");
callback(animationOptions2 && animationOptions2.onComplete, [context], chart);
}
function onAnimationProgress(context) {
const chart = context.chart;
const animationOptions2 = chart.options.animation;
callback(animationOptions2 && animationOptions2.onProgress, [context], chart);
}
function getCanvas(item) {
if (_isDomSupported() && typeof item === "string") {
item = document.getElementById(item);
} else if (item && item.length) {
item = item[0];
}
if (item && item.canvas) {
item = item.canvas;
}
return item;
}
function moveNumericKeys(obj, start3, move) {
const keys2 = Object.keys(obj);
for (const key of keys2) {
const intKey = +key;
if (intKey >= start3) {
const value = obj[key];
delete obj[key];
if (move > 0 || intKey > start3) {
obj[intKey + move] = value;
}
}
}
}
function determineLastEvent(e5, lastEvent, inChartArea, isClick) {
if (!inChartArea || e5.type === "mouseout") {
return null;
}
if (isClick) {
return lastEvent;
}
return e5;
}
function clipArc(ctx, element, endAngle) {
const { startAngle, pixelMargin, x: x4, y: y4, outerRadius, innerRadius } = element;
let angleMargin = pixelMargin / outerRadius;
ctx.beginPath();
ctx.arc(x4, y4, outerRadius, startAngle - angleMargin, endAngle + angleMargin);
if (innerRadius > pixelMargin) {
angleMargin = pixelMargin / innerRadius;
ctx.arc(x4, y4, innerRadius, endAngle + angleMargin, startAngle - angleMargin, true);
} else {
ctx.arc(x4, y4, pixelMargin, endAngle + HALF_PI, startAngle - HALF_PI);
}
ctx.closePath();
ctx.clip();
}
function toRadiusCorners(value) {
return _readValueToProps(value, ["outerStart", "outerEnd", "innerStart", "innerEnd"]);
}
function parseBorderRadius$1(arc, innerRadius, outerRadius, angleDelta) {
const o5 = toRadiusCorners(arc.options.borderRadius);
const halfThickness = (outerRadius - innerRadius) / 2;
const innerLimit = Math.min(halfThickness, angleDelta * innerRadius / 2);
const computeOuterLimit = (val) => {
const outerArcLimit = (outerRadius - Math.min(halfThickness, val)) * angleDelta / 2;
return _limitValue(val, 0, Math.min(halfThickness, outerArcLimit));
};
return {
outerStart: computeOuterLimit(o5.outerStart),
outerEnd: computeOuterLimit(o5.outerEnd),
innerStart: _limitValue(o5.innerStart, 0, innerLimit),
innerEnd: _limitValue(o5.innerEnd, 0, innerLimit)
};
}
function rThetaToXY(r6, theta, x4, y4) {
return {
x: x4 + r6 * Math.cos(theta),
y: y4 + r6 * Math.sin(theta)
};
}
function pathArc(ctx, element, offset3, spacing, end2) {
const { x: x4, y: y4, startAngle: start3, pixelMargin, innerRadius: innerR } = element;
const outerRadius = Math.max(element.outerRadius + spacing + offset3 - pixelMargin, 0);
const innerRadius = innerR > 0 ? innerR + spacing + offset3 + pixelMargin : 0;
let spacingOffset = 0;
const alpha2 = end2 - start3;
if (spacing) {
const noSpacingInnerRadius = innerR > 0 ? innerR - spacing : 0;
const noSpacingOuterRadius = outerRadius > 0 ? outerRadius - spacing : 0;
const avNogSpacingRadius = (noSpacingInnerRadius + noSpacingOuterRadius) / 2;
const adjustedAngle = avNogSpacingRadius !== 0 ? alpha2 * avNogSpacingRadius / (avNogSpacingRadius + spacing) : alpha2;
spacingOffset = (alpha2 - adjustedAngle) / 2;
}
const beta = Math.max(1e-3, alpha2 * outerRadius - offset3 / PI) / outerRadius;
const angleOffset = (alpha2 - beta) / 2;
const startAngle = start3 + angleOffset + spacingOffset;
const endAngle = end2 - angleOffset - spacingOffset;
const { outerStart, outerEnd, innerStart, innerEnd } = parseBorderRadius$1(element, innerRadius, outerRadius, endAngle - startAngle);
const outerStartAdjustedRadius = outerRadius - outerStart;
const outerEndAdjustedRadius = outerRadius - outerEnd;
const outerStartAdjustedAngle = startAngle + outerStart / outerStartAdjustedRadius;
const outerEndAdjustedAngle = endAngle - outerEnd / outerEndAdjustedRadius;
const innerStartAdjustedRadius = innerRadius + innerStart;
const innerEndAdjustedRadius = innerRadius + innerEnd;
const innerStartAdjustedAngle = startAngle + innerStart / innerStartAdjustedRadius;
const innerEndAdjustedAngle = endAngle - innerEnd / innerEndAdjustedRadius;
ctx.beginPath();
ctx.arc(x4, y4, outerRadius, outerStartAdjustedAngle, outerEndAdjustedAngle);
if (outerEnd > 0) {
const pCenter = rThetaToXY(outerEndAdjustedRadius, outerEndAdjustedAngle, x4, y4);
ctx.arc(pCenter.x, pCenter.y, outerEnd, outerEndAdjustedAngle, endAngle + HALF_PI);
}
const p4 = rThetaToXY(innerEndAdjustedRadius, endAngle, x4, y4);
ctx.lineTo(p4.x, p4.y);
if (innerEnd > 0) {
const pCenter = rThetaToXY(innerEndAdjustedRadius, innerEndAdjustedAngle, x4, y4);
ctx.arc(pCenter.x, pCenter.y, innerEnd, endAngle + HALF_PI, innerEndAdjustedAngle + Math.PI);
}
ctx.arc(x4, y4, innerRadius, endAngle - innerEnd / innerRadius, startAngle + innerStart / innerRadius, true);
if (innerStart > 0) {
const pCenter = rThetaToXY(innerStartAdjustedRadius, innerStartAdjustedAngle, x4, y4);
ctx.arc(pCenter.x, pCenter.y, innerStart, innerStartAdjustedAngle + Math.PI, startAngle - HALF_PI);
}
const p8 = rThetaToXY(outerStartAdjustedRadius, startAngle, x4, y4);
ctx.lineTo(p8.x, p8.y);
if (outerStart > 0) {
const pCenter = rThetaToXY(outerStartAdjustedRadius, outerStartAdjustedAngle, x4, y4);
ctx.arc(pCenter.x, pCenter.y, outerStart, startAngle - HALF_PI, outerStartAdjustedAngle);
}
ctx.closePath();
}
function drawArc(ctx, element, offset3, spacing) {
const { fullCircles, startAngle, circumference } = element;
let endAngle = element.endAngle;
if (fullCircles) {
pathArc(ctx, element, offset3, spacing, startAngle + TAU);
for (let i5 = 0; i5 < fullCircles; ++i5) {
ctx.fill();
}
if (!isNaN(circumference)) {
endAngle = startAngle + circumference % TAU;
if (circumference % TAU === 0) {
endAngle += TAU;
}
}
}
pathArc(ctx, element, offset3, spacing, endAngle);
ctx.fill();
return endAngle;
}
function drawFullCircleBorders(ctx, element, inner) {
const { x: x4, y: y4, startAngle, pixelMargin, fullCircles } = element;
const outerRadius = Math.max(element.outerRadius - pixelMargin, 0);
const innerRadius = element.innerRadius + pixelMargin;
let i5;
if (inner) {
clipArc(ctx, element, startAngle + TAU);
}
ctx.beginPath();
ctx.arc(x4, y4, innerRadius, startAngle + TAU, startAngle, true);
for (i5 = 0; i5 < fullCircles; ++i5) {
ctx.stroke();
}
ctx.beginPath();
ctx.arc(x4, y4, outerRadius, startAngle, startAngle + TAU);
for (i5 = 0; i5 < fullCircles; ++i5) {
ctx.stroke();
}
}
function drawBorder(ctx, element, offset3, spacing, endAngle) {
const { options } = element;
const { borderWidth, borderJoinStyle } = options;
const inner = options.borderAlign === "inner";
if (!borderWidth) {
return;
}
if (inner) {
ctx.lineWidth = borderWidth * 2;
ctx.lineJoin = borderJoinStyle || "round";
} else {
ctx.lineWidth = borderWidth;
ctx.lineJoin = borderJoinStyle || "bevel";
}
if (element.fullCircles) {
drawFullCircleBorders(ctx, element, inner);
}
if (inner) {
clipArc(ctx, element, endAngle);
}
pathArc(ctx, element, offset3, spacing, endAngle);
ctx.stroke();
}
function setStyle(ctx, options, style2 = options) {
ctx.lineCap = valueOrDefault(style2.borderCapStyle, options.borderCapStyle);
ctx.setLineDash(valueOrDefault(style2.borderDash, options.borderDash));
ctx.lineDashOffset = valueOrDefault(style2.borderDashOffset, options.borderDashOffset);
ctx.lineJoin = valueOrDefault(style2.borderJoinStyle, options.borderJoinStyle);
ctx.lineWidth = valueOrDefault(style2.borderWidth, options.borderWidth);
ctx.strokeStyle = valueOrDefault(style2.borderColor, options.borderColor);
}
function lineTo(ctx, previous, target) {
ctx.lineTo(target.x, target.y);
}
function getLineMethod(options) {
if (options.stepped) {
return _steppedLineTo;
}
if (options.tension || options.cubicInterpolationMode === "monotone") {
return _bezierCurveTo;
}
return lineTo;
}
function pathVars(points, segment, params = {}) {
const count = points.length;
const { start: paramsStart = 0, end: paramsEnd = count - 1 } = params;
const { start: segmentStart, end: segmentEnd } = segment;
const start3 = Math.max(paramsStart, segmentStart);
const end2 = Math.min(paramsEnd, segmentEnd);
const outside = paramsStart < segmentStart && paramsEnd < segmentStart || paramsStart > segmentEnd && paramsEnd > segmentEnd;
return {
count,
start: start3,
loop: segment.loop,
ilen: end2 < start3 && !outside ? count + end2 - start3 : end2 - start3
};
}
function pathSegment(ctx, line, segment, params) {
const { points, options } = line;
const { count, start: start3, loop, ilen } = pathVars(points, segment, params);
const lineMethod = getLineMethod(options);
let { move = true, reverse } = params || {};
let i5, point, prev;
for (i5 = 0; i5 <= ilen; ++i5) {
point = points[(start3 + (reverse ? ilen - i5 : i5)) % count];
if (point.skip) {
continue;
} else if (move) {
ctx.moveTo(point.x, point.y);
move = false;
} else {
lineMethod(ctx, prev, point, reverse, options.stepped);
}
prev = point;
}
if (loop) {
point = points[(start3 + (reverse ? ilen : 0)) % count];
lineMethod(ctx, prev, point, reverse, options.stepped);
}
return !!loop;
}
function fastPathSegment(ctx, line, segment, params) {
const points = line.points;
const { count, start: start3, ilen } = pathVars(points, segment, params);
const { move = true, reverse } = params || {};
let avgX = 0;
let countX = 0;
let i5, point, prevX, minY, maxY, lastY;
const pointIndex = (index3) => (start3 + (reverse ? ilen - index3 : index3)) % count;
const drawX = () => {
if (minY !== maxY) {
ctx.lineTo(avgX, maxY);
ctx.lineTo(avgX, minY);
ctx.lineTo(avgX, lastY);
}
};
if (move) {
point = points[pointIndex(0)];
ctx.moveTo(point.x, point.y);
}
for (i5 = 0; i5 <= ilen; ++i5) {
point = points[pointIndex(i5)];
if (point.skip) {
continue;
}
const x4 = point.x;
const y4 = point.y;
const truncX = x4 | 0;
if (truncX === prevX) {
if (y4 < minY) {
minY = y4;
} else if (y4 > maxY) {
maxY = y4;
}
avgX = (countX * avgX + x4) / ++countX;
} else {
drawX();
ctx.lineTo(x4, y4);
prevX = truncX;
countX = 0;
minY = maxY = y4;
}
lastY = y4;
}
drawX();
}
function _getSegmentMethod(line) {
const opts = line.options;
const borderDash = opts.borderDash && opts.borderDash.length;
const useFastPath = !line._decimated && !line._loop && !opts.tension && opts.cubicInterpolationMode !== "monotone" && !opts.stepped && !borderDash;
return useFastPath ? fastPathSegment : pathSegment;
}
function _getInterpolationMethod(options) {
if (options.stepped) {
return _steppedInterpolation;
}
if (options.tension || options.cubicInterpolationMode === "monotone") {
return _bezierInterpolation;
}
return _pointInLine;
}
function strokePathWithCache(ctx, line, start3, count) {
let path = line._path;
if (!path) {
path = line._path = new Path2D();
if (line.path(path, start3, count)) {
path.closePath();
}
}
setStyle(ctx, line.options);
ctx.stroke(path);
}
function strokePathDirect(ctx, line, start3, count) {
const { segments, options } = line;
const segmentMethod = _getSegmentMethod(line);
for (const segment of segments) {
setStyle(ctx, options, segment.style);
ctx.beginPath();
if (segmentMethod(ctx, line, segment, { start: start3, end: start3 + count - 1 })) {
ctx.closePath();
}
ctx.stroke();
}
}
function draw(ctx, line, start3, count) {
if (usePath2D && !line.options.segment) {
strokePathWithCache(ctx, line, start3, count);
} else {
strokePathDirect(ctx, line, start3, count);
}
}
function inRange$1(el, pos, axis, useFinalPosition) {
const options = el.options;
const { [axis]: value } = el.getProps([axis], useFinalPosition);
return Math.abs(pos - value) < options.radius + options.hitRadius;
}
function getBarBounds(bar, useFinalPosition) {
const { x: x4, y: y4, base: base2, width, height } = bar.getProps(["x", "y", "base", "width", "height"], useFinalPosition);
let left2, right2, top2, bottom2, half;
if (bar.horizontal) {
half = height / 2;
left2 = Math.min(x4, base2);
right2 = Math.max(x4, base2);
top2 = y4 - half;
bottom2 = y4 + half;
} else {
half = width / 2;
left2 = x4 - half;
right2 = x4 + half;
top2 = Math.min(y4, base2);
bottom2 = Math.max(y4, base2);
}
return { left: left2, top: top2, right: right2, bottom: bottom2 };
}
function skipOrLimit(skip2, value, min2, max2) {
return skip2 ? 0 : _limitValue(value, min2, max2);
}
function parseBorderWidth(bar, maxW, maxH) {
const value = bar.options.borderWidth;
const skip2 = bar.borderSkipped;
const o5 = toTRBL(value);
return {
t: skipOrLimit(skip2.top, o5.top, 0, maxH),
r: skipOrLimit(skip2.right, o5.right, 0, maxW),
b: skipOrLimit(skip2.bottom, o5.bottom, 0, maxH),
l: skipOrLimit(skip2.left, o5.left, 0, maxW)
};
}
function parseBorderRadius(bar, maxW, maxH) {
const { enableBorderRadius } = bar.getProps(["enableBorderRadius"]);
const value = bar.options.borderRadius;
const o5 = toTRBLCorners(value);
const maxR = Math.min(maxW, maxH);
const skip2 = bar.borderSkipped;
const enableBorder = enableBorderRadius || isObject(value);
return {
topLeft: skipOrLimit(!enableBorder || skip2.top || skip2.left, o5.topLeft, 0, maxR),
topRight: skipOrLimit(!enableBorder || skip2.top || skip2.right, o5.topRight, 0, maxR),
bottomLeft: skipOrLimit(!enableBorder || skip2.bottom || skip2.left, o5.bottomLeft, 0, maxR),
bottomRight: skipOrLimit(!enableBorder || skip2.bottom || skip2.right, o5.bottomRight, 0, maxR)
};
}
function boundingRects(bar) {
const bounds = getBarBounds(bar);
const width = bounds.right - bounds.left;
const height = bounds.bottom - bounds.top;
const border = parseBorderWidth(bar, width / 2, height / 2);
const radius = parseBorderRadius(bar, width / 2, height / 2);
return {
outer: {
x: bounds.left,
y: bounds.top,
w: width,
h: height,
radius
},
inner: {
x: bounds.left + border.l,
y: bounds.top + border.t,
w: width - border.l - border.r,
h: height - border.t - border.b,
radius: {
topLeft: Math.max(0, radius.topLeft - Math.max(border.t, border.l)),
topRight: Math.max(0, radius.topRight - Math.max(border.t, border.r)),
bottomLeft: Math.max(0, radius.bottomLeft - Math.max(border.b, border.l)),
bottomRight: Math.max(0, radius.bottomRight - Math.max(border.b, border.r))
}
}
};
}
function inRange(bar, x4, y4, useFinalPosition) {
const skipX = x4 === null;
const skipY = y4 === null;
const skipBoth = skipX && skipY;
const bounds = bar && !skipBoth && getBarBounds(bar, useFinalPosition);
return bounds && (skipX || _isBetween(x4, bounds.left, bounds.right)) && (skipY || _isBetween(y4, bounds.top, bounds.bottom));
}
function hasRadius(radius) {
return radius.topLeft || radius.topRight || radius.bottomLeft || radius.bottomRight;
}
function addNormalRectPath(ctx, rect) {
ctx.rect(rect.x, rect.y, rect.w, rect.h);
}
function inflateRect(rect, amount, refRect = {}) {
const x4 = rect.x !== refRect.x ? -amount : 0;
const y4 = rect.y !== refRect.y ? -amount : 0;
const w4 = (rect.x + rect.w !== refRect.x + refRect.w ? amount : 0) - x4;
const h6 = (rect.y + rect.h !== refRect.y + refRect.h ? amount : 0) - y4;
return {
x: rect.x + x4,
y: rect.y + y4,
w: rect.w + w4,
h: rect.h + h6,
radius: rect.radius
};
}
function lttbDecimation(data, start3, count, availableWidth, options) {
const samples = options.samples || availableWidth;
if (samples >= count) {
return data.slice(start3, start3 + count);
}
const decimated = [];
const bucketWidth = (count - 2) / (samples - 2);
let sampledIndex = 0;
const endIndex = start3 + count - 1;
let a5 = start3;
let i5, maxAreaPoint, maxArea, area, nextA;
decimated[sampledIndex++] = data[a5];
for (i5 = 0; i5 < samples - 2; i5++) {
let avgX = 0;
let avgY = 0;
let j4;
const avgRangeStart = Math.floor((i5 + 1) * bucketWidth) + 1 + start3;
const avgRangeEnd = Math.min(Math.floor((i5 + 2) * bucketWidth) + 1, count) + start3;
const avgRangeLength = avgRangeEnd - avgRangeStart;
for (j4 = avgRangeStart; j4 < avgRangeEnd; j4++) {
avgX += data[j4].x;
avgY += data[j4].y;
}
avgX /= avgRangeLength;
avgY /= avgRangeLength;
const rangeOffs = Math.floor(i5 * bucketWidth) + 1 + start3;
const rangeTo = Math.min(Math.floor((i5 + 1) * bucketWidth) + 1, count) + start3;
const { x: pointAx, y: pointAy } = data[a5];
maxArea = area = -1;
for (j4 = rangeOffs; j4 < rangeTo; j4++) {
area = 0.5 * Math.abs(
(pointAx - avgX) * (data[j4].y - pointAy) - (pointAx - data[j4].x) * (avgY - pointAy)
);
if (area > maxArea) {
maxArea = area;
maxAreaPoint = data[j4];
nextA = j4;
}
}
decimated[sampledIndex++] = maxAreaPoint;
a5 = nextA;
}
decimated[sampledIndex++] = data[endIndex];
return decimated;
}
function minMaxDecimation(data, start3, count, availableWidth) {
let avgX = 0;
let countX = 0;
let i5, point, x4, y4, prevX, minIndex, maxIndex, startIndex, minY, maxY;
const decimated = [];
const endIndex = start3 + count - 1;
const xMin = data[start3].x;
const xMax = data[endIndex].x;
const dx = xMax - xMin;
for (i5 = start3; i5 < start3 + count; ++i5) {
point = data[i5];
x4 = (point.x - xMin) / dx * availableWidth;
y4 = point.y;
const truncX = x4 | 0;
if (truncX === prevX) {
if (y4 < minY) {
minY = y4;
minIndex = i5;
} else if (y4 > maxY) {
maxY = y4;
maxIndex = i5;
}
avgX = (countX * avgX + point.x) / ++countX;
} else {
const lastIndex = i5 - 1;
if (!isNullOrUndef(minIndex) && !isNullOrUndef(maxIndex)) {
const intermediateIndex1 = Math.min(minIndex, maxIndex);
const intermediateIndex2 = Math.max(minIndex, maxIndex);
if (intermediateIndex1 !== startIndex && intermediateIndex1 !== lastIndex) {
decimated.push({
...data[intermediateIndex1],
x: avgX
});
}
if (intermediateIndex2 !== startIndex && intermediateIndex2 !== lastIndex) {
decimated.push({
...data[intermediateIndex2],
x: avgX
});
}
}
if (i5 > 0 && lastIndex !== startIndex) {
decimated.push(data[lastIndex]);
}
decimated.push(point);
prevX = truncX;
countX = 0;
minY = maxY = y4;
minIndex = maxIndex = startIndex = i5;
}
}
return decimated;
}
function cleanDecimatedDataset(dataset) {
if (dataset._decimated) {
const data = dataset._data;
delete dataset._decimated;
delete dataset._data;
Object.defineProperty(dataset, "data", { value: data });
}
}
function cleanDecimatedData(chart) {
chart.data.datasets.forEach((dataset) => {
cleanDecimatedDataset(dataset);
});
}
function getStartAndCountOfVisiblePointsSimplified(meta, points) {
const pointCount = points.length;
let start3 = 0;
let count;
const { iScale } = meta;
const { min: min2, max: max2, minDefined, maxDefined } = iScale.getUserBounds();
if (minDefined) {
start3 = _limitValue(_lookupByKey(points, iScale.axis, min2).lo, 0, pointCount - 1);
}
if (maxDefined) {
count = _limitValue(_lookupByKey(points, iScale.axis, max2).hi + 1, start3, pointCount) - start3;
} else {
count = pointCount - start3;
}
return { start: start3, count };
}
function getLineByIndex(chart, index3) {
const meta = chart.getDatasetMeta(index3);
const visible = meta && chart.isDatasetVisible(index3);
return visible ? meta.dataset : null;
}
function parseFillOption(line) {
const options = line.options;
const fillOption = options.fill;
let fill = valueOrDefault(fillOption && fillOption.target, fillOption);
if (fill === void 0) {
fill = !!options.backgroundColor;
}
if (fill === false || fill === null) {
return false;
}
if (fill === true) {
return "origin";
}
return fill;
}
function decodeFill(line, index3, count) {
const fill = parseFillOption(line);
if (isObject(fill)) {
return isNaN(fill.value) ? false : fill;
}
let target = parseFloat(fill);
if (isNumberFinite(target) && Math.floor(target) === target) {
if (fill[0] === "-" || fill[0] === "+") {
target = index3 + target;
}
if (target === index3 || target < 0 || target >= count) {
return false;
}
return target;
}
return ["origin", "start", "end", "stack", "shape"].indexOf(fill) >= 0 && fill;
}
function computeLinearBoundary(source) {
const { scale = {}, fill } = source;
let target = null;
let horizontal;
if (fill === "start") {
target = scale.bottom;
} else if (fill === "end") {
target = scale.top;
} else if (isObject(fill)) {
target = scale.getPixelForValue(fill.value);
} else if (scale.getBasePixel) {
target = scale.getBasePixel();
}
if (isNumberFinite(target)) {
horizontal = scale.isHorizontal();
return {
x: horizontal ? target : null,
y: horizontal ? null : target
};
}
return null;
}
function computeCircularBoundary(source) {
const { scale, fill } = source;
const options = scale.options;
const length = scale.getLabels().length;
const target = [];
const start3 = options.reverse ? scale.max : scale.min;
const end2 = options.reverse ? scale.min : scale.max;
let i5, center, value;
if (fill === "start") {
value = start3;
} else if (fill === "end") {
value = end2;
} else if (isObject(fill)) {
value = fill.value;
} else {
value = scale.getBaseValue();
}
if (options.grid.circular) {
center = scale.getPointPositionForValue(0, start3);
return new simpleArc({
x: center.x,
y: center.y,
radius: scale.getDistanceFromCenterForValue(value)
});
}
for (i5 = 0; i5 < length; ++i5) {
target.push(scale.getPointPositionForValue(i5, value));
}
return target;
}
function computeBoundary(source) {
const scale = source.scale || {};
if (scale.getPointPositionForValue) {
return computeCircularBoundary(source);
}
return computeLinearBoundary(source);
}
function findSegmentEnd(start3, end2, points) {
for (; end2 > start3; end2--) {
const point = points[end2];
if (!isNaN(point.x) && !isNaN(point.y)) {
break;
}
}
return end2;
}
function pointsFromSegments(boundary, line) {
const { x: x4 = null, y: y4 = null } = boundary || {};
const linePoints = line.points;
const points = [];
line.segments.forEach(({ start: start3, end: end2 }) => {
end2 = findSegmentEnd(start3, end2, linePoints);
const first3 = linePoints[start3];
const last = linePoints[end2];
if (y4 !== null) {
points.push({ x: first3.x, y: y4 });
points.push({ x: last.x, y: y4 });
} else if (x4 !== null) {
points.push({ x: x4, y: first3.y });
points.push({ x: x4, y: last.y });
}
});
return points;
}
function buildStackLine(source) {
const { scale, index: index3, line } = source;
const points = [];
const segments = line.segments;
const sourcePoints = line.points;
const linesBelow = getLinesBelow(scale, index3);
linesBelow.push(createBoundaryLine({ x: null, y: scale.bottom }, line));
for (let i5 = 0; i5 < segments.length; i5++) {
const segment = segments[i5];
for (let j4 = segment.start; j4 <= segment.end; j4++) {
addPointsBelow(points, sourcePoints[j4], linesBelow);
}
}
return new LineElement({ points, options: {} });
}
function getLinesBelow(scale, index3) {
const below = [];
const metas = scale.getMatchingVisibleMetas("line");
for (let i5 = 0; i5 < metas.length; i5++) {
const meta = metas[i5];
if (meta.index === index3) {
break;
}
if (!meta.hidden) {
below.unshift(meta.dataset);
}
}
return below;
}
function addPointsBelow(points, sourcePoint, linesBelow) {
const postponed = [];
for (let j4 = 0; j4 < linesBelow.length; j4++) {
const line = linesBelow[j4];
const { first: first3, last, point } = findPoint(line, sourcePoint, "x");
if (!point || first3 && last) {
continue;
}
if (first3) {
postponed.unshift(point);
} else {
points.push(point);
if (!last) {
break;
}
}
}
points.push(...postponed);
}
function findPoint(line, sourcePoint, property) {
const point = line.interpolate(sourcePoint, property);
if (!point) {
return {};
}
const pointValue = point[property];
const segments = line.segments;
const linePoints = line.points;
let first3 = false;
let last = false;
for (let i5 = 0; i5 < segments.length; i5++) {
const segment = segments[i5];
const firstValue = linePoints[segment.start][property];
const lastValue = linePoints[segment.end][property];
if (_isBetween(pointValue, firstValue, lastValue)) {
first3 = pointValue === firstValue;
last = pointValue === lastValue;
break;
}
}
return { first: first3, last, point };
}
function getTarget(source) {
const { chart, fill, line } = source;
if (isNumberFinite(fill)) {
return getLineByIndex(chart, fill);
}
if (fill === "stack") {
return buildStackLine(source);
}
if (fill === "shape") {
return true;
}
const boundary = computeBoundary(source);
if (boundary instanceof simpleArc) {
return boundary;
}
return createBoundaryLine(boundary, line);
}
function createBoundaryLine(boundary, line) {
let points = [];
let _loop = false;
if (isArray(boundary)) {
_loop = true;
points = boundary;
} else {
points = pointsFromSegments(boundary, line);
}
return points.length ? new LineElement({
points,
options: { tension: 0 },
_loop,
_fullLoop: _loop
}) : null;
}
function resolveTarget(sources, index3, propagate) {
const source = sources[index3];
let fill = source.fill;
const visited = [index3];
let target;
if (!propagate) {
return fill;
}
while (fill !== false && visited.indexOf(fill) === -1) {
if (!isNumberFinite(fill)) {
return fill;
}
target = sources[fill];
if (!target) {
return false;
}
if (target.visible) {
return fill;
}
visited.push(fill);
fill = target.fill;
}
return false;
}
function _clip(ctx, target, clipY) {
ctx.beginPath();
target.path(ctx);
ctx.lineTo(target.last().x, clipY);
ctx.lineTo(target.first().x, clipY);
ctx.closePath();
ctx.clip();
}
function getBounds(property, first3, last, loop) {
if (loop) {
return;
}
let start3 = first3[property];
let end2 = last[property];
if (property === "angle") {
start3 = _normalizeAngle(start3);
end2 = _normalizeAngle(end2);
}
return { property, start: start3, end: end2 };
}
function _getEdge(a5, b4, prop, fn3) {
if (a5 && b4) {
return fn3(a5[prop], b4[prop]);
}
return a5 ? a5[prop] : b4 ? b4[prop] : 0;
}
function _segments(line, target, property) {
const segments = line.segments;
const points = line.points;
const tpoints = target.points;
const parts = [];
for (const segment of segments) {
let { start: start3, end: end2 } = segment;
end2 = findSegmentEnd(start3, end2, points);
const bounds = getBounds(property, points[start3], points[end2], segment.loop);
if (!target.segments) {
parts.push({
source: segment,
target: bounds,
start: points[start3],
end: points[end2]
});
continue;
}
const targetSegments = _boundSegments(target, bounds);
for (const tgt of targetSegments) {
const subBounds = getBounds(property, tpoints[tgt.start], tpoints[tgt.end], tgt.loop);
const fillSources = _boundSegment(segment, points, subBounds);
for (const fillSource of fillSources) {
parts.push({
source: fillSource,
target: tgt,
start: {
[property]: _getEdge(bounds, subBounds, "start", Math.max)
},
end: {
[property]: _getEdge(bounds, subBounds, "end", Math.min)
}
});
}
}
}
return parts;
}
function clipBounds(ctx, scale, bounds) {
const { top: top2, bottom: bottom2 } = scale.chart.chartArea;
const { property, start: start3, end: end2 } = bounds || {};
if (property === "x") {
ctx.beginPath();
ctx.rect(start3, top2, end2 - start3, bottom2 - top2);
ctx.clip();
}
}
function interpolatedLineTo(ctx, target, point, property) {
const interpolatedPoint = target.interpolate(point, property);
if (interpolatedPoint) {
ctx.lineTo(interpolatedPoint.x, interpolatedPoint.y);
}
}
function _fill(ctx, cfg) {
const { line, target, property, color: color2, scale } = cfg;
const segments = _segments(line, target, property);
for (const { source: src, target: tgt, start: start3, end: end2 } of segments) {
const { style: { backgroundColor = color2 } = {} } = src;
const notShape = target !== true;
ctx.save();
ctx.fillStyle = backgroundColor;
clipBounds(ctx, scale, notShape && getBounds(property, start3, end2));
ctx.beginPath();
const lineLoop = !!line.pathSegment(ctx, src);
let loop;
if (notShape) {
if (lineLoop) {
ctx.closePath();
} else {
interpolatedLineTo(ctx, target, end2, property);
}
const targetLoop = !!target.pathSegment(ctx, tgt, { move: lineLoop, reverse: true });
loop = lineLoop && targetLoop;
if (!loop) {
interpolatedLineTo(ctx, target, start3, property);
}
}
ctx.closePath();
ctx.fill(loop ? "evenodd" : "nonzero");
ctx.restore();
}
}
function doFill(ctx, cfg) {
const { line, target, above, below, area, scale } = cfg;
const property = line._loop ? "angle" : cfg.axis;
ctx.save();
if (property === "x" && below !== above) {
_clip(ctx, target, area.top);
_fill(ctx, { line, target, color: above, scale, property });
ctx.restore();
ctx.save();
_clip(ctx, target, area.bottom);
}
_fill(ctx, { line, target, color: below, scale, property });
ctx.restore();
}
function drawfill(ctx, source, area) {
const target = getTarget(source);
const { line, scale, axis } = source;
const lineOpts = line.options;
const fillOption = lineOpts.fill;
const color2 = lineOpts.backgroundColor;
const { above = color2, below = color2 } = fillOption || {};
if (target && line.points.length) {
clipArea(ctx, area);
doFill(ctx, { line, target, above, below, area, scale, axis });
unclipArea(ctx);
}
}
function isListened(type, opts) {
if (type === "mousemove" && (opts.onHover || opts.onLeave)) {
return true;
}
if (opts.onClick && (type === "click" || type === "mouseup")) {
return true;
}
return false;
}
function createTitle(chart, titleOpts) {
const title = new Title({
ctx: chart.ctx,
options: titleOpts,
chart
});
layouts.configure(chart, title, titleOpts);
layouts.addBox(chart, title);
chart.titleBlock = title;
}
function pushOrConcat(base2, toPush) {
if (toPush) {
if (isArray(toPush)) {
Array.prototype.push.apply(base2, toPush);
} else {
base2.push(toPush);
}
}
return base2;
}
function splitNewlines(str) {
if ((typeof str === "string" || str instanceof String) && str.indexOf("\n") > -1) {
return str.split("\n");
}
return str;
}
function createTooltipItem(chart, item) {
const { element, datasetIndex, index: index3 } = item;
const controller = chart.getDatasetMeta(datasetIndex).controller;
const { label, value } = controller.getLabelAndValue(index3);
return {
chart,
label,
parsed: controller.getParsed(index3),
raw: chart.data.datasets[datasetIndex].data[index3],
formattedValue: value,
dataset: controller.getDataset(),
dataIndex: index3,
datasetIndex,
element
};
}
function getTooltipSize(tooltip, options) {
const ctx = tooltip.chart.ctx;
const { body, footer, title } = tooltip;
const { boxWidth, boxHeight } = options;
const bodyFont = toFont(options.bodyFont);
const titleFont = toFont(options.titleFont);
const footerFont = toFont(options.footerFont);
const titleLineCount = title.length;
const footerLineCount = footer.length;
const bodyLineItemCount = body.length;
const padding = toPadding(options.padding);
let height = padding.height;
let width = 0;
let combinedBodyLength = body.reduce((count, bodyItem) => count + bodyItem.before.length + bodyItem.lines.length + bodyItem.after.length, 0);
combinedBodyLength += tooltip.beforeBody.length + tooltip.afterBody.length;
if (titleLineCount) {
height += titleLineCount * titleFont.lineHeight + (titleLineCount - 1) * options.titleSpacing + options.titleMarginBottom;
}
if (combinedBodyLength) {
const bodyLineHeight = options.displayColors ? Math.max(boxHeight, bodyFont.lineHeight) : bodyFont.lineHeight;
height += bodyLineItemCount * bodyLineHeight + (combinedBodyLength - bodyLineItemCount) * bodyFont.lineHeight + (combinedBodyLength - 1) * options.bodySpacing;
}
if (footerLineCount) {
height += options.footerMarginTop + footerLineCount * footerFont.lineHeight + (footerLineCount - 1) * options.footerSpacing;
}
let widthPadding = 0;
const maxLineWidth = function(line) {
width = Math.max(width, ctx.measureText(line).width + widthPadding);
};
ctx.save();
ctx.font = titleFont.string;
each(tooltip.title, maxLineWidth);
ctx.font = bodyFont.string;
each(tooltip.beforeBody.concat(tooltip.afterBody), maxLineWidth);
widthPadding = options.displayColors ? boxWidth + 2 + options.boxPadding : 0;
each(body, (bodyItem) => {
each(bodyItem.before, maxLineWidth);
each(bodyItem.lines, maxLineWidth);
each(bodyItem.after, maxLineWidth);
});
widthPadding = 0;
ctx.font = footerFont.string;
each(tooltip.footer, maxLineWidth);
ctx.restore();
width += padding.width;
return { width, height };
}
function determineYAlign(chart, size) {
const { y: y4, height } = size;
if (y4 < height / 2) {
return "top";
} else if (y4 > chart.height - height / 2) {
return "bottom";
}
return "center";
}
function doesNotFitWithAlign(xAlign, chart, options, size) {
const { x: x4, width } = size;
const caret = options.caretSize + options.caretPadding;
if (xAlign === "left" && x4 + width + caret > chart.width) {
return true;
}
if (xAlign === "right" && x4 - width - caret < 0) {
return true;
}
}
function determineXAlign(chart, options, size, yAlign) {
const { x: x4, width } = size;
const { width: chartWidth, chartArea: { left: left2, right: right2 } } = chart;
let xAlign = "center";
if (yAlign === "center") {
xAlign = x4 <= (left2 + right2) / 2 ? "left" : "right";
} else if (x4 <= width / 2) {
xAlign = "left";
} else if (x4 >= chartWidth - width / 2) {
xAlign = "right";
}
if (doesNotFitWithAlign(xAlign, chart, options, size)) {
xAlign = "center";
}
return xAlign;
}
function determineAlignment(chart, options, size) {
const yAlign = size.yAlign || options.yAlign || determineYAlign(chart, size);
return {
xAlign: size.xAlign || options.xAlign || determineXAlign(chart, options, size, yAlign),
yAlign
};
}
function alignX(size, xAlign) {
let { x: x4, width } = size;
if (xAlign === "right") {
x4 -= width;
} else if (xAlign === "center") {
x4 -= width / 2;
}
return x4;
}
function alignY(size, yAlign, paddingAndSize) {
let { y: y4, height } = size;
if (yAlign === "top") {
y4 += paddingAndSize;
} else if (yAlign === "bottom") {
y4 -= height + paddingAndSize;
} else {
y4 -= height / 2;
}
return y4;
}
function getBackgroundPoint(options, size, alignment, chart) {
const { caretSize, caretPadding, cornerRadius } = options;
const { xAlign, yAlign } = alignment;
const paddingAndSize = caretSize + caretPadding;
const { topLeft, topRight, bottomLeft, bottomRight } = toTRBLCorners(cornerRadius);
let x4 = alignX(size, xAlign);
const y4 = alignY(size, yAlign, paddingAndSize);
if (yAlign === "center") {
if (xAlign === "left") {
x4 += paddingAndSize;
} else if (xAlign === "right") {
x4 -= paddingAndSize;
}
} else if (xAlign === "left") {
x4 -= Math.max(topLeft, bottomLeft) + caretSize;
} else if (xAlign === "right") {
x4 += Math.max(topRight, bottomRight) + caretSize;
}
return {
x: _limitValue(x4, 0, chart.width - size.width),
y: _limitValue(y4, 0, chart.height - size.height)
};
}
function getAlignedX(tooltip, align, options) {
const padding = toPadding(options.padding);
return align === "center" ? tooltip.x + tooltip.width / 2 : align === "right" ? tooltip.x + tooltip.width - padding.right : tooltip.x + padding.left;
}
function getBeforeAfterBodyLines(callback2) {
return pushOrConcat([], splitNewlines(callback2));
}
function createTooltipContext(parent, tooltip, tooltipItems) {
return createContext(parent, {
tooltip,
tooltipItems,
type: "tooltip"
});
}
function overrideCallbacks(callbacks, context) {
const override = context && context.dataset && context.dataset.tooltip && context.dataset.tooltip.callbacks;
return override ? callbacks.override(override) : callbacks;
}
function findOrAddLabel(labels, raw, index3, addedLabels) {
const first3 = labels.indexOf(raw);
if (first3 === -1) {
return addIfString(labels, raw, index3, addedLabels);
}
const last = labels.lastIndexOf(raw);
return first3 !== last ? index3 : first3;
}
function generateTicks$1(generationOptions, dataRange) {
const ticks = [];
const MIN_SPACING = 1e-14;
const { bounds, step, min: min2, max: max2, precision, count, maxTicks, maxDigits, includeBounds } = generationOptions;
const unit = step || 1;
const maxSpaces = maxTicks - 1;
const { min: rmin, max: rmax } = dataRange;
const minDefined = !isNullOrUndef(min2);
const maxDefined = !isNullOrUndef(max2);
const countDefined = !isNullOrUndef(count);
const minSpacing = (rmax - rmin) / (maxDigits + 1);
let spacing = niceNum((rmax - rmin) / maxSpaces / unit) * unit;
let factor, niceMin, niceMax, numSpaces;
if (spacing < MIN_SPACING && !minDefined && !maxDefined) {
return [{ value: rmin }, { value: rmax }];
}
numSpaces = Math.ceil(rmax / spacing) - Math.floor(rmin / spacing);
if (numSpaces > maxSpaces) {
spacing = niceNum(numSpaces * spacing / maxSpaces / unit) * unit;
}
if (!isNullOrUndef(precision)) {
factor = Math.pow(10, precision);
spacing = Math.ceil(spacing * factor) / factor;
}
if (bounds === "ticks") {
niceMin = Math.floor(rmin / spacing) * spacing;
niceMax = Math.ceil(rmax / spacing) * spacing;
} else {
niceMin = rmin;
niceMax = rmax;
}
if (minDefined && maxDefined && step && almostWhole((max2 - min2) / step, spacing / 1e3)) {
numSpaces = Math.round(Math.min((max2 - min2) / spacing, maxTicks));
spacing = (max2 - min2) / numSpaces;
niceMin = min2;
niceMax = max2;
} else if (countDefined) {
niceMin = minDefined ? min2 : niceMin;
niceMax = maxDefined ? max2 : niceMax;
numSpaces = count - 1;
spacing = (niceMax - niceMin) / numSpaces;
} else {
numSpaces = (niceMax - niceMin) / spacing;
if (almostEquals(numSpaces, Math.round(numSpaces), spacing / 1e3)) {
numSpaces = Math.round(numSpaces);
} else {
numSpaces = Math.ceil(numSpaces);
}
}
const decimalPlaces = Math.max(
_decimalPlaces(spacing),
_decimalPlaces(niceMin)
);
factor = Math.pow(10, isNullOrUndef(precision) ? decimalPlaces : precision);
niceMin = Math.round(niceMin * factor) / factor;
niceMax = Math.round(niceMax * factor) / factor;
let j4 = 0;
if (minDefined) {
if (includeBounds && niceMin !== min2) {
ticks.push({ value: min2 });
if (niceMin < min2) {
j4++;
}
if (almostEquals(Math.round((niceMin + j4 * spacing) * factor) / factor, min2, relativeLabelSize(min2, minSpacing, generationOptions))) {
j4++;
}
} else if (niceMin < min2) {
j4++;
}
}
for (; j4 < numSpaces; ++j4) {
ticks.push({ value: Math.round((niceMin + j4 * spacing) * factor) / factor });
}
if (maxDefined && includeBounds && niceMax !== max2) {
if (ticks.length && almostEquals(ticks[ticks.length - 1].value, max2, relativeLabelSize(max2, minSpacing, generationOptions))) {
ticks[ticks.length - 1].value = max2;
} else {
ticks.push({ value: max2 });
}
} else if (!maxDefined || niceMax === max2) {
ticks.push({ value: niceMax });
}
return ticks;
}
function relativeLabelSize(value, minSpacing, { horizontal, minRotation }) {
const rad = toRadians(minRotation);
const ratio = (horizontal ? Math.sin(rad) : Math.cos(rad)) || 1e-3;
const length = 0.75 * minSpacing * ("" + value).length;
return Math.min(minSpacing / ratio, length);
}
function isMajor(tickVal) {
const remain = tickVal / Math.pow(10, Math.floor(log10(tickVal)));
return remain === 1;
}
function generateTicks(generationOptions, dataRange) {
const endExp = Math.floor(log10(dataRange.max));
const endSignificand = Math.ceil(dataRange.max / Math.pow(10, endExp));
const ticks = [];
let tickVal = finiteOrDefault(generationOptions.min, Math.pow(10, Math.floor(log10(dataRange.min))));
let exp = Math.floor(log10(tickVal));
let significand = Math.floor(tickVal / Math.pow(10, exp));
let precision = exp < 0 ? Math.pow(10, Math.abs(exp)) : 1;
do {
ticks.push({ value: tickVal, major: isMajor(tickVal) });
++significand;
if (significand === 10) {
significand = 1;
++exp;
precision = exp >= 0 ? 1 : precision;
}
tickVal = Math.round(significand * Math.pow(10, exp) * precision) / precision;
} while (exp < endExp || exp === endExp && significand < endSignificand);
const lastTick = finiteOrDefault(generationOptions.max, tickVal);
ticks.push({ value: lastTick, major: isMajor(tickVal) });
return ticks;
}
function getTickBackdropHeight(opts) {
const tickOpts = opts.ticks;
if (tickOpts.display && opts.display) {
const padding = toPadding(tickOpts.backdropPadding);
return valueOrDefault(tickOpts.font && tickOpts.font.size, defaults.font.size) + padding.height;
}
return 0;
}
function measureLabelSize(ctx, font, label) {
label = isArray(label) ? label : [label];
return {
w: _longestText(ctx, font.string, label),
h: label.length * font.lineHeight
};
}
function determineLimits(angle, pos, size, min2, max2) {
if (angle === min2 || angle === max2) {
return {
start: pos - size / 2,
end: pos + size / 2
};
} else if (angle < min2 || angle > max2) {
return {
start: pos - size,
end: pos
};
}
return {
start: pos,
end: pos + size
};
}
function fitWithPointLabels(scale) {
const orig = {
l: scale.left + scale._padding.left,
r: scale.right - scale._padding.right,
t: scale.top + scale._padding.top,
b: scale.bottom - scale._padding.bottom
};
const limits = Object.assign({}, orig);
const labelSizes = [];
const padding = [];
const valueCount = scale._pointLabels.length;
const pointLabelOpts = scale.options.pointLabels;
const additionalAngle = pointLabelOpts.centerPointLabels ? PI / valueCount : 0;
for (let i5 = 0; i5 < valueCount; i5++) {
const opts = pointLabelOpts.setContext(scale.getPointLabelContext(i5));
padding[i5] = opts.padding;
const pointPosition = scale.getPointPosition(i5, scale.drawingArea + padding[i5], additionalAngle);
const plFont = toFont(opts.font);
const textSize = measureLabelSize(scale.ctx, plFont, scale._pointLabels[i5]);
labelSizes[i5] = textSize;
const angleRadians = _normalizeAngle(scale.getIndexAngle(i5) + additionalAngle);
const angle = Math.round(toDegrees(angleRadians));
const hLimits = determineLimits(angle, pointPosition.x, textSize.w, 0, 180);
const vLimits = determineLimits(angle, pointPosition.y, textSize.h, 90, 270);
updateLimits(limits, orig, angleRadians, hLimits, vLimits);
}
scale.setCenterPoint(
orig.l - limits.l,
limits.r - orig.r,
orig.t - limits.t,
limits.b - orig.b
);
scale._pointLabelItems = buildPointLabelItems(scale, labelSizes, padding);
}
function updateLimits(limits, orig, angle, hLimits, vLimits) {
const sin = Math.abs(Math.sin(angle));
const cos = Math.abs(Math.cos(angle));
let x4 = 0;
let y4 = 0;
if (hLimits.start < orig.l) {
x4 = (orig.l - hLimits.start) / sin;
limits.l = Math.min(limits.l, orig.l - x4);
} else if (hLimits.end > orig.r) {
x4 = (hLimits.end - orig.r) / sin;
limits.r = Math.max(limits.r, orig.r + x4);
}
if (vLimits.start < orig.t) {
y4 = (orig.t - vLimits.start) / cos;
limits.t = Math.min(limits.t, orig.t - y4);
} else if (vLimits.end > orig.b) {
y4 = (vLimits.end - orig.b) / cos;
limits.b = Math.max(limits.b, orig.b + y4);
}
}
function buildPointLabelItems(scale, labelSizes, padding) {
const items = [];
const valueCount = scale._pointLabels.length;
const opts = scale.options;
const extra = getTickBackdropHeight(opts) / 2;
const outerDistance = scale.drawingArea;
const additionalAngle = opts.pointLabels.centerPointLabels ? PI / valueCount : 0;
for (let i5 = 0; i5 < valueCount; i5++) {
const pointLabelPosition = scale.getPointPosition(i5, outerDistance + extra + padding[i5], additionalAngle);
const angle = Math.round(toDegrees(_normalizeAngle(pointLabelPosition.angle + HALF_PI)));
const size = labelSizes[i5];
const y4 = yForAngle(pointLabelPosition.y, size.h, angle);
const textAlign = getTextAlignForAngle(angle);
const left2 = leftForTextAlign(pointLabelPosition.x, size.w, textAlign);
items.push({
x: pointLabelPosition.x,
y: y4,
textAlign,
left: left2,
top: y4,
right: left2 + size.w,
bottom: y4 + size.h
});
}
return items;
}
function getTextAlignForAngle(angle) {
if (angle === 0 || angle === 180) {
return "center";
} else if (angle < 180) {
return "left";
}
return "right";
}
function leftForTextAlign(x4, w4, align) {
if (align === "right") {
x4 -= w4;
} else if (align === "center") {
x4 -= w4 / 2;
}
return x4;
}
function yForAngle(y4, h6, angle) {
if (angle === 90 || angle === 270) {
y4 -= h6 / 2;
} else if (angle > 270 || angle < 90) {
y4 -= h6;
}
return y4;
}
function drawPointLabels(scale, labelCount) {
const { ctx, options: { pointLabels } } = scale;
for (let i5 = labelCount - 1; i5 >= 0; i5--) {
const optsAtIndex = pointLabels.setContext(scale.getPointLabelContext(i5));
const plFont = toFont(optsAtIndex.font);
const { x: x4, y: y4, textAlign, left: left2, top: top2, right: right2, bottom: bottom2 } = scale._pointLabelItems[i5];
const { backdropColor } = optsAtIndex;
if (!isNullOrUndef(backdropColor)) {
const padding = toPadding(optsAtIndex.backdropPadding);
ctx.fillStyle = backdropColor;
ctx.fillRect(left2 - padding.left, top2 - padding.top, right2 - left2 + padding.width, bottom2 - top2 + padding.height);
}
renderText(
ctx,
scale._pointLabels[i5],
x4,
y4 + plFont.lineHeight / 2,
plFont,
{
color: optsAtIndex.color,
textAlign,
textBaseline: "middle"
}
);
}
}
function pathRadiusLine(scale, radius, circular, labelCount) {
const { ctx } = scale;
if (circular) {
ctx.arc(scale.xCenter, scale.yCenter, radius, 0, TAU);
} else {
let pointPosition = scale.getPointPosition(0, radius);
ctx.moveTo(pointPosition.x, pointPosition.y);
for (let i5 = 1; i5 < labelCount; i5++) {
pointPosition = scale.getPointPosition(i5, radius);
ctx.lineTo(pointPosition.x, pointPosition.y);
}
}
}
function drawRadiusLine(scale, gridLineOpts, radius, labelCount) {
const ctx = scale.ctx;
const circular = gridLineOpts.circular;
const { color: color2, lineWidth } = gridLineOpts;
if (!circular && !labelCount || !color2 || !lineWidth || radius < 0) {
return;
}
ctx.save();
ctx.strokeStyle = color2;
ctx.lineWidth = lineWidth;
ctx.setLineDash(gridLineOpts.borderDash);
ctx.lineDashOffset = gridLineOpts.borderDashOffset;
ctx.beginPath();
pathRadiusLine(scale, radius, circular, labelCount);
ctx.closePath();
ctx.stroke();
ctx.restore();
}
function createPointLabelContext(parent, index3, label) {
return createContext(parent, {
label,
index: index3,
type: "pointLabel"
});
}
function sorter(a5, b4) {
return a5 - b4;
}
function parse(scale, input) {
if (isNullOrUndef(input)) {
return null;
}
const adapter = scale._adapter;
const { parser, round: round3, isoWeekday } = scale._parseOpts;
let value = input;
if (typeof parser === "function") {
value = parser(value);
}
if (!isNumberFinite(value)) {
value = typeof parser === "string" ? adapter.parse(value, parser) : adapter.parse(value);
}
if (value === null) {
return null;
}
if (round3) {
value = round3 === "week" && (isNumber(isoWeekday) || isoWeekday === true) ? adapter.startOf(value, "isoWeek", isoWeekday) : adapter.startOf(value, round3);
}
return +value;
}
function determineUnitForAutoTicks(minUnit, min2, max2, capacity) {
const ilen = UNITS.length;
for (let i5 = UNITS.indexOf(minUnit); i5 < ilen - 1; ++i5) {
const interval = INTERVALS[UNITS[i5]];
const factor = interval.steps ? interval.steps : Number.MAX_SAFE_INTEGER;
if (interval.common && Math.ceil((max2 - min2) / (factor * interval.size)) <= capacity) {
return UNITS[i5];
}
}
return UNITS[ilen - 1];
}
function determineUnitForFormatting(scale, numTicks, minUnit, min2, max2) {
for (let i5 = UNITS.length - 1; i5 >= UNITS.indexOf(minUnit); i5--) {
const unit = UNITS[i5];
if (INTERVALS[unit].common && scale._adapter.diff(max2, min2, unit) >= numTicks - 1) {
return unit;
}
}
return UNITS[minUnit ? UNITS.indexOf(minUnit) : 0];
}
function determineMajorUnit(unit) {
for (let i5 = UNITS.indexOf(unit) + 1, ilen = UNITS.length; i5 < ilen; ++i5) {
if (INTERVALS[UNITS[i5]].common) {
return UNITS[i5];
}
}
}
function addTick(ticks, time, timestamps) {
if (!timestamps) {
ticks[time] = true;
} else if (timestamps.length) {
const { lo, hi: hi2 } = _lookup(timestamps, time);
const timestamp = timestamps[lo] >= time ? timestamps[lo] : timestamps[hi2];
ticks[timestamp] = true;
}
}
function setMajorTicks(scale, ticks, map3, majorUnit) {
const adapter = scale._adapter;
const first3 = +adapter.startOf(ticks[0].value, majorUnit);
const last = ticks[ticks.length - 1].value;
let major, index3;
for (major = first3; major <= last; major = +adapter.add(major, 1, majorUnit)) {
index3 = map3[major];
if (index3 >= 0) {
ticks[index3].major = true;
}
}
return ticks;
}
function ticksFromTimestamps(scale, values, majorUnit) {
const ticks = [];
const map3 = {};
const ilen = values.length;
let i5, value;
for (i5 = 0; i5 < ilen; ++i5) {
value = values[i5];
map3[value] = i5;
ticks.push({
value,
major: false
});
}
return ilen === 0 || !majorUnit ? ticks : setMajorTicks(scale, ticks, map3, majorUnit);
}
function interpolate(table, val, reverse) {
let lo = 0;
let hi2 = table.length - 1;
let prevSource, nextSource, prevTarget, nextTarget;
if (reverse) {
if (val >= table[lo].pos && val <= table[hi2].pos) {
({ lo, hi: hi2 } = _lookupByKey(table, "pos", val));
}
({ pos: prevSource, time: prevTarget } = table[lo]);
({ pos: nextSource, time: nextTarget } = table[hi2]);
} else {
if (val >= table[lo].time && val <= table[hi2].time) {
({ lo, hi: hi2 } = _lookupByKey(table, "time", val));
}
({ time: prevSource, pos: prevTarget } = table[lo]);
({ time: nextSource, pos: nextTarget } = table[hi2]);
}
const span = nextSource - prevSource;
return span ? prevTarget + (nextTarget - prevTarget) * (val - prevSource) / span : prevTarget;
}
var Animator, animator, transparent, interpolators, Animation, numbers, colors, animationOptions, Animations, isDirectUpdateMode, cloneIfNotShared, createStack, DatasetController, BarController, BubbleController, DoughnutController, LineController, PolarAreaController, PieController, RadarController, ScatterController, controllers, DateAdapter, adapters, Interaction, STATIC_POSITIONS, layouts, BasePlatform, BasicPlatform, EXPANDO_KEY, EVENT_TYPES, isNullOrEmpty, eventListenerOptions, drpListeningCharts, oldDevicePixelRatio, DomPlatform, Element2, formatters, Ticks, reverseAlign, offsetFromEdge, Scale, TypedRegistry, Registry, registry, PluginService, keyCache, keysCached, addIfFound, Config, hasFunction, version, KNOWN_POSITIONS, instances, getChart, Chart, invalidatePlugins, enumerable, ArcElement, usePath2D, LineElement, PointElement, BarElement, elements, plugin_decimation, simpleArc, plugin_filler, getBoxSize, itemsEqual, Legend, plugin_legend, Title, plugin_title, map2, plugin_subtitle, positioners, Tooltip, plugin_tooltip, plugins, addIfString, validIndex, CategoryScale, LinearScaleBase, LinearScale, LogarithmicScale, RadialLinearScale, INTERVALS, UNITS, TimeScale, TimeSeriesScale, scales, registerables;
var init_chart_esm = __esm({
"node_modules/chartkick/node_modules/chart.js/dist/chart.esm.js"() {
init_helpers_segment();
init_helpers_segment();
Animator = class {
constructor() {
this._request = null;
this._charts = /* @__PURE__ */ new Map();
this._running = false;
this._lastDate = void 0;
}
_notify(chart, anims, date, type) {
const callbacks = anims.listeners[type];
const numSteps = anims.duration;
callbacks.forEach((fn3) => fn3({
chart,
initial: anims.initial,
numSteps,
currentStep: Math.min(date - anims.start, numSteps)
}));
}
_refresh() {
if (this._request) {
return;
}
this._running = true;
this._request = requestAnimFrame.call(window, () => {
this._update();
this._request = null;
if (this._running) {
this._refresh();
}
});
}
_update(date = Date.now()) {
let remaining = 0;
this._charts.forEach((anims, chart) => {
if (!anims.running || !anims.items.length) {
return;
}
const items = anims.items;
let i5 = items.length - 1;
let draw2 = false;
let item;
for (; i5 >= 0; --i5) {
item = items[i5];
if (item._active) {
if (item._total > anims.duration) {
anims.duration = item._total;
}
item.tick(date);
draw2 = true;
} else {
items[i5] = items[items.length - 1];
items.pop();
}
}
if (draw2) {
chart.draw();
this._notify(chart, anims, date, "progress");
}
if (!items.length) {
anims.running = false;
this._notify(chart, anims, date, "complete");
anims.initial = false;
}
remaining += items.length;
});
this._lastDate = date;
if (remaining === 0) {
this._running = false;
}
}
_getAnims(chart) {
const charts = this._charts;
let anims = charts.get(chart);
if (!anims) {
anims = {
running: false,
initial: true,
items: [],
listeners: {
complete: [],
progress: []
}
};
charts.set(chart, anims);
}
return anims;
}
listen(chart, event2, cb) {
this._getAnims(chart).listeners[event2].push(cb);
}
add(chart, items) {
if (!items || !items.length) {
return;
}
this._getAnims(chart).items.push(...items);
}
has(chart) {
return this._getAnims(chart).items.length > 0;
}
start(chart) {
const anims = this._charts.get(chart);
if (!anims) {
return;
}
anims.running = true;
anims.start = Date.now();
anims.duration = anims.items.reduce((acc, cur) => Math.max(acc, cur._duration), 0);
this._refresh();
}
running(chart) {
if (!this._running) {
return false;
}
const anims = this._charts.get(chart);
if (!anims || !anims.running || !anims.items.length) {
return false;
}
return true;
}
stop(chart) {
const anims = this._charts.get(chart);
if (!anims || !anims.items.length) {
return;
}
const items = anims.items;
let i5 = items.length - 1;
for (; i5 >= 0; --i5) {
items[i5].cancel();
}
anims.items = [];
this._notify(chart, anims, Date.now(), "complete");
}
remove(chart) {
return this._charts.delete(chart);
}
};
animator = new Animator();
transparent = "transparent";
interpolators = {
boolean(from, to, factor) {
return factor > 0.5 ? to : from;
},
color(from, to, factor) {
const c0 = color(from || transparent);
const c1 = c0.valid && color(to || transparent);
return c1 && c1.valid ? c1.mix(c0, factor).hexString() : to;
},
number(from, to, factor) {
return from + (to - from) * factor;
}
};
Animation = class {
constructor(cfg, target, prop, to) {
const currentValue = target[prop];
to = resolve([cfg.to, to, currentValue, cfg.from]);
const from = resolve([cfg.from, currentValue, to]);
this._active = true;
this._fn = cfg.fn || interpolators[cfg.type || typeof from];
this._easing = effects[cfg.easing] || effects.linear;
this._start = Math.floor(Date.now() + (cfg.delay || 0));
this._duration = this._total = Math.floor(cfg.duration);
this._loop = !!cfg.loop;
this._target = target;
this._prop = prop;
this._from = from;
this._to = to;
this._promises = void 0;
}
active() {
return this._active;
}
update(cfg, to, date) {
if (this._active) {
this._notify(false);
const currentValue = this._target[this._prop];
const elapsed = date - this._start;
const remain = this._duration - elapsed;
this._start = date;
this._duration = Math.floor(Math.max(remain, cfg.duration));
this._total += elapsed;
this._loop = !!cfg.loop;
this._to = resolve([cfg.to, to, currentValue, cfg.from]);
this._from = resolve([cfg.from, currentValue, to]);
}
}
cancel() {
if (this._active) {
this.tick(Date.now());
this._active = false;
this._notify(false);
}
}
tick(date) {
const elapsed = date - this._start;
const duration2 = this._duration;
const prop = this._prop;
const from = this._from;
const loop = this._loop;
const to = this._to;
let factor;
this._active = from !== to && (loop || elapsed < duration2);
if (!this._active) {
this._target[prop] = to;
this._notify(true);
return;
}
if (elapsed < 0) {
this._target[prop] = from;
return;
}
factor = elapsed / duration2 % 2;
factor = loop && factor > 1 ? 2 - factor : factor;
factor = this._easing(Math.min(1, Math.max(0, factor)));
this._target[prop] = this._fn(from, to, factor);
}
wait() {
const promises = this._promises || (this._promises = []);
return new Promise((res, rej) => {
promises.push({ res, rej });
});
}
_notify(resolved) {
const method = resolved ? "res" : "rej";
const promises = this._promises || [];
for (let i5 = 0; i5 < promises.length; i5++) {
promises[i5][method]();
}
}
};
numbers = ["x", "y", "borderWidth", "radius", "tension"];
colors = ["color", "borderColor", "backgroundColor"];
defaults.set("animation", {
delay: void 0,
duration: 1e3,
easing: "easeOutQuart",
fn: void 0,
from: void 0,
loop: void 0,
to: void 0,
type: void 0
});
animationOptions = Object.keys(defaults.animation);
defaults.describe("animation", {
_fallback: false,
_indexable: false,
_scriptable: (name) => name !== "onProgress" && name !== "onComplete" && name !== "fn"
});
defaults.set("animations", {
colors: {
type: "color",
properties: colors
},
numbers: {
type: "number",
properties: numbers
}
});
defaults.describe("animations", {
_fallback: "animation"
});
defaults.set("transitions", {
active: {
animation: {
duration: 400
}
},
resize: {
animation: {
duration: 0
}
},
show: {
animations: {
colors: {
from: "transparent"
},
visible: {
type: "boolean",
duration: 0
}
}
},
hide: {
animations: {
colors: {
to: "transparent"
},
visible: {
type: "boolean",
easing: "linear",
fn: (v4) => v4 | 0
}
}
}
});
Animations = class {
constructor(chart, config2) {
this._chart = chart;
this._properties = /* @__PURE__ */ new Map();
this.configure(config2);
}
configure(config2) {
if (!isObject(config2)) {
return;
}
const animatedProps = this._properties;
Object.getOwnPropertyNames(config2).forEach((key) => {
const cfg = config2[key];
if (!isObject(cfg)) {
return;
}
const resolved = {};
for (const option2 of animationOptions) {
resolved[option2] = cfg[option2];
}
(isArray(cfg.properties) && cfg.properties || [key]).forEach((prop) => {
if (prop === key || !animatedProps.has(prop)) {
animatedProps.set(prop, resolved);
}
});
});
}
_animateOptions(target, values) {
const newOptions = values.options;
const options = resolveTargetOptions(target, newOptions);
if (!options) {
return [];
}
const animations = this._createAnimations(options, newOptions);
if (newOptions.$shared) {
awaitAll(target.options.$animations, newOptions).then(() => {
target.options = newOptions;
}, () => {
});
}
return animations;
}
_createAnimations(target, values) {
const animatedProps = this._properties;
const animations = [];
const running = target.$animations || (target.$animations = {});
const props = Object.keys(values);
const date = Date.now();
let i5;
for (i5 = props.length - 1; i5 >= 0; --i5) {
const prop = props[i5];
if (prop.charAt(0) === "$") {
continue;
}
if (prop === "options") {
animations.push(...this._animateOptions(target, values));
continue;
}
const value = values[prop];
let animation = running[prop];
const cfg = animatedProps.get(prop);
if (animation) {
if (cfg && animation.active()) {
animation.update(cfg, value, date);
continue;
} else {
animation.cancel();
}
}
if (!cfg || !cfg.duration) {
target[prop] = value;
continue;
}
running[prop] = animation = new Animation(cfg, target, prop, value);
animations.push(animation);
}
return animations;
}
update(target, values) {
if (this._properties.size === 0) {
Object.assign(target, values);
return;
}
const animations = this._createAnimations(target, values);
if (animations.length) {
animator.add(this._chart, animations);
return true;
}
}
};
isDirectUpdateMode = (mode) => mode === "reset" || mode === "none";
cloneIfNotShared = (cached, shared) => shared ? cached : Object.assign({}, cached);
createStack = (canStack, meta, chart) => canStack && !meta.hidden && meta._stacked && { keys: getSortedDatasetIndices(chart, true), values: null };
DatasetController = class {
constructor(chart, datasetIndex) {
this.chart = chart;
this._ctx = chart.ctx;
this.index = datasetIndex;
this._cachedDataOpts = {};
this._cachedMeta = this.getMeta();
this._type = this._cachedMeta.type;
this.options = void 0;
this._parsing = false;
this._data = void 0;
this._objectData = void 0;
this._sharedOptions = void 0;
this._drawStart = void 0;
this._drawCount = void 0;
this.enableOptionSharing = false;
this.$context = void 0;
this._syncList = [];
this.initialize();
}
initialize() {
const meta = this._cachedMeta;
this.configure();
this.linkScales();
meta._stacked = isStacked(meta.vScale, meta);
this.addElements();
}
updateIndex(datasetIndex) {
if (this.index !== datasetIndex) {
clearStacks(this._cachedMeta);
}
this.index = datasetIndex;
}
linkScales() {
const chart = this.chart;
const meta = this._cachedMeta;
const dataset = this.getDataset();
const chooseId = (axis, x4, y4, r6) => axis === "x" ? x4 : axis === "r" ? r6 : y4;
const xid = meta.xAxisID = valueOrDefault(dataset.xAxisID, getFirstScaleId(chart, "x"));
const yid = meta.yAxisID = valueOrDefault(dataset.yAxisID, getFirstScaleId(chart, "y"));
const rid = meta.rAxisID = valueOrDefault(dataset.rAxisID, getFirstScaleId(chart, "r"));
const indexAxis = meta.indexAxis;
const iid = meta.iAxisID = chooseId(indexAxis, xid, yid, rid);
const vid = meta.vAxisID = chooseId(indexAxis, yid, xid, rid);
meta.xScale = this.getScaleForId(xid);
meta.yScale = this.getScaleForId(yid);
meta.rScale = this.getScaleForId(rid);
meta.iScale = this.getScaleForId(iid);
meta.vScale = this.getScaleForId(vid);
}
getDataset() {
return this.chart.data.datasets[this.index];
}
getMeta() {
return this.chart.getDatasetMeta(this.index);
}
getScaleForId(scaleID) {
return this.chart.scales[scaleID];
}
_getOtherScale(scale) {
const meta = this._cachedMeta;
return scale === meta.iScale ? meta.vScale : meta.iScale;
}
reset() {
this._update("reset");
}
_destroy() {
const meta = this._cachedMeta;
if (this._data) {
unlistenArrayEvents(this._data, this);
}
if (meta._stacked) {
clearStacks(meta);
}
}
_dataCheck() {
const dataset = this.getDataset();
const data = dataset.data || (dataset.data = []);
const _data = this._data;
if (isObject(data)) {
this._data = convertObjectDataToArray(data);
} else if (_data !== data) {
if (_data) {
unlistenArrayEvents(_data, this);
const meta = this._cachedMeta;
clearStacks(meta);
meta._parsed = [];
}
if (data && Object.isExtensible(data)) {
listenArrayEvents(data, this);
}
this._syncList = [];
this._data = data;
}
}
addElements() {
const meta = this._cachedMeta;
this._dataCheck();
if (this.datasetElementType) {
meta.dataset = new this.datasetElementType();
}
}
buildOrUpdateElements(resetNewElements) {
const meta = this._cachedMeta;
const dataset = this.getDataset();
let stackChanged = false;
this._dataCheck();
const oldStacked = meta._stacked;
meta._stacked = isStacked(meta.vScale, meta);
if (meta.stack !== dataset.stack) {
stackChanged = true;
clearStacks(meta);
meta.stack = dataset.stack;
}
this._resyncElements(resetNewElements);
if (stackChanged || oldStacked !== meta._stacked) {
updateStacks(this, meta._parsed);
}
}
configure() {
const config2 = this.chart.config;
const scopeKeys = config2.datasetScopeKeys(this._type);
const scopes = config2.getOptionScopes(this.getDataset(), scopeKeys, true);
this.options = config2.createResolver(scopes, this.getContext());
this._parsing = this.options.parsing;
this._cachedDataOpts = {};
}
parse(start3, count) {
const { _cachedMeta: meta, _data: data } = this;
const { iScale, _stacked } = meta;
const iAxis = iScale.axis;
let sorted = start3 === 0 && count === data.length ? true : meta._sorted;
let prev = start3 > 0 && meta._parsed[start3 - 1];
let i5, cur, parsed;
if (this._parsing === false) {
meta._parsed = data;
meta._sorted = true;
parsed = data;
} else {
if (isArray(data[start3])) {
parsed = this.parseArrayData(meta, data, start3, count);
} else if (isObject(data[start3])) {
parsed = this.parseObjectData(meta, data, start3, count);
} else {
parsed = this.parsePrimitiveData(meta, data, start3, count);
}
const isNotInOrderComparedToPrev = () => cur[iAxis] === null || prev && cur[iAxis] < prev[iAxis];
for (i5 = 0; i5 < count; ++i5) {
meta._parsed[i5 + start3] = cur = parsed[i5];
if (sorted) {
if (isNotInOrderComparedToPrev()) {
sorted = false;
}
prev = cur;
}
}
meta._sorted = sorted;
}
if (_stacked) {
updateStacks(this, parsed);
}
}
parsePrimitiveData(meta, data, start3, count) {
const { iScale, vScale } = meta;
const iAxis = iScale.axis;
const vAxis = vScale.axis;
const labels = iScale.getLabels();
const singleScale = iScale === vScale;
const parsed = new Array(count);
let i5, ilen, index3;
for (i5 = 0, ilen = count; i5 < ilen; ++i5) {
index3 = i5 + start3;
parsed[i5] = {
[iAxis]: singleScale || iScale.parse(labels[index3], index3),
[vAxis]: vScale.parse(data[index3], index3)
};
}
return parsed;
}
parseArrayData(meta, data, start3, count) {
const { xScale, yScale } = meta;
const parsed = new Array(count);
let i5, ilen, index3, item;
for (i5 = 0, ilen = count; i5 < ilen; ++i5) {
index3 = i5 + start3;
item = data[index3];
parsed[i5] = {
x: xScale.parse(item[0], index3),
y: yScale.parse(item[1], index3)
};
}
return parsed;
}
parseObjectData(meta, data, start3, count) {
const { xScale, yScale } = meta;
const { xAxisKey = "x", yAxisKey = "y" } = this._parsing;
const parsed = new Array(count);
let i5, ilen, index3, item;
for (i5 = 0, ilen = count; i5 < ilen; ++i5) {
index3 = i5 + start3;
item = data[index3];
parsed[i5] = {
x: xScale.parse(resolveObjectKey(item, xAxisKey), index3),
y: yScale.parse(resolveObjectKey(item, yAxisKey), index3)
};
}
return parsed;
}
getParsed(index3) {
return this._cachedMeta._parsed[index3];
}
getDataElement(index3) {
return this._cachedMeta.data[index3];
}
applyStack(scale, parsed, mode) {
const chart = this.chart;
const meta = this._cachedMeta;
const value = parsed[scale.axis];
const stack = {
keys: getSortedDatasetIndices(chart, true),
values: parsed._stacks[scale.axis]
};
return applyStack(stack, value, meta.index, { mode });
}
updateRangeFromParsed(range2, scale, parsed, stack) {
const parsedValue = parsed[scale.axis];
let value = parsedValue === null ? NaN : parsedValue;
const values = stack && parsed._stacks[scale.axis];
if (stack && values) {
stack.values = values;
value = applyStack(stack, parsedValue, this._cachedMeta.index);
}
range2.min = Math.min(range2.min, value);
range2.max = Math.max(range2.max, value);
}
getMinMax(scale, canStack) {
const meta = this._cachedMeta;
const _parsed = meta._parsed;
const sorted = meta._sorted && scale === meta.iScale;
const ilen = _parsed.length;
const otherScale = this._getOtherScale(scale);
const stack = createStack(canStack, meta, this.chart);
const range2 = { min: Number.POSITIVE_INFINITY, max: Number.NEGATIVE_INFINITY };
const { min: otherMin, max: otherMax } = getUserBounds(otherScale);
let i5, parsed;
function _skip() {
parsed = _parsed[i5];
const otherValue = parsed[otherScale.axis];
return !isNumberFinite(parsed[scale.axis]) || otherMin > otherValue || otherMax < otherValue;
}
for (i5 = 0; i5 < ilen; ++i5) {
if (_skip()) {
continue;
}
this.updateRangeFromParsed(range2, scale, parsed, stack);
if (sorted) {
break;
}
}
if (sorted) {
for (i5 = ilen - 1; i5 >= 0; --i5) {
if (_skip()) {
continue;
}
this.updateRangeFromParsed(range2, scale, parsed, stack);
break;
}
}
return range2;
}
getAllParsedValues(scale) {
const parsed = this._cachedMeta._parsed;
const values = [];
let i5, ilen, value;
for (i5 = 0, ilen = parsed.length; i5 < ilen; ++i5) {
value = parsed[i5][scale.axis];
if (isNumberFinite(value)) {
values.push(value);
}
}
return values;
}
getMaxOverflow() {
return false;
}
getLabelAndValue(index3) {
const meta = this._cachedMeta;
const iScale = meta.iScale;
const vScale = meta.vScale;
const parsed = this.getParsed(index3);
return {
label: iScale ? "" + iScale.getLabelForValue(parsed[iScale.axis]) : "",
value: vScale ? "" + vScale.getLabelForValue(parsed[vScale.axis]) : ""
};
}
_update(mode) {
const meta = this._cachedMeta;
this.update(mode || "default");
meta._clip = toClip(valueOrDefault(this.options.clip, defaultClip(meta.xScale, meta.yScale, this.getMaxOverflow())));
}
update(mode) {
}
draw() {
const ctx = this._ctx;
const chart = this.chart;
const meta = this._cachedMeta;
const elements2 = meta.data || [];
const area = chart.chartArea;
const active = [];
const start3 = this._drawStart || 0;
const count = this._drawCount || elements2.length - start3;
const drawActiveElementsOnTop = this.options.drawActiveElementsOnTop;
let i5;
if (meta.dataset) {
meta.dataset.draw(ctx, area, start3, count);
}
for (i5 = start3; i5 < start3 + count; ++i5) {
const element = elements2[i5];
if (element.hidden) {
continue;
}
if (element.active && drawActiveElementsOnTop) {
active.push(element);
} else {
element.draw(ctx, area);
}
}
for (i5 = 0; i5 < active.length; ++i5) {
active[i5].draw(ctx, area);
}
}
getStyle(index3, active) {
const mode = active ? "active" : "default";
return index3 === void 0 && this._cachedMeta.dataset ? this.resolveDatasetElementOptions(mode) : this.resolveDataElementOptions(index3 || 0, mode);
}
getContext(index3, active, mode) {
const dataset = this.getDataset();
let context;
if (index3 >= 0 && index3 < this._cachedMeta.data.length) {
const element = this._cachedMeta.data[index3];
context = element.$context || (element.$context = createDataContext(this.getContext(), index3, element));
context.parsed = this.getParsed(index3);
context.raw = dataset.data[index3];
context.index = context.dataIndex = index3;
} else {
context = this.$context || (this.$context = createDatasetContext(this.chart.getContext(), this.index));
context.dataset = dataset;
context.index = context.datasetIndex = this.index;
}
context.active = !!active;
context.mode = mode;
return context;
}
resolveDatasetElementOptions(mode) {
return this._resolveElementOptions(this.datasetElementType.id, mode);
}
resolveDataElementOptions(index3, mode) {
return this._resolveElementOptions(this.dataElementType.id, mode, index3);
}
_resolveElementOptions(elementType2, mode = "default", index3) {
const active = mode === "active";
const cache2 = this._cachedDataOpts;
const cacheKey = elementType2 + "-" + mode;
const cached = cache2[cacheKey];
const sharing = this.enableOptionSharing && defined(index3);
if (cached) {
return cloneIfNotShared(cached, sharing);
}
const config2 = this.chart.config;
const scopeKeys = config2.datasetElementScopeKeys(this._type, elementType2);
const prefixes = active ? [`${elementType2}Hover`, "hover", elementType2, ""] : [elementType2, ""];
const scopes = config2.getOptionScopes(this.getDataset(), scopeKeys);
const names2 = Object.keys(defaults.elements[elementType2]);
const context = () => this.getContext(index3, active);
const values = config2.resolveNamedOptions(scopes, names2, context, prefixes);
if (values.$shared) {
values.$shared = sharing;
cache2[cacheKey] = Object.freeze(cloneIfNotShared(values, sharing));
}
return values;
}
_resolveAnimations(index3, transition2, active) {
const chart = this.chart;
const cache2 = this._cachedDataOpts;
const cacheKey = `animation-${transition2}`;
const cached = cache2[cacheKey];
if (cached) {
return cached;
}
let options;
if (chart.options.animation !== false) {
const config2 = this.chart.config;
const scopeKeys = config2.datasetAnimationScopeKeys(this._type, transition2);
const scopes = config2.getOptionScopes(this.getDataset(), scopeKeys);
options = config2.createResolver(scopes, this.getContext(index3, active, transition2));
}
const animations = new Animations(chart, options && options.animations);
if (options && options._cacheable) {
cache2[cacheKey] = Object.freeze(animations);
}
return animations;
}
getSharedOptions(options) {
if (!options.$shared) {
return;
}
return this._sharedOptions || (this._sharedOptions = Object.assign({}, options));
}
includeOptions(mode, sharedOptions) {
return !sharedOptions || isDirectUpdateMode(mode) || this.chart._animationsDisabled;
}
updateElement(element, index3, properties, mode) {
if (isDirectUpdateMode(mode)) {
Object.assign(element, properties);
} else {
this._resolveAnimations(index3, mode).update(element, properties);
}
}
updateSharedOptions(sharedOptions, mode, newOptions) {
if (sharedOptions && !isDirectUpdateMode(mode)) {
this._resolveAnimations(void 0, mode).update(sharedOptions, newOptions);
}
}
_setStyle(element, index3, mode, active) {
element.active = active;
const options = this.getStyle(index3, active);
this._resolveAnimations(index3, mode, active).update(element, {
options: !active && this.getSharedOptions(options) || options
});
}
removeHoverStyle(element, datasetIndex, index3) {
this._setStyle(element, index3, "active", false);
}
setHoverStyle(element, datasetIndex, index3) {
this._setStyle(element, index3, "active", true);
}
_removeDatasetHoverStyle() {
const element = this._cachedMeta.dataset;
if (element) {
this._setStyle(element, void 0, "active", false);
}
}
_setDatasetHoverStyle() {
const element = this._cachedMeta.dataset;
if (element) {
this._setStyle(element, void 0, "active", true);
}
}
_resyncElements(resetNewElements) {
const data = this._data;
const elements2 = this._cachedMeta.data;
for (const [method, arg1, arg2] of this._syncList) {
this[method](arg1, arg2);
}
this._syncList = [];
const numMeta = elements2.length;
const numData = data.length;
const count = Math.min(numData, numMeta);
if (count) {
this.parse(0, count);
}
if (numData > numMeta) {
this._insertElements(numMeta, numData - numMeta, resetNewElements);
} else if (numData < numMeta) {
this._removeElements(numData, numMeta - numData);
}
}
_insertElements(start3, count, resetNewElements = true) {
const meta = this._cachedMeta;
const data = meta.data;
const end2 = start3 + count;
let i5;
const move = (arr) => {
arr.length += count;
for (i5 = arr.length - 1; i5 >= end2; i5--) {
arr[i5] = arr[i5 - count];
}
};
move(data);
for (i5 = start3; i5 < end2; ++i5) {
data[i5] = new this.dataElementType();
}
if (this._parsing) {
move(meta._parsed);
}
this.parse(start3, count);
if (resetNewElements) {
this.updateElements(data, start3, count, "reset");
}
}
updateElements(element, start3, count, mode) {
}
_removeElements(start3, count) {
const meta = this._cachedMeta;
if (this._parsing) {
const removed = meta._parsed.splice(start3, count);
if (meta._stacked) {
clearStacks(meta, removed);
}
}
meta.data.splice(start3, count);
}
_sync(args) {
if (this._parsing) {
this._syncList.push(args);
} else {
const [method, arg1, arg2] = args;
this[method](arg1, arg2);
}
this.chart._dataChanges.push([this.index, ...args]);
}
_onDataPush() {
const count = arguments.length;
this._sync(["_insertElements", this.getDataset().data.length - count, count]);
}
_onDataPop() {
this._sync(["_removeElements", this._cachedMeta.data.length - 1, 1]);
}
_onDataShift() {
this._sync(["_removeElements", 0, 1]);
}
_onDataSplice(start3, count) {
if (count) {
this._sync(["_removeElements", start3, count]);
}
const newCount = arguments.length - 2;
if (newCount) {
this._sync(["_insertElements", start3, newCount]);
}
}
_onDataUnshift() {
this._sync(["_insertElements", 0, arguments.length]);
}
};
DatasetController.defaults = {};
DatasetController.prototype.datasetElementType = null;
DatasetController.prototype.dataElementType = null;
BarController = class extends DatasetController {
parsePrimitiveData(meta, data, start3, count) {
return parseArrayOrPrimitive(meta, data, start3, count);
}
parseArrayData(meta, data, start3, count) {
return parseArrayOrPrimitive(meta, data, start3, count);
}
parseObjectData(meta, data, start3, count) {
const { iScale, vScale } = meta;
const { xAxisKey = "x", yAxisKey = "y" } = this._parsing;
const iAxisKey = iScale.axis === "x" ? xAxisKey : yAxisKey;
const vAxisKey = vScale.axis === "x" ? xAxisKey : yAxisKey;
const parsed = [];
let i5, ilen, item, obj;
for (i5 = start3, ilen = start3 + count; i5 < ilen; ++i5) {
obj = data[i5];
item = {};
item[iScale.axis] = iScale.parse(resolveObjectKey(obj, iAxisKey), i5);
parsed.push(parseValue(resolveObjectKey(obj, vAxisKey), item, vScale, i5));
}
return parsed;
}
updateRangeFromParsed(range2, scale, parsed, stack) {
super.updateRangeFromParsed(range2, scale, parsed, stack);
const custom = parsed._custom;
if (custom && scale === this._cachedMeta.vScale) {
range2.min = Math.min(range2.min, custom.min);
range2.max = Math.max(range2.max, custom.max);
}
}
getMaxOverflow() {
return 0;
}
getLabelAndValue(index3) {
const meta = this._cachedMeta;
const { iScale, vScale } = meta;
const parsed = this.getParsed(index3);
const custom = parsed._custom;
const value = isFloatBar(custom) ? "[" + custom.start + ", " + custom.end + "]" : "" + vScale.getLabelForValue(parsed[vScale.axis]);
return {
label: "" + iScale.getLabelForValue(parsed[iScale.axis]),
value
};
}
initialize() {
this.enableOptionSharing = true;
super.initialize();
const meta = this._cachedMeta;
meta.stack = this.getDataset().stack;
}
update(mode) {
const meta = this._cachedMeta;
this.updateElements(meta.data, 0, meta.data.length, mode);
}
updateElements(bars, start3, count, mode) {
const reset2 = mode === "reset";
const { index: index3, _cachedMeta: { vScale } } = this;
const base2 = vScale.getBasePixel();
const horizontal = vScale.isHorizontal();
const ruler = this._getRuler();
const firstOpts = this.resolveDataElementOptions(start3, mode);
const sharedOptions = this.getSharedOptions(firstOpts);
const includeOptions = this.includeOptions(mode, sharedOptions);
this.updateSharedOptions(sharedOptions, mode, firstOpts);
for (let i5 = start3; i5 < start3 + count; i5++) {
const parsed = this.getParsed(i5);
const vpixels = reset2 || isNullOrUndef(parsed[vScale.axis]) ? { base: base2, head: base2 } : this._calculateBarValuePixels(i5);
const ipixels = this._calculateBarIndexPixels(i5, ruler);
const stack = (parsed._stacks || {})[vScale.axis];
const properties = {
horizontal,
base: vpixels.base,
enableBorderRadius: !stack || isFloatBar(parsed._custom) || (index3 === stack._top || index3 === stack._bottom),
x: horizontal ? vpixels.head : ipixels.center,
y: horizontal ? ipixels.center : vpixels.head,
height: horizontal ? ipixels.size : Math.abs(vpixels.size),
width: horizontal ? Math.abs(vpixels.size) : ipixels.size
};
if (includeOptions) {
properties.options = sharedOptions || this.resolveDataElementOptions(i5, bars[i5].active ? "active" : mode);
}
const options = properties.options || bars[i5].options;
setBorderSkipped(properties, options, stack, index3);
setInflateAmount(properties, options, ruler.ratio);
this.updateElement(bars[i5], i5, properties, mode);
}
}
_getStacks(last, dataIndex) {
const meta = this._cachedMeta;
const iScale = meta.iScale;
const metasets = iScale.getMatchingVisibleMetas(this._type);
const stacked = iScale.options.stacked;
const ilen = metasets.length;
const stacks = [];
let i5, item;
for (i5 = 0; i5 < ilen; ++i5) {
item = metasets[i5];
if (!item.controller.options.grouped) {
continue;
}
if (typeof dataIndex !== "undefined") {
const val = item.controller.getParsed(dataIndex)[item.controller._cachedMeta.vScale.axis];
if (isNullOrUndef(val) || isNaN(val)) {
continue;
}
}
if (stacked === false || stacks.indexOf(item.stack) === -1 || stacked === void 0 && item.stack === void 0) {
stacks.push(item.stack);
}
if (item.index === last) {
break;
}
}
if (!stacks.length) {
stacks.push(void 0);
}
return stacks;
}
_getStackCount(index3) {
return this._getStacks(void 0, index3).length;
}
_getStackIndex(datasetIndex, name, dataIndex) {
const stacks = this._getStacks(datasetIndex, dataIndex);
const index3 = name !== void 0 ? stacks.indexOf(name) : -1;
return index3 === -1 ? stacks.length - 1 : index3;
}
_getRuler() {
const opts = this.options;
const meta = this._cachedMeta;
const iScale = meta.iScale;
const pixels = [];
let i5, ilen;
for (i5 = 0, ilen = meta.data.length; i5 < ilen; ++i5) {
pixels.push(iScale.getPixelForValue(this.getParsed(i5)[iScale.axis], i5));
}
const barThickness = opts.barThickness;
const min2 = barThickness || computeMinSampleSize(meta);
return {
min: min2,
pixels,
start: iScale._startPixel,
end: iScale._endPixel,
stackCount: this._getStackCount(),
scale: iScale,
grouped: opts.grouped,
ratio: barThickness ? 1 : opts.categoryPercentage * opts.barPercentage
};
}
_calculateBarValuePixels(index3) {
const { _cachedMeta: { vScale, _stacked }, options: { base: baseValue, minBarLength } } = this;
const actualBase = baseValue || 0;
const parsed = this.getParsed(index3);
const custom = parsed._custom;
const floating = isFloatBar(custom);
let value = parsed[vScale.axis];
let start3 = 0;
let length = _stacked ? this.applyStack(vScale, parsed, _stacked) : value;
let head, size;
if (length !== value) {
start3 = length - value;
length = value;
}
if (floating) {
value = custom.barStart;
length = custom.barEnd - custom.barStart;
if (value !== 0 && sign(value) !== sign(custom.barEnd)) {
start3 = 0;
}
start3 += value;
}
const startValue = !isNullOrUndef(baseValue) && !floating ? baseValue : start3;
let base2 = vScale.getPixelForValue(startValue);
if (this.chart.getDataVisibility(index3)) {
head = vScale.getPixelForValue(start3 + length);
} else {
head = base2;
}
size = head - base2;
if (Math.abs(size) < minBarLength) {
size = barSign(size, vScale, actualBase) * minBarLength;
if (value === actualBase) {
base2 -= size / 2;
}
head = base2 + size;
}
if (base2 === vScale.getPixelForValue(actualBase)) {
const halfGrid = sign(size) * vScale.getLineWidthForValue(actualBase) / 2;
base2 += halfGrid;
size -= halfGrid;
}
return {
size,
base: base2,
head,
center: head + size / 2
};
}
_calculateBarIndexPixels(index3, ruler) {
const scale = ruler.scale;
const options = this.options;
const skipNull = options.skipNull;
const maxBarThickness = valueOrDefault(options.maxBarThickness, Infinity);
let center, size;
if (ruler.grouped) {
const stackCount = skipNull ? this._getStackCount(index3) : ruler.stackCount;
const range2 = options.barThickness === "flex" ? computeFlexCategoryTraits(index3, ruler, options, stackCount) : computeFitCategoryTraits(index3, ruler, options, stackCount);
const stackIndex = this._getStackIndex(this.index, this._cachedMeta.stack, skipNull ? index3 : void 0);
center = range2.start + range2.chunk * stackIndex + range2.chunk / 2;
size = Math.min(maxBarThickness, range2.chunk * range2.ratio);
} else {
center = scale.getPixelForValue(this.getParsed(index3)[scale.axis], index3);
size = Math.min(maxBarThickness, ruler.min * ruler.ratio);
}
return {
base: center - size / 2,
head: center + size / 2,
center,
size
};
}
draw() {
const meta = this._cachedMeta;
const vScale = meta.vScale;
const rects = meta.data;
const ilen = rects.length;
let i5 = 0;
for (; i5 < ilen; ++i5) {
if (this.getParsed(i5)[vScale.axis] !== null) {
rects[i5].draw(this._ctx);
}
}
}
};
BarController.id = "bar";
BarController.defaults = {
datasetElementType: false,
dataElementType: "bar",
categoryPercentage: 0.8,
barPercentage: 0.9,
grouped: true,
animations: {
numbers: {
type: "number",
properties: ["x", "y", "base", "width", "height"]
}
}
};
BarController.overrides = {
scales: {
_index_: {
type: "category",
offset: true,
grid: {
offset: true
}
},
_value_: {
type: "linear",
beginAtZero: true
}
}
};
BubbleController = class extends DatasetController {
initialize() {
this.enableOptionSharing = true;
super.initialize();
}
parsePrimitiveData(meta, data, start3, count) {
const parsed = super.parsePrimitiveData(meta, data, start3, count);
for (let i5 = 0; i5 < parsed.length; i5++) {
parsed[i5]._custom = this.resolveDataElementOptions(i5 + start3).radius;
}
return parsed;
}
parseArrayData(meta, data, start3, count) {
const parsed = super.parseArrayData(meta, data, start3, count);
for (let i5 = 0; i5 < parsed.length; i5++) {
const item = data[start3 + i5];
parsed[i5]._custom = valueOrDefault(item[2], this.resolveDataElementOptions(i5 + start3).radius);
}
return parsed;
}
parseObjectData(meta, data, start3, count) {
const parsed = super.parseObjectData(meta, data, start3, count);
for (let i5 = 0; i5 < parsed.length; i5++) {
const item = data[start3 + i5];
parsed[i5]._custom = valueOrDefault(item && item.r && +item.r, this.resolveDataElementOptions(i5 + start3).radius);
}
return parsed;
}
getMaxOverflow() {
const data = this._cachedMeta.data;
let max2 = 0;
for (let i5 = data.length - 1; i5 >= 0; --i5) {
max2 = Math.max(max2, data[i5].size(this.resolveDataElementOptions(i5)) / 2);
}
return max2 > 0 && max2;
}
getLabelAndValue(index3) {
const meta = this._cachedMeta;
const { xScale, yScale } = meta;
const parsed = this.getParsed(index3);
const x4 = xScale.getLabelForValue(parsed.x);
const y4 = yScale.getLabelForValue(parsed.y);
const r6 = parsed._custom;
return {
label: meta.label,
value: "(" + x4 + ", " + y4 + (r6 ? ", " + r6 : "") + ")"
};
}
update(mode) {
const points = this._cachedMeta.data;
this.updateElements(points, 0, points.length, mode);
}
updateElements(points, start3, count, mode) {
const reset2 = mode === "reset";
const { iScale, vScale } = this._cachedMeta;
const firstOpts = this.resolveDataElementOptions(start3, mode);
const sharedOptions = this.getSharedOptions(firstOpts);
const includeOptions = this.includeOptions(mode, sharedOptions);
const iAxis = iScale.axis;
const vAxis = vScale.axis;
for (let i5 = start3; i5 < start3 + count; i5++) {
const point = points[i5];
const parsed = !reset2 && this.getParsed(i5);
const properties = {};
const iPixel = properties[iAxis] = reset2 ? iScale.getPixelForDecimal(0.5) : iScale.getPixelForValue(parsed[iAxis]);
const vPixel = properties[vAxis] = reset2 ? vScale.getBasePixel() : vScale.getPixelForValue(parsed[vAxis]);
properties.skip = isNaN(iPixel) || isNaN(vPixel);
if (includeOptions) {
properties.options = this.resolveDataElementOptions(i5, point.active ? "active" : mode);
if (reset2) {
properties.options.radius = 0;
}
}
this.updateElement(point, i5, properties, mode);
}
this.updateSharedOptions(sharedOptions, mode, firstOpts);
}
resolveDataElementOptions(index3, mode) {
const parsed = this.getParsed(index3);
let values = super.resolveDataElementOptions(index3, mode);
if (values.$shared) {
values = Object.assign({}, values, { $shared: false });
}
const radius = values.radius;
if (mode !== "active") {
values.radius = 0;
}
values.radius += valueOrDefault(parsed && parsed._custom, radius);
return values;
}
};
BubbleController.id = "bubble";
BubbleController.defaults = {
datasetElementType: false,
dataElementType: "point",
animations: {
numbers: {
type: "number",
properties: ["x", "y", "borderWidth", "radius"]
}
}
};
BubbleController.overrides = {
scales: {
x: {
type: "linear"
},
y: {
type: "linear"
}
},
plugins: {
tooltip: {
callbacks: {
title() {
return "";
}
}
}
}
};
DoughnutController = class extends DatasetController {
constructor(chart, datasetIndex) {
super(chart, datasetIndex);
this.enableOptionSharing = true;
this.innerRadius = void 0;
this.outerRadius = void 0;
this.offsetX = void 0;
this.offsetY = void 0;
}
linkScales() {
}
parse(start3, count) {
const data = this.getDataset().data;
const meta = this._cachedMeta;
if (this._parsing === false) {
meta._parsed = data;
} else {
let getter = (i6) => +data[i6];
if (isObject(data[start3])) {
const { key = "value" } = this._parsing;
getter = (i6) => +resolveObjectKey(data[i6], key);
}
let i5, ilen;
for (i5 = start3, ilen = start3 + count; i5 < ilen; ++i5) {
meta._parsed[i5] = getter(i5);
}
}
}
_getRotation() {
return toRadians(this.options.rotation - 90);
}
_getCircumference() {
return toRadians(this.options.circumference);
}
_getRotationExtents() {
let min2 = TAU;
let max2 = -TAU;
for (let i5 = 0; i5 < this.chart.data.datasets.length; ++i5) {
if (this.chart.isDatasetVisible(i5)) {
const controller = this.chart.getDatasetMeta(i5).controller;
const rotation = controller._getRotation();
const circumference = controller._getCircumference();
min2 = Math.min(min2, rotation);
max2 = Math.max(max2, rotation + circumference);
}
}
return {
rotation: min2,
circumference: max2 - min2
};
}
update(mode) {
const chart = this.chart;
const { chartArea } = chart;
const meta = this._cachedMeta;
const arcs = meta.data;
const spacing = this.getMaxBorderWidth() + this.getMaxOffset(arcs) + this.options.spacing;
const maxSize = Math.max((Math.min(chartArea.width, chartArea.height) - spacing) / 2, 0);
const cutout = Math.min(toPercentage(this.options.cutout, maxSize), 1);
const chartWeight = this._getRingWeight(this.index);
const { circumference, rotation } = this._getRotationExtents();
const { ratioX, ratioY, offsetX, offsetY } = getRatioAndOffset(rotation, circumference, cutout);
const maxWidth = (chartArea.width - spacing) / ratioX;
const maxHeight = (chartArea.height - spacing) / ratioY;
const maxRadius = Math.max(Math.min(maxWidth, maxHeight) / 2, 0);
const outerRadius = toDimension(this.options.radius, maxRadius);
const innerRadius = Math.max(outerRadius * cutout, 0);
const radiusLength = (outerRadius - innerRadius) / this._getVisibleDatasetWeightTotal();
this.offsetX = offsetX * outerRadius;
this.offsetY = offsetY * outerRadius;
meta.total = this.calculateTotal();
this.outerRadius = outerRadius - radiusLength * this._getRingWeightOffset(this.index);
this.innerRadius = Math.max(this.outerRadius - radiusLength * chartWeight, 0);
this.updateElements(arcs, 0, arcs.length, mode);
}
_circumference(i5, reset2) {
const opts = this.options;
const meta = this._cachedMeta;
const circumference = this._getCircumference();
if (reset2 && opts.animation.animateRotate || !this.chart.getDataVisibility(i5) || meta._parsed[i5] === null || meta.data[i5].hidden) {
return 0;
}
return this.calculateCircumference(meta._parsed[i5] * circumference / TAU);
}
updateElements(arcs, start3, count, mode) {
const reset2 = mode === "reset";
const chart = this.chart;
const chartArea = chart.chartArea;
const opts = chart.options;
const animationOpts = opts.animation;
const centerX = (chartArea.left + chartArea.right) / 2;
const centerY = (chartArea.top + chartArea.bottom) / 2;
const animateScale = reset2 && animationOpts.animateScale;
const innerRadius = animateScale ? 0 : this.innerRadius;
const outerRadius = animateScale ? 0 : this.outerRadius;
const firstOpts = this.resolveDataElementOptions(start3, mode);
const sharedOptions = this.getSharedOptions(firstOpts);
const includeOptions = this.includeOptions(mode, sharedOptions);
let startAngle = this._getRotation();
let i5;
for (i5 = 0; i5 < start3; ++i5) {
startAngle += this._circumference(i5, reset2);
}
for (i5 = start3; i5 < start3 + count; ++i5) {
const circumference = this._circumference(i5, reset2);
const arc = arcs[i5];
const properties = {
x: centerX + this.offsetX,
y: centerY + this.offsetY,
startAngle,
endAngle: startAngle + circumference,
circumference,
outerRadius,
innerRadius
};
if (includeOptions) {
properties.options = sharedOptions || this.resolveDataElementOptions(i5, arc.active ? "active" : mode);
}
startAngle += circumference;
this.updateElement(arc, i5, properties, mode);
}
this.updateSharedOptions(sharedOptions, mode, firstOpts);
}
calculateTotal() {
const meta = this._cachedMeta;
const metaData = meta.data;
let total = 0;
let i5;
for (i5 = 0; i5 < metaData.length; i5++) {
const value = meta._parsed[i5];
if (value !== null && !isNaN(value) && this.chart.getDataVisibility(i5) && !metaData[i5].hidden) {
total += Math.abs(value);
}
}
return total;
}
calculateCircumference(value) {
const total = this._cachedMeta.total;
if (total > 0 && !isNaN(value)) {
return TAU * (Math.abs(value) / total);
}
return 0;
}
getLabelAndValue(index3) {
const meta = this._cachedMeta;
const chart = this.chart;
const labels = chart.data.labels || [];
const value = formatNumber(meta._parsed[index3], chart.options.locale);
return {
label: labels[index3] || "",
value
};
}
getMaxBorderWidth(arcs) {
let max2 = 0;
const chart = this.chart;
let i5, ilen, meta, controller, options;
if (!arcs) {
for (i5 = 0, ilen = chart.data.datasets.length; i5 < ilen; ++i5) {
if (chart.isDatasetVisible(i5)) {
meta = chart.getDatasetMeta(i5);
arcs = meta.data;
controller = meta.controller;
break;
}
}
}
if (!arcs) {
return 0;
}
for (i5 = 0, ilen = arcs.length; i5 < ilen; ++i5) {
options = controller.resolveDataElementOptions(i5);
if (options.borderAlign !== "inner") {
max2 = Math.max(max2, options.borderWidth || 0, options.hoverBorderWidth || 0);
}
}
return max2;
}
getMaxOffset(arcs) {
let max2 = 0;
for (let i5 = 0, ilen = arcs.length; i5 < ilen; ++i5) {
const options = this.resolveDataElementOptions(i5);
max2 = Math.max(max2, options.offset || 0, options.hoverOffset || 0);
}
return max2;
}
_getRingWeightOffset(datasetIndex) {
let ringWeightOffset = 0;
for (let i5 = 0; i5 < datasetIndex; ++i5) {
if (this.chart.isDatasetVisible(i5)) {
ringWeightOffset += this._getRingWeight(i5);
}
}
return ringWeightOffset;
}
_getRingWeight(datasetIndex) {
return Math.max(valueOrDefault(this.chart.data.datasets[datasetIndex].weight, 1), 0);
}
_getVisibleDatasetWeightTotal() {
return this._getRingWeightOffset(this.chart.data.datasets.length) || 1;
}
};
DoughnutController.id = "doughnut";
DoughnutController.defaults = {
datasetElementType: false,
dataElementType: "arc",
animation: {
animateRotate: true,
animateScale: false
},
animations: {
numbers: {
type: "number",
properties: ["circumference", "endAngle", "innerRadius", "outerRadius", "startAngle", "x", "y", "offset", "borderWidth", "spacing"]
}
},
cutout: "50%",
rotation: 0,
circumference: 360,
radius: "100%",
spacing: 0,
indexAxis: "r"
};
DoughnutController.descriptors = {
_scriptable: (name) => name !== "spacing",
_indexable: (name) => name !== "spacing"
};
DoughnutController.overrides = {
aspectRatio: 1,
plugins: {
legend: {
labels: {
generateLabels(chart) {
const data = chart.data;
if (data.labels.length && data.datasets.length) {
const { labels: { pointStyle } } = chart.legend.options;
return data.labels.map((label, i5) => {
const meta = chart.getDatasetMeta(0);
const style2 = meta.controller.getStyle(i5);
return {
text: label,
fillStyle: style2.backgroundColor,
strokeStyle: style2.borderColor,
lineWidth: style2.borderWidth,
pointStyle,
hidden: !chart.getDataVisibility(i5),
index: i5
};
});
}
return [];
}
},
onClick(e5, legendItem, legend) {
legend.chart.toggleDataVisibility(legendItem.index);
legend.chart.update();
}
},
tooltip: {
callbacks: {
title() {
return "";
},
label(tooltipItem) {
let dataLabel = tooltipItem.label;
const value = ": " + tooltipItem.formattedValue;
if (isArray(dataLabel)) {
dataLabel = dataLabel.slice();
dataLabel[0] += value;
} else {
dataLabel += value;
}
return dataLabel;
}
}
}
}
};
LineController = class extends DatasetController {
initialize() {
this.enableOptionSharing = true;
super.initialize();
}
update(mode) {
const meta = this._cachedMeta;
const { dataset: line, data: points = [], _dataset } = meta;
const animationsDisabled = this.chart._animationsDisabled;
let { start: start3, count } = getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);
this._drawStart = start3;
this._drawCount = count;
if (scaleRangesChanged(meta)) {
start3 = 0;
count = points.length;
}
line._chart = this.chart;
line._datasetIndex = this.index;
line._decimated = !!_dataset._decimated;
line.points = points;
const options = this.resolveDatasetElementOptions(mode);
if (!this.options.showLine) {
options.borderWidth = 0;
}
options.segment = this.options.segment;
this.updateElement(line, void 0, {
animated: !animationsDisabled,
options
}, mode);
this.updateElements(points, start3, count, mode);
}
updateElements(points, start3, count, mode) {
const reset2 = mode === "reset";
const { iScale, vScale, _stacked, _dataset } = this._cachedMeta;
const firstOpts = this.resolveDataElementOptions(start3, mode);
const sharedOptions = this.getSharedOptions(firstOpts);
const includeOptions = this.includeOptions(mode, sharedOptions);
const iAxis = iScale.axis;
const vAxis = vScale.axis;
const { spanGaps, segment } = this.options;
const maxGapLength = isNumber(spanGaps) ? spanGaps : Number.POSITIVE_INFINITY;
const directUpdate = this.chart._animationsDisabled || reset2 || mode === "none";
let prevParsed = start3 > 0 && this.getParsed(start3 - 1);
for (let i5 = start3; i5 < start3 + count; ++i5) {
const point = points[i5];
const parsed = this.getParsed(i5);
const properties = directUpdate ? point : {};
const nullData = isNullOrUndef(parsed[vAxis]);
const iPixel = properties[iAxis] = iScale.getPixelForValue(parsed[iAxis], i5);
const vPixel = properties[vAxis] = reset2 || nullData ? vScale.getBasePixel() : vScale.getPixelForValue(_stacked ? this.applyStack(vScale, parsed, _stacked) : parsed[vAxis], i5);
properties.skip = isNaN(iPixel) || isNaN(vPixel) || nullData;
properties.stop = i5 > 0 && parsed[iAxis] - prevParsed[iAxis] > maxGapLength;
if (segment) {
properties.parsed = parsed;
properties.raw = _dataset.data[i5];
}
if (includeOptions) {
properties.options = sharedOptions || this.resolveDataElementOptions(i5, point.active ? "active" : mode);
}
if (!directUpdate) {
this.updateElement(point, i5, properties, mode);
}
prevParsed = parsed;
}
this.updateSharedOptions(sharedOptions, mode, firstOpts);
}
getMaxOverflow() {
const meta = this._cachedMeta;
const dataset = meta.dataset;
const border = dataset.options && dataset.options.borderWidth || 0;
const data = meta.data || [];
if (!data.length) {
return border;
}
const firstPoint = data[0].size(this.resolveDataElementOptions(0));
const lastPoint = data[data.length - 1].size(this.resolveDataElementOptions(data.length - 1));
return Math.max(border, firstPoint, lastPoint) / 2;
}
draw() {
const meta = this._cachedMeta;
meta.dataset.updateControlPoints(this.chart.chartArea, meta.iScale.axis);
super.draw();
}
};
LineController.id = "line";
LineController.defaults = {
datasetElementType: "line",
dataElementType: "point",
showLine: true,
spanGaps: false
};
LineController.overrides = {
scales: {
_index_: {
type: "category"
},
_value_: {
type: "linear"
}
}
};
PolarAreaController = class extends DatasetController {
constructor(chart, datasetIndex) {
super(chart, datasetIndex);
this.innerRadius = void 0;
this.outerRadius = void 0;
}
getLabelAndValue(index3) {
const meta = this._cachedMeta;
const chart = this.chart;
const labels = chart.data.labels || [];
const value = formatNumber(meta._parsed[index3].r, chart.options.locale);
return {
label: labels[index3] || "",
value
};
}
update(mode) {
const arcs = this._cachedMeta.data;
this._updateRadius();
this.updateElements(arcs, 0, arcs.length, mode);
}
_updateRadius() {
const chart = this.chart;
const chartArea = chart.chartArea;
const opts = chart.options;
const minSize = Math.min(chartArea.right - chartArea.left, chartArea.bottom - chartArea.top);
const outerRadius = Math.max(minSize / 2, 0);
const innerRadius = Math.max(opts.cutoutPercentage ? outerRadius / 100 * opts.cutoutPercentage : 1, 0);
const radiusLength = (outerRadius - innerRadius) / chart.getVisibleDatasetCount();
this.outerRadius = outerRadius - radiusLength * this.index;
this.innerRadius = this.outerRadius - radiusLength;
}
updateElements(arcs, start3, count, mode) {
const reset2 = mode === "reset";
const chart = this.chart;
const dataset = this.getDataset();
const opts = chart.options;
const animationOpts = opts.animation;
const scale = this._cachedMeta.rScale;
const centerX = scale.xCenter;
const centerY = scale.yCenter;
const datasetStartAngle = scale.getIndexAngle(0) - 0.5 * PI;
let angle = datasetStartAngle;
let i5;
const defaultAngle = 360 / this.countVisibleElements();
for (i5 = 0; i5 < start3; ++i5) {
angle += this._computeAngle(i5, mode, defaultAngle);
}
for (i5 = start3; i5 < start3 + count; i5++) {
const arc = arcs[i5];
let startAngle = angle;
let endAngle = angle + this._computeAngle(i5, mode, defaultAngle);
let outerRadius = chart.getDataVisibility(i5) ? scale.getDistanceFromCenterForValue(dataset.data[i5]) : 0;
angle = endAngle;
if (reset2) {
if (animationOpts.animateScale) {
outerRadius = 0;
}
if (animationOpts.animateRotate) {
startAngle = endAngle = datasetStartAngle;
}
}
const properties = {
x: centerX,
y: centerY,
innerRadius: 0,
outerRadius,
startAngle,
endAngle,
options: this.resolveDataElementOptions(i5, arc.active ? "active" : mode)
};
this.updateElement(arc, i5, properties, mode);
}
}
countVisibleElements() {
const dataset = this.getDataset();
const meta = this._cachedMeta;
let count = 0;
meta.data.forEach((element, index3) => {
if (!isNaN(dataset.data[index3]) && this.chart.getDataVisibility(index3)) {
count++;
}
});
return count;
}
_computeAngle(index3, mode, defaultAngle) {
return this.chart.getDataVisibility(index3) ? toRadians(this.resolveDataElementOptions(index3, mode).angle || defaultAngle) : 0;
}
};
PolarAreaController.id = "polarArea";
PolarAreaController.defaults = {
dataElementType: "arc",
animation: {
animateRotate: true,
animateScale: true
},
animations: {
numbers: {
type: "number",
properties: ["x", "y", "startAngle", "endAngle", "innerRadius", "outerRadius"]
}
},
indexAxis: "r",
startAngle: 0
};
PolarAreaController.overrides = {
aspectRatio: 1,
plugins: {
legend: {
labels: {
generateLabels(chart) {
const data = chart.data;
if (data.labels.length && data.datasets.length) {
const { labels: { pointStyle } } = chart.legend.options;
return data.labels.map((label, i5) => {
const meta = chart.getDatasetMeta(0);
const style2 = meta.controller.getStyle(i5);
return {
text: label,
fillStyle: style2.backgroundColor,
strokeStyle: style2.borderColor,
lineWidth: style2.borderWidth,
pointStyle,
hidden: !chart.getDataVisibility(i5),
index: i5
};
});
}
return [];
}
},
onClick(e5, legendItem, legend) {
legend.chart.toggleDataVisibility(legendItem.index);
legend.chart.update();
}
},
tooltip: {
callbacks: {
title() {
return "";
},
label(context) {
return context.chart.data.labels[context.dataIndex] + ": " + context.formattedValue;
}
}
}
},
scales: {
r: {
type: "radialLinear",
angleLines: {
display: false
},
beginAtZero: true,
grid: {
circular: true
},
pointLabels: {
display: false
},
startAngle: 0
}
}
};
PieController = class extends DoughnutController {
};
PieController.id = "pie";
PieController.defaults = {
cutout: 0,
rotation: 0,
circumference: 360,
radius: "100%"
};
RadarController = class extends DatasetController {
getLabelAndValue(index3) {
const vScale = this._cachedMeta.vScale;
const parsed = this.getParsed(index3);
return {
label: vScale.getLabels()[index3],
value: "" + vScale.getLabelForValue(parsed[vScale.axis])
};
}
update(mode) {
const meta = this._cachedMeta;
const line = meta.dataset;
const points = meta.data || [];
const labels = meta.iScale.getLabels();
line.points = points;
if (mode !== "resize") {
const options = this.resolveDatasetElementOptions(mode);
if (!this.options.showLine) {
options.borderWidth = 0;
}
const properties = {
_loop: true,
_fullLoop: labels.length === points.length,
options
};
this.updateElement(line, void 0, properties, mode);
}
this.updateElements(points, 0, points.length, mode);
}
updateElements(points, start3, count, mode) {
const dataset = this.getDataset();
const scale = this._cachedMeta.rScale;
const reset2 = mode === "reset";
for (let i5 = start3; i5 < start3 + count; i5++) {
const point = points[i5];
const options = this.resolveDataElementOptions(i5, point.active ? "active" : mode);
const pointPosition = scale.getPointPositionForValue(i5, dataset.data[i5]);
const x4 = reset2 ? scale.xCenter : pointPosition.x;
const y4 = reset2 ? scale.yCenter : pointPosition.y;
const properties = {
x: x4,
y: y4,
angle: pointPosition.angle,
skip: isNaN(x4) || isNaN(y4),
options
};
this.updateElement(point, i5, properties, mode);
}
}
};
RadarController.id = "radar";
RadarController.defaults = {
datasetElementType: "line",
dataElementType: "point",
indexAxis: "r",
showLine: true,
elements: {
line: {
fill: "start"
}
}
};
RadarController.overrides = {
aspectRatio: 1,
scales: {
r: {
type: "radialLinear"
}
}
};
ScatterController = class extends LineController {
};
ScatterController.id = "scatter";
ScatterController.defaults = {
showLine: false,
fill: false
};
ScatterController.overrides = {
interaction: {
mode: "point"
},
plugins: {
tooltip: {
callbacks: {
title() {
return "";
},
label(item) {
return "(" + item.label + ", " + item.formattedValue + ")";
}
}
}
},
scales: {
x: {
type: "linear"
},
y: {
type: "linear"
}
}
};
controllers = /* @__PURE__ */ Object.freeze({
__proto__: null,
BarController,
BubbleController,
DoughnutController,
LineController,
PolarAreaController,
PieController,
RadarController,
ScatterController
});
DateAdapter = class {
constructor(options) {
this.options = options || {};
}
formats() {
return abstract();
}
parse(value, format2) {
return abstract();
}
format(timestamp, format2) {
return abstract();
}
add(timestamp, amount, unit) {
return abstract();
}
diff(a5, b4, unit) {
return abstract();
}
startOf(timestamp, unit, weekday) {
return abstract();
}
endOf(timestamp, unit) {
return abstract();
}
};
DateAdapter.override = function(members) {
Object.assign(DateAdapter.prototype, members);
};
adapters = {
_date: DateAdapter
};
Interaction = {
modes: {
index(chart, e5, options, useFinalPosition) {
const position = getRelativePosition2(e5, chart);
const axis = options.axis || "x";
const items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition) : getNearestItems(chart, position, axis, false, useFinalPosition);
const elements2 = [];
if (!items.length) {
return [];
}
chart.getSortedVisibleDatasetMetas().forEach((meta) => {
const index3 = items[0].index;
const element = meta.data[index3];
if (element && !element.skip) {
elements2.push({ element, datasetIndex: meta.index, index: index3 });
}
});
return elements2;
},
dataset(chart, e5, options, useFinalPosition) {
const position = getRelativePosition2(e5, chart);
const axis = options.axis || "xy";
let items = options.intersect ? getIntersectItems(chart, position, axis, useFinalPosition) : getNearestItems(chart, position, axis, false, useFinalPosition);
if (items.length > 0) {
const datasetIndex = items[0].datasetIndex;
const data = chart.getDatasetMeta(datasetIndex).data;
items = [];
for (let i5 = 0; i5 < data.length; ++i5) {
items.push({ element: data[i5], datasetIndex, index: i5 });
}
}
return items;
},
point(chart, e5, options, useFinalPosition) {
const position = getRelativePosition2(e5, chart);
const axis = options.axis || "xy";
return getIntersectItems(chart, position, axis, useFinalPosition);
},
nearest(chart, e5, options, useFinalPosition) {
const position = getRelativePosition2(e5, chart);
const axis = options.axis || "xy";
return getNearestItems(chart, position, axis, options.intersect, useFinalPosition);
},
x(chart, e5, options, useFinalPosition) {
return getAxisItems(chart, e5, { axis: "x", intersect: options.intersect }, useFinalPosition);
},
y(chart, e5, options, useFinalPosition) {
return getAxisItems(chart, e5, { axis: "y", intersect: options.intersect }, useFinalPosition);
}
}
};
STATIC_POSITIONS = ["left", "top", "right", "bottom"];
defaults.set("layout", {
autoPadding: true,
padding: {
top: 0,
right: 0,
bottom: 0,
left: 0
}
});
layouts = {
addBox(chart, item) {
if (!chart.boxes) {
chart.boxes = [];
}
item.fullSize = item.fullSize || false;
item.position = item.position || "top";
item.weight = item.weight || 0;
item._layers = item._layers || function() {
return [{
z: 0,
draw(chartArea) {
item.draw(chartArea);
}
}];
};
chart.boxes.push(item);
},
removeBox(chart, layoutItem) {
const index3 = chart.boxes ? chart.boxes.indexOf(layoutItem) : -1;
if (index3 !== -1) {
chart.boxes.splice(index3, 1);
}
},
configure(chart, item, options) {
item.fullSize = options.fullSize;
item.position = options.position;
item.weight = options.weight;
},
update(chart, width, height, minPadding) {
if (!chart) {
return;
}
const padding = toPadding(chart.options.layout.padding);
const availableWidth = Math.max(width - padding.width, 0);
const availableHeight = Math.max(height - padding.height, 0);
const boxes = buildLayoutBoxes(chart.boxes);
const verticalBoxes = boxes.vertical;
const horizontalBoxes = boxes.horizontal;
each(chart.boxes, (box) => {
if (typeof box.beforeLayout === "function") {
box.beforeLayout();
}
});
const visibleVerticalBoxCount = verticalBoxes.reduce((total, wrap3) => wrap3.box.options && wrap3.box.options.display === false ? total : total + 1, 0) || 1;
const params = Object.freeze({
outerWidth: width,
outerHeight: height,
padding,
availableWidth,
availableHeight,
vBoxMaxWidth: availableWidth / 2 / visibleVerticalBoxCount,
hBoxMaxHeight: availableHeight / 2
});
const maxPadding = Object.assign({}, padding);
updateMaxPadding(maxPadding, toPadding(minPadding));
const chartArea = Object.assign({
maxPadding,
w: availableWidth,
h: availableHeight,
x: padding.left,
y: padding.top
}, padding);
const stacks = setLayoutDims(verticalBoxes.concat(horizontalBoxes), params);
fitBoxes(boxes.fullSize, chartArea, params, stacks);
fitBoxes(verticalBoxes, chartArea, params, stacks);
if (fitBoxes(horizontalBoxes, chartArea, params, stacks)) {
fitBoxes(verticalBoxes, chartArea, params, stacks);
}
handleMaxPadding(chartArea);
placeBoxes(boxes.leftAndTop, chartArea, params, stacks);
chartArea.x += chartArea.w;
chartArea.y += chartArea.h;
placeBoxes(boxes.rightAndBottom, chartArea, params, stacks);
chart.chartArea = {
left: chartArea.left,
top: chartArea.top,
right: chartArea.left + chartArea.w,
bottom: chartArea.top + chartArea.h,
height: chartArea.h,
width: chartArea.w
};
each(boxes.chartArea, (layout) => {
const box = layout.box;
Object.assign(box, chart.chartArea);
box.update(chartArea.w, chartArea.h, { left: 0, top: 0, right: 0, bottom: 0 });
});
}
};
BasePlatform = class {
acquireContext(canvas, aspectRatio) {
}
releaseContext(context) {
return false;
}
addEventListener(chart, type, listener) {
}
removeEventListener(chart, type, listener) {
}
getDevicePixelRatio() {
return 1;
}
getMaximumSize(element, width, height, aspectRatio) {
width = Math.max(0, width || element.width);
height = height || element.height;
return {
width,
height: Math.max(0, aspectRatio ? Math.floor(width / aspectRatio) : height)
};
}
isAttached(canvas) {
return true;
}
updateConfig(config2) {
}
};
BasicPlatform = class extends BasePlatform {
acquireContext(item) {
return item && item.getContext && item.getContext("2d") || null;
}
updateConfig(config2) {
config2.options.animation = false;
}
};
EXPANDO_KEY = "$chartjs";
EVENT_TYPES = {
touchstart: "mousedown",
touchmove: "mousemove",
touchend: "mouseup",
pointerenter: "mouseenter",
pointerdown: "mousedown",
pointermove: "mousemove",
pointerup: "mouseup",
pointerleave: "mouseout",
pointerout: "mouseout"
};
isNullOrEmpty = (value) => value === null || value === "";
eventListenerOptions = supportsEventListenerOptions ? { passive: true } : false;
drpListeningCharts = /* @__PURE__ */ new Map();
oldDevicePixelRatio = 0;
DomPlatform = class extends BasePlatform {
acquireContext(canvas, aspectRatio) {
const context = canvas && canvas.getContext && canvas.getContext("2d");
if (context && context.canvas === canvas) {
initCanvas(canvas, aspectRatio);
return context;
}
return null;
}
releaseContext(context) {
const canvas = context.canvas;
if (!canvas[EXPANDO_KEY]) {
return false;
}
const initial = canvas[EXPANDO_KEY].initial;
["height", "width"].forEach((prop) => {
const value = initial[prop];
if (isNullOrUndef(value)) {
canvas.removeAttribute(prop);
} else {
canvas.setAttribute(prop, value);
}
});
const style2 = initial.style || {};
Object.keys(style2).forEach((key) => {
canvas.style[key] = style2[key];
});
canvas.width = canvas.width;
delete canvas[EXPANDO_KEY];
return true;
}
addEventListener(chart, type, listener) {
this.removeEventListener(chart, type);
const proxies = chart.$proxies || (chart.$proxies = {});
const handlers2 = {
attach: createAttachObserver,
detach: createDetachObserver,
resize: createResizeObserver
};
const handler = handlers2[type] || createProxyAndListen;
proxies[type] = handler(chart, type, listener);
}
removeEventListener(chart, type) {
const proxies = chart.$proxies || (chart.$proxies = {});
const proxy = proxies[type];
if (!proxy) {
return;
}
const handlers2 = {
attach: releaseObserver,
detach: releaseObserver,
resize: releaseObserver
};
const handler = handlers2[type] || removeListener;
handler(chart, type, proxy);
proxies[type] = void 0;
}
getDevicePixelRatio() {
return window.devicePixelRatio;
}
getMaximumSize(canvas, width, height, aspectRatio) {
return getMaximumSize(canvas, width, height, aspectRatio);
}
isAttached(canvas) {
const container = _getParentNode(canvas);
return !!(container && container.isConnected);
}
};
Element2 = class {
constructor() {
this.x = void 0;
this.y = void 0;
this.active = false;
this.options = void 0;
this.$animations = void 0;
}
tooltipPosition(useFinalPosition) {
const { x: x4, y: y4 } = this.getProps(["x", "y"], useFinalPosition);
return { x: x4, y: y4 };
}
hasValue() {
return isNumber(this.x) && isNumber(this.y);
}
getProps(props, final) {
const anims = this.$animations;
if (!final || !anims) {
return this;
}
const ret = {};
props.forEach((prop) => {
ret[prop] = anims[prop] && anims[prop].active() ? anims[prop]._to : this[prop];
});
return ret;
}
};
Element2.defaults = {};
Element2.defaultRoutes = void 0;
formatters = {
values(value) {
return isArray(value) ? value : "" + value;
},
numeric(tickValue, index3, ticks) {
if (tickValue === 0) {
return "0";
}
const locale2 = this.chart.options.locale;
let notation;
let delta = tickValue;
if (ticks.length > 1) {
const maxTick = Math.max(Math.abs(ticks[0].value), Math.abs(ticks[ticks.length - 1].value));
if (maxTick < 1e-4 || maxTick > 1e15) {
notation = "scientific";
}
delta = calculateDelta(tickValue, ticks);
}
const logDelta = log10(Math.abs(delta));
const numDecimal = Math.max(Math.min(-1 * Math.floor(logDelta), 20), 0);
const options = { notation, minimumFractionDigits: numDecimal, maximumFractionDigits: numDecimal };
Object.assign(options, this.options.ticks.format);
return formatNumber(tickValue, locale2, options);
},
logarithmic(tickValue, index3, ticks) {
if (tickValue === 0) {
return "0";
}
const remain = tickValue / Math.pow(10, Math.floor(log10(tickValue)));
if (remain === 1 || remain === 2 || remain === 5) {
return formatters.numeric.call(this, tickValue, index3, ticks);
}
return "";
}
};
Ticks = { formatters };
defaults.set("scale", {
display: true,
offset: false,
reverse: false,
beginAtZero: false,
bounds: "ticks",
grace: 0,
grid: {
display: true,
lineWidth: 1,
drawBorder: true,
drawOnChartArea: true,
drawTicks: true,
tickLength: 8,
tickWidth: (_ctx, options) => options.lineWidth,
tickColor: (_ctx, options) => options.color,
offset: false,
borderDash: [],
borderDashOffset: 0,
borderWidth: 1
},
title: {
display: false,
text: "",
padding: {
top: 4,
bottom: 4
}
},
ticks: {
minRotation: 0,
maxRotation: 50,
mirror: false,
textStrokeWidth: 0,
textStrokeColor: "",
padding: 3,
display: true,
autoSkip: true,
autoSkipPadding: 3,
labelOffset: 0,
callback: Ticks.formatters.values,
minor: {},
major: {},
align: "center",
crossAlign: "near",
showLabelBackdrop: false,
backdropColor: "rgba(255, 255, 255, 0.75)",
backdropPadding: 2
}
});
defaults.route("scale.ticks", "color", "", "color");
defaults.route("scale.grid", "color", "", "borderColor");
defaults.route("scale.grid", "borderColor", "", "borderColor");
defaults.route("scale.title", "color", "", "color");
defaults.describe("scale", {
_fallback: false,
_scriptable: (name) => !name.startsWith("before") && !name.startsWith("after") && name !== "callback" && name !== "parser",
_indexable: (name) => name !== "borderDash" && name !== "tickBorderDash"
});
defaults.describe("scales", {
_fallback: "scale"
});
defaults.describe("scale.ticks", {
_scriptable: (name) => name !== "backdropPadding" && name !== "callback",
_indexable: (name) => name !== "backdropPadding"
});
reverseAlign = (align) => align === "left" ? "right" : align === "right" ? "left" : align;
offsetFromEdge = (scale, edge, offset3) => edge === "top" || edge === "left" ? scale[edge] + offset3 : scale[edge] - offset3;
Scale = class extends Element2 {
constructor(cfg) {
super();
this.id = cfg.id;
this.type = cfg.type;
this.options = void 0;
this.ctx = cfg.ctx;
this.chart = cfg.chart;
this.top = void 0;
this.bottom = void 0;
this.left = void 0;
this.right = void 0;
this.width = void 0;
this.height = void 0;
this._margins = {
left: 0,
right: 0,
top: 0,
bottom: 0
};
this.maxWidth = void 0;
this.maxHeight = void 0;
this.paddingTop = void 0;
this.paddingBottom = void 0;
this.paddingLeft = void 0;
this.paddingRight = void 0;
this.axis = void 0;
this.labelRotation = void 0;
this.min = void 0;
this.max = void 0;
this._range = void 0;
this.ticks = [];
this._gridLineItems = null;
this._labelItems = null;
this._labelSizes = null;
this._length = 0;
this._maxLength = 0;
this._longestTextCache = {};
this._startPixel = void 0;
this._endPixel = void 0;
this._reversePixels = false;
this._userMax = void 0;
this._userMin = void 0;
this._suggestedMax = void 0;
this._suggestedMin = void 0;
this._ticksLength = 0;
this._borderValue = 0;
this._cache = {};
this._dataLimitsCached = false;
this.$context = void 0;
}
init(options) {
this.options = options.setContext(this.getContext());
this.axis = options.axis;
this._userMin = this.parse(options.min);
this._userMax = this.parse(options.max);
this._suggestedMin = this.parse(options.suggestedMin);
this._suggestedMax = this.parse(options.suggestedMax);
}
parse(raw, index3) {
return raw;
}
getUserBounds() {
let { _userMin, _userMax, _suggestedMin, _suggestedMax } = this;
_userMin = finiteOrDefault(_userMin, Number.POSITIVE_INFINITY);
_userMax = finiteOrDefault(_userMax, Number.NEGATIVE_INFINITY);
_suggestedMin = finiteOrDefault(_suggestedMin, Number.POSITIVE_INFINITY);
_suggestedMax = finiteOrDefault(_suggestedMax, Number.NEGATIVE_INFINITY);
return {
min: finiteOrDefault(_userMin, _suggestedMin),
max: finiteOrDefault(_userMax, _suggestedMax),
minDefined: isNumberFinite(_userMin),
maxDefined: isNumberFinite(_userMax)
};
}
getMinMax(canStack) {
let { min: min2, max: max2, minDefined, maxDefined } = this.getUserBounds();
let range2;
if (minDefined && maxDefined) {
return { min: min2, max: max2 };
}
const metas = this.getMatchingVisibleMetas();
for (let i5 = 0, ilen = metas.length; i5 < ilen; ++i5) {
range2 = metas[i5].controller.getMinMax(this, canStack);
if (!minDefined) {
min2 = Math.min(min2, range2.min);
}
if (!maxDefined) {
max2 = Math.max(max2, range2.max);
}
}
min2 = maxDefined && min2 > max2 ? max2 : min2;
max2 = minDefined && min2 > max2 ? min2 : max2;
return {
min: finiteOrDefault(min2, finiteOrDefault(max2, min2)),
max: finiteOrDefault(max2, finiteOrDefault(min2, max2))
};
}
getPadding() {
return {
left: this.paddingLeft || 0,
top: this.paddingTop || 0,
right: this.paddingRight || 0,
bottom: this.paddingBottom || 0
};
}
getTicks() {
return this.ticks;
}
getLabels() {
const data = this.chart.data;
return this.options.labels || (this.isHorizontal() ? data.xLabels : data.yLabels) || data.labels || [];
}
beforeLayout() {
this._cache = {};
this._dataLimitsCached = false;
}
beforeUpdate() {
callback(this.options.beforeUpdate, [this]);
}
update(maxWidth, maxHeight, margins) {
const { beginAtZero, grace, ticks: tickOpts } = this.options;
const sampleSize = tickOpts.sampleSize;
this.beforeUpdate();
this.maxWidth = maxWidth;
this.maxHeight = maxHeight;
this._margins = margins = Object.assign({
left: 0,
right: 0,
top: 0,
bottom: 0
}, margins);
this.ticks = null;
this._labelSizes = null;
this._gridLineItems = null;
this._labelItems = null;
this.beforeSetDimensions();
this.setDimensions();
this.afterSetDimensions();
this._maxLength = this.isHorizontal() ? this.width + margins.left + margins.right : this.height + margins.top + margins.bottom;
if (!this._dataLimitsCached) {
this.beforeDataLimits();
this.determineDataLimits();
this.afterDataLimits();
this._range = _addGrace(this, grace, beginAtZero);
this._dataLimitsCached = true;
}
this.beforeBuildTicks();
this.ticks = this.buildTicks() || [];
this.afterBuildTicks();
const samplingEnabled = sampleSize < this.ticks.length;
this._convertTicksToLabels(samplingEnabled ? sample(this.ticks, sampleSize) : this.ticks);
this.configure();
this.beforeCalculateLabelRotation();
this.calculateLabelRotation();
this.afterCalculateLabelRotation();
if (tickOpts.display && (tickOpts.autoSkip || tickOpts.source === "auto")) {
this.ticks = autoSkip(this, this.ticks);
this._labelSizes = null;
}
if (samplingEnabled) {
this._convertTicksToLabels(this.ticks);
}
this.beforeFit();
this.fit();
this.afterFit();
this.afterUpdate();
}
configure() {
let reversePixels = this.options.reverse;
let startPixel, endPixel;
if (this.isHorizontal()) {
startPixel = this.left;
endPixel = this.right;
} else {
startPixel = this.top;
endPixel = this.bottom;
reversePixels = !reversePixels;
}
this._startPixel = startPixel;
this._endPixel = endPixel;
this._reversePixels = reversePixels;
this._length = endPixel - startPixel;
this._alignToPixels = this.options.alignToPixels;
}
afterUpdate() {
callback(this.options.afterUpdate, [this]);
}
beforeSetDimensions() {
callback(this.options.beforeSetDimensions, [this]);
}
setDimensions() {
if (this.isHorizontal()) {
this.width = this.maxWidth;
this.left = 0;
this.right = this.width;
} else {
this.height = this.maxHeight;
this.top = 0;
this.bottom = this.height;
}
this.paddingLeft = 0;
this.paddingTop = 0;
this.paddingRight = 0;
this.paddingBottom = 0;
}
afterSetDimensions() {
callback(this.options.afterSetDimensions, [this]);
}
_callHooks(name) {
this.chart.notifyPlugins(name, this.getContext());
callback(this.options[name], [this]);
}
beforeDataLimits() {
this._callHooks("beforeDataLimits");
}
determineDataLimits() {
}
afterDataLimits() {
this._callHooks("afterDataLimits");
}
beforeBuildTicks() {
this._callHooks("beforeBuildTicks");
}
buildTicks() {
return [];
}
afterBuildTicks() {
this._callHooks("afterBuildTicks");
}
beforeTickToLabelConversion() {
callback(this.options.beforeTickToLabelConversion, [this]);
}
generateTickLabels(ticks) {
const tickOpts = this.options.ticks;
let i5, ilen, tick;
for (i5 = 0, ilen = ticks.length; i5 < ilen; i5++) {
tick = ticks[i5];
tick.label = callback(tickOpts.callback, [tick.value, i5, ticks], this);
}
}
afterTickToLabelConversion() {
callback(this.options.afterTickToLabelConversion, [this]);
}
beforeCalculateLabelRotation() {
callback(this.options.beforeCalculateLabelRotation, [this]);
}
calculateLabelRotation() {
const options = this.options;
const tickOpts = options.ticks;
const numTicks = this.ticks.length;
const minRotation = tickOpts.minRotation || 0;
const maxRotation = tickOpts.maxRotation;
let labelRotation = minRotation;
let tickWidth, maxHeight, maxLabelDiagonal;
if (!this._isVisible() || !tickOpts.display || minRotation >= maxRotation || numTicks <= 1 || !this.isHorizontal()) {
this.labelRotation = minRotation;
return;
}
const labelSizes = this._getLabelSizes();
const maxLabelWidth = labelSizes.widest.width;
const maxLabelHeight = labelSizes.highest.height;
const maxWidth = _limitValue(this.chart.width - maxLabelWidth, 0, this.maxWidth);
tickWidth = options.offset ? this.maxWidth / numTicks : maxWidth / (numTicks - 1);
if (maxLabelWidth + 6 > tickWidth) {
tickWidth = maxWidth / (numTicks - (options.offset ? 0.5 : 1));
maxHeight = this.maxHeight - getTickMarkLength(options.grid) - tickOpts.padding - getTitleHeight(options.title, this.chart.options.font);
maxLabelDiagonal = Math.sqrt(maxLabelWidth * maxLabelWidth + maxLabelHeight * maxLabelHeight);
labelRotation = toDegrees(Math.min(
Math.asin(_limitValue((labelSizes.highest.height + 6) / tickWidth, -1, 1)),
Math.asin(_limitValue(maxHeight / maxLabelDiagonal, -1, 1)) - Math.asin(_limitValue(maxLabelHeight / maxLabelDiagonal, -1, 1))
));
labelRotation = Math.max(minRotation, Math.min(maxRotation, labelRotation));
}
this.labelRotation = labelRotation;
}
afterCalculateLabelRotation() {
callback(this.options.afterCalculateLabelRotation, [this]);
}
beforeFit() {
callback(this.options.beforeFit, [this]);
}
fit() {
const minSize = {
width: 0,
height: 0
};
const { chart, options: { ticks: tickOpts, title: titleOpts, grid: gridOpts } } = this;
const display = this._isVisible();
const isHorizontal = this.isHorizontal();
if (display) {
const titleHeight = getTitleHeight(titleOpts, chart.options.font);
if (isHorizontal) {
minSize.width = this.maxWidth;
minSize.height = getTickMarkLength(gridOpts) + titleHeight;
} else {
minSize.height = this.maxHeight;
minSize.width = getTickMarkLength(gridOpts) + titleHeight;
}
if (tickOpts.display && this.ticks.length) {
const { first: first3, last, widest, highest } = this._getLabelSizes();
const tickPadding = tickOpts.padding * 2;
const angleRadians = toRadians(this.labelRotation);
const cos = Math.cos(angleRadians);
const sin = Math.sin(angleRadians);
if (isHorizontal) {
const labelHeight = tickOpts.mirror ? 0 : sin * widest.width + cos * highest.height;
minSize.height = Math.min(this.maxHeight, minSize.height + labelHeight + tickPadding);
} else {
const labelWidth = tickOpts.mirror ? 0 : cos * widest.width + sin * highest.height;
minSize.width = Math.min(this.maxWidth, minSize.width + labelWidth + tickPadding);
}
this._calculatePadding(first3, last, sin, cos);
}
}
this._handleMargins();
if (isHorizontal) {
this.width = this._length = chart.width - this._margins.left - this._margins.right;
this.height = minSize.height;
} else {
this.width = minSize.width;
this.height = this._length = chart.height - this._margins.top - this._margins.bottom;
}
}
_calculatePadding(first3, last, sin, cos) {
const { ticks: { align, padding }, position } = this.options;
const isRotated = this.labelRotation !== 0;
const labelsBelowTicks = position !== "top" && this.axis === "x";
if (this.isHorizontal()) {
const offsetLeft = this.getPixelForTick(0) - this.left;
const offsetRight = this.right - this.getPixelForTick(this.ticks.length - 1);
let paddingLeft = 0;
let paddingRight = 0;
if (isRotated) {
if (labelsBelowTicks) {
paddingLeft = cos * first3.width;
paddingRight = sin * last.height;
} else {
paddingLeft = sin * first3.height;
paddingRight = cos * last.width;
}
} else if (align === "start") {
paddingRight = last.width;
} else if (align === "end") {
paddingLeft = first3.width;
} else {
paddingLeft = first3.width / 2;
paddingRight = last.width / 2;
}
this.paddingLeft = Math.max((paddingLeft - offsetLeft + padding) * this.width / (this.width - offsetLeft), 0);
this.paddingRight = Math.max((paddingRight - offsetRight + padding) * this.width / (this.width - offsetRight), 0);
} else {
let paddingTop = last.height / 2;
let paddingBottom = first3.height / 2;
if (align === "start") {
paddingTop = 0;
paddingBottom = first3.height;
} else if (align === "end") {
paddingTop = last.height;
paddingBottom = 0;
}
this.paddingTop = paddingTop + padding;
this.paddingBottom = paddingBottom + padding;
}
}
_handleMargins() {
if (this._margins) {
this._margins.left = Math.max(this.paddingLeft, this._margins.left);
this._margins.top = Math.max(this.paddingTop, this._margins.top);
this._margins.right = Math.max(this.paddingRight, this._margins.right);
this._margins.bottom = Math.max(this.paddingBottom, this._margins.bottom);
}
}
afterFit() {
callback(this.options.afterFit, [this]);
}
isHorizontal() {
const { axis, position } = this.options;
return position === "top" || position === "bottom" || axis === "x";
}
isFullSize() {
return this.options.fullSize;
}
_convertTicksToLabels(ticks) {
this.beforeTickToLabelConversion();
this.generateTickLabels(ticks);
let i5, ilen;
for (i5 = 0, ilen = ticks.length; i5 < ilen; i5++) {
if (isNullOrUndef(ticks[i5].label)) {
ticks.splice(i5, 1);
ilen--;
i5--;
}
}
this.afterTickToLabelConversion();
}
_getLabelSizes() {
let labelSizes = this._labelSizes;
if (!labelSizes) {
const sampleSize = this.options.ticks.sampleSize;
let ticks = this.ticks;
if (sampleSize < ticks.length) {
ticks = sample(ticks, sampleSize);
}
this._labelSizes = labelSizes = this._computeLabelSizes(ticks, ticks.length);
}
return labelSizes;
}
_computeLabelSizes(ticks, length) {
const { ctx, _longestTextCache: caches } = this;
const widths = [];
const heights = [];
let widestLabelSize = 0;
let highestLabelSize = 0;
let i5, j4, jlen, label, tickFont, fontString, cache2, lineHeight, width, height, nestedLabel;
for (i5 = 0; i5 < length; ++i5) {
label = ticks[i5].label;
tickFont = this._resolveTickFontOptions(i5);
ctx.font = fontString = tickFont.string;
cache2 = caches[fontString] = caches[fontString] || { data: {}, gc: [] };
lineHeight = tickFont.lineHeight;
width = height = 0;
if (!isNullOrUndef(label) && !isArray(label)) {
width = _measureText(ctx, cache2.data, cache2.gc, width, label);
height = lineHeight;
} else if (isArray(label)) {
for (j4 = 0, jlen = label.length; j4 < jlen; ++j4) {
nestedLabel = label[j4];
if (!isNullOrUndef(nestedLabel) && !isArray(nestedLabel)) {
width = _measureText(ctx, cache2.data, cache2.gc, width, nestedLabel);
height += lineHeight;
}
}
}
widths.push(width);
heights.push(height);
widestLabelSize = Math.max(width, widestLabelSize);
highestLabelSize = Math.max(height, highestLabelSize);
}
garbageCollect(caches, length);
const widest = widths.indexOf(widestLabelSize);
const highest = heights.indexOf(highestLabelSize);
const valueAt = (idx) => ({ width: widths[idx] || 0, height: heights[idx] || 0 });
return {
first: valueAt(0),
last: valueAt(length - 1),
widest: valueAt(widest),
highest: valueAt(highest),
widths,
heights
};
}
getLabelForValue(value) {
return value;
}
getPixelForValue(value, index3) {
return NaN;
}
getValueForPixel(pixel) {
}
getPixelForTick(index3) {
const ticks = this.ticks;
if (index3 < 0 || index3 > ticks.length - 1) {
return null;
}
return this.getPixelForValue(ticks[index3].value);
}
getPixelForDecimal(decimal) {
if (this._reversePixels) {
decimal = 1 - decimal;
}
const pixel = this._startPixel + decimal * this._length;
return _int16Range(this._alignToPixels ? _alignPixel(this.chart, pixel, 0) : pixel);
}
getDecimalForPixel(pixel) {
const decimal = (pixel - this._startPixel) / this._length;
return this._reversePixels ? 1 - decimal : decimal;
}
getBasePixel() {
return this.getPixelForValue(this.getBaseValue());
}
getBaseValue() {
const { min: min2, max: max2 } = this;
return min2 < 0 && max2 < 0 ? max2 : min2 > 0 && max2 > 0 ? min2 : 0;
}
getContext(index3) {
const ticks = this.ticks || [];
if (index3 >= 0 && index3 < ticks.length) {
const tick = ticks[index3];
return tick.$context || (tick.$context = createTickContext(this.getContext(), index3, tick));
}
return this.$context || (this.$context = createScaleContext(this.chart.getContext(), this));
}
_tickSize() {
const optionTicks = this.options.ticks;
const rot = toRadians(this.labelRotation);
const cos = Math.abs(Math.cos(rot));
const sin = Math.abs(Math.sin(rot));
const labelSizes = this._getLabelSizes();
const padding = optionTicks.autoSkipPadding || 0;
const w4 = labelSizes ? labelSizes.widest.width + padding : 0;
const h6 = labelSizes ? labelSizes.highest.height + padding : 0;
return this.isHorizontal() ? h6 * cos > w4 * sin ? w4 / cos : h6 / sin : h6 * sin < w4 * cos ? h6 / cos : w4 / sin;
}
_isVisible() {
const display = this.options.display;
if (display !== "auto") {
return !!display;
}
return this.getMatchingVisibleMetas().length > 0;
}
_computeGridLineItems(chartArea) {
const axis = this.axis;
const chart = this.chart;
const options = this.options;
const { grid, position } = options;
const offset3 = grid.offset;
const isHorizontal = this.isHorizontal();
const ticks = this.ticks;
const ticksLength = ticks.length + (offset3 ? 1 : 0);
const tl = getTickMarkLength(grid);
const items = [];
const borderOpts = grid.setContext(this.getContext());
const axisWidth = borderOpts.drawBorder ? borderOpts.borderWidth : 0;
const axisHalfWidth = axisWidth / 2;
const alignBorderValue = function(pixel) {
return _alignPixel(chart, pixel, axisWidth);
};
let borderValue, i5, lineValue, alignedLineValue;
let tx1, ty1, tx2, ty2, x1, y1, x22, y22;
if (position === "top") {
borderValue = alignBorderValue(this.bottom);
ty1 = this.bottom - tl;
ty2 = borderValue - axisHalfWidth;
y1 = alignBorderValue(chartArea.top) + axisHalfWidth;
y22 = chartArea.bottom;
} else if (position === "bottom") {
borderValue = alignBorderValue(this.top);
y1 = chartArea.top;
y22 = alignBorderValue(chartArea.bottom) - axisHalfWidth;
ty1 = borderValue + axisHalfWidth;
ty2 = this.top + tl;
} else if (position === "left") {
borderValue = alignBorderValue(this.right);
tx1 = this.right - tl;
tx2 = borderValue - axisHalfWidth;
x1 = alignBorderValue(chartArea.left) + axisHalfWidth;
x22 = chartArea.right;
} else if (position === "right") {
borderValue = alignBorderValue(this.left);
x1 = chartArea.left;
x22 = alignBorderValue(chartArea.right) - axisHalfWidth;
tx1 = borderValue + axisHalfWidth;
tx2 = this.left + tl;
} else if (axis === "x") {
if (position === "center") {
borderValue = alignBorderValue((chartArea.top + chartArea.bottom) / 2 + 0.5);
} else if (isObject(position)) {
const positionAxisID = Object.keys(position)[0];
const value = position[positionAxisID];
borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));
}
y1 = chartArea.top;
y22 = chartArea.bottom;
ty1 = borderValue + axisHalfWidth;
ty2 = ty1 + tl;
} else if (axis === "y") {
if (position === "center") {
borderValue = alignBorderValue((chartArea.left + chartArea.right) / 2);
} else if (isObject(position)) {
const positionAxisID = Object.keys(position)[0];
const value = position[positionAxisID];
borderValue = alignBorderValue(this.chart.scales[positionAxisID].getPixelForValue(value));
}
tx1 = borderValue - axisHalfWidth;
tx2 = tx1 - tl;
x1 = chartArea.left;
x22 = chartArea.right;
}
const limit = valueOrDefault(options.ticks.maxTicksLimit, ticksLength);
const step = Math.max(1, Math.ceil(ticksLength / limit));
for (i5 = 0; i5 < ticksLength; i5 += step) {
const optsAtIndex = grid.setContext(this.getContext(i5));
const lineWidth = optsAtIndex.lineWidth;
const lineColor = optsAtIndex.color;
const borderDash = grid.borderDash || [];
const borderDashOffset = optsAtIndex.borderDashOffset;
const tickWidth = optsAtIndex.tickWidth;
const tickColor = optsAtIndex.tickColor;
const tickBorderDash = optsAtIndex.tickBorderDash || [];
const tickBorderDashOffset = optsAtIndex.tickBorderDashOffset;
lineValue = getPixelForGridLine(this, i5, offset3);
if (lineValue === void 0) {
continue;
}
alignedLineValue = _alignPixel(chart, lineValue, lineWidth);
if (isHorizontal) {
tx1 = tx2 = x1 = x22 = alignedLineValue;
} else {
ty1 = ty2 = y1 = y22 = alignedLineValue;
}
items.push({
tx1,
ty1,
tx2,
ty2,
x1,
y1,
x2: x22,
y2: y22,
width: lineWidth,
color: lineColor,
borderDash,
borderDashOffset,
tickWidth,
tickColor,
tickBorderDash,
tickBorderDashOffset
});
}
this._ticksLength = ticksLength;
this._borderValue = borderValue;
return items;
}
_computeLabelItems(chartArea) {
const axis = this.axis;
const options = this.options;
const { position, ticks: optionTicks } = options;
const isHorizontal = this.isHorizontal();
const ticks = this.ticks;
const { align, crossAlign, padding, mirror } = optionTicks;
const tl = getTickMarkLength(options.grid);
const tickAndPadding = tl + padding;
const hTickAndPadding = mirror ? -padding : tickAndPadding;
const rotation = -toRadians(this.labelRotation);
const items = [];
let i5, ilen, tick, label, x4, y4, textAlign, pixel, font, lineHeight, lineCount, textOffset;
let textBaseline = "middle";
if (position === "top") {
y4 = this.bottom - hTickAndPadding;
textAlign = this._getXAxisLabelAlignment();
} else if (position === "bottom") {
y4 = this.top + hTickAndPadding;
textAlign = this._getXAxisLabelAlignment();
} else if (position === "left") {
const ret = this._getYAxisLabelAlignment(tl);
textAlign = ret.textAlign;
x4 = ret.x;
} else if (position === "right") {
const ret = this._getYAxisLabelAlignment(tl);
textAlign = ret.textAlign;
x4 = ret.x;
} else if (axis === "x") {
if (position === "center") {
y4 = (chartArea.top + chartArea.bottom) / 2 + tickAndPadding;
} else if (isObject(position)) {
const positionAxisID = Object.keys(position)[0];
const value = position[positionAxisID];
y4 = this.chart.scales[positionAxisID].getPixelForValue(value) + tickAndPadding;
}
textAlign = this._getXAxisLabelAlignment();
} else if (axis === "y") {
if (position === "center") {
x4 = (chartArea.left + chartArea.right) / 2 - tickAndPadding;
} else if (isObject(position)) {
const positionAxisID = Object.keys(position)[0];
const value = position[positionAxisID];
x4 = this.chart.scales[positionAxisID].getPixelForValue(value);
}
textAlign = this._getYAxisLabelAlignment(tl).textAlign;
}
if (axis === "y") {
if (align === "start") {
textBaseline = "top";
} else if (align === "end") {
textBaseline = "bottom";
}
}
const labelSizes = this._getLabelSizes();
for (i5 = 0, ilen = ticks.length; i5 < ilen; ++i5) {
tick = ticks[i5];
label = tick.label;
const optsAtIndex = optionTicks.setContext(this.getContext(i5));
pixel = this.getPixelForTick(i5) + optionTicks.labelOffset;
font = this._resolveTickFontOptions(i5);
lineHeight = font.lineHeight;
lineCount = isArray(label) ? label.length : 1;
const halfCount = lineCount / 2;
const color2 = optsAtIndex.color;
const strokeColor = optsAtIndex.textStrokeColor;
const strokeWidth = optsAtIndex.textStrokeWidth;
if (isHorizontal) {
x4 = pixel;
if (position === "top") {
if (crossAlign === "near" || rotation !== 0) {
textOffset = -lineCount * lineHeight + lineHeight / 2;
} else if (crossAlign === "center") {
textOffset = -labelSizes.highest.height / 2 - halfCount * lineHeight + lineHeight;
} else {
textOffset = -labelSizes.highest.height + lineHeight / 2;
}
} else {
if (crossAlign === "near" || rotation !== 0) {
textOffset = lineHeight / 2;
} else if (crossAlign === "center") {
textOffset = labelSizes.highest.height / 2 - halfCount * lineHeight;
} else {
textOffset = labelSizes.highest.height - lineCount * lineHeight;
}
}
if (mirror) {
textOffset *= -1;
}
} else {
y4 = pixel;
textOffset = (1 - lineCount) * lineHeight / 2;
}
let backdrop;
if (optsAtIndex.showLabelBackdrop) {
const labelPadding = toPadding(optsAtIndex.backdropPadding);
const height = labelSizes.heights[i5];
const width = labelSizes.widths[i5];
let top2 = y4 + textOffset - labelPadding.top;
let left2 = x4 - labelPadding.left;
switch (textBaseline) {
case "middle":
top2 -= height / 2;
break;
case "bottom":
top2 -= height;
break;
}
switch (textAlign) {
case "center":
left2 -= width / 2;
break;
case "right":
left2 -= width;
break;
}
backdrop = {
left: left2,
top: top2,
width: width + labelPadding.width,
height: height + labelPadding.height,
color: optsAtIndex.backdropColor
};
}
items.push({
rotation,
label,
font,
color: color2,
strokeColor,
strokeWidth,
textOffset,
textAlign,
textBaseline,
translation: [x4, y4],
backdrop
});
}
return items;
}
_getXAxisLabelAlignment() {
const { position, ticks } = this.options;
const rotation = -toRadians(this.labelRotation);
if (rotation) {
return position === "top" ? "left" : "right";
}
let align = "center";
if (ticks.align === "start") {
align = "left";
} else if (ticks.align === "end") {
align = "right";
}
return align;
}
_getYAxisLabelAlignment(tl) {
const { position, ticks: { crossAlign, mirror, padding } } = this.options;
const labelSizes = this._getLabelSizes();
const tickAndPadding = tl + padding;
const widest = labelSizes.widest.width;
let textAlign;
let x4;
if (position === "left") {
if (mirror) {
x4 = this.right + padding;
if (crossAlign === "near") {
textAlign = "left";
} else if (crossAlign === "center") {
textAlign = "center";
x4 += widest / 2;
} else {
textAlign = "right";
x4 += widest;
}
} else {
x4 = this.right - tickAndPadding;
if (crossAlign === "near") {
textAlign = "right";
} else if (crossAlign === "center") {
textAlign = "center";
x4 -= widest / 2;
} else {
textAlign = "left";
x4 = this.left;
}
}
} else if (position === "right") {
if (mirror) {
x4 = this.left + padding;
if (crossAlign === "near") {
textAlign = "right";
} else if (crossAlign === "center") {
textAlign = "center";
x4 -= widest / 2;
} else {
textAlign = "left";
x4 -= widest;
}
} else {
x4 = this.left + tickAndPadding;
if (crossAlign === "near") {
textAlign = "left";
} else if (crossAlign === "center") {
textAlign = "center";
x4 += widest / 2;
} else {
textAlign = "right";
x4 = this.right;
}
}
} else {
textAlign = "right";
}
return { textAlign, x: x4 };
}
_computeLabelArea() {
if (this.options.ticks.mirror) {
return;
}
const chart = this.chart;
const position = this.options.position;
if (position === "left" || position === "right") {
return { top: 0, left: this.left, bottom: chart.height, right: this.right };
}
if (position === "top" || position === "bottom") {
return { top: this.top, left: 0, bottom: this.bottom, right: chart.width };
}
}
drawBackground() {
const { ctx, options: { backgroundColor }, left: left2, top: top2, width, height } = this;
if (backgroundColor) {
ctx.save();
ctx.fillStyle = backgroundColor;
ctx.fillRect(left2, top2, width, height);
ctx.restore();
}
}
getLineWidthForValue(value) {
const grid = this.options.grid;
if (!this._isVisible() || !grid.display) {
return 0;
}
const ticks = this.ticks;
const index3 = ticks.findIndex((t5) => t5.value === value);
if (index3 >= 0) {
const opts = grid.setContext(this.getContext(index3));
return opts.lineWidth;
}
return 0;
}
drawGrid(chartArea) {
const grid = this.options.grid;
const ctx = this.ctx;
const items = this._gridLineItems || (this._gridLineItems = this._computeGridLineItems(chartArea));
let i5, ilen;
const drawLine = (p1, p22, style2) => {
if (!style2.width || !style2.color) {
return;
}
ctx.save();
ctx.lineWidth = style2.width;
ctx.strokeStyle = style2.color;
ctx.setLineDash(style2.borderDash || []);
ctx.lineDashOffset = style2.borderDashOffset;
ctx.beginPath();
ctx.moveTo(p1.x, p1.y);
ctx.lineTo(p22.x, p22.y);
ctx.stroke();
ctx.restore();
};
if (grid.display) {
for (i5 = 0, ilen = items.length; i5 < ilen; ++i5) {
const item = items[i5];
if (grid.drawOnChartArea) {
drawLine(
{ x: item.x1, y: item.y1 },
{ x: item.x2, y: item.y2 },
item
);
}
if (grid.drawTicks) {
drawLine(
{ x: item.tx1, y: item.ty1 },
{ x: item.tx2, y: item.ty2 },
{
color: item.tickColor,
width: item.tickWidth,
borderDash: item.tickBorderDash,
borderDashOffset: item.tickBorderDashOffset
}
);
}
}
}
}
drawBorder() {
const { chart, ctx, options: { grid } } = this;
const borderOpts = grid.setContext(this.getContext());
const axisWidth = grid.drawBorder ? borderOpts.borderWidth : 0;
if (!axisWidth) {
return;
}
const lastLineWidth = grid.setContext(this.getContext(0)).lineWidth;
const borderValue = this._borderValue;
let x1, x22, y1, y22;
if (this.isHorizontal()) {
x1 = _alignPixel(chart, this.left, axisWidth) - axisWidth / 2;
x22 = _alignPixel(chart, this.right, lastLineWidth) + lastLineWidth / 2;
y1 = y22 = borderValue;
} else {
y1 = _alignPixel(chart, this.top, axisWidth) - axisWidth / 2;
y22 = _alignPixel(chart, this.bottom, lastLineWidth) + lastLineWidth / 2;
x1 = x22 = borderValue;
}
ctx.save();
ctx.lineWidth = borderOpts.borderWidth;
ctx.strokeStyle = borderOpts.borderColor;
ctx.beginPath();
ctx.moveTo(x1, y1);
ctx.lineTo(x22, y22);
ctx.stroke();
ctx.restore();
}
drawLabels(chartArea) {
const optionTicks = this.options.ticks;
if (!optionTicks.display) {
return;
}
const ctx = this.ctx;
const area = this._computeLabelArea();
if (area) {
clipArea(ctx, area);
}
const items = this._labelItems || (this._labelItems = this._computeLabelItems(chartArea));
let i5, ilen;
for (i5 = 0, ilen = items.length; i5 < ilen; ++i5) {
const item = items[i5];
const tickFont = item.font;
const label = item.label;
if (item.backdrop) {
ctx.fillStyle = item.backdrop.color;
ctx.fillRect(item.backdrop.left, item.backdrop.top, item.backdrop.width, item.backdrop.height);
}
let y4 = item.textOffset;
renderText(ctx, label, 0, y4, tickFont, item);
}
if (area) {
unclipArea(ctx);
}
}
drawTitle() {
const { ctx, options: { position, title, reverse } } = this;
if (!title.display) {
return;
}
const font = toFont(title.font);
const padding = toPadding(title.padding);
const align = title.align;
let offset3 = font.lineHeight / 2;
if (position === "bottom" || position === "center" || isObject(position)) {
offset3 += padding.bottom;
if (isArray(title.text)) {
offset3 += font.lineHeight * (title.text.length - 1);
}
} else {
offset3 += padding.top;
}
const { titleX, titleY, maxWidth, rotation } = titleArgs(this, offset3, position, align);
renderText(ctx, title.text, 0, 0, font, {
color: title.color,
maxWidth,
rotation,
textAlign: titleAlign(align, position, reverse),
textBaseline: "middle",
translation: [titleX, titleY]
});
}
draw(chartArea) {
if (!this._isVisible()) {
return;
}
this.drawBackground();
this.drawGrid(chartArea);
this.drawBorder();
this.drawTitle();
this.drawLabels(chartArea);
}
_layers() {
const opts = this.options;
const tz = opts.ticks && opts.ticks.z || 0;
const gz = valueOrDefault(opts.grid && opts.grid.z, -1);
if (!this._isVisible() || this.draw !== Scale.prototype.draw) {
return [{
z: tz,
draw: (chartArea) => {
this.draw(chartArea);
}
}];
}
return [{
z: gz,
draw: (chartArea) => {
this.drawBackground();
this.drawGrid(chartArea);
this.drawTitle();
}
}, {
z: gz + 1,
draw: () => {
this.drawBorder();
}
}, {
z: tz,
draw: (chartArea) => {
this.drawLabels(chartArea);
}
}];
}
getMatchingVisibleMetas(type) {
const metas = this.chart.getSortedVisibleDatasetMetas();
const axisID = this.axis + "AxisID";
const result = [];
let i5, ilen;
for (i5 = 0, ilen = metas.length; i5 < ilen; ++i5) {
const meta = metas[i5];
if (meta[axisID] === this.id && (!type || meta.type === type)) {
result.push(meta);
}
}
return result;
}
_resolveTickFontOptions(index3) {
const opts = this.options.ticks.setContext(this.getContext(index3));
return toFont(opts.font);
}
_maxDigits() {
const fontSize = this._resolveTickFontOptions(0).lineHeight;
return (this.isHorizontal() ? this.width : this.height) / fontSize;
}
};
TypedRegistry = class {
constructor(type, scope, override) {
this.type = type;
this.scope = scope;
this.override = override;
this.items = /* @__PURE__ */ Object.create(null);
}
isForType(type) {
return Object.prototype.isPrototypeOf.call(this.type.prototype, type.prototype);
}
register(item) {
const proto = Object.getPrototypeOf(item);
let parentScope;
if (isIChartComponent(proto)) {
parentScope = this.register(proto);
}
const items = this.items;
const id = item.id;
const scope = this.scope + "." + id;
if (!id) {
throw new Error("class does not have id: " + item);
}
if (id in items) {
return scope;
}
items[id] = item;
registerDefaults(item, scope, parentScope);
if (this.override) {
defaults.override(item.id, item.overrides);
}
return scope;
}
get(id) {
return this.items[id];
}
unregister(item) {
const items = this.items;
const id = item.id;
const scope = this.scope;
if (id in items) {
delete items[id];
}
if (scope && id in defaults[scope]) {
delete defaults[scope][id];
if (this.override) {
delete overrides[id];
}
}
}
};
Registry = class {
constructor() {
this.controllers = new TypedRegistry(DatasetController, "datasets", true);
this.elements = new TypedRegistry(Element2, "elements");
this.plugins = new TypedRegistry(Object, "plugins");
this.scales = new TypedRegistry(Scale, "scales");
this._typedRegistries = [this.controllers, this.scales, this.elements];
}
add(...args) {
this._each("register", args);
}
remove(...args) {
this._each("unregister", args);
}
addControllers(...args) {
this._each("register", args, this.controllers);
}
addElements(...args) {
this._each("register", args, this.elements);
}
addPlugins(...args) {
this._each("register", args, this.plugins);
}
addScales(...args) {
this._each("register", args, this.scales);
}
getController(id) {
return this._get(id, this.controllers, "controller");
}
getElement(id) {
return this._get(id, this.elements, "element");
}
getPlugin(id) {
return this._get(id, this.plugins, "plugin");
}
getScale(id) {
return this._get(id, this.scales, "scale");
}
removeControllers(...args) {
this._each("unregister", args, this.controllers);
}
removeElements(...args) {
this._each("unregister", args, this.elements);
}
removePlugins(...args) {
this._each("unregister", args, this.plugins);
}
removeScales(...args) {
this._each("unregister", args, this.scales);
}
_each(method, args, typedRegistry) {
[...args].forEach((arg) => {
const reg = typedRegistry || this._getRegistryForType(arg);
if (typedRegistry || reg.isForType(arg) || reg === this.plugins && arg.id) {
this._exec(method, reg, arg);
} else {
each(arg, (item) => {
const itemReg = typedRegistry || this._getRegistryForType(item);
this._exec(method, itemReg, item);
});
}
});
}
_exec(method, registry2, component) {
const camelMethod = _capitalize(method);
callback(component["before" + camelMethod], [], component);
registry2[method](component);
callback(component["after" + camelMethod], [], component);
}
_getRegistryForType(type) {
for (let i5 = 0; i5 < this._typedRegistries.length; i5++) {
const reg = this._typedRegistries[i5];
if (reg.isForType(type)) {
return reg;
}
}
return this.plugins;
}
_get(id, typedRegistry, type) {
const item = typedRegistry.get(id);
if (item === void 0) {
throw new Error('"' + id + '" is not a registered ' + type + ".");
}
return item;
}
};
registry = new Registry();
PluginService = class {
constructor() {
this._init = [];
}
notify(chart, hook, args, filter2) {
if (hook === "beforeInit") {
this._init = this._createDescriptors(chart, true);
this._notify(this._init, chart, "install");
}
const descriptors2 = filter2 ? this._descriptors(chart).filter(filter2) : this._descriptors(chart);
const result = this._notify(descriptors2, chart, hook, args);
if (hook === "afterDestroy") {
this._notify(descriptors2, chart, "stop");
this._notify(this._init, chart, "uninstall");
}
return result;
}
_notify(descriptors2, chart, hook, args) {
args = args || {};
for (const descriptor of descriptors2) {
const plugin = descriptor.plugin;
const method = plugin[hook];
const params = [chart, args, descriptor.options];
if (callback(method, params, plugin) === false && args.cancelable) {
return false;
}
}
return true;
}
invalidate() {
if (!isNullOrUndef(this._cache)) {
this._oldCache = this._cache;
this._cache = void 0;
}
}
_descriptors(chart) {
if (this._cache) {
return this._cache;
}
const descriptors2 = this._cache = this._createDescriptors(chart);
this._notifyStateChanges(chart);
return descriptors2;
}
_createDescriptors(chart, all) {
const config2 = chart && chart.config;
const options = valueOrDefault(config2.options && config2.options.plugins, {});
const plugins3 = allPlugins(config2);
return options === false && !all ? [] : createDescriptors(chart, plugins3, options, all);
}
_notifyStateChanges(chart) {
const previousDescriptors = this._oldCache || [];
const descriptors2 = this._cache;
const diff = (a5, b4) => a5.filter((x4) => !b4.some((y4) => x4.plugin.id === y4.plugin.id));
this._notify(diff(previousDescriptors, descriptors2), chart, "stop");
this._notify(diff(descriptors2, previousDescriptors), chart, "start");
}
};
keyCache = /* @__PURE__ */ new Map();
keysCached = /* @__PURE__ */ new Set();
addIfFound = (set2, obj, key) => {
const opts = resolveObjectKey(obj, key);
if (opts !== void 0) {
set2.add(opts);
}
};
Config = class {
constructor(config2) {
this._config = initConfig(config2);
this._scopeCache = /* @__PURE__ */ new Map();
this._resolverCache = /* @__PURE__ */ new Map();
}
get platform() {
return this._config.platform;
}
get type() {
return this._config.type;
}
set type(type) {
this._config.type = type;
}
get data() {
return this._config.data;
}
set data(data) {
this._config.data = initData(data);
}
get options() {
return this._config.options;
}
set options(options) {
this._config.options = options;
}
get plugins() {
return this._config.plugins;
}
update() {
const config2 = this._config;
this.clearCache();
initOptions(config2);
}
clearCache() {
this._scopeCache.clear();
this._resolverCache.clear();
}
datasetScopeKeys(datasetType) {
return cachedKeys(
datasetType,
() => [[
`datasets.${datasetType}`,
""
]]
);
}
datasetAnimationScopeKeys(datasetType, transition2) {
return cachedKeys(
`${datasetType}.transition.${transition2}`,
() => [
[
`datasets.${datasetType}.transitions.${transition2}`,
`transitions.${transition2}`
],
[
`datasets.${datasetType}`,
""
]
]
);
}
datasetElementScopeKeys(datasetType, elementType2) {
return cachedKeys(
`${datasetType}-${elementType2}`,
() => [[
`datasets.${datasetType}.elements.${elementType2}`,
`datasets.${datasetType}`,
`elements.${elementType2}`,
""
]]
);
}
pluginScopeKeys(plugin) {
const id = plugin.id;
const type = this.type;
return cachedKeys(
`${type}-plugin-${id}`,
() => [[
`plugins.${id}`,
...plugin.additionalOptionScopes || []
]]
);
}
_cachedScopes(mainScope, resetCache) {
const _scopeCache = this._scopeCache;
let cache2 = _scopeCache.get(mainScope);
if (!cache2 || resetCache) {
cache2 = /* @__PURE__ */ new Map();
_scopeCache.set(mainScope, cache2);
}
return cache2;
}
getOptionScopes(mainScope, keyLists, resetCache) {
const { options, type } = this;
const cache2 = this._cachedScopes(mainScope, resetCache);
const cached = cache2.get(keyLists);
if (cached) {
return cached;
}
const scopes = /* @__PURE__ */ new Set();
keyLists.forEach((keys2) => {
if (mainScope) {
scopes.add(mainScope);
keys2.forEach((key) => addIfFound(scopes, mainScope, key));
}
keys2.forEach((key) => addIfFound(scopes, options, key));
keys2.forEach((key) => addIfFound(scopes, overrides[type] || {}, key));
keys2.forEach((key) => addIfFound(scopes, defaults, key));
keys2.forEach((key) => addIfFound(scopes, descriptors, key));
});
const array = Array.from(scopes);
if (array.length === 0) {
array.push(/* @__PURE__ */ Object.create(null));
}
if (keysCached.has(keyLists)) {
cache2.set(keyLists, array);
}
return array;
}
chartOptionScopes() {
const { options, type } = this;
return [
options,
overrides[type] || {},
defaults.datasets[type] || {},
{ type },
defaults,
descriptors
];
}
resolveNamedOptions(scopes, names2, context, prefixes = [""]) {
const result = { $shared: true };
const { resolver, subPrefixes } = getResolver(this._resolverCache, scopes, prefixes);
let options = resolver;
if (needContext(resolver, names2)) {
result.$shared = false;
context = isFunction(context) ? context() : context;
const subResolver = this.createResolver(scopes, context, subPrefixes);
options = _attachContext(resolver, context, subResolver);
}
for (const prop of names2) {
result[prop] = options[prop];
}
return result;
}
createResolver(scopes, context, prefixes = [""], descriptorDefaults) {
const { resolver } = getResolver(this._resolverCache, scopes, prefixes);
return isObject(context) ? _attachContext(resolver, context, void 0, descriptorDefaults) : resolver;
}
};
hasFunction = (value) => isObject(value) && Object.getOwnPropertyNames(value).reduce((acc, key) => acc || isFunction(value[key]), false);
version = "3.7.0";
KNOWN_POSITIONS = ["top", "bottom", "left", "right", "chartArea"];
instances = {};
getChart = (key) => {
const canvas = getCanvas(key);
return Object.values(instances).filter((c4) => c4.canvas === canvas).pop();
};
Chart = class {
constructor(item, userConfig) {
const config2 = this.config = new Config(userConfig);
const initialCanvas = getCanvas(item);
const existingChart = getChart(initialCanvas);
if (existingChart) {
throw new Error(
"Canvas is already in use. Chart with ID '" + existingChart.id + "' must be destroyed before the canvas can be reused."
);
}
const options = config2.createResolver(config2.chartOptionScopes(), this.getContext());
this.platform = new (config2.platform || _detectPlatform(initialCanvas))();
this.platform.updateConfig(config2);
const context = this.platform.acquireContext(initialCanvas, options.aspectRatio);
const canvas = context && context.canvas;
const height = canvas && canvas.height;
const width = canvas && canvas.width;
this.id = uid();
this.ctx = context;
this.canvas = canvas;
this.width = width;
this.height = height;
this._options = options;
this._aspectRatio = this.aspectRatio;
this._layers = [];
this._metasets = [];
this._stacks = void 0;
this.boxes = [];
this.currentDevicePixelRatio = void 0;
this.chartArea = void 0;
this._active = [];
this._lastEvent = void 0;
this._listeners = {};
this._responsiveListeners = void 0;
this._sortedMetasets = [];
this.scales = {};
this._plugins = new PluginService();
this.$proxies = {};
this._hiddenIndices = {};
this.attached = false;
this._animationsDisabled = void 0;
this.$context = void 0;
this._doResize = debounce((mode) => this.update(mode), options.resizeDelay || 0);
this._dataChanges = [];
instances[this.id] = this;
if (!context || !canvas) {
console.error("Failed to create chart: can't acquire context from the given item");
return;
}
animator.listen(this, "complete", onAnimationsComplete);
animator.listen(this, "progress", onAnimationProgress);
this._initialize();
if (this.attached) {
this.update();
}
}
get aspectRatio() {
const { options: { aspectRatio, maintainAspectRatio }, width, height, _aspectRatio } = this;
if (!isNullOrUndef(aspectRatio)) {
return aspectRatio;
}
if (maintainAspectRatio && _aspectRatio) {
return _aspectRatio;
}
return height ? width / height : null;
}
get data() {
return this.config.data;
}
set data(data) {
this.config.data = data;
}
get options() {
return this._options;
}
set options(options) {
this.config.options = options;
}
_initialize() {
this.notifyPlugins("beforeInit");
if (this.options.responsive) {
this.resize();
} else {
retinaScale(this, this.options.devicePixelRatio);
}
this.bindEvents();
this.notifyPlugins("afterInit");
return this;
}
clear() {
clearCanvas(this.canvas, this.ctx);
return this;
}
stop() {
animator.stop(this);
return this;
}
resize(width, height) {
if (!animator.running(this)) {
this._resize(width, height);
} else {
this._resizeBeforeDraw = { width, height };
}
}
_resize(width, height) {
const options = this.options;
const canvas = this.canvas;
const aspectRatio = options.maintainAspectRatio && this.aspectRatio;
const newSize = this.platform.getMaximumSize(canvas, width, height, aspectRatio);
const newRatio = options.devicePixelRatio || this.platform.getDevicePixelRatio();
const mode = this.width ? "resize" : "attach";
this.width = newSize.width;
this.height = newSize.height;
this._aspectRatio = this.aspectRatio;
if (!retinaScale(this, newRatio, true)) {
return;
}
this.notifyPlugins("resize", { size: newSize });
callback(options.onResize, [this, newSize], this);
if (this.attached) {
if (this._doResize(mode)) {
this.render();
}
}
}
ensureScalesHaveIDs() {
const options = this.options;
const scalesOptions = options.scales || {};
each(scalesOptions, (axisOptions, axisID) => {
axisOptions.id = axisID;
});
}
buildOrUpdateScales() {
const options = this.options;
const scaleOpts = options.scales;
const scales2 = this.scales;
const updated = Object.keys(scales2).reduce((obj, id) => {
obj[id] = false;
return obj;
}, {});
let items = [];
if (scaleOpts) {
items = items.concat(
Object.keys(scaleOpts).map((id) => {
const scaleOptions = scaleOpts[id];
const axis = determineAxis(id, scaleOptions);
const isRadial = axis === "r";
const isHorizontal = axis === "x";
return {
options: scaleOptions,
dposition: isRadial ? "chartArea" : isHorizontal ? "bottom" : "left",
dtype: isRadial ? "radialLinear" : isHorizontal ? "category" : "linear"
};
})
);
}
each(items, (item) => {
const scaleOptions = item.options;
const id = scaleOptions.id;
const axis = determineAxis(id, scaleOptions);
const scaleType = valueOrDefault(scaleOptions.type, item.dtype);
if (scaleOptions.position === void 0 || positionIsHorizontal(scaleOptions.position, axis) !== positionIsHorizontal(item.dposition)) {
scaleOptions.position = item.dposition;
}
updated[id] = true;
let scale = null;
if (id in scales2 && scales2[id].type === scaleType) {
scale = scales2[id];
} else {
const scaleClass = registry.getScale(scaleType);
scale = new scaleClass({
id,
type: scaleType,
ctx: this.ctx,
chart: this
});
scales2[scale.id] = scale;
}
scale.init(scaleOptions, options);
});
each(updated, (hasUpdated, id) => {
if (!hasUpdated) {
delete scales2[id];
}
});
each(scales2, (scale) => {
layouts.configure(this, scale, scale.options);
layouts.addBox(this, scale);
});
}
_updateMetasets() {
const metasets = this._metasets;
const numData = this.data.datasets.length;
const numMeta = metasets.length;
metasets.sort((a5, b4) => a5.index - b4.index);
if (numMeta > numData) {
for (let i5 = numData; i5 < numMeta; ++i5) {
this._destroyDatasetMeta(i5);
}
metasets.splice(numData, numMeta - numData);
}
this._sortedMetasets = metasets.slice(0).sort(compare2Level("order", "index"));
}
_removeUnreferencedMetasets() {
const { _metasets: metasets, data: { datasets } } = this;
if (metasets.length > datasets.length) {
delete this._stacks;
}
metasets.forEach((meta, index3) => {
if (datasets.filter((x4) => x4 === meta._dataset).length === 0) {
this._destroyDatasetMeta(index3);
}
});
}
buildOrUpdateControllers() {
const newControllers = [];
const datasets = this.data.datasets;
let i5, ilen;
this._removeUnreferencedMetasets();
for (i5 = 0, ilen = datasets.length; i5 < ilen; i5++) {
const dataset = datasets[i5];
let meta = this.getDatasetMeta(i5);
const type = dataset.type || this.config.type;
if (meta.type && meta.type !== type) {
this._destroyDatasetMeta(i5);
meta = this.getDatasetMeta(i5);
}
meta.type = type;
meta.indexAxis = dataset.indexAxis || getIndexAxis(type, this.options);
meta.order = dataset.order || 0;
meta.index = i5;
meta.label = "" + dataset.label;
meta.visible = this.isDatasetVisible(i5);
if (meta.controller) {
meta.controller.updateIndex(i5);
meta.controller.linkScales();
} else {
const ControllerClass = registry.getController(type);
const { datasetElementType, dataElementType } = defaults.datasets[type];
Object.assign(ControllerClass.prototype, {
dataElementType: registry.getElement(dataElementType),
datasetElementType: datasetElementType && registry.getElement(datasetElementType)
});
meta.controller = new ControllerClass(this, i5);
newControllers.push(meta.controller);
}
}
this._updateMetasets();
return newControllers;
}
_resetElements() {
each(this.data.datasets, (dataset, datasetIndex) => {
this.getDatasetMeta(datasetIndex).controller.reset();
}, this);
}
reset() {
this._resetElements();
this.notifyPlugins("reset");
}
update(mode) {
const config2 = this.config;
config2.update();
const options = this._options = config2.createResolver(config2.chartOptionScopes(), this.getContext());
const animsDisabled = this._animationsDisabled = !options.animation;
this._updateScales();
this._checkEventBindings();
this._updateHiddenIndices();
this._plugins.invalidate();
if (this.notifyPlugins("beforeUpdate", { mode, cancelable: true }) === false) {
return;
}
const newControllers = this.buildOrUpdateControllers();
this.notifyPlugins("beforeElementsUpdate");
let minPadding = 0;
for (let i5 = 0, ilen = this.data.datasets.length; i5 < ilen; i5++) {
const { controller } = this.getDatasetMeta(i5);
const reset2 = !animsDisabled && newControllers.indexOf(controller) === -1;
controller.buildOrUpdateElements(reset2);
minPadding = Math.max(+controller.getMaxOverflow(), minPadding);
}
minPadding = this._minPadding = options.layout.autoPadding ? minPadding : 0;
this._updateLayout(minPadding);
if (!animsDisabled) {
each(newControllers, (controller) => {
controller.reset();
});
}
this._updateDatasets(mode);
this.notifyPlugins("afterUpdate", { mode });
this._layers.sort(compare2Level("z", "_idx"));
const { _active, _lastEvent } = this;
if (_lastEvent) {
this._eventHandler(_lastEvent, true);
} else if (_active.length) {
this._updateHoverStyles(_active, _active, true);
}
this.render();
}
_updateScales() {
each(this.scales, (scale) => {
layouts.removeBox(this, scale);
});
this.ensureScalesHaveIDs();
this.buildOrUpdateScales();
}
_checkEventBindings() {
const options = this.options;
const existingEvents = new Set(Object.keys(this._listeners));
const newEvents = new Set(options.events);
if (!setsEqual(existingEvents, newEvents) || !!this._responsiveListeners !== options.responsive) {
this.unbindEvents();
this.bindEvents();
}
}
_updateHiddenIndices() {
const { _hiddenIndices } = this;
const changes = this._getUniformDataChanges() || [];
for (const { method, start: start3, count } of changes) {
const move = method === "_removeElements" ? -count : count;
moveNumericKeys(_hiddenIndices, start3, move);
}
}
_getUniformDataChanges() {
const _dataChanges = this._dataChanges;
if (!_dataChanges || !_dataChanges.length) {
return;
}
this._dataChanges = [];
const datasetCount = this.data.datasets.length;
const makeSet = (idx) => new Set(
_dataChanges.filter((c4) => c4[0] === idx).map((c4, i5) => i5 + "," + c4.splice(1).join(","))
);
const changeSet = makeSet(0);
for (let i5 = 1; i5 < datasetCount; i5++) {
if (!setsEqual(changeSet, makeSet(i5))) {
return;
}
}
return Array.from(changeSet).map((c4) => c4.split(",")).map((a5) => ({ method: a5[1], start: +a5[2], count: +a5[3] }));
}
_updateLayout(minPadding) {
if (this.notifyPlugins("beforeLayout", { cancelable: true }) === false) {
return;
}
layouts.update(this, this.width, this.height, minPadding);
const area = this.chartArea;
const noArea = area.width <= 0 || area.height <= 0;
this._layers = [];
each(this.boxes, (box) => {
if (noArea && box.position === "chartArea") {
return;
}
if (box.configure) {
box.configure();
}
this._layers.push(...box._layers());
}, this);
this._layers.forEach((item, index3) => {
item._idx = index3;
});
this.notifyPlugins("afterLayout");
}
_updateDatasets(mode) {
if (this.notifyPlugins("beforeDatasetsUpdate", { mode, cancelable: true }) === false) {
return;
}
for (let i5 = 0, ilen = this.data.datasets.length; i5 < ilen; ++i5) {
this.getDatasetMeta(i5).controller.configure();
}
for (let i5 = 0, ilen = this.data.datasets.length; i5 < ilen; ++i5) {
this._updateDataset(i5, isFunction(mode) ? mode({ datasetIndex: i5 }) : mode);
}
this.notifyPlugins("afterDatasetsUpdate", { mode });
}
_updateDataset(index3, mode) {
const meta = this.getDatasetMeta(index3);
const args = { meta, index: index3, mode, cancelable: true };
if (this.notifyPlugins("beforeDatasetUpdate", args) === false) {
return;
}
meta.controller._update(mode);
args.cancelable = false;
this.notifyPlugins("afterDatasetUpdate", args);
}
render() {
if (this.notifyPlugins("beforeRender", { cancelable: true }) === false) {
return;
}
if (animator.has(this)) {
if (this.attached && !animator.running(this)) {
animator.start(this);
}
} else {
this.draw();
onAnimationsComplete({ chart: this });
}
}
draw() {
let i5;
if (this._resizeBeforeDraw) {
const { width, height } = this._resizeBeforeDraw;
this._resize(width, height);
this._resizeBeforeDraw = null;
}
this.clear();
if (this.width <= 0 || this.height <= 0) {
return;
}
if (this.notifyPlugins("beforeDraw", { cancelable: true }) === false) {
return;
}
const layers = this._layers;
for (i5 = 0; i5 < layers.length && layers[i5].z <= 0; ++i5) {
layers[i5].draw(this.chartArea);
}
this._drawDatasets();
for (; i5 < layers.length; ++i5) {
layers[i5].draw(this.chartArea);
}
this.notifyPlugins("afterDraw");
}
_getSortedDatasetMetas(filterVisible) {
const metasets = this._sortedMetasets;
const result = [];
let i5, ilen;
for (i5 = 0, ilen = metasets.length; i5 < ilen; ++i5) {
const meta = metasets[i5];
if (!filterVisible || meta.visible) {
result.push(meta);
}
}
return result;
}
getSortedVisibleDatasetMetas() {
return this._getSortedDatasetMetas(true);
}
_drawDatasets() {
if (this.notifyPlugins("beforeDatasetsDraw", { cancelable: true }) === false) {
return;
}
const metasets = this.getSortedVisibleDatasetMetas();
for (let i5 = metasets.length - 1; i5 >= 0; --i5) {
this._drawDataset(metasets[i5]);
}
this.notifyPlugins("afterDatasetsDraw");
}
_drawDataset(meta) {
const ctx = this.ctx;
const clip = meta._clip;
const useClip = !clip.disabled;
const area = this.chartArea;
const args = {
meta,
index: meta.index,
cancelable: true
};
if (this.notifyPlugins("beforeDatasetDraw", args) === false) {
return;
}
if (useClip) {
clipArea(ctx, {
left: clip.left === false ? 0 : area.left - clip.left,
right: clip.right === false ? this.width : area.right + clip.right,
top: clip.top === false ? 0 : area.top - clip.top,
bottom: clip.bottom === false ? this.height : area.bottom + clip.bottom
});
}
meta.controller.draw();
if (useClip) {
unclipArea(ctx);
}
args.cancelable = false;
this.notifyPlugins("afterDatasetDraw", args);
}
getElementsAtEventForMode(e5, mode, options, useFinalPosition) {
const method = Interaction.modes[mode];
if (typeof method === "function") {
return method(this, e5, options, useFinalPosition);
}
return [];
}
getDatasetMeta(datasetIndex) {
const dataset = this.data.datasets[datasetIndex];
const metasets = this._metasets;
let meta = metasets.filter((x4) => x4 && x4._dataset === dataset).pop();
if (!meta) {
meta = {
type: null,
data: [],
dataset: null,
controller: null,
hidden: null,
xAxisID: null,
yAxisID: null,
order: dataset && dataset.order || 0,
index: datasetIndex,
_dataset: dataset,
_parsed: [],
_sorted: false
};
metasets.push(meta);
}
return meta;
}
getContext() {
return this.$context || (this.$context = createContext(null, { chart: this, type: "chart" }));
}
getVisibleDatasetCount() {
return this.getSortedVisibleDatasetMetas().length;
}
isDatasetVisible(datasetIndex) {
const dataset = this.data.datasets[datasetIndex];
if (!dataset) {
return false;
}
const meta = this.getDatasetMeta(datasetIndex);
return typeof meta.hidden === "boolean" ? !meta.hidden : !dataset.hidden;
}
setDatasetVisibility(datasetIndex, visible) {
const meta = this.getDatasetMeta(datasetIndex);
meta.hidden = !visible;
}
toggleDataVisibility(index3) {
this._hiddenIndices[index3] = !this._hiddenIndices[index3];
}
getDataVisibility(index3) {
return !this._hiddenIndices[index3];
}
_updateVisibility(datasetIndex, dataIndex, visible) {
const mode = visible ? "show" : "hide";
const meta = this.getDatasetMeta(datasetIndex);
const anims = meta.controller._resolveAnimations(void 0, mode);
if (defined(dataIndex)) {
meta.data[dataIndex].hidden = !visible;
this.update();
} else {
this.setDatasetVisibility(datasetIndex, visible);
anims.update(meta, { visible });
this.update((ctx) => ctx.datasetIndex === datasetIndex ? mode : void 0);
}
}
hide(datasetIndex, dataIndex) {
this._updateVisibility(datasetIndex, dataIndex, false);
}
show(datasetIndex, dataIndex) {
this._updateVisibility(datasetIndex, dataIndex, true);
}
_destroyDatasetMeta(datasetIndex) {
const meta = this._metasets[datasetIndex];
if (meta && meta.controller) {
meta.controller._destroy();
}
delete this._metasets[datasetIndex];
}
_stop() {
let i5, ilen;
this.stop();
animator.remove(this);
for (i5 = 0, ilen = this.data.datasets.length; i5 < ilen; ++i5) {
this._destroyDatasetMeta(i5);
}
}
destroy() {
this.notifyPlugins("beforeDestroy");
const { canvas, ctx } = this;
this._stop();
this.config.clearCache();
if (canvas) {
this.unbindEvents();
clearCanvas(canvas, ctx);
this.platform.releaseContext(ctx);
this.canvas = null;
this.ctx = null;
}
this.notifyPlugins("destroy");
delete instances[this.id];
this.notifyPlugins("afterDestroy");
}
toBase64Image(...args) {
return this.canvas.toDataURL(...args);
}
bindEvents() {
this.bindUserEvents();
if (this.options.responsive) {
this.bindResponsiveEvents();
} else {
this.attached = true;
}
}
bindUserEvents() {
const listeners = this._listeners;
const platform = this.platform;
const _add = (type, listener2) => {
platform.addEventListener(this, type, listener2);
listeners[type] = listener2;
};
const listener = (e5, x4, y4) => {
e5.offsetX = x4;
e5.offsetY = y4;
this._eventHandler(e5);
};
each(this.options.events, (type) => _add(type, listener));
}
bindResponsiveEvents() {
if (!this._responsiveListeners) {
this._responsiveListeners = {};
}
const listeners = this._responsiveListeners;
const platform = this.platform;
const _add = (type, listener2) => {
platform.addEventListener(this, type, listener2);
listeners[type] = listener2;
};
const _remove = (type, listener2) => {
if (listeners[type]) {
platform.removeEventListener(this, type, listener2);
delete listeners[type];
}
};
const listener = (width, height) => {
if (this.canvas) {
this.resize(width, height);
}
};
let detached;
const attached = () => {
_remove("attach", attached);
this.attached = true;
this.resize();
_add("resize", listener);
_add("detach", detached);
};
detached = () => {
this.attached = false;
_remove("resize", listener);
this._stop();
this._resize(0, 0);
_add("attach", attached);
};
if (platform.isAttached(this.canvas)) {
attached();
} else {
detached();
}
}
unbindEvents() {
each(this._listeners, (listener, type) => {
this.platform.removeEventListener(this, type, listener);
});
this._listeners = {};
each(this._responsiveListeners, (listener, type) => {
this.platform.removeEventListener(this, type, listener);
});
this._responsiveListeners = void 0;
}
updateHoverStyle(items, mode, enabled) {
const prefix = enabled ? "set" : "remove";
let meta, item, i5, ilen;
if (mode === "dataset") {
meta = this.getDatasetMeta(items[0].datasetIndex);
meta.controller["_" + prefix + "DatasetHoverStyle"]();
}
for (i5 = 0, ilen = items.length; i5 < ilen; ++i5) {
item = items[i5];
const controller = item && this.getDatasetMeta(item.datasetIndex).controller;
if (controller) {
controller[prefix + "HoverStyle"](item.element, item.datasetIndex, item.index);
}
}
}
getActiveElements() {
return this._active || [];
}
setActiveElements(activeElements) {
const lastActive = this._active || [];
const active = activeElements.map(({ datasetIndex, index: index3 }) => {
const meta = this.getDatasetMeta(datasetIndex);
if (!meta) {
throw new Error("No dataset found at index " + datasetIndex);
}
return {
datasetIndex,
element: meta.data[index3],
index: index3
};
});
const changed = !_elementsEqual(active, lastActive);
if (changed) {
this._active = active;
this._lastEvent = null;
this._updateHoverStyles(active, lastActive);
}
}
notifyPlugins(hook, args, filter2) {
return this._plugins.notify(this, hook, args, filter2);
}
_updateHoverStyles(active, lastActive, replay) {
const hoverOptions = this.options.hover;
const diff = (a5, b4) => a5.filter((x4) => !b4.some((y4) => x4.datasetIndex === y4.datasetIndex && x4.index === y4.index));
const deactivated = diff(lastActive, active);
const activated = replay ? active : diff(active, lastActive);
if (deactivated.length) {
this.updateHoverStyle(deactivated, hoverOptions.mode, false);
}
if (activated.length && hoverOptions.mode) {
this.updateHoverStyle(activated, hoverOptions.mode, true);
}
}
_eventHandler(e5, replay) {
const args = {
event: e5,
replay,
cancelable: true,
inChartArea: _isPointInArea(e5, this.chartArea, this._minPadding)
};
const eventFilter = (plugin) => (plugin.options.events || this.options.events).includes(e5.native.type);
if (this.notifyPlugins("beforeEvent", args, eventFilter) === false) {
return;
}
const changed = this._handleEvent(e5, replay, args.inChartArea);
args.cancelable = false;
this.notifyPlugins("afterEvent", args, eventFilter);
if (changed || args.changed) {
this.render();
}
return this;
}
_handleEvent(e5, replay, inChartArea) {
const { _active: lastActive = [], options } = this;
const useFinalPosition = replay;
const active = this._getActiveElements(e5, lastActive, inChartArea, useFinalPosition);
const isClick = _isClickEvent(e5);
const lastEvent = determineLastEvent(e5, this._lastEvent, inChartArea, isClick);
if (inChartArea) {
this._lastEvent = null;
callback(options.onHover, [e5, active, this], this);
if (isClick) {
callback(options.onClick, [e5, active, this], this);
}
}
const changed = !_elementsEqual(active, lastActive);
if (changed || replay) {
this._active = active;
this._updateHoverStyles(active, lastActive, replay);
}
this._lastEvent = lastEvent;
return changed;
}
_getActiveElements(e5, lastActive, inChartArea, useFinalPosition) {
if (e5.type === "mouseout") {
return [];
}
if (!inChartArea) {
return lastActive;
}
const hoverOptions = this.options.hover;
return this.getElementsAtEventForMode(e5, hoverOptions.mode, hoverOptions, useFinalPosition);
}
};
invalidatePlugins = () => each(Chart.instances, (chart) => chart._plugins.invalidate());
enumerable = true;
Object.defineProperties(Chart, {
defaults: {
enumerable,
value: defaults
},
instances: {
enumerable,
value: instances
},
overrides: {
enumerable,
value: overrides
},
registry: {
enumerable,
value: registry
},
version: {
enumerable,
value: version
},
getChart: {
enumerable,
value: getChart
},
register: {
enumerable,
value: (...items) => {
registry.add(...items);
invalidatePlugins();
}
},
unregister: {
enumerable,
value: (...items) => {
registry.remove(...items);
invalidatePlugins();
}
}
});
ArcElement = class extends Element2 {
constructor(cfg) {
super();
this.options = void 0;
this.circumference = void 0;
this.startAngle = void 0;
this.endAngle = void 0;
this.innerRadius = void 0;
this.outerRadius = void 0;
this.pixelMargin = 0;
this.fullCircles = 0;
if (cfg) {
Object.assign(this, cfg);
}
}
inRange(chartX, chartY, useFinalPosition) {
const point = this.getProps(["x", "y"], useFinalPosition);
const { angle, distance } = getAngleFromPoint(point, { x: chartX, y: chartY });
const { startAngle, endAngle, innerRadius, outerRadius, circumference } = this.getProps([
"startAngle",
"endAngle",
"innerRadius",
"outerRadius",
"circumference"
], useFinalPosition);
const rAdjust = this.options.spacing / 2;
const _circumference = valueOrDefault(circumference, endAngle - startAngle);
const betweenAngles = _circumference >= TAU || _angleBetween(angle, startAngle, endAngle);
const withinRadius = _isBetween(distance, innerRadius + rAdjust, outerRadius + rAdjust);
return betweenAngles && withinRadius;
}
getCenterPoint(useFinalPosition) {
const { x: x4, y: y4, startAngle, endAngle, innerRadius, outerRadius } = this.getProps([
"x",
"y",
"startAngle",
"endAngle",
"innerRadius",
"outerRadius",
"circumference"
], useFinalPosition);
const { offset: offset3, spacing } = this.options;
const halfAngle = (startAngle + endAngle) / 2;
const halfRadius = (innerRadius + outerRadius + spacing + offset3) / 2;
return {
x: x4 + Math.cos(halfAngle) * halfRadius,
y: y4 + Math.sin(halfAngle) * halfRadius
};
}
tooltipPosition(useFinalPosition) {
return this.getCenterPoint(useFinalPosition);
}
draw(ctx) {
const { options, circumference } = this;
const offset3 = (options.offset || 0) / 2;
const spacing = (options.spacing || 0) / 2;
this.pixelMargin = options.borderAlign === "inner" ? 0.33 : 0;
this.fullCircles = circumference > TAU ? Math.floor(circumference / TAU) : 0;
if (circumference === 0 || this.innerRadius < 0 || this.outerRadius < 0) {
return;
}
ctx.save();
let radiusOffset = 0;
if (offset3) {
radiusOffset = offset3 / 2;
const halfAngle = (this.startAngle + this.endAngle) / 2;
ctx.translate(Math.cos(halfAngle) * radiusOffset, Math.sin(halfAngle) * radiusOffset);
if (this.circumference >= PI) {
radiusOffset = offset3;
}
}
ctx.fillStyle = options.backgroundColor;
ctx.strokeStyle = options.borderColor;
const endAngle = drawArc(ctx, this, radiusOffset, spacing);
drawBorder(ctx, this, radiusOffset, spacing, endAngle);
ctx.restore();
}
};
ArcElement.id = "arc";
ArcElement.defaults = {
borderAlign: "center",
borderColor: "#fff",
borderJoinStyle: void 0,
borderRadius: 0,
borderWidth: 2,
offset: 0,
spacing: 0,
angle: void 0
};
ArcElement.defaultRoutes = {
backgroundColor: "backgroundColor"
};
usePath2D = typeof Path2D === "function";
LineElement = class extends Element2 {
constructor(cfg) {
super();
this.animated = true;
this.options = void 0;
this._chart = void 0;
this._loop = void 0;
this._fullLoop = void 0;
this._path = void 0;
this._points = void 0;
this._segments = void 0;
this._decimated = false;
this._pointsUpdated = false;
this._datasetIndex = void 0;
if (cfg) {
Object.assign(this, cfg);
}
}
updateControlPoints(chartArea, indexAxis) {
const options = this.options;
if ((options.tension || options.cubicInterpolationMode === "monotone") && !options.stepped && !this._pointsUpdated) {
const loop = options.spanGaps ? this._loop : this._fullLoop;
_updateBezierControlPoints(this._points, options, chartArea, loop, indexAxis);
this._pointsUpdated = true;
}
}
set points(points) {
this._points = points;
delete this._segments;
delete this._path;
this._pointsUpdated = false;
}
get points() {
return this._points;
}
get segments() {
return this._segments || (this._segments = _computeSegments(this, this.options.segment));
}
first() {
const segments = this.segments;
const points = this.points;
return segments.length && points[segments[0].start];
}
last() {
const segments = this.segments;
const points = this.points;
const count = segments.length;
return count && points[segments[count - 1].end];
}
interpolate(point, property) {
const options = this.options;
const value = point[property];
const points = this.points;
const segments = _boundSegments(this, { property, start: value, end: value });
if (!segments.length) {
return;
}
const result = [];
const _interpolate = _getInterpolationMethod(options);
let i5, ilen;
for (i5 = 0, ilen = segments.length; i5 < ilen; ++i5) {
const { start: start3, end: end2 } = segments[i5];
const p1 = points[start3];
const p22 = points[end2];
if (p1 === p22) {
result.push(p1);
continue;
}
const t5 = Math.abs((value - p1[property]) / (p22[property] - p1[property]));
const interpolated = _interpolate(p1, p22, t5, options.stepped);
interpolated[property] = point[property];
result.push(interpolated);
}
return result.length === 1 ? result[0] : result;
}
pathSegment(ctx, segment, params) {
const segmentMethod = _getSegmentMethod(this);
return segmentMethod(ctx, this, segment, params);
}
path(ctx, start3, count) {
const segments = this.segments;
const segmentMethod = _getSegmentMethod(this);
let loop = this._loop;
start3 = start3 || 0;
count = count || this.points.length - start3;
for (const segment of segments) {
loop &= segmentMethod(ctx, this, segment, { start: start3, end: start3 + count - 1 });
}
return !!loop;
}
draw(ctx, chartArea, start3, count) {
const options = this.options || {};
const points = this.points || [];
if (points.length && options.borderWidth) {
ctx.save();
draw(ctx, this, start3, count);
ctx.restore();
}
if (this.animated) {
this._pointsUpdated = false;
this._path = void 0;
}
}
};
LineElement.id = "line";
LineElement.defaults = {
borderCapStyle: "butt",
borderDash: [],
borderDashOffset: 0,
borderJoinStyle: "miter",
borderWidth: 3,
capBezierPoints: true,
cubicInterpolationMode: "default",
fill: false,
spanGaps: false,
stepped: false,
tension: 0
};
LineElement.defaultRoutes = {
backgroundColor: "backgroundColor",
borderColor: "borderColor"
};
LineElement.descriptors = {
_scriptable: true,
_indexable: (name) => name !== "borderDash" && name !== "fill"
};
PointElement = class extends Element2 {
constructor(cfg) {
super();
this.options = void 0;
this.parsed = void 0;
this.skip = void 0;
this.stop = void 0;
if (cfg) {
Object.assign(this, cfg);
}
}
inRange(mouseX, mouseY, useFinalPosition) {
const options = this.options;
const { x: x4, y: y4 } = this.getProps(["x", "y"], useFinalPosition);
return Math.pow(mouseX - x4, 2) + Math.pow(mouseY - y4, 2) < Math.pow(options.hitRadius + options.radius, 2);
}
inXRange(mouseX, useFinalPosition) {
return inRange$1(this, mouseX, "x", useFinalPosition);
}
inYRange(mouseY, useFinalPosition) {
return inRange$1(this, mouseY, "y", useFinalPosition);
}
getCenterPoint(useFinalPosition) {
const { x: x4, y: y4 } = this.getProps(["x", "y"], useFinalPosition);
return { x: x4, y: y4 };
}
size(options) {
options = options || this.options || {};
let radius = options.radius || 0;
radius = Math.max(radius, radius && options.hoverRadius || 0);
const borderWidth = radius && options.borderWidth || 0;
return (radius + borderWidth) * 2;
}
draw(ctx, area) {
const options = this.options;
if (this.skip || options.radius < 0.1 || !_isPointInArea(this, area, this.size(options) / 2)) {
return;
}
ctx.strokeStyle = options.borderColor;
ctx.lineWidth = options.borderWidth;
ctx.fillStyle = options.backgroundColor;
drawPoint(ctx, options, this.x, this.y);
}
getRange() {
const options = this.options || {};
return options.radius + options.hitRadius;
}
};
PointElement.id = "point";
PointElement.defaults = {
borderWidth: 1,
hitRadius: 1,
hoverBorderWidth: 1,
hoverRadius: 4,
pointStyle: "circle",
radius: 3,
rotation: 0
};
PointElement.defaultRoutes = {
backgroundColor: "backgroundColor",
borderColor: "borderColor"
};
BarElement = class extends Element2 {
constructor(cfg) {
super();
this.options = void 0;
this.horizontal = void 0;
this.base = void 0;
this.width = void 0;
this.height = void 0;
this.inflateAmount = void 0;
if (cfg) {
Object.assign(this, cfg);
}
}
draw(ctx) {
const { inflateAmount, options: { borderColor, backgroundColor } } = this;
const { inner, outer } = boundingRects(this);
const addRectPath = hasRadius(outer.radius) ? addRoundedRectPath : addNormalRectPath;
ctx.save();
if (outer.w !== inner.w || outer.h !== inner.h) {
ctx.beginPath();
addRectPath(ctx, inflateRect(outer, inflateAmount, inner));
ctx.clip();
addRectPath(ctx, inflateRect(inner, -inflateAmount, outer));
ctx.fillStyle = borderColor;
ctx.fill("evenodd");
}
ctx.beginPath();
addRectPath(ctx, inflateRect(inner, inflateAmount));
ctx.fillStyle = backgroundColor;
ctx.fill();
ctx.restore();
}
inRange(mouseX, mouseY, useFinalPosition) {
return inRange(this, mouseX, mouseY, useFinalPosition);
}
inXRange(mouseX, useFinalPosition) {
return inRange(this, mouseX, null, useFinalPosition);
}
inYRange(mouseY, useFinalPosition) {
return inRange(this, null, mouseY, useFinalPosition);
}
getCenterPoint(useFinalPosition) {
const { x: x4, y: y4, base: base2, horizontal } = this.getProps(["x", "y", "base", "horizontal"], useFinalPosition);
return {
x: horizontal ? (x4 + base2) / 2 : x4,
y: horizontal ? y4 : (y4 + base2) / 2
};
}
getRange(axis) {
return axis === "x" ? this.width / 2 : this.height / 2;
}
};
BarElement.id = "bar";
BarElement.defaults = {
borderSkipped: "start",
borderWidth: 0,
borderRadius: 0,
inflateAmount: "auto",
pointStyle: void 0
};
BarElement.defaultRoutes = {
backgroundColor: "backgroundColor",
borderColor: "borderColor"
};
elements = /* @__PURE__ */ Object.freeze({
__proto__: null,
ArcElement,
LineElement,
PointElement,
BarElement
});
plugin_decimation = {
id: "decimation",
defaults: {
algorithm: "min-max",
enabled: false
},
beforeElementsUpdate: (chart, args, options) => {
if (!options.enabled) {
cleanDecimatedData(chart);
return;
}
const availableWidth = chart.width;
chart.data.datasets.forEach((dataset, datasetIndex) => {
const { _data, indexAxis } = dataset;
const meta = chart.getDatasetMeta(datasetIndex);
const data = _data || dataset.data;
if (resolve([indexAxis, chart.options.indexAxis]) === "y") {
return;
}
if (meta.type !== "line") {
return;
}
const xAxis = chart.scales[meta.xAxisID];
if (xAxis.type !== "linear" && xAxis.type !== "time") {
return;
}
if (chart.options.parsing) {
return;
}
let { start: start3, count } = getStartAndCountOfVisiblePointsSimplified(meta, data);
const threshold = options.threshold || 4 * availableWidth;
if (count <= threshold) {
cleanDecimatedDataset(dataset);
return;
}
if (isNullOrUndef(_data)) {
dataset._data = data;
delete dataset.data;
Object.defineProperty(dataset, "data", {
configurable: true,
enumerable: true,
get: function() {
return this._decimated;
},
set: function(d4) {
this._data = d4;
}
});
}
let decimated;
switch (options.algorithm) {
case "lttb":
decimated = lttbDecimation(data, start3, count, availableWidth, options);
break;
case "min-max":
decimated = minMaxDecimation(data, start3, count, availableWidth);
break;
default:
throw new Error(`Unsupported decimation algorithm '${options.algorithm}'`);
}
dataset._decimated = decimated;
});
},
destroy(chart) {
cleanDecimatedData(chart);
}
};
simpleArc = class {
constructor(opts) {
this.x = opts.x;
this.y = opts.y;
this.radius = opts.radius;
}
pathSegment(ctx, bounds, opts) {
const { x: x4, y: y4, radius } = this;
bounds = bounds || { start: 0, end: TAU };
ctx.arc(x4, y4, radius, bounds.end, bounds.start, true);
return !opts.bounds;
}
interpolate(point) {
const { x: x4, y: y4, radius } = this;
const angle = point.angle;
return {
x: x4 + Math.cos(angle) * radius,
y: y4 + Math.sin(angle) * radius,
angle
};
}
};
plugin_filler = {
id: "filler",
afterDatasetsUpdate(chart, _args, options) {
const count = (chart.data.datasets || []).length;
const sources = [];
let meta, i5, line, source;
for (i5 = 0; i5 < count; ++i5) {
meta = chart.getDatasetMeta(i5);
line = meta.dataset;
source = null;
if (line && line.options && line instanceof LineElement) {
source = {
visible: chart.isDatasetVisible(i5),
index: i5,
fill: decodeFill(line, i5, count),
chart,
axis: meta.controller.options.indexAxis,
scale: meta.vScale,
line
};
}
meta.$filler = source;
sources.push(source);
}
for (i5 = 0; i5 < count; ++i5) {
source = sources[i5];
if (!source || source.fill === false) {
continue;
}
source.fill = resolveTarget(sources, i5, options.propagate);
}
},
beforeDraw(chart, _args, options) {
const draw2 = options.drawTime === "beforeDraw";
const metasets = chart.getSortedVisibleDatasetMetas();
const area = chart.chartArea;
for (let i5 = metasets.length - 1; i5 >= 0; --i5) {
const source = metasets[i5].$filler;
if (!source) {
continue;
}
source.line.updateControlPoints(area, source.axis);
if (draw2) {
drawfill(chart.ctx, source, area);
}
}
},
beforeDatasetsDraw(chart, _args, options) {
if (options.drawTime !== "beforeDatasetsDraw") {
return;
}
const metasets = chart.getSortedVisibleDatasetMetas();
for (let i5 = metasets.length - 1; i5 >= 0; --i5) {
const source = metasets[i5].$filler;
if (source) {
drawfill(chart.ctx, source, chart.chartArea);
}
}
},
beforeDatasetDraw(chart, args, options) {
const source = args.meta.$filler;
if (!source || source.fill === false || options.drawTime !== "beforeDatasetDraw") {
return;
}
drawfill(chart.ctx, source, chart.chartArea);
},
defaults: {
propagate: true,
drawTime: "beforeDatasetDraw"
}
};
getBoxSize = (labelOpts, fontSize) => {
let { boxHeight = fontSize, boxWidth = fontSize } = labelOpts;
if (labelOpts.usePointStyle) {
boxHeight = Math.min(boxHeight, fontSize);
boxWidth = Math.min(boxWidth, fontSize);
}
return {
boxWidth,
boxHeight,
itemHeight: Math.max(fontSize, boxHeight)
};
};
itemsEqual = (a5, b4) => a5 !== null && b4 !== null && a5.datasetIndex === b4.datasetIndex && a5.index === b4.index;
Legend = class extends Element2 {
constructor(config2) {
super();
this._added = false;
this.legendHitBoxes = [];
this._hoveredItem = null;
this.doughnutMode = false;
this.chart = config2.chart;
this.options = config2.options;
this.ctx = config2.ctx;
this.legendItems = void 0;
this.columnSizes = void 0;
this.lineWidths = void 0;
this.maxHeight = void 0;
this.maxWidth = void 0;
this.top = void 0;
this.bottom = void 0;
this.left = void 0;
this.right = void 0;
this.height = void 0;
this.width = void 0;
this._margins = void 0;
this.position = void 0;
this.weight = void 0;
this.fullSize = void 0;
}
update(maxWidth, maxHeight, margins) {
this.maxWidth = maxWidth;
this.maxHeight = maxHeight;
this._margins = margins;
this.setDimensions();
this.buildLabels();
this.fit();
}
setDimensions() {
if (this.isHorizontal()) {
this.width = this.maxWidth;
this.left = this._margins.left;
this.right = this.width;
} else {
this.height = this.maxHeight;
this.top = this._margins.top;
this.bottom = this.height;
}
}
buildLabels() {
const labelOpts = this.options.labels || {};
let legendItems = callback(labelOpts.generateLabels, [this.chart], this) || [];
if (labelOpts.filter) {
legendItems = legendItems.filter((item) => labelOpts.filter(item, this.chart.data));
}
if (labelOpts.sort) {
legendItems = legendItems.sort((a5, b4) => labelOpts.sort(a5, b4, this.chart.data));
}
if (this.options.reverse) {
legendItems.reverse();
}
this.legendItems = legendItems;
}
fit() {
const { options, ctx } = this;
if (!options.display) {
this.width = this.height = 0;
return;
}
const labelOpts = options.labels;
const labelFont = toFont(labelOpts.font);
const fontSize = labelFont.size;
const titleHeight = this._computeTitleHeight();
const { boxWidth, itemHeight } = getBoxSize(labelOpts, fontSize);
let width, height;
ctx.font = labelFont.string;
if (this.isHorizontal()) {
width = this.maxWidth;
height = this._fitRows(titleHeight, fontSize, boxWidth, itemHeight) + 10;
} else {
height = this.maxHeight;
width = this._fitCols(titleHeight, fontSize, boxWidth, itemHeight) + 10;
}
this.width = Math.min(width, options.maxWidth || this.maxWidth);
this.height = Math.min(height, options.maxHeight || this.maxHeight);
}
_fitRows(titleHeight, fontSize, boxWidth, itemHeight) {
const { ctx, maxWidth, options: { labels: { padding } } } = this;
const hitboxes = this.legendHitBoxes = [];
const lineWidths = this.lineWidths = [0];
const lineHeight = itemHeight + padding;
let totalHeight = titleHeight;
ctx.textAlign = "left";
ctx.textBaseline = "middle";
let row = -1;
let top2 = -lineHeight;
this.legendItems.forEach((legendItem, i5) => {
const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width;
if (i5 === 0 || lineWidths[lineWidths.length - 1] + itemWidth + 2 * padding > maxWidth) {
totalHeight += lineHeight;
lineWidths[lineWidths.length - (i5 > 0 ? 0 : 1)] = 0;
top2 += lineHeight;
row++;
}
hitboxes[i5] = { left: 0, top: top2, row, width: itemWidth, height: itemHeight };
lineWidths[lineWidths.length - 1] += itemWidth + padding;
});
return totalHeight;
}
_fitCols(titleHeight, fontSize, boxWidth, itemHeight) {
const { ctx, maxHeight, options: { labels: { padding } } } = this;
const hitboxes = this.legendHitBoxes = [];
const columnSizes = this.columnSizes = [];
const heightLimit = maxHeight - titleHeight;
let totalWidth = padding;
let currentColWidth = 0;
let currentColHeight = 0;
let left2 = 0;
let col = 0;
this.legendItems.forEach((legendItem, i5) => {
const itemWidth = boxWidth + fontSize / 2 + ctx.measureText(legendItem.text).width;
if (i5 > 0 && currentColHeight + itemHeight + 2 * padding > heightLimit) {
totalWidth += currentColWidth + padding;
columnSizes.push({ width: currentColWidth, height: currentColHeight });
left2 += currentColWidth + padding;
col++;
currentColWidth = currentColHeight = 0;
}
hitboxes[i5] = { left: left2, top: currentColHeight, col, width: itemWidth, height: itemHeight };
currentColWidth = Math.max(currentColWidth, itemWidth);
currentColHeight += itemHeight + padding;
});
totalWidth += currentColWidth;
columnSizes.push({ width: currentColWidth, height: currentColHeight });
return totalWidth;
}
adjustHitBoxes() {
if (!this.options.display) {
return;
}
const titleHeight = this._computeTitleHeight();
const { legendHitBoxes: hitboxes, options: { align, labels: { padding }, rtl } } = this;
const rtlHelper = getRtlAdapter(rtl, this.left, this.width);
if (this.isHorizontal()) {
let row = 0;
let left2 = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);
for (const hitbox of hitboxes) {
if (row !== hitbox.row) {
row = hitbox.row;
left2 = _alignStartEnd(align, this.left + padding, this.right - this.lineWidths[row]);
}
hitbox.top += this.top + titleHeight + padding;
hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(left2), hitbox.width);
left2 += hitbox.width + padding;
}
} else {
let col = 0;
let top2 = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);
for (const hitbox of hitboxes) {
if (hitbox.col !== col) {
col = hitbox.col;
top2 = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - this.columnSizes[col].height);
}
hitbox.top = top2;
hitbox.left += this.left + padding;
hitbox.left = rtlHelper.leftForLtr(rtlHelper.x(hitbox.left), hitbox.width);
top2 += hitbox.height + padding;
}
}
}
isHorizontal() {
return this.options.position === "top" || this.options.position === "bottom";
}
draw() {
if (this.options.display) {
const ctx = this.ctx;
clipArea(ctx, this);
this._draw();
unclipArea(ctx);
}
}
_draw() {
const { options: opts, columnSizes, lineWidths, ctx } = this;
const { align, labels: labelOpts } = opts;
const defaultColor = defaults.color;
const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);
const labelFont = toFont(labelOpts.font);
const { color: fontColor, padding } = labelOpts;
const fontSize = labelFont.size;
const halfFontSize = fontSize / 2;
let cursor;
this.drawTitle();
ctx.textAlign = rtlHelper.textAlign("left");
ctx.textBaseline = "middle";
ctx.lineWidth = 0.5;
ctx.font = labelFont.string;
const { boxWidth, boxHeight, itemHeight } = getBoxSize(labelOpts, fontSize);
const drawLegendBox = function(x4, y4, legendItem) {
if (isNaN(boxWidth) || boxWidth <= 0 || isNaN(boxHeight) || boxHeight < 0) {
return;
}
ctx.save();
const lineWidth = valueOrDefault(legendItem.lineWidth, 1);
ctx.fillStyle = valueOrDefault(legendItem.fillStyle, defaultColor);
ctx.lineCap = valueOrDefault(legendItem.lineCap, "butt");
ctx.lineDashOffset = valueOrDefault(legendItem.lineDashOffset, 0);
ctx.lineJoin = valueOrDefault(legendItem.lineJoin, "miter");
ctx.lineWidth = lineWidth;
ctx.strokeStyle = valueOrDefault(legendItem.strokeStyle, defaultColor);
ctx.setLineDash(valueOrDefault(legendItem.lineDash, []));
if (labelOpts.usePointStyle) {
const drawOptions = {
radius: boxWidth * Math.SQRT2 / 2,
pointStyle: legendItem.pointStyle,
rotation: legendItem.rotation,
borderWidth: lineWidth
};
const centerX = rtlHelper.xPlus(x4, boxWidth / 2);
const centerY = y4 + halfFontSize;
drawPoint(ctx, drawOptions, centerX, centerY);
} else {
const yBoxTop = y4 + Math.max((fontSize - boxHeight) / 2, 0);
const xBoxLeft = rtlHelper.leftForLtr(x4, boxWidth);
const borderRadius = toTRBLCorners(legendItem.borderRadius);
ctx.beginPath();
if (Object.values(borderRadius).some((v4) => v4 !== 0)) {
addRoundedRectPath(ctx, {
x: xBoxLeft,
y: yBoxTop,
w: boxWidth,
h: boxHeight,
radius: borderRadius
});
} else {
ctx.rect(xBoxLeft, yBoxTop, boxWidth, boxHeight);
}
ctx.fill();
if (lineWidth !== 0) {
ctx.stroke();
}
}
ctx.restore();
};
const fillText = function(x4, y4, legendItem) {
renderText(ctx, legendItem.text, x4, y4 + itemHeight / 2, labelFont, {
strikethrough: legendItem.hidden,
textAlign: rtlHelper.textAlign(legendItem.textAlign)
});
};
const isHorizontal = this.isHorizontal();
const titleHeight = this._computeTitleHeight();
if (isHorizontal) {
cursor = {
x: _alignStartEnd(align, this.left + padding, this.right - lineWidths[0]),
y: this.top + padding + titleHeight,
line: 0
};
} else {
cursor = {
x: this.left + padding,
y: _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[0].height),
line: 0
};
}
overrideTextDirection(this.ctx, opts.textDirection);
const lineHeight = itemHeight + padding;
this.legendItems.forEach((legendItem, i5) => {
ctx.strokeStyle = legendItem.fontColor || fontColor;
ctx.fillStyle = legendItem.fontColor || fontColor;
const textWidth = ctx.measureText(legendItem.text).width;
const textAlign = rtlHelper.textAlign(legendItem.textAlign || (legendItem.textAlign = labelOpts.textAlign));
const width = boxWidth + halfFontSize + textWidth;
let x4 = cursor.x;
let y4 = cursor.y;
rtlHelper.setWidth(this.width);
if (isHorizontal) {
if (i5 > 0 && x4 + width + padding > this.right) {
y4 = cursor.y += lineHeight;
cursor.line++;
x4 = cursor.x = _alignStartEnd(align, this.left + padding, this.right - lineWidths[cursor.line]);
}
} else if (i5 > 0 && y4 + lineHeight > this.bottom) {
x4 = cursor.x = x4 + columnSizes[cursor.line].width + padding;
cursor.line++;
y4 = cursor.y = _alignStartEnd(align, this.top + titleHeight + padding, this.bottom - columnSizes[cursor.line].height);
}
const realX = rtlHelper.x(x4);
drawLegendBox(realX, y4, legendItem);
x4 = _textX(textAlign, x4 + boxWidth + halfFontSize, isHorizontal ? x4 + width : this.right, opts.rtl);
fillText(rtlHelper.x(x4), y4, legendItem);
if (isHorizontal) {
cursor.x += width + padding;
} else {
cursor.y += lineHeight;
}
});
restoreTextDirection(this.ctx, opts.textDirection);
}
drawTitle() {
const opts = this.options;
const titleOpts = opts.title;
const titleFont = toFont(titleOpts.font);
const titlePadding = toPadding(titleOpts.padding);
if (!titleOpts.display) {
return;
}
const rtlHelper = getRtlAdapter(opts.rtl, this.left, this.width);
const ctx = this.ctx;
const position = titleOpts.position;
const halfFontSize = titleFont.size / 2;
const topPaddingPlusHalfFontSize = titlePadding.top + halfFontSize;
let y4;
let left2 = this.left;
let maxWidth = this.width;
if (this.isHorizontal()) {
maxWidth = Math.max(...this.lineWidths);
y4 = this.top + topPaddingPlusHalfFontSize;
left2 = _alignStartEnd(opts.align, left2, this.right - maxWidth);
} else {
const maxHeight = this.columnSizes.reduce((acc, size) => Math.max(acc, size.height), 0);
y4 = topPaddingPlusHalfFontSize + _alignStartEnd(opts.align, this.top, this.bottom - maxHeight - opts.labels.padding - this._computeTitleHeight());
}
const x4 = _alignStartEnd(position, left2, left2 + maxWidth);
ctx.textAlign = rtlHelper.textAlign(_toLeftRightCenter(position));
ctx.textBaseline = "middle";
ctx.strokeStyle = titleOpts.color;
ctx.fillStyle = titleOpts.color;
ctx.font = titleFont.string;
renderText(ctx, titleOpts.text, x4, y4, titleFont);
}
_computeTitleHeight() {
const titleOpts = this.options.title;
const titleFont = toFont(titleOpts.font);
const titlePadding = toPadding(titleOpts.padding);
return titleOpts.display ? titleFont.lineHeight + titlePadding.height : 0;
}
_getLegendItemAt(x4, y4) {
let i5, hitBox, lh;
if (_isBetween(x4, this.left, this.right) && _isBetween(y4, this.top, this.bottom)) {
lh = this.legendHitBoxes;
for (i5 = 0; i5 < lh.length; ++i5) {
hitBox = lh[i5];
if (_isBetween(x4, hitBox.left, hitBox.left + hitBox.width) && _isBetween(y4, hitBox.top, hitBox.top + hitBox.height)) {
return this.legendItems[i5];
}
}
}
return null;
}
handleEvent(e5) {
const opts = this.options;
if (!isListened(e5.type, opts)) {
return;
}
const hoveredItem = this._getLegendItemAt(e5.x, e5.y);
if (e5.type === "mousemove") {
const previous = this._hoveredItem;
const sameItem = itemsEqual(previous, hoveredItem);
if (previous && !sameItem) {
callback(opts.onLeave, [e5, previous, this], this);
}
this._hoveredItem = hoveredItem;
if (hoveredItem && !sameItem) {
callback(opts.onHover, [e5, hoveredItem, this], this);
}
} else if (hoveredItem) {
callback(opts.onClick, [e5, hoveredItem, this], this);
}
}
};
plugin_legend = {
id: "legend",
_element: Legend,
start(chart, _args, options) {
const legend = chart.legend = new Legend({ ctx: chart.ctx, options, chart });
layouts.configure(chart, legend, options);
layouts.addBox(chart, legend);
},
stop(chart) {
layouts.removeBox(chart, chart.legend);
delete chart.legend;
},
beforeUpdate(chart, _args, options) {
const legend = chart.legend;
layouts.configure(chart, legend, options);
legend.options = options;
},
afterUpdate(chart) {
const legend = chart.legend;
legend.buildLabels();
legend.adjustHitBoxes();
},
afterEvent(chart, args) {
if (!args.replay) {
chart.legend.handleEvent(args.event);
}
},
defaults: {
display: true,
position: "top",
align: "center",
fullSize: true,
reverse: false,
weight: 1e3,
onClick(e5, legendItem, legend) {
const index3 = legendItem.datasetIndex;
const ci2 = legend.chart;
if (ci2.isDatasetVisible(index3)) {
ci2.hide(index3);
legendItem.hidden = true;
} else {
ci2.show(index3);
legendItem.hidden = false;
}
},
onHover: null,
onLeave: null,
labels: {
color: (ctx) => ctx.chart.options.color,
boxWidth: 40,
padding: 10,
generateLabels(chart) {
const datasets = chart.data.datasets;
const { labels: { usePointStyle, pointStyle, textAlign, color: color2 } } = chart.legend.options;
return chart._getSortedDatasetMetas().map((meta) => {
const style2 = meta.controller.getStyle(usePointStyle ? 0 : void 0);
const borderWidth = toPadding(style2.borderWidth);
return {
text: datasets[meta.index].label,
fillStyle: style2.backgroundColor,
fontColor: color2,
hidden: !meta.visible,
lineCap: style2.borderCapStyle,
lineDash: style2.borderDash,
lineDashOffset: style2.borderDashOffset,
lineJoin: style2.borderJoinStyle,
lineWidth: (borderWidth.width + borderWidth.height) / 4,
strokeStyle: style2.borderColor,
pointStyle: pointStyle || style2.pointStyle,
rotation: style2.rotation,
textAlign: textAlign || style2.textAlign,
borderRadius: 0,
datasetIndex: meta.index
};
}, this);
}
},
title: {
color: (ctx) => ctx.chart.options.color,
display: false,
position: "center",
text: ""
}
},
descriptors: {
_scriptable: (name) => !name.startsWith("on"),
labels: {
_scriptable: (name) => !["generateLabels", "filter", "sort"].includes(name)
}
}
};
Title = class extends Element2 {
constructor(config2) {
super();
this.chart = config2.chart;
this.options = config2.options;
this.ctx = config2.ctx;
this._padding = void 0;
this.top = void 0;
this.bottom = void 0;
this.left = void 0;
this.right = void 0;
this.width = void 0;
this.height = void 0;
this.position = void 0;
this.weight = void 0;
this.fullSize = void 0;
}
update(maxWidth, maxHeight) {
const opts = this.options;
this.left = 0;
this.top = 0;
if (!opts.display) {
this.width = this.height = this.right = this.bottom = 0;
return;
}
this.width = this.right = maxWidth;
this.height = this.bottom = maxHeight;
const lineCount = isArray(opts.text) ? opts.text.length : 1;
this._padding = toPadding(opts.padding);
const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height;
if (this.isHorizontal()) {
this.height = textSize;
} else {
this.width = textSize;
}
}
isHorizontal() {
const pos = this.options.position;
return pos === "top" || pos === "bottom";
}
_drawArgs(offset3) {
const { top: top2, left: left2, bottom: bottom2, right: right2, options } = this;
const align = options.align;
let rotation = 0;
let maxWidth, titleX, titleY;
if (this.isHorizontal()) {
titleX = _alignStartEnd(align, left2, right2);
titleY = top2 + offset3;
maxWidth = right2 - left2;
} else {
if (options.position === "left") {
titleX = left2 + offset3;
titleY = _alignStartEnd(align, bottom2, top2);
rotation = PI * -0.5;
} else {
titleX = right2 - offset3;
titleY = _alignStartEnd(align, top2, bottom2);
rotation = PI * 0.5;
}
maxWidth = bottom2 - top2;
}
return { titleX, titleY, maxWidth, rotation };
}
draw() {
const ctx = this.ctx;
const opts = this.options;
if (!opts.display) {
return;
}
const fontOpts = toFont(opts.font);
const lineHeight = fontOpts.lineHeight;
const offset3 = lineHeight / 2 + this._padding.top;
const { titleX, titleY, maxWidth, rotation } = this._drawArgs(offset3);
renderText(ctx, opts.text, 0, 0, fontOpts, {
color: opts.color,
maxWidth,
rotation,
textAlign: _toLeftRightCenter(opts.align),
textBaseline: "middle",
translation: [titleX, titleY]
});
}
};
plugin_title = {
id: "title",
_element: Title,
start(chart, _args, options) {
createTitle(chart, options);
},
stop(chart) {
const titleBlock = chart.titleBlock;
layouts.removeBox(chart, titleBlock);
delete chart.titleBlock;
},
beforeUpdate(chart, _args, options) {
const title = chart.titleBlock;
layouts.configure(chart, title, options);
title.options = options;
},
defaults: {
align: "center",
display: false,
font: {
weight: "bold"
},
fullSize: true,
padding: 10,
position: "top",
text: "",
weight: 2e3
},
defaultRoutes: {
color: "color"
},
descriptors: {
_scriptable: true,
_indexable: false
}
};
map2 = /* @__PURE__ */ new WeakMap();
plugin_subtitle = {
id: "subtitle",
start(chart, _args, options) {
const title = new Title({
ctx: chart.ctx,
options,
chart
});
layouts.configure(chart, title, options);
layouts.addBox(chart, title);
map2.set(chart, title);
},
stop(chart) {
layouts.removeBox(chart, map2.get(chart));
map2.delete(chart);
},
beforeUpdate(chart, _args, options) {
const title = map2.get(chart);
layouts.configure(chart, title, options);
title.options = options;
},
defaults: {
align: "center",
display: false,
font: {
weight: "normal"
},
fullSize: true,
padding: 0,
position: "top",
text: "",
weight: 1500
},
defaultRoutes: {
color: "color"
},
descriptors: {
_scriptable: true,
_indexable: false
}
};
positioners = {
average(items) {
if (!items.length) {
return false;
}
let i5, len;
let x4 = 0;
let y4 = 0;
let count = 0;
for (i5 = 0, len = items.length; i5 < len; ++i5) {
const el = items[i5].element;
if (el && el.hasValue()) {
const pos = el.tooltipPosition();
x4 += pos.x;
y4 += pos.y;
++count;
}
}
return {
x: x4 / count,
y: y4 / count
};
},
nearest(items, eventPosition) {
if (!items.length) {
return false;
}
let x4 = eventPosition.x;
let y4 = eventPosition.y;
let minDistance = Number.POSITIVE_INFINITY;
let i5, len, nearestElement;
for (i5 = 0, len = items.length; i5 < len; ++i5) {
const el = items[i5].element;
if (el && el.hasValue()) {
const center = el.getCenterPoint();
const d4 = distanceBetweenPoints(eventPosition, center);
if (d4 < minDistance) {
minDistance = d4;
nearestElement = el;
}
}
}
if (nearestElement) {
const tp = nearestElement.tooltipPosition();
x4 = tp.x;
y4 = tp.y;
}
return {
x: x4,
y: y4
};
}
};
Tooltip = class extends Element2 {
constructor(config2) {
super();
this.opacity = 0;
this._active = [];
this._eventPosition = void 0;
this._size = void 0;
this._cachedAnimations = void 0;
this._tooltipItems = [];
this.$animations = void 0;
this.$context = void 0;
this.chart = config2.chart || config2._chart;
this._chart = this.chart;
this.options = config2.options;
this.dataPoints = void 0;
this.title = void 0;
this.beforeBody = void 0;
this.body = void 0;
this.afterBody = void 0;
this.footer = void 0;
this.xAlign = void 0;
this.yAlign = void 0;
this.x = void 0;
this.y = void 0;
this.height = void 0;
this.width = void 0;
this.caretX = void 0;
this.caretY = void 0;
this.labelColors = void 0;
this.labelPointStyles = void 0;
this.labelTextColors = void 0;
}
initialize(options) {
this.options = options;
this._cachedAnimations = void 0;
this.$context = void 0;
}
_resolveAnimations() {
const cached = this._cachedAnimations;
if (cached) {
return cached;
}
const chart = this.chart;
const options = this.options.setContext(this.getContext());
const opts = options.enabled && chart.options.animation && options.animations;
const animations = new Animations(this.chart, opts);
if (opts._cacheable) {
this._cachedAnimations = Object.freeze(animations);
}
return animations;
}
getContext() {
return this.$context || (this.$context = createTooltipContext(this.chart.getContext(), this, this._tooltipItems));
}
getTitle(context, options) {
const { callbacks } = options;
const beforeTitle = callbacks.beforeTitle.apply(this, [context]);
const title = callbacks.title.apply(this, [context]);
const afterTitle = callbacks.afterTitle.apply(this, [context]);
let lines = [];
lines = pushOrConcat(lines, splitNewlines(beforeTitle));
lines = pushOrConcat(lines, splitNewlines(title));
lines = pushOrConcat(lines, splitNewlines(afterTitle));
return lines;
}
getBeforeBody(tooltipItems, options) {
return getBeforeAfterBodyLines(options.callbacks.beforeBody.apply(this, [tooltipItems]));
}
getBody(tooltipItems, options) {
const { callbacks } = options;
const bodyItems = [];
each(tooltipItems, (context) => {
const bodyItem = {
before: [],
lines: [],
after: []
};
const scoped = overrideCallbacks(callbacks, context);
pushOrConcat(bodyItem.before, splitNewlines(scoped.beforeLabel.call(this, context)));
pushOrConcat(bodyItem.lines, scoped.label.call(this, context));
pushOrConcat(bodyItem.after, splitNewlines(scoped.afterLabel.call(this, context)));
bodyItems.push(bodyItem);
});
return bodyItems;
}
getAfterBody(tooltipItems, options) {
return getBeforeAfterBodyLines(options.callbacks.afterBody.apply(this, [tooltipItems]));
}
getFooter(tooltipItems, options) {
const { callbacks } = options;
const beforeFooter = callbacks.beforeFooter.apply(this, [tooltipItems]);
const footer = callbacks.footer.apply(this, [tooltipItems]);
const afterFooter = callbacks.afterFooter.apply(this, [tooltipItems]);
let lines = [];
lines = pushOrConcat(lines, splitNewlines(beforeFooter));
lines = pushOrConcat(lines, splitNewlines(footer));
lines = pushOrConcat(lines, splitNewlines(afterFooter));
return lines;
}
_createItems(options) {
const active = this._active;
const data = this.chart.data;
const labelColors = [];
const labelPointStyles = [];
const labelTextColors = [];
let tooltipItems = [];
let i5, len;
for (i5 = 0, len = active.length; i5 < len; ++i5) {
tooltipItems.push(createTooltipItem(this.chart, active[i5]));
}
if (options.filter) {
tooltipItems = tooltipItems.filter((element, index3, array) => options.filter(element, index3, array, data));
}
if (options.itemSort) {
tooltipItems = tooltipItems.sort((a5, b4) => options.itemSort(a5, b4, data));
}
each(tooltipItems, (context) => {
const scoped = overrideCallbacks(options.callbacks, context);
labelColors.push(scoped.labelColor.call(this, context));
labelPointStyles.push(scoped.labelPointStyle.call(this, context));
labelTextColors.push(scoped.labelTextColor.call(this, context));
});
this.labelColors = labelColors;
this.labelPointStyles = labelPointStyles;
this.labelTextColors = labelTextColors;
this.dataPoints = tooltipItems;
return tooltipItems;
}
update(changed, replay) {
const options = this.options.setContext(this.getContext());
const active = this._active;
let properties;
let tooltipItems = [];
if (!active.length) {
if (this.opacity !== 0) {
properties = {
opacity: 0
};
}
} else {
const position = positioners[options.position].call(this, active, this._eventPosition);
tooltipItems = this._createItems(options);
this.title = this.getTitle(tooltipItems, options);
this.beforeBody = this.getBeforeBody(tooltipItems, options);
this.body = this.getBody(tooltipItems, options);
this.afterBody = this.getAfterBody(tooltipItems, options);
this.footer = this.getFooter(tooltipItems, options);
const size = this._size = getTooltipSize(this, options);
const positionAndSize = Object.assign({}, position, size);
const alignment = determineAlignment(this.chart, options, positionAndSize);
const backgroundPoint = getBackgroundPoint(options, positionAndSize, alignment, this.chart);
this.xAlign = alignment.xAlign;
this.yAlign = alignment.yAlign;
properties = {
opacity: 1,
x: backgroundPoint.x,
y: backgroundPoint.y,
width: size.width,
height: size.height,
caretX: position.x,
caretY: position.y
};
}
this._tooltipItems = tooltipItems;
this.$context = void 0;
if (properties) {
this._resolveAnimations().update(this, properties);
}
if (changed && options.external) {
options.external.call(this, { chart: this.chart, tooltip: this, replay });
}
}
drawCaret(tooltipPoint, ctx, size, options) {
const caretPosition = this.getCaretPosition(tooltipPoint, size, options);
ctx.lineTo(caretPosition.x1, caretPosition.y1);
ctx.lineTo(caretPosition.x2, caretPosition.y2);
ctx.lineTo(caretPosition.x3, caretPosition.y3);
}
getCaretPosition(tooltipPoint, size, options) {
const { xAlign, yAlign } = this;
const { caretSize, cornerRadius } = options;
const { topLeft, topRight, bottomLeft, bottomRight } = toTRBLCorners(cornerRadius);
const { x: ptX, y: ptY } = tooltipPoint;
const { width, height } = size;
let x1, x22, x32, y1, y22, y32;
if (yAlign === "center") {
y22 = ptY + height / 2;
if (xAlign === "left") {
x1 = ptX;
x22 = x1 - caretSize;
y1 = y22 + caretSize;
y32 = y22 - caretSize;
} else {
x1 = ptX + width;
x22 = x1 + caretSize;
y1 = y22 - caretSize;
y32 = y22 + caretSize;
}
x32 = x1;
} else {
if (xAlign === "left") {
x22 = ptX + Math.max(topLeft, bottomLeft) + caretSize;
} else if (xAlign === "right") {
x22 = ptX + width - Math.max(topRight, bottomRight) - caretSize;
} else {
x22 = this.caretX;
}
if (yAlign === "top") {
y1 = ptY;
y22 = y1 - caretSize;
x1 = x22 - caretSize;
x32 = x22 + caretSize;
} else {
y1 = ptY + height;
y22 = y1 + caretSize;
x1 = x22 + caretSize;
x32 = x22 - caretSize;
}
y32 = y1;
}
return { x1, x2: x22, x3: x32, y1, y2: y22, y3: y32 };
}
drawTitle(pt2, ctx, options) {
const title = this.title;
const length = title.length;
let titleFont, titleSpacing, i5;
if (length) {
const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);
pt2.x = getAlignedX(this, options.titleAlign, options);
ctx.textAlign = rtlHelper.textAlign(options.titleAlign);
ctx.textBaseline = "middle";
titleFont = toFont(options.titleFont);
titleSpacing = options.titleSpacing;
ctx.fillStyle = options.titleColor;
ctx.font = titleFont.string;
for (i5 = 0; i5 < length; ++i5) {
ctx.fillText(title[i5], rtlHelper.x(pt2.x), pt2.y + titleFont.lineHeight / 2);
pt2.y += titleFont.lineHeight + titleSpacing;
if (i5 + 1 === length) {
pt2.y += options.titleMarginBottom - titleSpacing;
}
}
}
}
_drawColorBox(ctx, pt2, i5, rtlHelper, options) {
const labelColors = this.labelColors[i5];
const labelPointStyle = this.labelPointStyles[i5];
const { boxHeight, boxWidth, boxPadding } = options;
const bodyFont = toFont(options.bodyFont);
const colorX = getAlignedX(this, "left", options);
const rtlColorX = rtlHelper.x(colorX);
const yOffSet = boxHeight < bodyFont.lineHeight ? (bodyFont.lineHeight - boxHeight) / 2 : 0;
const colorY = pt2.y + yOffSet;
if (options.usePointStyle) {
const drawOptions = {
radius: Math.min(boxWidth, boxHeight) / 2,
pointStyle: labelPointStyle.pointStyle,
rotation: labelPointStyle.rotation,
borderWidth: 1
};
const centerX = rtlHelper.leftForLtr(rtlColorX, boxWidth) + boxWidth / 2;
const centerY = colorY + boxHeight / 2;
ctx.strokeStyle = options.multiKeyBackground;
ctx.fillStyle = options.multiKeyBackground;
drawPoint(ctx, drawOptions, centerX, centerY);
ctx.strokeStyle = labelColors.borderColor;
ctx.fillStyle = labelColors.backgroundColor;
drawPoint(ctx, drawOptions, centerX, centerY);
} else {
ctx.lineWidth = labelColors.borderWidth || 1;
ctx.strokeStyle = labelColors.borderColor;
ctx.setLineDash(labelColors.borderDash || []);
ctx.lineDashOffset = labelColors.borderDashOffset || 0;
const outerX = rtlHelper.leftForLtr(rtlColorX, boxWidth - boxPadding);
const innerX = rtlHelper.leftForLtr(rtlHelper.xPlus(rtlColorX, 1), boxWidth - boxPadding - 2);
const borderRadius = toTRBLCorners(labelColors.borderRadius);
if (Object.values(borderRadius).some((v4) => v4 !== 0)) {
ctx.beginPath();
ctx.fillStyle = options.multiKeyBackground;
addRoundedRectPath(ctx, {
x: outerX,
y: colorY,
w: boxWidth,
h: boxHeight,
radius: borderRadius
});
ctx.fill();
ctx.stroke();
ctx.fillStyle = labelColors.backgroundColor;
ctx.beginPath();
addRoundedRectPath(ctx, {
x: innerX,
y: colorY + 1,
w: boxWidth - 2,
h: boxHeight - 2,
radius: borderRadius
});
ctx.fill();
} else {
ctx.fillStyle = options.multiKeyBackground;
ctx.fillRect(outerX, colorY, boxWidth, boxHeight);
ctx.strokeRect(outerX, colorY, boxWidth, boxHeight);
ctx.fillStyle = labelColors.backgroundColor;
ctx.fillRect(innerX, colorY + 1, boxWidth - 2, boxHeight - 2);
}
}
ctx.fillStyle = this.labelTextColors[i5];
}
drawBody(pt2, ctx, options) {
const { body } = this;
const { bodySpacing, bodyAlign, displayColors, boxHeight, boxWidth, boxPadding } = options;
const bodyFont = toFont(options.bodyFont);
let bodyLineHeight = bodyFont.lineHeight;
let xLinePadding = 0;
const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);
const fillLineOfText = function(line) {
ctx.fillText(line, rtlHelper.x(pt2.x + xLinePadding), pt2.y + bodyLineHeight / 2);
pt2.y += bodyLineHeight + bodySpacing;
};
const bodyAlignForCalculation = rtlHelper.textAlign(bodyAlign);
let bodyItem, textColor, lines, i5, j4, ilen, jlen;
ctx.textAlign = bodyAlign;
ctx.textBaseline = "middle";
ctx.font = bodyFont.string;
pt2.x = getAlignedX(this, bodyAlignForCalculation, options);
ctx.fillStyle = options.bodyColor;
each(this.beforeBody, fillLineOfText);
xLinePadding = displayColors && bodyAlignForCalculation !== "right" ? bodyAlign === "center" ? boxWidth / 2 + boxPadding : boxWidth + 2 + boxPadding : 0;
for (i5 = 0, ilen = body.length; i5 < ilen; ++i5) {
bodyItem = body[i5];
textColor = this.labelTextColors[i5];
ctx.fillStyle = textColor;
each(bodyItem.before, fillLineOfText);
lines = bodyItem.lines;
if (displayColors && lines.length) {
this._drawColorBox(ctx, pt2, i5, rtlHelper, options);
bodyLineHeight = Math.max(bodyFont.lineHeight, boxHeight);
}
for (j4 = 0, jlen = lines.length; j4 < jlen; ++j4) {
fillLineOfText(lines[j4]);
bodyLineHeight = bodyFont.lineHeight;
}
each(bodyItem.after, fillLineOfText);
}
xLinePadding = 0;
bodyLineHeight = bodyFont.lineHeight;
each(this.afterBody, fillLineOfText);
pt2.y -= bodySpacing;
}
drawFooter(pt2, ctx, options) {
const footer = this.footer;
const length = footer.length;
let footerFont, i5;
if (length) {
const rtlHelper = getRtlAdapter(options.rtl, this.x, this.width);
pt2.x = getAlignedX(this, options.footerAlign, options);
pt2.y += options.footerMarginTop;
ctx.textAlign = rtlHelper.textAlign(options.footerAlign);
ctx.textBaseline = "middle";
footerFont = toFont(options.footerFont);
ctx.fillStyle = options.footerColor;
ctx.font = footerFont.string;
for (i5 = 0; i5 < length; ++i5) {
ctx.fillText(footer[i5], rtlHelper.x(pt2.x), pt2.y + footerFont.lineHeight / 2);
pt2.y += footerFont.lineHeight + options.footerSpacing;
}
}
}
drawBackground(pt2, ctx, tooltipSize, options) {
const { xAlign, yAlign } = this;
const { x: x4, y: y4 } = pt2;
const { width, height } = tooltipSize;
const { topLeft, topRight, bottomLeft, bottomRight } = toTRBLCorners(options.cornerRadius);
ctx.fillStyle = options.backgroundColor;
ctx.strokeStyle = options.borderColor;
ctx.lineWidth = options.borderWidth;
ctx.beginPath();
ctx.moveTo(x4 + topLeft, y4);
if (yAlign === "top") {
this.drawCaret(pt2, ctx, tooltipSize, options);
}
ctx.lineTo(x4 + width - topRight, y4);
ctx.quadraticCurveTo(x4 + width, y4, x4 + width, y4 + topRight);
if (yAlign === "center" && xAlign === "right") {
this.drawCaret(pt2, ctx, tooltipSize, options);
}
ctx.lineTo(x4 + width, y4 + height - bottomRight);
ctx.quadraticCurveTo(x4 + width, y4 + height, x4 + width - bottomRight, y4 + height);
if (yAlign === "bottom") {
this.drawCaret(pt2, ctx, tooltipSize, options);
}
ctx.lineTo(x4 + bottomLeft, y4 + height);
ctx.quadraticCurveTo(x4, y4 + height, x4, y4 + height - bottomLeft);
if (yAlign === "center" && xAlign === "left") {
this.drawCaret(pt2, ctx, tooltipSize, options);
}
ctx.lineTo(x4, y4 + topLeft);
ctx.quadraticCurveTo(x4, y4, x4 + topLeft, y4);
ctx.closePath();
ctx.fill();
if (options.borderWidth > 0) {
ctx.stroke();
}
}
_updateAnimationTarget(options) {
const chart = this.chart;
const anims = this.$animations;
const animX = anims && anims.x;
const animY = anims && anims.y;
if (animX || animY) {
const position = positioners[options.position].call(this, this._active, this._eventPosition);
if (!position) {
return;
}
const size = this._size = getTooltipSize(this, options);
const positionAndSize = Object.assign({}, position, this._size);
const alignment = determineAlignment(chart, options, positionAndSize);
const point = getBackgroundPoint(options, positionAndSize, alignment, chart);
if (animX._to !== point.x || animY._to !== point.y) {
this.xAlign = alignment.xAlign;
this.yAlign = alignment.yAlign;
this.width = size.width;
this.height = size.height;
this.caretX = position.x;
this.caretY = position.y;
this._resolveAnimations().update(this, point);
}
}
}
draw(ctx) {
const options = this.options.setContext(this.getContext());
let opacity = this.opacity;
if (!opacity) {
return;
}
this._updateAnimationTarget(options);
const tooltipSize = {
width: this.width,
height: this.height
};
const pt2 = {
x: this.x,
y: this.y
};
opacity = Math.abs(opacity) < 1e-3 ? 0 : opacity;
const padding = toPadding(options.padding);
const hasTooltipContent = this.title.length || this.beforeBody.length || this.body.length || this.afterBody.length || this.footer.length;
if (options.enabled && hasTooltipContent) {
ctx.save();
ctx.globalAlpha = opacity;
this.drawBackground(pt2, ctx, tooltipSize, options);
overrideTextDirection(ctx, options.textDirection);
pt2.y += padding.top;
this.drawTitle(pt2, ctx, options);
this.drawBody(pt2, ctx, options);
this.drawFooter(pt2, ctx, options);
restoreTextDirection(ctx, options.textDirection);
ctx.restore();
}
}
getActiveElements() {
return this._active || [];
}
setActiveElements(activeElements, eventPosition) {
const lastActive = this._active;
const active = activeElements.map(({ datasetIndex, index: index3 }) => {
const meta = this.chart.getDatasetMeta(datasetIndex);
if (!meta) {
throw new Error("Cannot find a dataset at index " + datasetIndex);
}
return {
datasetIndex,
element: meta.data[index3],
index: index3
};
});
const changed = !_elementsEqual(lastActive, active);
const positionChanged = this._positionChanged(active, eventPosition);
if (changed || positionChanged) {
this._active = active;
this._eventPosition = eventPosition;
this._ignoreReplayEvents = true;
this.update(true);
}
}
handleEvent(e5, replay, inChartArea = true) {
if (replay && this._ignoreReplayEvents) {
return false;
}
this._ignoreReplayEvents = false;
const options = this.options;
const lastActive = this._active || [];
const active = this._getActiveElements(e5, lastActive, replay, inChartArea);
const positionChanged = this._positionChanged(active, e5);
const changed = replay || !_elementsEqual(active, lastActive) || positionChanged;
if (changed) {
this._active = active;
if (options.enabled || options.external) {
this._eventPosition = {
x: e5.x,
y: e5.y
};
this.update(true, replay);
}
}
return changed;
}
_getActiveElements(e5, lastActive, replay, inChartArea) {
const options = this.options;
if (e5.type === "mouseout") {
return [];
}
if (!inChartArea) {
return lastActive;
}
const active = this.chart.getElementsAtEventForMode(e5, options.mode, options, replay);
if (options.reverse) {
active.reverse();
}
return active;
}
_positionChanged(active, e5) {
const { caretX, caretY, options } = this;
const position = positioners[options.position].call(this, active, e5);
return position !== false && (caretX !== position.x || caretY !== position.y);
}
};
Tooltip.positioners = positioners;
plugin_tooltip = {
id: "tooltip",
_element: Tooltip,
positioners,
afterInit(chart, _args, options) {
if (options) {
chart.tooltip = new Tooltip({ chart, options });
}
},
beforeUpdate(chart, _args, options) {
if (chart.tooltip) {
chart.tooltip.initialize(options);
}
},
reset(chart, _args, options) {
if (chart.tooltip) {
chart.tooltip.initialize(options);
}
},
afterDraw(chart) {
const tooltip = chart.tooltip;
const args = {
tooltip
};
if (chart.notifyPlugins("beforeTooltipDraw", args) === false) {
return;
}
if (tooltip) {
tooltip.draw(chart.ctx);
}
chart.notifyPlugins("afterTooltipDraw", args);
},
afterEvent(chart, args) {
if (chart.tooltip) {
const useFinalPosition = args.replay;
if (chart.tooltip.handleEvent(args.event, useFinalPosition, args.inChartArea)) {
args.changed = true;
}
}
},
defaults: {
enabled: true,
external: null,
position: "average",
backgroundColor: "rgba(0,0,0,0.8)",
titleColor: "#fff",
titleFont: {
weight: "bold"
},
titleSpacing: 2,
titleMarginBottom: 6,
titleAlign: "left",
bodyColor: "#fff",
bodySpacing: 2,
bodyFont: {},
bodyAlign: "left",
footerColor: "#fff",
footerSpacing: 2,
footerMarginTop: 6,
footerFont: {
weight: "bold"
},
footerAlign: "left",
padding: 6,
caretPadding: 2,
caretSize: 5,
cornerRadius: 6,
boxHeight: (ctx, opts) => opts.bodyFont.size,
boxWidth: (ctx, opts) => opts.bodyFont.size,
multiKeyBackground: "#fff",
displayColors: true,
boxPadding: 0,
borderColor: "rgba(0,0,0,0)",
borderWidth: 0,
animation: {
duration: 400,
easing: "easeOutQuart"
},
animations: {
numbers: {
type: "number",
properties: ["x", "y", "width", "height", "caretX", "caretY"]
},
opacity: {
easing: "linear",
duration: 200
}
},
callbacks: {
beforeTitle: noop,
title(tooltipItems) {
if (tooltipItems.length > 0) {
const item = tooltipItems[0];
const labels = item.chart.data.labels;
const labelCount = labels ? labels.length : 0;
if (this && this.options && this.options.mode === "dataset") {
return item.dataset.label || "";
} else if (item.label) {
return item.label;
} else if (labelCount > 0 && item.dataIndex < labelCount) {
return labels[item.dataIndex];
}
}
return "";
},
afterTitle: noop,
beforeBody: noop,
beforeLabel: noop,
label(tooltipItem) {
if (this && this.options && this.options.mode === "dataset") {
return tooltipItem.label + ": " + tooltipItem.formattedValue || tooltipItem.formattedValue;
}
let label = tooltipItem.dataset.label || "";
if (label) {
label += ": ";
}
const value = tooltipItem.formattedValue;
if (!isNullOrUndef(value)) {
label += value;
}
return label;
},
labelColor(tooltipItem) {
const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);
const options = meta.controller.getStyle(tooltipItem.dataIndex);
return {
borderColor: options.borderColor,
backgroundColor: options.backgroundColor,
borderWidth: options.borderWidth,
borderDash: options.borderDash,
borderDashOffset: options.borderDashOffset,
borderRadius: 0
};
},
labelTextColor() {
return this.options.bodyColor;
},
labelPointStyle(tooltipItem) {
const meta = tooltipItem.chart.getDatasetMeta(tooltipItem.datasetIndex);
const options = meta.controller.getStyle(tooltipItem.dataIndex);
return {
pointStyle: options.pointStyle,
rotation: options.rotation
};
},
afterLabel: noop,
afterBody: noop,
beforeFooter: noop,
footer: noop,
afterFooter: noop
}
},
defaultRoutes: {
bodyFont: "font",
footerFont: "font",
titleFont: "font"
},
descriptors: {
_scriptable: (name) => name !== "filter" && name !== "itemSort" && name !== "external",
_indexable: false,
callbacks: {
_scriptable: false,
_indexable: false
},
animation: {
_fallback: false
},
animations: {
_fallback: "animation"
}
},
additionalOptionScopes: ["interaction"]
};
plugins = /* @__PURE__ */ Object.freeze({
__proto__: null,
Decimation: plugin_decimation,
Filler: plugin_filler,
Legend: plugin_legend,
SubTitle: plugin_subtitle,
Title: plugin_title,
Tooltip: plugin_tooltip
});
addIfString = (labels, raw, index3, addedLabels) => {
if (typeof raw === "string") {
index3 = labels.push(raw) - 1;
addedLabels.unshift({ index: index3, label: raw });
} else if (isNaN(raw)) {
index3 = null;
}
return index3;
};
validIndex = (index3, max2) => index3 === null ? null : _limitValue(Math.round(index3), 0, max2);
CategoryScale = class extends Scale {
constructor(cfg) {
super(cfg);
this._startValue = void 0;
this._valueRange = 0;
this._addedLabels = [];
}
init(scaleOptions) {
const added = this._addedLabels;
if (added.length) {
const labels = this.getLabels();
for (const { index: index3, label } of added) {
if (labels[index3] === label) {
labels.splice(index3, 1);
}
}
this._addedLabels = [];
}
super.init(scaleOptions);
}
parse(raw, index3) {
if (isNullOrUndef(raw)) {
return null;
}
const labels = this.getLabels();
index3 = isFinite(index3) && labels[index3] === raw ? index3 : findOrAddLabel(labels, raw, valueOrDefault(index3, raw), this._addedLabels);
return validIndex(index3, labels.length - 1);
}
determineDataLimits() {
const { minDefined, maxDefined } = this.getUserBounds();
let { min: min2, max: max2 } = this.getMinMax(true);
if (this.options.bounds === "ticks") {
if (!minDefined) {
min2 = 0;
}
if (!maxDefined) {
max2 = this.getLabels().length - 1;
}
}
this.min = min2;
this.max = max2;
}
buildTicks() {
const min2 = this.min;
const max2 = this.max;
const offset3 = this.options.offset;
const ticks = [];
let labels = this.getLabels();
labels = min2 === 0 && max2 === labels.length - 1 ? labels : labels.slice(min2, max2 + 1);
this._valueRange = Math.max(labels.length - (offset3 ? 0 : 1), 1);
this._startValue = this.min - (offset3 ? 0.5 : 0);
for (let value = min2; value <= max2; value++) {
ticks.push({ value });
}
return ticks;
}
getLabelForValue(value) {
const labels = this.getLabels();
if (value >= 0 && value < labels.length) {
return labels[value];
}
return value;
}
configure() {
super.configure();
if (!this.isHorizontal()) {
this._reversePixels = !this._reversePixels;
}
}
getPixelForValue(value) {
if (typeof value !== "number") {
value = this.parse(value);
}
return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);
}
getPixelForTick(index3) {
const ticks = this.ticks;
if (index3 < 0 || index3 > ticks.length - 1) {
return null;
}
return this.getPixelForValue(ticks[index3].value);
}
getValueForPixel(pixel) {
return Math.round(this._startValue + this.getDecimalForPixel(pixel) * this._valueRange);
}
getBasePixel() {
return this.bottom;
}
};
CategoryScale.id = "category";
CategoryScale.defaults = {
ticks: {
callback: CategoryScale.prototype.getLabelForValue
}
};
LinearScaleBase = class extends Scale {
constructor(cfg) {
super(cfg);
this.start = void 0;
this.end = void 0;
this._startValue = void 0;
this._endValue = void 0;
this._valueRange = 0;
}
parse(raw, index3) {
if (isNullOrUndef(raw)) {
return null;
}
if ((typeof raw === "number" || raw instanceof Number) && !isFinite(+raw)) {
return null;
}
return +raw;
}
handleTickRangeOptions() {
const { beginAtZero } = this.options;
const { minDefined, maxDefined } = this.getUserBounds();
let { min: min2, max: max2 } = this;
const setMin = (v4) => min2 = minDefined ? min2 : v4;
const setMax = (v4) => max2 = maxDefined ? max2 : v4;
if (beginAtZero) {
const minSign = sign(min2);
const maxSign = sign(max2);
if (minSign < 0 && maxSign < 0) {
setMax(0);
} else if (minSign > 0 && maxSign > 0) {
setMin(0);
}
}
if (min2 === max2) {
let offset3 = 1;
if (max2 >= Number.MAX_SAFE_INTEGER || min2 <= Number.MIN_SAFE_INTEGER) {
offset3 = Math.abs(max2 * 0.05);
}
setMax(max2 + offset3);
if (!beginAtZero) {
setMin(min2 - offset3);
}
}
this.min = min2;
this.max = max2;
}
getTickLimit() {
const tickOpts = this.options.ticks;
let { maxTicksLimit, stepSize } = tickOpts;
let maxTicks;
if (stepSize) {
maxTicks = Math.ceil(this.max / stepSize) - Math.floor(this.min / stepSize) + 1;
if (maxTicks > 1e3) {
console.warn(`scales.${this.id}.ticks.stepSize: ${stepSize} would result generating up to ${maxTicks} ticks. Limiting to 1000.`);
maxTicks = 1e3;
}
} else {
maxTicks = this.computeTickLimit();
maxTicksLimit = maxTicksLimit || 11;
}
if (maxTicksLimit) {
maxTicks = Math.min(maxTicksLimit, maxTicks);
}
return maxTicks;
}
computeTickLimit() {
return Number.POSITIVE_INFINITY;
}
buildTicks() {
const opts = this.options;
const tickOpts = opts.ticks;
let maxTicks = this.getTickLimit();
maxTicks = Math.max(2, maxTicks);
const numericGeneratorOptions = {
maxTicks,
bounds: opts.bounds,
min: opts.min,
max: opts.max,
precision: tickOpts.precision,
step: tickOpts.stepSize,
count: tickOpts.count,
maxDigits: this._maxDigits(),
horizontal: this.isHorizontal(),
minRotation: tickOpts.minRotation || 0,
includeBounds: tickOpts.includeBounds !== false
};
const dataRange = this._range || this;
const ticks = generateTicks$1(numericGeneratorOptions, dataRange);
if (opts.bounds === "ticks") {
_setMinAndMaxByKey(ticks, this, "value");
}
if (opts.reverse) {
ticks.reverse();
this.start = this.max;
this.end = this.min;
} else {
this.start = this.min;
this.end = this.max;
}
return ticks;
}
configure() {
const ticks = this.ticks;
let start3 = this.min;
let end2 = this.max;
super.configure();
if (this.options.offset && ticks.length) {
const offset3 = (end2 - start3) / Math.max(ticks.length - 1, 1) / 2;
start3 -= offset3;
end2 += offset3;
}
this._startValue = start3;
this._endValue = end2;
this._valueRange = end2 - start3;
}
getLabelForValue(value) {
return formatNumber(value, this.chart.options.locale, this.options.ticks.format);
}
};
LinearScale = class extends LinearScaleBase {
determineDataLimits() {
const { min: min2, max: max2 } = this.getMinMax(true);
this.min = isNumberFinite(min2) ? min2 : 0;
this.max = isNumberFinite(max2) ? max2 : 1;
this.handleTickRangeOptions();
}
computeTickLimit() {
const horizontal = this.isHorizontal();
const length = horizontal ? this.width : this.height;
const minRotation = toRadians(this.options.ticks.minRotation);
const ratio = (horizontal ? Math.sin(minRotation) : Math.cos(minRotation)) || 1e-3;
const tickFont = this._resolveTickFontOptions(0);
return Math.ceil(length / Math.min(40, tickFont.lineHeight / ratio));
}
getPixelForValue(value) {
return value === null ? NaN : this.getPixelForDecimal((value - this._startValue) / this._valueRange);
}
getValueForPixel(pixel) {
return this._startValue + this.getDecimalForPixel(pixel) * this._valueRange;
}
};
LinearScale.id = "linear";
LinearScale.defaults = {
ticks: {
callback: Ticks.formatters.numeric
}
};
LogarithmicScale = class extends Scale {
constructor(cfg) {
super(cfg);
this.start = void 0;
this.end = void 0;
this._startValue = void 0;
this._valueRange = 0;
}
parse(raw, index3) {
const value = LinearScaleBase.prototype.parse.apply(this, [raw, index3]);
if (value === 0) {
this._zero = true;
return void 0;
}
return isNumberFinite(value) && value > 0 ? value : null;
}
determineDataLimits() {
const { min: min2, max: max2 } = this.getMinMax(true);
this.min = isNumberFinite(min2) ? Math.max(0, min2) : null;
this.max = isNumberFinite(max2) ? Math.max(0, max2) : null;
if (this.options.beginAtZero) {
this._zero = true;
}
this.handleTickRangeOptions();
}
handleTickRangeOptions() {
const { minDefined, maxDefined } = this.getUserBounds();
let min2 = this.min;
let max2 = this.max;
const setMin = (v4) => min2 = minDefined ? min2 : v4;
const setMax = (v4) => max2 = maxDefined ? max2 : v4;
const exp = (v4, m4) => Math.pow(10, Math.floor(log10(v4)) + m4);
if (min2 === max2) {
if (min2 <= 0) {
setMin(1);
setMax(10);
} else {
setMin(exp(min2, -1));
setMax(exp(max2, 1));
}
}
if (min2 <= 0) {
setMin(exp(max2, -1));
}
if (max2 <= 0) {
setMax(exp(min2, 1));
}
if (this._zero && this.min !== this._suggestedMin && min2 === exp(this.min, 0)) {
setMin(exp(min2, -1));
}
this.min = min2;
this.max = max2;
}
buildTicks() {
const opts = this.options;
const generationOptions = {
min: this._userMin,
max: this._userMax
};
const ticks = generateTicks(generationOptions, this);
if (opts.bounds === "ticks") {
_setMinAndMaxByKey(ticks, this, "value");
}
if (opts.reverse) {
ticks.reverse();
this.start = this.max;
this.end = this.min;
} else {
this.start = this.min;
this.end = this.max;
}
return ticks;
}
getLabelForValue(value) {
return value === void 0 ? "0" : formatNumber(value, this.chart.options.locale, this.options.ticks.format);
}
configure() {
const start3 = this.min;
super.configure();
this._startValue = log10(start3);
this._valueRange = log10(this.max) - log10(start3);
}
getPixelForValue(value) {
if (value === void 0 || value === 0) {
value = this.min;
}
if (value === null || isNaN(value)) {
return NaN;
}
return this.getPixelForDecimal(value === this.min ? 0 : (log10(value) - this._startValue) / this._valueRange);
}
getValueForPixel(pixel) {
const decimal = this.getDecimalForPixel(pixel);
return Math.pow(10, this._startValue + decimal * this._valueRange);
}
};
LogarithmicScale.id = "logarithmic";
LogarithmicScale.defaults = {
ticks: {
callback: Ticks.formatters.logarithmic,
major: {
enabled: true
}
}
};
RadialLinearScale = class extends LinearScaleBase {
constructor(cfg) {
super(cfg);
this.xCenter = void 0;
this.yCenter = void 0;
this.drawingArea = void 0;
this._pointLabels = [];
this._pointLabelItems = [];
}
setDimensions() {
const padding = this._padding = toPadding(getTickBackdropHeight(this.options) / 2);
const w4 = this.width = this.maxWidth - padding.width;
const h6 = this.height = this.maxHeight - padding.height;
this.xCenter = Math.floor(this.left + w4 / 2 + padding.left);
this.yCenter = Math.floor(this.top + h6 / 2 + padding.top);
this.drawingArea = Math.floor(Math.min(w4, h6) / 2);
}
determineDataLimits() {
const { min: min2, max: max2 } = this.getMinMax(false);
this.min = isNumberFinite(min2) && !isNaN(min2) ? min2 : 0;
this.max = isNumberFinite(max2) && !isNaN(max2) ? max2 : 0;
this.handleTickRangeOptions();
}
computeTickLimit() {
return Math.ceil(this.drawingArea / getTickBackdropHeight(this.options));
}
generateTickLabels(ticks) {
LinearScaleBase.prototype.generateTickLabels.call(this, ticks);
this._pointLabels = this.getLabels().map((value, index3) => {
const label = callback(this.options.pointLabels.callback, [value, index3], this);
return label || label === 0 ? label : "";
}).filter((v4, i5) => this.chart.getDataVisibility(i5));
}
fit() {
const opts = this.options;
if (opts.display && opts.pointLabels.display) {
fitWithPointLabels(this);
} else {
this.setCenterPoint(0, 0, 0, 0);
}
}
setCenterPoint(leftMovement, rightMovement, topMovement, bottomMovement) {
this.xCenter += Math.floor((leftMovement - rightMovement) / 2);
this.yCenter += Math.floor((topMovement - bottomMovement) / 2);
this.drawingArea -= Math.min(this.drawingArea / 2, Math.max(leftMovement, rightMovement, topMovement, bottomMovement));
}
getIndexAngle(index3) {
const angleMultiplier = TAU / (this._pointLabels.length || 1);
const startAngle = this.options.startAngle || 0;
return _normalizeAngle(index3 * angleMultiplier + toRadians(startAngle));
}
getDistanceFromCenterForValue(value) {
if (isNullOrUndef(value)) {
return NaN;
}
const scalingFactor = this.drawingArea / (this.max - this.min);
if (this.options.reverse) {
return (this.max - value) * scalingFactor;
}
return (value - this.min) * scalingFactor;
}
getValueForDistanceFromCenter(distance) {
if (isNullOrUndef(distance)) {
return NaN;
}
const scaledDistance = distance / (this.drawingArea / (this.max - this.min));
return this.options.reverse ? this.max - scaledDistance : this.min + scaledDistance;
}
getPointLabelContext(index3) {
const pointLabels = this._pointLabels || [];
if (index3 >= 0 && index3 < pointLabels.length) {
const pointLabel = pointLabels[index3];
return createPointLabelContext(this.getContext(), index3, pointLabel);
}
}
getPointPosition(index3, distanceFromCenter, additionalAngle = 0) {
const angle = this.getIndexAngle(index3) - HALF_PI + additionalAngle;
return {
x: Math.cos(angle) * distanceFromCenter + this.xCenter,
y: Math.sin(angle) * distanceFromCenter + this.yCenter,
angle
};
}
getPointPositionForValue(index3, value) {
return this.getPointPosition(index3, this.getDistanceFromCenterForValue(value));
}
getBasePosition(index3) {
return this.getPointPositionForValue(index3 || 0, this.getBaseValue());
}
getPointLabelPosition(index3) {
const { left: left2, top: top2, right: right2, bottom: bottom2 } = this._pointLabelItems[index3];
return {
left: left2,
top: top2,
right: right2,
bottom: bottom2
};
}
drawBackground() {
const { backgroundColor, grid: { circular } } = this.options;
if (backgroundColor) {
const ctx = this.ctx;
ctx.save();
ctx.beginPath();
pathRadiusLine(this, this.getDistanceFromCenterForValue(this._endValue), circular, this._pointLabels.length);
ctx.closePath();
ctx.fillStyle = backgroundColor;
ctx.fill();
ctx.restore();
}
}
drawGrid() {
const ctx = this.ctx;
const opts = this.options;
const { angleLines, grid } = opts;
const labelCount = this._pointLabels.length;
let i5, offset3, position;
if (opts.pointLabels.display) {
drawPointLabels(this, labelCount);
}
if (grid.display) {
this.ticks.forEach((tick, index3) => {
if (index3 !== 0) {
offset3 = this.getDistanceFromCenterForValue(tick.value);
const optsAtIndex = grid.setContext(this.getContext(index3 - 1));
drawRadiusLine(this, optsAtIndex, offset3, labelCount);
}
});
}
if (angleLines.display) {
ctx.save();
for (i5 = labelCount - 1; i5 >= 0; i5--) {
const optsAtIndex = angleLines.setContext(this.getPointLabelContext(i5));
const { color: color2, lineWidth } = optsAtIndex;
if (!lineWidth || !color2) {
continue;
}
ctx.lineWidth = lineWidth;
ctx.strokeStyle = color2;
ctx.setLineDash(optsAtIndex.borderDash);
ctx.lineDashOffset = optsAtIndex.borderDashOffset;
offset3 = this.getDistanceFromCenterForValue(opts.ticks.reverse ? this.min : this.max);
position = this.getPointPosition(i5, offset3);
ctx.beginPath();
ctx.moveTo(this.xCenter, this.yCenter);
ctx.lineTo(position.x, position.y);
ctx.stroke();
}
ctx.restore();
}
}
drawBorder() {
}
drawLabels() {
const ctx = this.ctx;
const opts = this.options;
const tickOpts = opts.ticks;
if (!tickOpts.display) {
return;
}
const startAngle = this.getIndexAngle(0);
let offset3, width;
ctx.save();
ctx.translate(this.xCenter, this.yCenter);
ctx.rotate(startAngle);
ctx.textAlign = "center";
ctx.textBaseline = "middle";
this.ticks.forEach((tick, index3) => {
if (index3 === 0 && !opts.reverse) {
return;
}
const optsAtIndex = tickOpts.setContext(this.getContext(index3));
const tickFont = toFont(optsAtIndex.font);
offset3 = this.getDistanceFromCenterForValue(this.ticks[index3].value);
if (optsAtIndex.showLabelBackdrop) {
ctx.font = tickFont.string;
width = ctx.measureText(tick.label).width;
ctx.fillStyle = optsAtIndex.backdropColor;
const padding = toPadding(optsAtIndex.backdropPadding);
ctx.fillRect(
-width / 2 - padding.left,
-offset3 - tickFont.size / 2 - padding.top,
width + padding.width,
tickFont.size + padding.height
);
}
renderText(ctx, tick.label, 0, -offset3, tickFont, {
color: optsAtIndex.color
});
});
ctx.restore();
}
drawTitle() {
}
};
RadialLinearScale.id = "radialLinear";
RadialLinearScale.defaults = {
display: true,
animate: true,
position: "chartArea",
angleLines: {
display: true,
lineWidth: 1,
borderDash: [],
borderDashOffset: 0
},
grid: {
circular: false
},
startAngle: 0,
ticks: {
showLabelBackdrop: true,
callback: Ticks.formatters.numeric
},
pointLabels: {
backdropColor: void 0,
backdropPadding: 2,
display: true,
font: {
size: 10
},
callback(label) {
return label;
},
padding: 5,
centerPointLabels: false
}
};
RadialLinearScale.defaultRoutes = {
"angleLines.color": "borderColor",
"pointLabels.color": "color",
"ticks.color": "color"
};
RadialLinearScale.descriptors = {
angleLines: {
_fallback: "grid"
}
};
INTERVALS = {
millisecond: { common: true, size: 1, steps: 1e3 },
second: { common: true, size: 1e3, steps: 60 },
minute: { common: true, size: 6e4, steps: 60 },
hour: { common: true, size: 36e5, steps: 24 },
day: { common: true, size: 864e5, steps: 30 },
week: { common: false, size: 6048e5, steps: 4 },
month: { common: true, size: 2628e6, steps: 12 },
quarter: { common: false, size: 7884e6, steps: 4 },
year: { common: true, size: 3154e7 }
};
UNITS = Object.keys(INTERVALS);
TimeScale = class extends Scale {
constructor(props) {
super(props);
this._cache = {
data: [],
labels: [],
all: []
};
this._unit = "day";
this._majorUnit = void 0;
this._offsets = {};
this._normalized = false;
this._parseOpts = void 0;
}
init(scaleOpts, opts) {
const time = scaleOpts.time || (scaleOpts.time = {});
const adapter = this._adapter = new adapters._date(scaleOpts.adapters.date);
mergeIf(time.displayFormats, adapter.formats());
this._parseOpts = {
parser: time.parser,
round: time.round,
isoWeekday: time.isoWeekday
};
super.init(scaleOpts);
this._normalized = opts.normalized;
}
parse(raw, index3) {
if (raw === void 0) {
return null;
}
return parse(this, raw);
}
beforeLayout() {
super.beforeLayout();
this._cache = {
data: [],
labels: [],
all: []
};
}
determineDataLimits() {
const options = this.options;
const adapter = this._adapter;
const unit = options.time.unit || "day";
let { min: min2, max: max2, minDefined, maxDefined } = this.getUserBounds();
function _applyBounds(bounds) {
if (!minDefined && !isNaN(bounds.min)) {
min2 = Math.min(min2, bounds.min);
}
if (!maxDefined && !isNaN(bounds.max)) {
max2 = Math.max(max2, bounds.max);
}
}
if (!minDefined || !maxDefined) {
_applyBounds(this._getLabelBounds());
if (options.bounds !== "ticks" || options.ticks.source !== "labels") {
_applyBounds(this.getMinMax(false));
}
}
min2 = isNumberFinite(min2) && !isNaN(min2) ? min2 : +adapter.startOf(Date.now(), unit);
max2 = isNumberFinite(max2) && !isNaN(max2) ? max2 : +adapter.endOf(Date.now(), unit) + 1;
this.min = Math.min(min2, max2 - 1);
this.max = Math.max(min2 + 1, max2);
}
_getLabelBounds() {
const arr = this.getLabelTimestamps();
let min2 = Number.POSITIVE_INFINITY;
let max2 = Number.NEGATIVE_INFINITY;
if (arr.length) {
min2 = arr[0];
max2 = arr[arr.length - 1];
}
return { min: min2, max: max2 };
}
buildTicks() {
const options = this.options;
const timeOpts = options.time;
const tickOpts = options.ticks;
const timestamps = tickOpts.source === "labels" ? this.getLabelTimestamps() : this._generate();
if (options.bounds === "ticks" && timestamps.length) {
this.min = this._userMin || timestamps[0];
this.max = this._userMax || timestamps[timestamps.length - 1];
}
const min2 = this.min;
const max2 = this.max;
const ticks = _filterBetween(timestamps, min2, max2);
this._unit = timeOpts.unit || (tickOpts.autoSkip ? determineUnitForAutoTicks(timeOpts.minUnit, this.min, this.max, this._getLabelCapacity(min2)) : determineUnitForFormatting(this, ticks.length, timeOpts.minUnit, this.min, this.max));
this._majorUnit = !tickOpts.major.enabled || this._unit === "year" ? void 0 : determineMajorUnit(this._unit);
this.initOffsets(timestamps);
if (options.reverse) {
ticks.reverse();
}
return ticksFromTimestamps(this, ticks, this._majorUnit);
}
initOffsets(timestamps) {
let start3 = 0;
let end2 = 0;
let first3, last;
if (this.options.offset && timestamps.length) {
first3 = this.getDecimalForValue(timestamps[0]);
if (timestamps.length === 1) {
start3 = 1 - first3;
} else {
start3 = (this.getDecimalForValue(timestamps[1]) - first3) / 2;
}
last = this.getDecimalForValue(timestamps[timestamps.length - 1]);
if (timestamps.length === 1) {
end2 = last;
} else {
end2 = (last - this.getDecimalForValue(timestamps[timestamps.length - 2])) / 2;
}
}
const limit = timestamps.length < 3 ? 0.5 : 0.25;
start3 = _limitValue(start3, 0, limit);
end2 = _limitValue(end2, 0, limit);
this._offsets = { start: start3, end: end2, factor: 1 / (start3 + 1 + end2) };
}
_generate() {
const adapter = this._adapter;
const min2 = this.min;
const max2 = this.max;
const options = this.options;
const timeOpts = options.time;
const minor = timeOpts.unit || determineUnitForAutoTicks(timeOpts.minUnit, min2, max2, this._getLabelCapacity(min2));
const stepSize = valueOrDefault(timeOpts.stepSize, 1);
const weekday = minor === "week" ? timeOpts.isoWeekday : false;
const hasWeekday = isNumber(weekday) || weekday === true;
const ticks = {};
let first3 = min2;
let time, count;
if (hasWeekday) {
first3 = +adapter.startOf(first3, "isoWeek", weekday);
}
first3 = +adapter.startOf(first3, hasWeekday ? "day" : minor);
if (adapter.diff(max2, min2, minor) > 1e5 * stepSize) {
throw new Error(min2 + " and " + max2 + " are too far apart with stepSize of " + stepSize + " " + minor);
}
const timestamps = options.ticks.source === "data" && this.getDataTimestamps();
for (time = first3, count = 0; time < max2; time = +adapter.add(time, stepSize, minor), count++) {
addTick(ticks, time, timestamps);
}
if (time === max2 || options.bounds === "ticks" || count === 1) {
addTick(ticks, time, timestamps);
}
return Object.keys(ticks).sort((a5, b4) => a5 - b4).map((x4) => +x4);
}
getLabelForValue(value) {
const adapter = this._adapter;
const timeOpts = this.options.time;
if (timeOpts.tooltipFormat) {
return adapter.format(value, timeOpts.tooltipFormat);
}
return adapter.format(value, timeOpts.displayFormats.datetime);
}
_tickFormatFunction(time, index3, ticks, format2) {
const options = this.options;
const formats2 = options.time.displayFormats;
const unit = this._unit;
const majorUnit = this._majorUnit;
const minorFormat = unit && formats2[unit];
const majorFormat = majorUnit && formats2[majorUnit];
const tick = ticks[index3];
const major = majorUnit && majorFormat && tick && tick.major;
const label = this._adapter.format(time, format2 || (major ? majorFormat : minorFormat));
const formatter = options.ticks.callback;
return formatter ? callback(formatter, [label, index3, ticks], this) : label;
}
generateTickLabels(ticks) {
let i5, ilen, tick;
for (i5 = 0, ilen = ticks.length; i5 < ilen; ++i5) {
tick = ticks[i5];
tick.label = this._tickFormatFunction(tick.value, i5, ticks);
}
}
getDecimalForValue(value) {
return value === null ? NaN : (value - this.min) / (this.max - this.min);
}
getPixelForValue(value) {
const offsets = this._offsets;
const pos = this.getDecimalForValue(value);
return this.getPixelForDecimal((offsets.start + pos) * offsets.factor);
}
getValueForPixel(pixel) {
const offsets = this._offsets;
const pos = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;
return this.min + pos * (this.max - this.min);
}
_getLabelSize(label) {
const ticksOpts = this.options.ticks;
const tickLabelWidth = this.ctx.measureText(label).width;
const angle = toRadians(this.isHorizontal() ? ticksOpts.maxRotation : ticksOpts.minRotation);
const cosRotation = Math.cos(angle);
const sinRotation = Math.sin(angle);
const tickFontSize = this._resolveTickFontOptions(0).size;
return {
w: tickLabelWidth * cosRotation + tickFontSize * sinRotation,
h: tickLabelWidth * sinRotation + tickFontSize * cosRotation
};
}
_getLabelCapacity(exampleTime) {
const timeOpts = this.options.time;
const displayFormats = timeOpts.displayFormats;
const format2 = displayFormats[timeOpts.unit] || displayFormats.millisecond;
const exampleLabel = this._tickFormatFunction(exampleTime, 0, ticksFromTimestamps(this, [exampleTime], this._majorUnit), format2);
const size = this._getLabelSize(exampleLabel);
const capacity = Math.floor(this.isHorizontal() ? this.width / size.w : this.height / size.h) - 1;
return capacity > 0 ? capacity : 1;
}
getDataTimestamps() {
let timestamps = this._cache.data || [];
let i5, ilen;
if (timestamps.length) {
return timestamps;
}
const metas = this.getMatchingVisibleMetas();
if (this._normalized && metas.length) {
return this._cache.data = metas[0].controller.getAllParsedValues(this);
}
for (i5 = 0, ilen = metas.length; i5 < ilen; ++i5) {
timestamps = timestamps.concat(metas[i5].controller.getAllParsedValues(this));
}
return this._cache.data = this.normalize(timestamps);
}
getLabelTimestamps() {
const timestamps = this._cache.labels || [];
let i5, ilen;
if (timestamps.length) {
return timestamps;
}
const labels = this.getLabels();
for (i5 = 0, ilen = labels.length; i5 < ilen; ++i5) {
timestamps.push(parse(this, labels[i5]));
}
return this._cache.labels = this._normalized ? timestamps : this.normalize(timestamps);
}
normalize(values) {
return _arrayUnique(values.sort(sorter));
}
};
TimeScale.id = "time";
TimeScale.defaults = {
bounds: "data",
adapters: {},
time: {
parser: false,
unit: false,
round: false,
isoWeekday: false,
minUnit: "millisecond",
displayFormats: {}
},
ticks: {
source: "auto",
major: {
enabled: false
}
}
};
TimeSeriesScale = class extends TimeScale {
constructor(props) {
super(props);
this._table = [];
this._minPos = void 0;
this._tableRange = void 0;
}
initOffsets() {
const timestamps = this._getTimestampsForTable();
const table = this._table = this.buildLookupTable(timestamps);
this._minPos = interpolate(table, this.min);
this._tableRange = interpolate(table, this.max) - this._minPos;
super.initOffsets(timestamps);
}
buildLookupTable(timestamps) {
const { min: min2, max: max2 } = this;
const items = [];
const table = [];
let i5, ilen, prev, curr, next;
for (i5 = 0, ilen = timestamps.length; i5 < ilen; ++i5) {
curr = timestamps[i5];
if (curr >= min2 && curr <= max2) {
items.push(curr);
}
}
if (items.length < 2) {
return [
{ time: min2, pos: 0 },
{ time: max2, pos: 1 }
];
}
for (i5 = 0, ilen = items.length; i5 < ilen; ++i5) {
next = items[i5 + 1];
prev = items[i5 - 1];
curr = items[i5];
if (Math.round((next + prev) / 2) !== curr) {
table.push({ time: curr, pos: i5 / (ilen - 1) });
}
}
return table;
}
_getTimestampsForTable() {
let timestamps = this._cache.all || [];
if (timestamps.length) {
return timestamps;
}
const data = this.getDataTimestamps();
const label = this.getLabelTimestamps();
if (data.length && label.length) {
timestamps = this.normalize(data.concat(label));
} else {
timestamps = data.length ? data : label;
}
timestamps = this._cache.all = timestamps;
return timestamps;
}
getDecimalForValue(value) {
return (interpolate(this._table, value) - this._minPos) / this._tableRange;
}
getValueForPixel(pixel) {
const offsets = this._offsets;
const decimal = this.getDecimalForPixel(pixel) / offsets.factor - offsets.end;
return interpolate(this._table, decimal * this._tableRange + this._minPos, true);
}
};
TimeSeriesScale.id = "timeseries";
TimeSeriesScale.defaults = TimeScale.defaults;
scales = /* @__PURE__ */ Object.freeze({
__proto__: null,
CategoryScale,
LinearScale,
LogarithmicScale,
RadialLinearScale,
TimeScale,
TimeSeriesScale
});
registerables = [
controllers,
elements,
plugins,
scales
];
}
});
// node_modules/chartkick/node_modules/chart.js/auto/auto.esm.js
var auto_esm_default;
var init_auto_esm = __esm({
"node_modules/chartkick/node_modules/chart.js/auto/auto.esm.js"() {
init_chart_esm();
Chart.register(...registerables);
auto_esm_default = Chart;
}
});
// node_modules/date-fns/esm/_lib/toInteger/index.js
function toInteger(dirtyNumber) {
if (dirtyNumber === null || dirtyNumber === true || dirtyNumber === false) {
return NaN;
}
var number = Number(dirtyNumber);
if (isNaN(number)) {
return number;
}
return number < 0 ? Math.ceil(number) : Math.floor(number);
}
var init_toInteger = __esm({
"node_modules/date-fns/esm/_lib/toInteger/index.js"() {
}
});
// node_modules/date-fns/esm/_lib/requiredArgs/index.js
function requiredArgs(required, args) {
if (args.length < required) {
throw new TypeError(required + " argument" + (required > 1 ? "s" : "") + " required, but only " + args.length + " present");
}
}
var init_requiredArgs = __esm({
"node_modules/date-fns/esm/_lib/requiredArgs/index.js"() {
}
});
// node_modules/date-fns/esm/toDate/index.js
function toDate(argument) {
requiredArgs(1, arguments);
var argStr = Object.prototype.toString.call(argument);
if (argument instanceof Date || typeof argument === "object" && argStr === "[object Date]") {
return new Date(argument.getTime());
} else if (typeof argument === "number" || argStr === "[object Number]") {
return new Date(argument);
} else {
if ((typeof argument === "string" || argStr === "[object String]") && typeof console !== "undefined") {
console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule");
console.warn(new Error().stack);
}
return new Date(NaN);
}
}
var init_toDate = __esm({
"node_modules/date-fns/esm/toDate/index.js"() {
init_requiredArgs();
}
});
// node_modules/date-fns/esm/addDays/index.js
function addDays(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var date = toDate(dirtyDate);
var amount = toInteger(dirtyAmount);
if (isNaN(amount)) {
return new Date(NaN);
}
if (!amount) {
return date;
}
date.setDate(date.getDate() + amount);
return date;
}
var init_addDays = __esm({
"node_modules/date-fns/esm/addDays/index.js"() {
init_toInteger();
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/addMonths/index.js
function addMonths(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var date = toDate(dirtyDate);
var amount = toInteger(dirtyAmount);
if (isNaN(amount)) {
return new Date(NaN);
}
if (!amount) {
return date;
}
var dayOfMonth = date.getDate();
var endOfDesiredMonth = new Date(date.getTime());
endOfDesiredMonth.setMonth(date.getMonth() + amount + 1, 0);
var daysInMonth2 = endOfDesiredMonth.getDate();
if (dayOfMonth >= daysInMonth2) {
return endOfDesiredMonth;
} else {
date.setFullYear(endOfDesiredMonth.getFullYear(), endOfDesiredMonth.getMonth(), dayOfMonth);
return date;
}
}
var init_addMonths = __esm({
"node_modules/date-fns/esm/addMonths/index.js"() {
init_toInteger();
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/addMilliseconds/index.js
function addMilliseconds(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var timestamp = toDate(dirtyDate).getTime();
var amount = toInteger(dirtyAmount);
return new Date(timestamp + amount);
}
var init_addMilliseconds = __esm({
"node_modules/date-fns/esm/addMilliseconds/index.js"() {
init_toInteger();
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/addHours/index.js
function addHours(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var amount = toInteger(dirtyAmount);
return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_HOUR);
}
var MILLISECONDS_IN_HOUR;
var init_addHours = __esm({
"node_modules/date-fns/esm/addHours/index.js"() {
init_toInteger();
init_addMilliseconds();
init_requiredArgs();
MILLISECONDS_IN_HOUR = 36e5;
}
});
// node_modules/date-fns/esm/startOfWeek/index.js
function startOfWeek(dirtyDate, dirtyOptions) {
requiredArgs(1, arguments);
var options = dirtyOptions || {};
var locale2 = options.locale;
var localeWeekStartsOn = locale2 && locale2.options && locale2.options.weekStartsOn;
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn);
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
}
var date = toDate(dirtyDate);
var day = date.getDay();
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
date.setDate(date.getDate() - diff);
date.setHours(0, 0, 0, 0);
return date;
}
var init_startOfWeek = __esm({
"node_modules/date-fns/esm/startOfWeek/index.js"() {
init_toDate();
init_toInteger();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js
function getTimezoneOffsetInMilliseconds(date) {
var utcDate = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds()));
utcDate.setUTCFullYear(date.getFullYear());
return date.getTime() - utcDate.getTime();
}
var init_getTimezoneOffsetInMilliseconds = __esm({
"node_modules/date-fns/esm/_lib/getTimezoneOffsetInMilliseconds/index.js"() {
}
});
// node_modules/date-fns/esm/startOfDay/index.js
function startOfDay(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setHours(0, 0, 0, 0);
return date;
}
var init_startOfDay = __esm({
"node_modules/date-fns/esm/startOfDay/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/differenceInCalendarDays/index.js
function differenceInCalendarDays(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var startOfDayLeft = startOfDay(dirtyDateLeft);
var startOfDayRight = startOfDay(dirtyDateRight);
var timestampLeft = startOfDayLeft.getTime() - getTimezoneOffsetInMilliseconds(startOfDayLeft);
var timestampRight = startOfDayRight.getTime() - getTimezoneOffsetInMilliseconds(startOfDayRight);
return Math.round((timestampLeft - timestampRight) / MILLISECONDS_IN_DAY);
}
var MILLISECONDS_IN_DAY;
var init_differenceInCalendarDays = __esm({
"node_modules/date-fns/esm/differenceInCalendarDays/index.js"() {
init_getTimezoneOffsetInMilliseconds();
init_startOfDay();
init_requiredArgs();
MILLISECONDS_IN_DAY = 864e5;
}
});
// node_modules/date-fns/esm/addMinutes/index.js
function addMinutes(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var amount = toInteger(dirtyAmount);
return addMilliseconds(dirtyDate, amount * MILLISECONDS_IN_MINUTE);
}
var MILLISECONDS_IN_MINUTE;
var init_addMinutes = __esm({
"node_modules/date-fns/esm/addMinutes/index.js"() {
init_toInteger();
init_addMilliseconds();
init_requiredArgs();
MILLISECONDS_IN_MINUTE = 6e4;
}
});
// node_modules/date-fns/esm/addQuarters/index.js
function addQuarters(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var amount = toInteger(dirtyAmount);
var months2 = amount * 3;
return addMonths(dirtyDate, months2);
}
var init_addQuarters = __esm({
"node_modules/date-fns/esm/addQuarters/index.js"() {
init_toInteger();
init_addMonths();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/addSeconds/index.js
function addSeconds(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var amount = toInteger(dirtyAmount);
return addMilliseconds(dirtyDate, amount * 1e3);
}
var init_addSeconds = __esm({
"node_modules/date-fns/esm/addSeconds/index.js"() {
init_toInteger();
init_addMilliseconds();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/addWeeks/index.js
function addWeeks(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var amount = toInteger(dirtyAmount);
var days = amount * 7;
return addDays(dirtyDate, days);
}
var init_addWeeks = __esm({
"node_modules/date-fns/esm/addWeeks/index.js"() {
init_toInteger();
init_addDays();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/addYears/index.js
function addYears(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var amount = toInteger(dirtyAmount);
return addMonths(dirtyDate, amount * 12);
}
var init_addYears = __esm({
"node_modules/date-fns/esm/addYears/index.js"() {
init_toInteger();
init_addMonths();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/compareAsc/index.js
function compareAsc(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
var diff = dateLeft.getTime() - dateRight.getTime();
if (diff < 0) {
return -1;
} else if (diff > 0) {
return 1;
} else {
return diff;
}
}
var init_compareAsc = __esm({
"node_modules/date-fns/esm/compareAsc/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/constants/index.js
var maxTime, millisecondsInMinute, millisecondsInHour, minTime;
var init_constants = __esm({
"node_modules/date-fns/esm/constants/index.js"() {
maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
millisecondsInMinute = 6e4;
millisecondsInHour = 36e5;
minTime = -maxTime;
}
});
// node_modules/date-fns/esm/isDate/index.js
function isDate(value) {
requiredArgs(1, arguments);
return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
}
var init_isDate = __esm({
"node_modules/date-fns/esm/isDate/index.js"() {
init_requiredArgs();
}
});
// node_modules/date-fns/esm/isValid/index.js
function isValid(dirtyDate) {
requiredArgs(1, arguments);
if (!isDate(dirtyDate) && typeof dirtyDate !== "number") {
return false;
}
var date = toDate(dirtyDate);
return !isNaN(Number(date));
}
var init_isValid = __esm({
"node_modules/date-fns/esm/isValid/index.js"() {
init_isDate();
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/differenceInCalendarMonths/index.js
function differenceInCalendarMonths(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
var yearDiff = dateLeft.getFullYear() - dateRight.getFullYear();
var monthDiff = dateLeft.getMonth() - dateRight.getMonth();
return yearDiff * 12 + monthDiff;
}
var init_differenceInCalendarMonths = __esm({
"node_modules/date-fns/esm/differenceInCalendarMonths/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/differenceInCalendarYears/index.js
function differenceInCalendarYears(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
return dateLeft.getFullYear() - dateRight.getFullYear();
}
var init_differenceInCalendarYears = __esm({
"node_modules/date-fns/esm/differenceInCalendarYears/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/differenceInDays/index.js
function compareLocalAsc(dateLeft, dateRight) {
var diff = dateLeft.getFullYear() - dateRight.getFullYear() || dateLeft.getMonth() - dateRight.getMonth() || dateLeft.getDate() - dateRight.getDate() || dateLeft.getHours() - dateRight.getHours() || dateLeft.getMinutes() - dateRight.getMinutes() || dateLeft.getSeconds() - dateRight.getSeconds() || dateLeft.getMilliseconds() - dateRight.getMilliseconds();
if (diff < 0) {
return -1;
} else if (diff > 0) {
return 1;
} else {
return diff;
}
}
function differenceInDays(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
var sign2 = compareLocalAsc(dateLeft, dateRight);
var difference = Math.abs(differenceInCalendarDays(dateLeft, dateRight));
dateLeft.setDate(dateLeft.getDate() - sign2 * difference);
var isLastDayNotFull = Number(compareLocalAsc(dateLeft, dateRight) === -sign2);
var result = sign2 * (difference - isLastDayNotFull);
return result === 0 ? 0 : result;
}
var init_differenceInDays = __esm({
"node_modules/date-fns/esm/differenceInDays/index.js"() {
init_toDate();
init_differenceInCalendarDays();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/differenceInMilliseconds/index.js
function differenceInMilliseconds(dateLeft, dateRight) {
requiredArgs(2, arguments);
return toDate(dateLeft).getTime() - toDate(dateRight).getTime();
}
var init_differenceInMilliseconds = __esm({
"node_modules/date-fns/esm/differenceInMilliseconds/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/_lib/roundingMethods/index.js
function getRoundingMethod(method) {
return method ? roundingMap[method] : roundingMap[defaultRoundingMethod];
}
var roundingMap, defaultRoundingMethod;
var init_roundingMethods = __esm({
"node_modules/date-fns/esm/_lib/roundingMethods/index.js"() {
roundingMap = {
ceil: Math.ceil,
round: Math.round,
floor: Math.floor,
trunc: function(value) {
return value < 0 ? Math.ceil(value) : Math.floor(value);
}
};
defaultRoundingMethod = "trunc";
}
});
// node_modules/date-fns/esm/differenceInHours/index.js
function differenceInHours(dateLeft, dateRight, options) {
requiredArgs(2, arguments);
var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInHour;
return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}
var init_differenceInHours = __esm({
"node_modules/date-fns/esm/differenceInHours/index.js"() {
init_constants();
init_differenceInMilliseconds();
init_requiredArgs();
init_roundingMethods();
}
});
// node_modules/date-fns/esm/differenceInMinutes/index.js
function differenceInMinutes(dateLeft, dateRight, options) {
requiredArgs(2, arguments);
var diff = differenceInMilliseconds(dateLeft, dateRight) / millisecondsInMinute;
return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}
var init_differenceInMinutes = __esm({
"node_modules/date-fns/esm/differenceInMinutes/index.js"() {
init_constants();
init_differenceInMilliseconds();
init_requiredArgs();
init_roundingMethods();
}
});
// node_modules/date-fns/esm/endOfDay/index.js
function endOfDay(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setHours(23, 59, 59, 999);
return date;
}
var init_endOfDay = __esm({
"node_modules/date-fns/esm/endOfDay/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/endOfMonth/index.js
function endOfMonth(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var month = date.getMonth();
date.setFullYear(date.getFullYear(), month + 1, 0);
date.setHours(23, 59, 59, 999);
return date;
}
var init_endOfMonth = __esm({
"node_modules/date-fns/esm/endOfMonth/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/isLastDayOfMonth/index.js
function isLastDayOfMonth(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
return endOfDay(date).getTime() === endOfMonth(date).getTime();
}
var init_isLastDayOfMonth = __esm({
"node_modules/date-fns/esm/isLastDayOfMonth/index.js"() {
init_toDate();
init_endOfDay();
init_endOfMonth();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/differenceInMonths/index.js
function differenceInMonths(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
var sign2 = compareAsc(dateLeft, dateRight);
var difference = Math.abs(differenceInCalendarMonths(dateLeft, dateRight));
var result;
if (difference < 1) {
result = 0;
} else {
if (dateLeft.getMonth() === 1 && dateLeft.getDate() > 27) {
dateLeft.setDate(30);
}
dateLeft.setMonth(dateLeft.getMonth() - sign2 * difference);
var isLastMonthNotFull = compareAsc(dateLeft, dateRight) === -sign2;
if (isLastDayOfMonth(toDate(dirtyDateLeft)) && difference === 1 && compareAsc(dirtyDateLeft, dateRight) === 1) {
isLastMonthNotFull = false;
}
result = sign2 * (difference - Number(isLastMonthNotFull));
}
return result === 0 ? 0 : result;
}
var init_differenceInMonths = __esm({
"node_modules/date-fns/esm/differenceInMonths/index.js"() {
init_toDate();
init_differenceInCalendarMonths();
init_compareAsc();
init_requiredArgs();
init_isLastDayOfMonth();
}
});
// node_modules/date-fns/esm/differenceInQuarters/index.js
function differenceInQuarters(dateLeft, dateRight, options) {
requiredArgs(2, arguments);
var diff = differenceInMonths(dateLeft, dateRight) / 3;
return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}
var init_differenceInQuarters = __esm({
"node_modules/date-fns/esm/differenceInQuarters/index.js"() {
init_differenceInMonths();
init_requiredArgs();
init_roundingMethods();
}
});
// node_modules/date-fns/esm/differenceInSeconds/index.js
function differenceInSeconds(dateLeft, dateRight, options) {
requiredArgs(2, arguments);
var diff = differenceInMilliseconds(dateLeft, dateRight) / 1e3;
return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}
var init_differenceInSeconds = __esm({
"node_modules/date-fns/esm/differenceInSeconds/index.js"() {
init_differenceInMilliseconds();
init_requiredArgs();
init_roundingMethods();
}
});
// node_modules/date-fns/esm/differenceInWeeks/index.js
function differenceInWeeks(dateLeft, dateRight, options) {
requiredArgs(2, arguments);
var diff = differenceInDays(dateLeft, dateRight) / 7;
return getRoundingMethod(options === null || options === void 0 ? void 0 : options.roundingMethod)(diff);
}
var init_differenceInWeeks = __esm({
"node_modules/date-fns/esm/differenceInWeeks/index.js"() {
init_differenceInDays();
init_requiredArgs();
init_roundingMethods();
}
});
// node_modules/date-fns/esm/differenceInYears/index.js
function differenceInYears(dirtyDateLeft, dirtyDateRight) {
requiredArgs(2, arguments);
var dateLeft = toDate(dirtyDateLeft);
var dateRight = toDate(dirtyDateRight);
var sign2 = compareAsc(dateLeft, dateRight);
var difference = Math.abs(differenceInCalendarYears(dateLeft, dateRight));
dateLeft.setFullYear(1584);
dateRight.setFullYear(1584);
var isLastYearNotFull = compareAsc(dateLeft, dateRight) === -sign2;
var result = sign2 * (difference - Number(isLastYearNotFull));
return result === 0 ? 0 : result;
}
var init_differenceInYears = __esm({
"node_modules/date-fns/esm/differenceInYears/index.js"() {
init_toDate();
init_differenceInCalendarYears();
init_compareAsc();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/startOfMinute/index.js
function startOfMinute(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setSeconds(0, 0);
return date;
}
var init_startOfMinute = __esm({
"node_modules/date-fns/esm/startOfMinute/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/startOfQuarter/index.js
function startOfQuarter(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var currentMonth = date.getMonth();
var month = currentMonth - currentMonth % 3;
date.setMonth(month, 1);
date.setHours(0, 0, 0, 0);
return date;
}
var init_startOfQuarter = __esm({
"node_modules/date-fns/esm/startOfQuarter/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/startOfMonth/index.js
function startOfMonth(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setDate(1);
date.setHours(0, 0, 0, 0);
return date;
}
var init_startOfMonth = __esm({
"node_modules/date-fns/esm/startOfMonth/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/startOfYear/index.js
function startOfYear(dirtyDate) {
requiredArgs(1, arguments);
var cleanDate = toDate(dirtyDate);
var date = new Date(0);
date.setFullYear(cleanDate.getFullYear(), 0, 1);
date.setHours(0, 0, 0, 0);
return date;
}
var init_startOfYear = __esm({
"node_modules/date-fns/esm/startOfYear/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/endOfYear/index.js
function endOfYear(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var year = date.getFullYear();
date.setFullYear(year + 1, 0, 0);
date.setHours(23, 59, 59, 999);
return date;
}
var init_endOfYear = __esm({
"node_modules/date-fns/esm/endOfYear/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/endOfHour/index.js
function endOfHour(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setMinutes(59, 59, 999);
return date;
}
var init_endOfHour = __esm({
"node_modules/date-fns/esm/endOfHour/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/endOfWeek/index.js
function endOfWeek(dirtyDate, dirtyOptions) {
requiredArgs(1, arguments);
var options = dirtyOptions || {};
var locale2 = options.locale;
var localeWeekStartsOn = locale2 && locale2.options && locale2.options.weekStartsOn;
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn);
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
}
var date = toDate(dirtyDate);
var day = date.getDay();
var diff = (day < weekStartsOn ? -7 : 0) + 6 - (day - weekStartsOn);
date.setDate(date.getDate() + diff);
date.setHours(23, 59, 59, 999);
return date;
}
var init_endOfWeek = __esm({
"node_modules/date-fns/esm/endOfWeek/index.js"() {
init_toDate();
init_toInteger();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/endOfMinute/index.js
function endOfMinute(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setSeconds(59, 999);
return date;
}
var init_endOfMinute = __esm({
"node_modules/date-fns/esm/endOfMinute/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/endOfQuarter/index.js
function endOfQuarter(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var currentMonth = date.getMonth();
var month = currentMonth - currentMonth % 3 + 3;
date.setMonth(month, 0);
date.setHours(23, 59, 59, 999);
return date;
}
var init_endOfQuarter = __esm({
"node_modules/date-fns/esm/endOfQuarter/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/endOfSecond/index.js
function endOfSecond(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setMilliseconds(999);
return date;
}
var init_endOfSecond = __esm({
"node_modules/date-fns/esm/endOfSecond/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js
var formatDistanceLocale, formatDistance, formatDistance_default;
var init_formatDistance = __esm({
"node_modules/date-fns/esm/locale/en-US/_lib/formatDistance/index.js"() {
formatDistanceLocale = {
lessThanXSeconds: {
one: "less than a second",
other: "less than {{count}} seconds"
},
xSeconds: {
one: "1 second",
other: "{{count}} seconds"
},
halfAMinute: "half a minute",
lessThanXMinutes: {
one: "less than a minute",
other: "less than {{count}} minutes"
},
xMinutes: {
one: "1 minute",
other: "{{count}} minutes"
},
aboutXHours: {
one: "about 1 hour",
other: "about {{count}} hours"
},
xHours: {
one: "1 hour",
other: "{{count}} hours"
},
xDays: {
one: "1 day",
other: "{{count}} days"
},
aboutXWeeks: {
one: "about 1 week",
other: "about {{count}} weeks"
},
xWeeks: {
one: "1 week",
other: "{{count}} weeks"
},
aboutXMonths: {
one: "about 1 month",
other: "about {{count}} months"
},
xMonths: {
one: "1 month",
other: "{{count}} months"
},
aboutXYears: {
one: "about 1 year",
other: "about {{count}} years"
},
xYears: {
one: "1 year",
other: "{{count}} years"
},
overXYears: {
one: "over 1 year",
other: "over {{count}} years"
},
almostXYears: {
one: "almost 1 year",
other: "almost {{count}} years"
}
};
formatDistance = function(token, count, options) {
var result;
var tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", count.toString());
}
if (options !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "in " + result;
} else {
return result + " ago";
}
}
return result;
};
formatDistance_default = formatDistance;
}
});
// node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js
function buildFormatLongFn(args) {
return function() {
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format2 = args.formats[width] || args.formats[args.defaultWidth];
return format2;
};
}
var init_buildFormatLongFn = __esm({
"node_modules/date-fns/esm/locale/_lib/buildFormatLongFn/index.js"() {
}
});
// node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js
var dateFormats, timeFormats, dateTimeFormats, formatLong, formatLong_default;
var init_formatLong = __esm({
"node_modules/date-fns/esm/locale/en-US/_lib/formatLong/index.js"() {
init_buildFormatLongFn();
dateFormats = {
full: "EEEE, MMMM do, y",
long: "MMMM do, y",
medium: "MMM d, y",
short: "MM/dd/yyyy"
};
timeFormats = {
full: "h:mm:ss a zzzz",
long: "h:mm:ss a z",
medium: "h:mm:ss a",
short: "h:mm a"
};
dateTimeFormats = {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
};
formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full"
})
};
formatLong_default = formatLong;
}
});
// node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js
var formatRelativeLocale, formatRelative, formatRelative_default;
var init_formatRelative = __esm({
"node_modules/date-fns/esm/locale/en-US/_lib/formatRelative/index.js"() {
formatRelativeLocale = {
lastWeek: "'last' eeee 'at' p",
yesterday: "'yesterday at' p",
today: "'today at' p",
tomorrow: "'tomorrow at' p",
nextWeek: "eeee 'at' p",
other: "P"
};
formatRelative = function(token, _date, _baseDate, _options) {
return formatRelativeLocale[token];
};
formatRelative_default = formatRelative;
}
});
// node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js
function buildLocalizeFn(args) {
return function(dirtyIndex, dirtyOptions) {
var options = dirtyOptions || {};
var context = options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index3 = args.argumentCallback ? args.argumentCallback(dirtyIndex) : dirtyIndex;
return valuesArray[index3];
};
}
var init_buildLocalizeFn = __esm({
"node_modules/date-fns/esm/locale/_lib/buildLocalizeFn/index.js"() {
}
});
// node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js
var eraValues, quarterValues, monthValues, dayValues, dayPeriodValues, formattingDayPeriodValues, ordinalNumber, localize, localize_default;
var init_localize = __esm({
"node_modules/date-fns/esm/locale/en-US/_lib/localize/index.js"() {
init_buildLocalizeFn();
eraValues = {
narrow: ["B", "A"],
abbreviated: ["BC", "AD"],
wide: ["Before Christ", "Anno Domini"]
};
quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
};
monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
wide: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
};
dayValues = {
narrow: ["S", "M", "T", "W", "T", "F", "S"],
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
wide: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"]
};
dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
}
};
formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
}
};
ordinalNumber = function(dirtyNumber, _options) {
var number = Number(dirtyNumber);
var rem100 = number % 100;
if (rem100 > 20 || rem100 < 10) {
switch (rem100 % 10) {
case 1:
return number + "st";
case 2:
return number + "nd";
case 3:
return number + "rd";
}
}
return number + "th";
};
localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: function(quarter) {
return quarter - 1;
}
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide"
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide"
})
};
localize_default = localize;
}
});
// node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js
function buildMatchFn(args) {
return function(string) {
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function(pattern) {
return pattern.test(matchedString);
}) : findKey(parsePatterns, function(pattern) {
return pattern.test(matchedString);
});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return {
value,
rest
};
};
}
function findKey(object, predicate) {
for (var key in object) {
if (object.hasOwnProperty(key) && predicate(object[key])) {
return key;
}
}
return void 0;
}
function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return void 0;
}
var init_buildMatchFn = __esm({
"node_modules/date-fns/esm/locale/_lib/buildMatchFn/index.js"() {
}
});
// node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js
function buildMatchPatternFn(args) {
return function(string) {
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return {
value,
rest
};
};
}
var init_buildMatchPatternFn = __esm({
"node_modules/date-fns/esm/locale/_lib/buildMatchPatternFn/index.js"() {
}
});
// node_modules/date-fns/esm/locale/en-US/_lib/match/index.js
var matchOrdinalNumberPattern, parseOrdinalNumberPattern, matchEraPatterns, parseEraPatterns, matchQuarterPatterns, parseQuarterPatterns, matchMonthPatterns, parseMonthPatterns, matchDayPatterns, parseDayPatterns, matchDayPeriodPatterns, parseDayPeriodPatterns, match, match_default;
var init_match = __esm({
"node_modules/date-fns/esm/locale/en-US/_lib/match/index.js"() {
init_buildMatchFn();
init_buildMatchPatternFn();
matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
parseOrdinalNumberPattern = /\d+/i;
matchEraPatterns = {
narrow: /^(b|a)/i,
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
wide: /^(before christ|before common era|anno domini|common era)/i
};
parseEraPatterns = {
any: [/^b/i, /^(a|c)/i]
};
matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](th|st|nd|rd)? quarter/i
};
parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i]
};
matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
};
parseMonthPatterns = {
narrow: [/^j/i, /^f/i, /^m/i, /^a/i, /^m/i, /^j/i, /^j/i, /^a/i, /^s/i, /^o/i, /^n/i, /^d/i],
any: [/^ja/i, /^f/i, /^mar/i, /^ap/i, /^may/i, /^jun/i, /^jul/i, /^au/i, /^s/i, /^o/i, /^n/i, /^d/i]
};
matchDayPatterns = {
narrow: /^[smtwf]/i,
short: /^(su|mo|tu|we|th|fr|sa)/i,
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
};
parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
};
matchDayPeriodPatterns = {
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
};
parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^mi/i,
noon: /^no/i,
morning: /morning/i,
afternoon: /afternoon/i,
evening: /evening/i,
night: /night/i
}
};
match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function(value) {
return parseInt(value, 10);
}
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function(index3) {
return index3 + 1;
}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
match_default = match;
}
});
// node_modules/date-fns/esm/locale/en-US/index.js
var locale, en_US_default;
var init_en_US = __esm({
"node_modules/date-fns/esm/locale/en-US/index.js"() {
init_formatDistance();
init_formatLong();
init_formatRelative();
init_localize();
init_match();
locale = {
code: "en-US",
formatDistance: formatDistance_default,
formatLong: formatLong_default,
formatRelative: formatRelative_default,
localize: localize_default,
match: match_default,
options: {
weekStartsOn: 0,
firstWeekContainsDate: 1
}
};
en_US_default = locale;
}
});
// node_modules/date-fns/esm/subMilliseconds/index.js
function subMilliseconds(dirtyDate, dirtyAmount) {
requiredArgs(2, arguments);
var amount = toInteger(dirtyAmount);
return addMilliseconds(dirtyDate, -amount);
}
var init_subMilliseconds = __esm({
"node_modules/date-fns/esm/subMilliseconds/index.js"() {
init_toInteger();
init_addMilliseconds();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js
function getUTCDayOfYear(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var timestamp = date.getTime();
date.setUTCMonth(0, 1);
date.setUTCHours(0, 0, 0, 0);
var startOfYearTimestamp = date.getTime();
var difference = timestamp - startOfYearTimestamp;
return Math.floor(difference / MILLISECONDS_IN_DAY2) + 1;
}
var MILLISECONDS_IN_DAY2;
var init_getUTCDayOfYear = __esm({
"node_modules/date-fns/esm/_lib/getUTCDayOfYear/index.js"() {
init_toDate();
init_requiredArgs();
MILLISECONDS_IN_DAY2 = 864e5;
}
});
// node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js
function startOfUTCISOWeek(dirtyDate) {
requiredArgs(1, arguments);
var weekStartsOn = 1;
var date = toDate(dirtyDate);
var day = date.getUTCDay();
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
date.setUTCDate(date.getUTCDate() - diff);
date.setUTCHours(0, 0, 0, 0);
return date;
}
var init_startOfUTCISOWeek = __esm({
"node_modules/date-fns/esm/_lib/startOfUTCISOWeek/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js
function getUTCISOWeekYear(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var year = date.getUTCFullYear();
var fourthOfJanuaryOfNextYear = new Date(0);
fourthOfJanuaryOfNextYear.setUTCFullYear(year + 1, 0, 4);
fourthOfJanuaryOfNextYear.setUTCHours(0, 0, 0, 0);
var startOfNextYear = startOfUTCISOWeek(fourthOfJanuaryOfNextYear);
var fourthOfJanuaryOfThisYear = new Date(0);
fourthOfJanuaryOfThisYear.setUTCFullYear(year, 0, 4);
fourthOfJanuaryOfThisYear.setUTCHours(0, 0, 0, 0);
var startOfThisYear = startOfUTCISOWeek(fourthOfJanuaryOfThisYear);
if (date.getTime() >= startOfNextYear.getTime()) {
return year + 1;
} else if (date.getTime() >= startOfThisYear.getTime()) {
return year;
} else {
return year - 1;
}
}
var init_getUTCISOWeekYear = __esm({
"node_modules/date-fns/esm/_lib/getUTCISOWeekYear/index.js"() {
init_toDate();
init_requiredArgs();
init_startOfUTCISOWeek();
}
});
// node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js
function startOfUTCISOWeekYear(dirtyDate) {
requiredArgs(1, arguments);
var year = getUTCISOWeekYear(dirtyDate);
var fourthOfJanuary = new Date(0);
fourthOfJanuary.setUTCFullYear(year, 0, 4);
fourthOfJanuary.setUTCHours(0, 0, 0, 0);
var date = startOfUTCISOWeek(fourthOfJanuary);
return date;
}
var init_startOfUTCISOWeekYear = __esm({
"node_modules/date-fns/esm/_lib/startOfUTCISOWeekYear/index.js"() {
init_getUTCISOWeekYear();
init_startOfUTCISOWeek();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js
function getUTCISOWeek(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var diff = startOfUTCISOWeek(date).getTime() - startOfUTCISOWeekYear(date).getTime();
return Math.round(diff / MILLISECONDS_IN_WEEK) + 1;
}
var MILLISECONDS_IN_WEEK;
var init_getUTCISOWeek = __esm({
"node_modules/date-fns/esm/_lib/getUTCISOWeek/index.js"() {
init_toDate();
init_startOfUTCISOWeek();
init_startOfUTCISOWeekYear();
init_requiredArgs();
MILLISECONDS_IN_WEEK = 6048e5;
}
});
// node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js
function startOfUTCWeek(dirtyDate, dirtyOptions) {
requiredArgs(1, arguments);
var options = dirtyOptions || {};
var locale2 = options.locale;
var localeWeekStartsOn = locale2 && locale2.options && locale2.options.weekStartsOn;
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn);
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
}
var date = toDate(dirtyDate);
var day = date.getUTCDay();
var diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
date.setUTCDate(date.getUTCDate() - diff);
date.setUTCHours(0, 0, 0, 0);
return date;
}
var init_startOfUTCWeek = __esm({
"node_modules/date-fns/esm/_lib/startOfUTCWeek/index.js"() {
init_toDate();
init_requiredArgs();
init_toInteger();
}
});
// node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js
function getUTCWeekYear(dirtyDate, dirtyOptions) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var year = date.getUTCFullYear();
var options = dirtyOptions || {};
var locale2 = options.locale;
var localeFirstWeekContainsDate = locale2 && locale2.options && locale2.options.firstWeekContainsDate;
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
}
var firstWeekOfNextYear = new Date(0);
firstWeekOfNextYear.setUTCFullYear(year + 1, 0, firstWeekContainsDate);
firstWeekOfNextYear.setUTCHours(0, 0, 0, 0);
var startOfNextYear = startOfUTCWeek(firstWeekOfNextYear, dirtyOptions);
var firstWeekOfThisYear = new Date(0);
firstWeekOfThisYear.setUTCFullYear(year, 0, firstWeekContainsDate);
firstWeekOfThisYear.setUTCHours(0, 0, 0, 0);
var startOfThisYear = startOfUTCWeek(firstWeekOfThisYear, dirtyOptions);
if (date.getTime() >= startOfNextYear.getTime()) {
return year + 1;
} else if (date.getTime() >= startOfThisYear.getTime()) {
return year;
} else {
return year - 1;
}
}
var init_getUTCWeekYear = __esm({
"node_modules/date-fns/esm/_lib/getUTCWeekYear/index.js"() {
init_toDate();
init_requiredArgs();
init_startOfUTCWeek();
init_toInteger();
}
});
// node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js
function startOfUTCWeekYear(dirtyDate, dirtyOptions) {
requiredArgs(1, arguments);
var options = dirtyOptions || {};
var locale2 = options.locale;
var localeFirstWeekContainsDate = locale2 && locale2.options && locale2.options.firstWeekContainsDate;
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
var year = getUTCWeekYear(dirtyDate, dirtyOptions);
var firstWeek = new Date(0);
firstWeek.setUTCFullYear(year, 0, firstWeekContainsDate);
firstWeek.setUTCHours(0, 0, 0, 0);
var date = startOfUTCWeek(firstWeek, dirtyOptions);
return date;
}
var init_startOfUTCWeekYear = __esm({
"node_modules/date-fns/esm/_lib/startOfUTCWeekYear/index.js"() {
init_getUTCWeekYear();
init_requiredArgs();
init_startOfUTCWeek();
init_toInteger();
}
});
// node_modules/date-fns/esm/_lib/getUTCWeek/index.js
function getUTCWeek(dirtyDate, options) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
var diff = startOfUTCWeek(date, options).getTime() - startOfUTCWeekYear(date, options).getTime();
return Math.round(diff / MILLISECONDS_IN_WEEK2) + 1;
}
var MILLISECONDS_IN_WEEK2;
var init_getUTCWeek = __esm({
"node_modules/date-fns/esm/_lib/getUTCWeek/index.js"() {
init_toDate();
init_startOfUTCWeek();
init_startOfUTCWeekYear();
init_requiredArgs();
MILLISECONDS_IN_WEEK2 = 6048e5;
}
});
// node_modules/date-fns/esm/_lib/addLeadingZeros/index.js
function addLeadingZeros(number, targetLength) {
var sign2 = number < 0 ? "-" : "";
var output = Math.abs(number).toString();
while (output.length < targetLength) {
output = "0" + output;
}
return sign2 + output;
}
var init_addLeadingZeros = __esm({
"node_modules/date-fns/esm/_lib/addLeadingZeros/index.js"() {
}
});
// node_modules/date-fns/esm/_lib/format/lightFormatters/index.js
var formatters2, lightFormatters_default;
var init_lightFormatters = __esm({
"node_modules/date-fns/esm/_lib/format/lightFormatters/index.js"() {
init_addLeadingZeros();
formatters2 = {
y: function(date, token) {
var signedYear = date.getUTCFullYear();
var year = signedYear > 0 ? signedYear : 1 - signedYear;
return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
},
M: function(date, token) {
var month = date.getUTCMonth();
return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
},
d: function(date, token) {
return addLeadingZeros(date.getUTCDate(), token.length);
},
a: function(date, token) {
var dayPeriodEnumValue = date.getUTCHours() / 12 >= 1 ? "pm" : "am";
switch (token) {
case "a":
case "aa":
return dayPeriodEnumValue.toUpperCase();
case "aaa":
return dayPeriodEnumValue;
case "aaaaa":
return dayPeriodEnumValue[0];
case "aaaa":
default:
return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
}
},
h: function(date, token) {
return addLeadingZeros(date.getUTCHours() % 12 || 12, token.length);
},
H: function(date, token) {
return addLeadingZeros(date.getUTCHours(), token.length);
},
m: function(date, token) {
return addLeadingZeros(date.getUTCMinutes(), token.length);
},
s: function(date, token) {
return addLeadingZeros(date.getUTCSeconds(), token.length);
},
S: function(date, token) {
var numberOfDigits = token.length;
var milliseconds = date.getUTCMilliseconds();
var fractionalSeconds = Math.floor(milliseconds * Math.pow(10, numberOfDigits - 3));
return addLeadingZeros(fractionalSeconds, token.length);
}
};
lightFormatters_default = formatters2;
}
});
// node_modules/date-fns/esm/_lib/format/formatters/index.js
function formatTimezoneShort(offset3, dirtyDelimiter) {
var sign2 = offset3 > 0 ? "-" : "+";
var absOffset = Math.abs(offset3);
var hours = Math.floor(absOffset / 60);
var minutes = absOffset % 60;
if (minutes === 0) {
return sign2 + String(hours);
}
var delimiter = dirtyDelimiter || "";
return sign2 + String(hours) + delimiter + addLeadingZeros(minutes, 2);
}
function formatTimezoneWithOptionalMinutes(offset3, dirtyDelimiter) {
if (offset3 % 60 === 0) {
var sign2 = offset3 > 0 ? "-" : "+";
return sign2 + addLeadingZeros(Math.abs(offset3) / 60, 2);
}
return formatTimezone(offset3, dirtyDelimiter);
}
function formatTimezone(offset3, dirtyDelimiter) {
var delimiter = dirtyDelimiter || "";
var sign2 = offset3 > 0 ? "-" : "+";
var absOffset = Math.abs(offset3);
var hours = addLeadingZeros(Math.floor(absOffset / 60), 2);
var minutes = addLeadingZeros(absOffset % 60, 2);
return sign2 + hours + delimiter + minutes;
}
var dayPeriodEnum, formatters3, formatters_default;
var init_formatters = __esm({
"node_modules/date-fns/esm/_lib/format/formatters/index.js"() {
init_getUTCDayOfYear();
init_getUTCISOWeek();
init_getUTCISOWeekYear();
init_getUTCWeek();
init_getUTCWeekYear();
init_addLeadingZeros();
init_lightFormatters();
dayPeriodEnum = {
am: "am",
pm: "pm",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
};
formatters3 = {
G: function(date, token, localize2) {
var era = date.getUTCFullYear() > 0 ? 1 : 0;
switch (token) {
case "G":
case "GG":
case "GGG":
return localize2.era(era, {
width: "abbreviated"
});
case "GGGGG":
return localize2.era(era, {
width: "narrow"
});
case "GGGG":
default:
return localize2.era(era, {
width: "wide"
});
}
},
y: function(date, token, localize2) {
if (token === "yo") {
var signedYear = date.getUTCFullYear();
var year = signedYear > 0 ? signedYear : 1 - signedYear;
return localize2.ordinalNumber(year, {
unit: "year"
});
}
return lightFormatters_default.y(date, token);
},
Y: function(date, token, localize2, options) {
var signedWeekYear = getUTCWeekYear(date, options);
var weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
if (token === "YY") {
var twoDigitYear = weekYear % 100;
return addLeadingZeros(twoDigitYear, 2);
}
if (token === "Yo") {
return localize2.ordinalNumber(weekYear, {
unit: "year"
});
}
return addLeadingZeros(weekYear, token.length);
},
R: function(date, token) {
var isoWeekYear = getUTCISOWeekYear(date);
return addLeadingZeros(isoWeekYear, token.length);
},
u: function(date, token) {
var year = date.getUTCFullYear();
return addLeadingZeros(year, token.length);
},
Q: function(date, token, localize2) {
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
switch (token) {
case "Q":
return String(quarter);
case "QQ":
return addLeadingZeros(quarter, 2);
case "Qo":
return localize2.ordinalNumber(quarter, {
unit: "quarter"
});
case "QQQ":
return localize2.quarter(quarter, {
width: "abbreviated",
context: "formatting"
});
case "QQQQQ":
return localize2.quarter(quarter, {
width: "narrow",
context: "formatting"
});
case "QQQQ":
default:
return localize2.quarter(quarter, {
width: "wide",
context: "formatting"
});
}
},
q: function(date, token, localize2) {
var quarter = Math.ceil((date.getUTCMonth() + 1) / 3);
switch (token) {
case "q":
return String(quarter);
case "qq":
return addLeadingZeros(quarter, 2);
case "qo":
return localize2.ordinalNumber(quarter, {
unit: "quarter"
});
case "qqq":
return localize2.quarter(quarter, {
width: "abbreviated",
context: "standalone"
});
case "qqqqq":
return localize2.quarter(quarter, {
width: "narrow",
context: "standalone"
});
case "qqqq":
default:
return localize2.quarter(quarter, {
width: "wide",
context: "standalone"
});
}
},
M: function(date, token, localize2) {
var month = date.getUTCMonth();
switch (token) {
case "M":
case "MM":
return lightFormatters_default.M(date, token);
case "Mo":
return localize2.ordinalNumber(month + 1, {
unit: "month"
});
case "MMM":
return localize2.month(month, {
width: "abbreviated",
context: "formatting"
});
case "MMMMM":
return localize2.month(month, {
width: "narrow",
context: "formatting"
});
case "MMMM":
default:
return localize2.month(month, {
width: "wide",
context: "formatting"
});
}
},
L: function(date, token, localize2) {
var month = date.getUTCMonth();
switch (token) {
case "L":
return String(month + 1);
case "LL":
return addLeadingZeros(month + 1, 2);
case "Lo":
return localize2.ordinalNumber(month + 1, {
unit: "month"
});
case "LLL":
return localize2.month(month, {
width: "abbreviated",
context: "standalone"
});
case "LLLLL":
return localize2.month(month, {
width: "narrow",
context: "standalone"
});
case "LLLL":
default:
return localize2.month(month, {
width: "wide",
context: "standalone"
});
}
},
w: function(date, token, localize2, options) {
var week = getUTCWeek(date, options);
if (token === "wo") {
return localize2.ordinalNumber(week, {
unit: "week"
});
}
return addLeadingZeros(week, token.length);
},
I: function(date, token, localize2) {
var isoWeek = getUTCISOWeek(date);
if (token === "Io") {
return localize2.ordinalNumber(isoWeek, {
unit: "week"
});
}
return addLeadingZeros(isoWeek, token.length);
},
d: function(date, token, localize2) {
if (token === "do") {
return localize2.ordinalNumber(date.getUTCDate(), {
unit: "date"
});
}
return lightFormatters_default.d(date, token);
},
D: function(date, token, localize2) {
var dayOfYear = getUTCDayOfYear(date);
if (token === "Do") {
return localize2.ordinalNumber(dayOfYear, {
unit: "dayOfYear"
});
}
return addLeadingZeros(dayOfYear, token.length);
},
E: function(date, token, localize2) {
var dayOfWeek2 = date.getUTCDay();
switch (token) {
case "E":
case "EE":
case "EEE":
return localize2.day(dayOfWeek2, {
width: "abbreviated",
context: "formatting"
});
case "EEEEE":
return localize2.day(dayOfWeek2, {
width: "narrow",
context: "formatting"
});
case "EEEEEE":
return localize2.day(dayOfWeek2, {
width: "short",
context: "formatting"
});
case "EEEE":
default:
return localize2.day(dayOfWeek2, {
width: "wide",
context: "formatting"
});
}
},
e: function(date, token, localize2, options) {
var dayOfWeek2 = date.getUTCDay();
var localDayOfWeek = (dayOfWeek2 - options.weekStartsOn + 8) % 7 || 7;
switch (token) {
case "e":
return String(localDayOfWeek);
case "ee":
return addLeadingZeros(localDayOfWeek, 2);
case "eo":
return localize2.ordinalNumber(localDayOfWeek, {
unit: "day"
});
case "eee":
return localize2.day(dayOfWeek2, {
width: "abbreviated",
context: "formatting"
});
case "eeeee":
return localize2.day(dayOfWeek2, {
width: "narrow",
context: "formatting"
});
case "eeeeee":
return localize2.day(dayOfWeek2, {
width: "short",
context: "formatting"
});
case "eeee":
default:
return localize2.day(dayOfWeek2, {
width: "wide",
context: "formatting"
});
}
},
c: function(date, token, localize2, options) {
var dayOfWeek2 = date.getUTCDay();
var localDayOfWeek = (dayOfWeek2 - options.weekStartsOn + 8) % 7 || 7;
switch (token) {
case "c":
return String(localDayOfWeek);
case "cc":
return addLeadingZeros(localDayOfWeek, token.length);
case "co":
return localize2.ordinalNumber(localDayOfWeek, {
unit: "day"
});
case "ccc":
return localize2.day(dayOfWeek2, {
width: "abbreviated",
context: "standalone"
});
case "ccccc":
return localize2.day(dayOfWeek2, {
width: "narrow",
context: "standalone"
});
case "cccccc":
return localize2.day(dayOfWeek2, {
width: "short",
context: "standalone"
});
case "cccc":
default:
return localize2.day(dayOfWeek2, {
width: "wide",
context: "standalone"
});
}
},
i: function(date, token, localize2) {
var dayOfWeek2 = date.getUTCDay();
var isoDayOfWeek = dayOfWeek2 === 0 ? 7 : dayOfWeek2;
switch (token) {
case "i":
return String(isoDayOfWeek);
case "ii":
return addLeadingZeros(isoDayOfWeek, token.length);
case "io":
return localize2.ordinalNumber(isoDayOfWeek, {
unit: "day"
});
case "iii":
return localize2.day(dayOfWeek2, {
width: "abbreviated",
context: "formatting"
});
case "iiiii":
return localize2.day(dayOfWeek2, {
width: "narrow",
context: "formatting"
});
case "iiiiii":
return localize2.day(dayOfWeek2, {
width: "short",
context: "formatting"
});
case "iiii":
default:
return localize2.day(dayOfWeek2, {
width: "wide",
context: "formatting"
});
}
},
a: function(date, token, localize2) {
var hours = date.getUTCHours();
var dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
switch (token) {
case "a":
case "aa":
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting"
});
case "aaa":
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting"
}).toLowerCase();
case "aaaaa":
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting"
});
case "aaaa":
default:
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting"
});
}
},
b: function(date, token, localize2) {
var hours = date.getUTCHours();
var dayPeriodEnumValue;
if (hours === 12) {
dayPeriodEnumValue = dayPeriodEnum.noon;
} else if (hours === 0) {
dayPeriodEnumValue = dayPeriodEnum.midnight;
} else {
dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
}
switch (token) {
case "b":
case "bb":
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting"
});
case "bbb":
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting"
}).toLowerCase();
case "bbbbb":
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting"
});
case "bbbb":
default:
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting"
});
}
},
B: function(date, token, localize2) {
var hours = date.getUTCHours();
var dayPeriodEnumValue;
if (hours >= 17) {
dayPeriodEnumValue = dayPeriodEnum.evening;
} else if (hours >= 12) {
dayPeriodEnumValue = dayPeriodEnum.afternoon;
} else if (hours >= 4) {
dayPeriodEnumValue = dayPeriodEnum.morning;
} else {
dayPeriodEnumValue = dayPeriodEnum.night;
}
switch (token) {
case "B":
case "BB":
case "BBB":
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "abbreviated",
context: "formatting"
});
case "BBBBB":
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "narrow",
context: "formatting"
});
case "BBBB":
default:
return localize2.dayPeriod(dayPeriodEnumValue, {
width: "wide",
context: "formatting"
});
}
},
h: function(date, token, localize2) {
if (token === "ho") {
var hours = date.getUTCHours() % 12;
if (hours === 0)
hours = 12;
return localize2.ordinalNumber(hours, {
unit: "hour"
});
}
return lightFormatters_default.h(date, token);
},
H: function(date, token, localize2) {
if (token === "Ho") {
return localize2.ordinalNumber(date.getUTCHours(), {
unit: "hour"
});
}
return lightFormatters_default.H(date, token);
},
K: function(date, token, localize2) {
var hours = date.getUTCHours() % 12;
if (token === "Ko") {
return localize2.ordinalNumber(hours, {
unit: "hour"
});
}
return addLeadingZeros(hours, token.length);
},
k: function(date, token, localize2) {
var hours = date.getUTCHours();
if (hours === 0)
hours = 24;
if (token === "ko") {
return localize2.ordinalNumber(hours, {
unit: "hour"
});
}
return addLeadingZeros(hours, token.length);
},
m: function(date, token, localize2) {
if (token === "mo") {
return localize2.ordinalNumber(date.getUTCMinutes(), {
unit: "minute"
});
}
return lightFormatters_default.m(date, token);
},
s: function(date, token, localize2) {
if (token === "so") {
return localize2.ordinalNumber(date.getUTCSeconds(), {
unit: "second"
});
}
return lightFormatters_default.s(date, token);
},
S: function(date, token) {
return lightFormatters_default.S(date, token);
},
X: function(date, token, _localize, options) {
var originalDate = options._originalDate || date;
var timezoneOffset = originalDate.getTimezoneOffset();
if (timezoneOffset === 0) {
return "Z";
}
switch (token) {
case "X":
return formatTimezoneWithOptionalMinutes(timezoneOffset);
case "XXXX":
case "XX":
return formatTimezone(timezoneOffset);
case "XXXXX":
case "XXX":
default:
return formatTimezone(timezoneOffset, ":");
}
},
x: function(date, token, _localize, options) {
var originalDate = options._originalDate || date;
var timezoneOffset = originalDate.getTimezoneOffset();
switch (token) {
case "x":
return formatTimezoneWithOptionalMinutes(timezoneOffset);
case "xxxx":
case "xx":
return formatTimezone(timezoneOffset);
case "xxxxx":
case "xxx":
default:
return formatTimezone(timezoneOffset, ":");
}
},
O: function(date, token, _localize, options) {
var originalDate = options._originalDate || date;
var timezoneOffset = originalDate.getTimezoneOffset();
switch (token) {
case "O":
case "OO":
case "OOO":
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
case "OOOO":
default:
return "GMT" + formatTimezone(timezoneOffset, ":");
}
},
z: function(date, token, _localize, options) {
var originalDate = options._originalDate || date;
var timezoneOffset = originalDate.getTimezoneOffset();
switch (token) {
case "z":
case "zz":
case "zzz":
return "GMT" + formatTimezoneShort(timezoneOffset, ":");
case "zzzz":
default:
return "GMT" + formatTimezone(timezoneOffset, ":");
}
},
t: function(date, token, _localize, options) {
var originalDate = options._originalDate || date;
var timestamp = Math.floor(originalDate.getTime() / 1e3);
return addLeadingZeros(timestamp, token.length);
},
T: function(date, token, _localize, options) {
var originalDate = options._originalDate || date;
var timestamp = originalDate.getTime();
return addLeadingZeros(timestamp, token.length);
}
};
formatters_default = formatters3;
}
});
// node_modules/date-fns/esm/_lib/format/longFormatters/index.js
function dateLongFormatter(pattern, formatLong2) {
switch (pattern) {
case "P":
return formatLong2.date({
width: "short"
});
case "PP":
return formatLong2.date({
width: "medium"
});
case "PPP":
return formatLong2.date({
width: "long"
});
case "PPPP":
default:
return formatLong2.date({
width: "full"
});
}
}
function timeLongFormatter(pattern, formatLong2) {
switch (pattern) {
case "p":
return formatLong2.time({
width: "short"
});
case "pp":
return formatLong2.time({
width: "medium"
});
case "ppp":
return formatLong2.time({
width: "long"
});
case "pppp":
default:
return formatLong2.time({
width: "full"
});
}
}
function dateTimeLongFormatter(pattern, formatLong2) {
var matchResult = pattern.match(/(P+)(p+)?/) || [];
var datePattern = matchResult[1];
var timePattern = matchResult[2];
if (!timePattern) {
return dateLongFormatter(pattern, formatLong2);
}
var dateTimeFormat;
switch (datePattern) {
case "P":
dateTimeFormat = formatLong2.dateTime({
width: "short"
});
break;
case "PP":
dateTimeFormat = formatLong2.dateTime({
width: "medium"
});
break;
case "PPP":
dateTimeFormat = formatLong2.dateTime({
width: "long"
});
break;
case "PPPP":
default:
dateTimeFormat = formatLong2.dateTime({
width: "full"
});
break;
}
return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2));
}
var longFormatters, longFormatters_default;
var init_longFormatters = __esm({
"node_modules/date-fns/esm/_lib/format/longFormatters/index.js"() {
longFormatters = {
p: timeLongFormatter,
P: dateTimeLongFormatter
};
longFormatters_default = longFormatters;
}
});
// node_modules/date-fns/esm/_lib/protectedTokens/index.js
function isProtectedDayOfYearToken(token) {
return protectedDayOfYearTokens.indexOf(token) !== -1;
}
function isProtectedWeekYearToken(token) {
return protectedWeekYearTokens.indexOf(token) !== -1;
}
function throwProtectedError(token, format2, input) {
if (token === "YYYY") {
throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(format2, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
} else if (token === "YY") {
throw new RangeError("Use `yy` instead of `YY` (in `".concat(format2, "`) for formatting years to the input `").concat(input, "`; see: https://git.io/fxCyr"));
} else if (token === "D") {
throw new RangeError("Use `d` instead of `D` (in `".concat(format2, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
} else if (token === "DD") {
throw new RangeError("Use `dd` instead of `DD` (in `".concat(format2, "`) for formatting days of the month to the input `").concat(input, "`; see: https://git.io/fxCyr"));
}
}
var protectedDayOfYearTokens, protectedWeekYearTokens;
var init_protectedTokens = __esm({
"node_modules/date-fns/esm/_lib/protectedTokens/index.js"() {
protectedDayOfYearTokens = ["D", "DD"];
protectedWeekYearTokens = ["YY", "YYYY"];
}
});
// node_modules/date-fns/esm/format/index.js
function format(dirtyDate, dirtyFormatStr, dirtyOptions) {
requiredArgs(2, arguments);
var formatStr = String(dirtyFormatStr);
var options = dirtyOptions || {};
var locale2 = options.locale || en_US_default;
var localeFirstWeekContainsDate = locale2.options && locale2.options.firstWeekContainsDate;
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
}
var localeWeekStartsOn = locale2.options && locale2.options.weekStartsOn;
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn);
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
}
if (!locale2.localize) {
throw new RangeError("locale must contain localize property");
}
if (!locale2.formatLong) {
throw new RangeError("locale must contain formatLong property");
}
var originalDate = toDate(dirtyDate);
if (!isValid(originalDate)) {
throw new RangeError("Invalid time value");
}
var timezoneOffset = getTimezoneOffsetInMilliseconds(originalDate);
var utcDate = subMilliseconds(originalDate, timezoneOffset);
var formatterOptions = {
firstWeekContainsDate,
weekStartsOn,
locale: locale2,
_originalDate: originalDate
};
var result = formatStr.match(longFormattingTokensRegExp).map(function(substring) {
var firstCharacter = substring[0];
if (firstCharacter === "p" || firstCharacter === "P") {
var longFormatter = longFormatters_default[firstCharacter];
return longFormatter(substring, locale2.formatLong, formatterOptions);
}
return substring;
}).join("").match(formattingTokensRegExp).map(function(substring) {
if (substring === "''") {
return "'";
}
var firstCharacter = substring[0];
if (firstCharacter === "'") {
return cleanEscapedString(substring);
}
var formatter = formatters_default[firstCharacter];
if (formatter) {
if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(substring)) {
throwProtectedError(substring, dirtyFormatStr, dirtyDate);
}
if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(substring)) {
throwProtectedError(substring, dirtyFormatStr, dirtyDate);
}
return formatter(utcDate, substring, locale2.localize, formatterOptions);
}
if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
}
return substring;
}).join("");
return result;
}
function cleanEscapedString(input) {
return input.match(escapedStringRegExp)[1].replace(doubleQuoteRegExp, "'");
}
var formattingTokensRegExp, longFormattingTokensRegExp, escapedStringRegExp, doubleQuoteRegExp, unescapedLatinCharacterRegExp;
var init_format = __esm({
"node_modules/date-fns/esm/format/index.js"() {
init_isValid();
init_en_US();
init_subMilliseconds();
init_toDate();
init_formatters();
init_longFormatters();
init_getTimezoneOffsetInMilliseconds();
init_protectedTokens();
init_toInteger();
init_requiredArgs();
formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
escapedStringRegExp = /^'([^]*?)'?$/;
doubleQuoteRegExp = /''/g;
unescapedLatinCharacterRegExp = /[a-zA-Z]/;
}
});
// node_modules/date-fns/esm/_lib/assign/index.js
function assign(target, dirtyObject) {
if (target == null) {
throw new TypeError("assign requires that input parameter not be null or undefined");
}
dirtyObject = dirtyObject || {};
for (var property in dirtyObject) {
if (Object.prototype.hasOwnProperty.call(dirtyObject, property)) {
target[property] = dirtyObject[property];
}
}
return target;
}
var init_assign = __esm({
"node_modules/date-fns/esm/_lib/assign/index.js"() {
}
});
// node_modules/date-fns/esm/_lib/setUTCDay/index.js
function setUTCDay(dirtyDate, dirtyDay, dirtyOptions) {
requiredArgs(2, arguments);
var options = dirtyOptions || {};
var locale2 = options.locale;
var localeWeekStartsOn = locale2 && locale2.options && locale2.options.weekStartsOn;
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn);
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
}
var date = toDate(dirtyDate);
var day = toInteger(dirtyDay);
var currentDay = date.getUTCDay();
var remainder = day % 7;
var dayIndex = (remainder + 7) % 7;
var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
date.setUTCDate(date.getUTCDate() + diff);
return date;
}
var init_setUTCDay = __esm({
"node_modules/date-fns/esm/_lib/setUTCDay/index.js"() {
init_toDate();
init_requiredArgs();
init_toInteger();
}
});
// node_modules/date-fns/esm/_lib/setUTCISODay/index.js
function setUTCISODay(dirtyDate, dirtyDay) {
requiredArgs(2, arguments);
var day = toInteger(dirtyDay);
if (day % 7 === 0) {
day = day - 7;
}
var weekStartsOn = 1;
var date = toDate(dirtyDate);
var currentDay = date.getUTCDay();
var remainder = day % 7;
var dayIndex = (remainder + 7) % 7;
var diff = (dayIndex < weekStartsOn ? 7 : 0) + day - currentDay;
date.setUTCDate(date.getUTCDate() + diff);
return date;
}
var init_setUTCISODay = __esm({
"node_modules/date-fns/esm/_lib/setUTCISODay/index.js"() {
init_toDate();
init_requiredArgs();
init_toInteger();
}
});
// node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js
function setUTCISOWeek(dirtyDate, dirtyISOWeek) {
requiredArgs(2, arguments);
var date = toDate(dirtyDate);
var isoWeek = toInteger(dirtyISOWeek);
var diff = getUTCISOWeek(date) - isoWeek;
date.setUTCDate(date.getUTCDate() - diff * 7);
return date;
}
var init_setUTCISOWeek = __esm({
"node_modules/date-fns/esm/_lib/setUTCISOWeek/index.js"() {
init_toInteger();
init_toDate();
init_getUTCISOWeek();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/_lib/setUTCWeek/index.js
function setUTCWeek(dirtyDate, dirtyWeek, options) {
requiredArgs(2, arguments);
var date = toDate(dirtyDate);
var week = toInteger(dirtyWeek);
var diff = getUTCWeek(date, options) - week;
date.setUTCDate(date.getUTCDate() - diff * 7);
return date;
}
var init_setUTCWeek = __esm({
"node_modules/date-fns/esm/_lib/setUTCWeek/index.js"() {
init_toInteger();
init_toDate();
init_getUTCWeek();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/parse/_lib/parsers/index.js
function parseNumericPattern(pattern, string, valueCallback) {
var matchResult = string.match(pattern);
if (!matchResult) {
return null;
}
var value = parseInt(matchResult[0], 10);
return {
value: valueCallback ? valueCallback(value) : value,
rest: string.slice(matchResult[0].length)
};
}
function parseTimezonePattern(pattern, string) {
var matchResult = string.match(pattern);
if (!matchResult) {
return null;
}
if (matchResult[0] === "Z") {
return {
value: 0,
rest: string.slice(1)
};
}
var sign2 = matchResult[1] === "+" ? 1 : -1;
var hours = matchResult[2] ? parseInt(matchResult[2], 10) : 0;
var minutes = matchResult[3] ? parseInt(matchResult[3], 10) : 0;
var seconds = matchResult[5] ? parseInt(matchResult[5], 10) : 0;
return {
value: sign2 * (hours * MILLISECONDS_IN_HOUR2 + minutes * MILLISECONDS_IN_MINUTE2 + seconds * MILLISECONDS_IN_SECOND),
rest: string.slice(matchResult[0].length)
};
}
function parseAnyDigitsSigned(string, valueCallback) {
return parseNumericPattern(numericPatterns.anyDigitsSigned, string, valueCallback);
}
function parseNDigits(n7, string, valueCallback) {
switch (n7) {
case 1:
return parseNumericPattern(numericPatterns.singleDigit, string, valueCallback);
case 2:
return parseNumericPattern(numericPatterns.twoDigits, string, valueCallback);
case 3:
return parseNumericPattern(numericPatterns.threeDigits, string, valueCallback);
case 4:
return parseNumericPattern(numericPatterns.fourDigits, string, valueCallback);
default:
return parseNumericPattern(new RegExp("^\\d{1," + n7 + "}"), string, valueCallback);
}
}
function parseNDigitsSigned(n7, string, valueCallback) {
switch (n7) {
case 1:
return parseNumericPattern(numericPatterns.singleDigitSigned, string, valueCallback);
case 2:
return parseNumericPattern(numericPatterns.twoDigitsSigned, string, valueCallback);
case 3:
return parseNumericPattern(numericPatterns.threeDigitsSigned, string, valueCallback);
case 4:
return parseNumericPattern(numericPatterns.fourDigitsSigned, string, valueCallback);
default:
return parseNumericPattern(new RegExp("^-?\\d{1," + n7 + "}"), string, valueCallback);
}
}
function dayPeriodEnumToHours(enumValue) {
switch (enumValue) {
case "morning":
return 4;
case "evening":
return 17;
case "pm":
case "noon":
case "afternoon":
return 12;
case "am":
case "midnight":
case "night":
default:
return 0;
}
}
function normalizeTwoDigitYear(twoDigitYear, currentYear) {
var isCommonEra = currentYear > 0;
var absCurrentYear = isCommonEra ? currentYear : 1 - currentYear;
var result;
if (absCurrentYear <= 50) {
result = twoDigitYear || 100;
} else {
var rangeEnd = absCurrentYear + 50;
var rangeEndCentury = Math.floor(rangeEnd / 100) * 100;
var isPreviousCentury = twoDigitYear >= rangeEnd % 100;
result = twoDigitYear + rangeEndCentury - (isPreviousCentury ? 100 : 0);
}
return isCommonEra ? result : 1 - result;
}
function isLeapYearIndex(year) {
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
}
var MILLISECONDS_IN_HOUR2, MILLISECONDS_IN_MINUTE2, MILLISECONDS_IN_SECOND, numericPatterns, timezonePatterns, DAYS_IN_MONTH, DAYS_IN_MONTH_LEAP_YEAR, parsers, parsers_default;
var init_parsers = __esm({
"node_modules/date-fns/esm/parse/_lib/parsers/index.js"() {
init_getUTCWeekYear();
init_setUTCDay();
init_setUTCISODay();
init_setUTCISOWeek();
init_setUTCWeek();
init_startOfUTCISOWeek();
init_startOfUTCWeek();
MILLISECONDS_IN_HOUR2 = 36e5;
MILLISECONDS_IN_MINUTE2 = 6e4;
MILLISECONDS_IN_SECOND = 1e3;
numericPatterns = {
month: /^(1[0-2]|0?\d)/,
date: /^(3[0-1]|[0-2]?\d)/,
dayOfYear: /^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,
week: /^(5[0-3]|[0-4]?\d)/,
hour23h: /^(2[0-3]|[0-1]?\d)/,
hour24h: /^(2[0-4]|[0-1]?\d)/,
hour11h: /^(1[0-1]|0?\d)/,
hour12h: /^(1[0-2]|0?\d)/,
minute: /^[0-5]?\d/,
second: /^[0-5]?\d/,
singleDigit: /^\d/,
twoDigits: /^\d{1,2}/,
threeDigits: /^\d{1,3}/,
fourDigits: /^\d{1,4}/,
anyDigitsSigned: /^-?\d+/,
singleDigitSigned: /^-?\d/,
twoDigitsSigned: /^-?\d{1,2}/,
threeDigitsSigned: /^-?\d{1,3}/,
fourDigitsSigned: /^-?\d{1,4}/
};
timezonePatterns = {
basicOptionalMinutes: /^([+-])(\d{2})(\d{2})?|Z/,
basic: /^([+-])(\d{2})(\d{2})|Z/,
basicOptionalSeconds: /^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,
extended: /^([+-])(\d{2}):(\d{2})|Z/,
extendedOptionalSeconds: /^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/
};
DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
DAYS_IN_MONTH_LEAP_YEAR = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
parsers = {
G: {
priority: 140,
parse: function(string, token, match3, _options) {
switch (token) {
case "G":
case "GG":
case "GGG":
return match3.era(string, {
width: "abbreviated"
}) || match3.era(string, {
width: "narrow"
});
case "GGGGG":
return match3.era(string, {
width: "narrow"
});
case "GGGG":
default:
return match3.era(string, {
width: "wide"
}) || match3.era(string, {
width: "abbreviated"
}) || match3.era(string, {
width: "narrow"
});
}
},
set: function(date, flags, value, _options) {
flags.era = value;
date.setUTCFullYear(value, 0, 1);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["R", "u", "t", "T"]
},
y: {
priority: 130,
parse: function(string, token, match3, _options) {
var valueCallback = function(year) {
return {
year,
isTwoDigitYear: token === "yy"
};
};
switch (token) {
case "y":
return parseNDigits(4, string, valueCallback);
case "yo":
return match3.ordinalNumber(string, {
unit: "year",
valueCallback
});
default:
return parseNDigits(token.length, string, valueCallback);
}
},
validate: function(_date, value, _options) {
return value.isTwoDigitYear || value.year > 0;
},
set: function(date, flags, value, _options) {
var currentYear = date.getUTCFullYear();
if (value.isTwoDigitYear) {
var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
date.setUTCFullYear(normalizedTwoDigitYear, 0, 1);
date.setUTCHours(0, 0, 0, 0);
return date;
}
var year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
date.setUTCFullYear(year, 0, 1);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["Y", "R", "u", "w", "I", "i", "e", "c", "t", "T"]
},
Y: {
priority: 130,
parse: function(string, token, match3, _options) {
var valueCallback = function(year) {
return {
year,
isTwoDigitYear: token === "YY"
};
};
switch (token) {
case "Y":
return parseNDigits(4, string, valueCallback);
case "Yo":
return match3.ordinalNumber(string, {
unit: "year",
valueCallback
});
default:
return parseNDigits(token.length, string, valueCallback);
}
},
validate: function(_date, value, _options) {
return value.isTwoDigitYear || value.year > 0;
},
set: function(date, flags, value, options) {
var currentYear = getUTCWeekYear(date, options);
if (value.isTwoDigitYear) {
var normalizedTwoDigitYear = normalizeTwoDigitYear(value.year, currentYear);
date.setUTCFullYear(normalizedTwoDigitYear, 0, options.firstWeekContainsDate);
date.setUTCHours(0, 0, 0, 0);
return startOfUTCWeek(date, options);
}
var year = !("era" in flags) || flags.era === 1 ? value.year : 1 - value.year;
date.setUTCFullYear(year, 0, options.firstWeekContainsDate);
date.setUTCHours(0, 0, 0, 0);
return startOfUTCWeek(date, options);
},
incompatibleTokens: ["y", "R", "u", "Q", "q", "M", "L", "I", "d", "D", "i", "t", "T"]
},
R: {
priority: 130,
parse: function(string, token, _match, _options) {
if (token === "R") {
return parseNDigitsSigned(4, string);
}
return parseNDigitsSigned(token.length, string);
},
set: function(_date, _flags, value, _options) {
var firstWeekOfYear = new Date(0);
firstWeekOfYear.setUTCFullYear(value, 0, 4);
firstWeekOfYear.setUTCHours(0, 0, 0, 0);
return startOfUTCISOWeek(firstWeekOfYear);
},
incompatibleTokens: ["G", "y", "Y", "u", "Q", "q", "M", "L", "w", "d", "D", "e", "c", "t", "T"]
},
u: {
priority: 130,
parse: function(string, token, _match, _options) {
if (token === "u") {
return parseNDigitsSigned(4, string);
}
return parseNDigitsSigned(token.length, string);
},
set: function(date, _flags, value, _options) {
date.setUTCFullYear(value, 0, 1);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["G", "y", "Y", "R", "w", "I", "i", "e", "c", "t", "T"]
},
Q: {
priority: 120,
parse: function(string, token, match3, _options) {
switch (token) {
case "Q":
case "QQ":
return parseNDigits(token.length, string);
case "Qo":
return match3.ordinalNumber(string, {
unit: "quarter"
});
case "QQQ":
return match3.quarter(string, {
width: "abbreviated",
context: "formatting"
}) || match3.quarter(string, {
width: "narrow",
context: "formatting"
});
case "QQQQQ":
return match3.quarter(string, {
width: "narrow",
context: "formatting"
});
case "QQQQ":
default:
return match3.quarter(string, {
width: "wide",
context: "formatting"
}) || match3.quarter(string, {
width: "abbreviated",
context: "formatting"
}) || match3.quarter(string, {
width: "narrow",
context: "formatting"
});
}
},
validate: function(_date, value, _options) {
return value >= 1 && value <= 4;
},
set: function(date, _flags, value, _options) {
date.setUTCMonth((value - 1) * 3, 1);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["Y", "R", "q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]
},
q: {
priority: 120,
parse: function(string, token, match3, _options) {
switch (token) {
case "q":
case "qq":
return parseNDigits(token.length, string);
case "qo":
return match3.ordinalNumber(string, {
unit: "quarter"
});
case "qqq":
return match3.quarter(string, {
width: "abbreviated",
context: "standalone"
}) || match3.quarter(string, {
width: "narrow",
context: "standalone"
});
case "qqqqq":
return match3.quarter(string, {
width: "narrow",
context: "standalone"
});
case "qqqq":
default:
return match3.quarter(string, {
width: "wide",
context: "standalone"
}) || match3.quarter(string, {
width: "abbreviated",
context: "standalone"
}) || match3.quarter(string, {
width: "narrow",
context: "standalone"
});
}
},
validate: function(_date, value, _options) {
return value >= 1 && value <= 4;
},
set: function(date, _flags, value, _options) {
date.setUTCMonth((value - 1) * 3, 1);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["Y", "R", "Q", "M", "L", "w", "I", "d", "D", "i", "e", "c", "t", "T"]
},
M: {
priority: 110,
parse: function(string, token, match3, _options) {
var valueCallback = function(value) {
return value - 1;
};
switch (token) {
case "M":
return parseNumericPattern(numericPatterns.month, string, valueCallback);
case "MM":
return parseNDigits(2, string, valueCallback);
case "Mo":
return match3.ordinalNumber(string, {
unit: "month",
valueCallback
});
case "MMM":
return match3.month(string, {
width: "abbreviated",
context: "formatting"
}) || match3.month(string, {
width: "narrow",
context: "formatting"
});
case "MMMMM":
return match3.month(string, {
width: "narrow",
context: "formatting"
});
case "MMMM":
default:
return match3.month(string, {
width: "wide",
context: "formatting"
}) || match3.month(string, {
width: "abbreviated",
context: "formatting"
}) || match3.month(string, {
width: "narrow",
context: "formatting"
});
}
},
validate: function(_date, value, _options) {
return value >= 0 && value <= 11;
},
set: function(date, _flags, value, _options) {
date.setUTCMonth(value, 1);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["Y", "R", "q", "Q", "L", "w", "I", "D", "i", "e", "c", "t", "T"]
},
L: {
priority: 110,
parse: function(string, token, match3, _options) {
var valueCallback = function(value) {
return value - 1;
};
switch (token) {
case "L":
return parseNumericPattern(numericPatterns.month, string, valueCallback);
case "LL":
return parseNDigits(2, string, valueCallback);
case "Lo":
return match3.ordinalNumber(string, {
unit: "month",
valueCallback
});
case "LLL":
return match3.month(string, {
width: "abbreviated",
context: "standalone"
}) || match3.month(string, {
width: "narrow",
context: "standalone"
});
case "LLLLL":
return match3.month(string, {
width: "narrow",
context: "standalone"
});
case "LLLL":
default:
return match3.month(string, {
width: "wide",
context: "standalone"
}) || match3.month(string, {
width: "abbreviated",
context: "standalone"
}) || match3.month(string, {
width: "narrow",
context: "standalone"
});
}
},
validate: function(_date, value, _options) {
return value >= 0 && value <= 11;
},
set: function(date, _flags, value, _options) {
date.setUTCMonth(value, 1);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["Y", "R", "q", "Q", "M", "w", "I", "D", "i", "e", "c", "t", "T"]
},
w: {
priority: 100,
parse: function(string, token, match3, _options) {
switch (token) {
case "w":
return parseNumericPattern(numericPatterns.week, string);
case "wo":
return match3.ordinalNumber(string, {
unit: "week"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(_date, value, _options) {
return value >= 1 && value <= 53;
},
set: function(date, _flags, value, options) {
return startOfUTCWeek(setUTCWeek(date, value, options), options);
},
incompatibleTokens: ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "i", "t", "T"]
},
I: {
priority: 100,
parse: function(string, token, match3, _options) {
switch (token) {
case "I":
return parseNumericPattern(numericPatterns.week, string);
case "Io":
return match3.ordinalNumber(string, {
unit: "week"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(_date, value, _options) {
return value >= 1 && value <= 53;
},
set: function(date, _flags, value, options) {
return startOfUTCISOWeek(setUTCISOWeek(date, value, options), options);
},
incompatibleTokens: ["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "e", "c", "t", "T"]
},
d: {
priority: 90,
subPriority: 1,
parse: function(string, token, match3, _options) {
switch (token) {
case "d":
return parseNumericPattern(numericPatterns.date, string);
case "do":
return match3.ordinalNumber(string, {
unit: "date"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(date, value, _options) {
var year = date.getUTCFullYear();
var isLeapYear2 = isLeapYearIndex(year);
var month = date.getUTCMonth();
if (isLeapYear2) {
return value >= 1 && value <= DAYS_IN_MONTH_LEAP_YEAR[month];
} else {
return value >= 1 && value <= DAYS_IN_MONTH[month];
}
},
set: function(date, _flags, value, _options) {
date.setUTCDate(value);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["Y", "R", "q", "Q", "w", "I", "D", "i", "e", "c", "t", "T"]
},
D: {
priority: 90,
subPriority: 1,
parse: function(string, token, match3, _options) {
switch (token) {
case "D":
case "DD":
return parseNumericPattern(numericPatterns.dayOfYear, string);
case "Do":
return match3.ordinalNumber(string, {
unit: "date"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(date, value, _options) {
var year = date.getUTCFullYear();
var isLeapYear2 = isLeapYearIndex(year);
if (isLeapYear2) {
return value >= 1 && value <= 366;
} else {
return value >= 1 && value <= 365;
}
},
set: function(date, _flags, value, _options) {
date.setUTCMonth(0, value);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["Y", "R", "q", "Q", "M", "L", "w", "I", "d", "E", "i", "e", "c", "t", "T"]
},
E: {
priority: 90,
parse: function(string, token, match3, _options) {
switch (token) {
case "E":
case "EE":
case "EEE":
return match3.day(string, {
width: "abbreviated",
context: "formatting"
}) || match3.day(string, {
width: "short",
context: "formatting"
}) || match3.day(string, {
width: "narrow",
context: "formatting"
});
case "EEEEE":
return match3.day(string, {
width: "narrow",
context: "formatting"
});
case "EEEEEE":
return match3.day(string, {
width: "short",
context: "formatting"
}) || match3.day(string, {
width: "narrow",
context: "formatting"
});
case "EEEE":
default:
return match3.day(string, {
width: "wide",
context: "formatting"
}) || match3.day(string, {
width: "abbreviated",
context: "formatting"
}) || match3.day(string, {
width: "short",
context: "formatting"
}) || match3.day(string, {
width: "narrow",
context: "formatting"
});
}
},
validate: function(_date, value, _options) {
return value >= 0 && value <= 6;
},
set: function(date, _flags, value, options) {
date = setUTCDay(date, value, options);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["D", "i", "e", "c", "t", "T"]
},
e: {
priority: 90,
parse: function(string, token, match3, options) {
var valueCallback = function(value) {
var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
};
switch (token) {
case "e":
case "ee":
return parseNDigits(token.length, string, valueCallback);
case "eo":
return match3.ordinalNumber(string, {
unit: "day",
valueCallback
});
case "eee":
return match3.day(string, {
width: "abbreviated",
context: "formatting"
}) || match3.day(string, {
width: "short",
context: "formatting"
}) || match3.day(string, {
width: "narrow",
context: "formatting"
});
case "eeeee":
return match3.day(string, {
width: "narrow",
context: "formatting"
});
case "eeeeee":
return match3.day(string, {
width: "short",
context: "formatting"
}) || match3.day(string, {
width: "narrow",
context: "formatting"
});
case "eeee":
default:
return match3.day(string, {
width: "wide",
context: "formatting"
}) || match3.day(string, {
width: "abbreviated",
context: "formatting"
}) || match3.day(string, {
width: "short",
context: "formatting"
}) || match3.day(string, {
width: "narrow",
context: "formatting"
});
}
},
validate: function(_date, value, _options) {
return value >= 0 && value <= 6;
},
set: function(date, _flags, value, options) {
date = setUTCDay(date, value, options);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "c", "t", "T"]
},
c: {
priority: 90,
parse: function(string, token, match3, options) {
var valueCallback = function(value) {
var wholeWeekDays = Math.floor((value - 1) / 7) * 7;
return (value + options.weekStartsOn + 6) % 7 + wholeWeekDays;
};
switch (token) {
case "c":
case "cc":
return parseNDigits(token.length, string, valueCallback);
case "co":
return match3.ordinalNumber(string, {
unit: "day",
valueCallback
});
case "ccc":
return match3.day(string, {
width: "abbreviated",
context: "standalone"
}) || match3.day(string, {
width: "short",
context: "standalone"
}) || match3.day(string, {
width: "narrow",
context: "standalone"
});
case "ccccc":
return match3.day(string, {
width: "narrow",
context: "standalone"
});
case "cccccc":
return match3.day(string, {
width: "short",
context: "standalone"
}) || match3.day(string, {
width: "narrow",
context: "standalone"
});
case "cccc":
default:
return match3.day(string, {
width: "wide",
context: "standalone"
}) || match3.day(string, {
width: "abbreviated",
context: "standalone"
}) || match3.day(string, {
width: "short",
context: "standalone"
}) || match3.day(string, {
width: "narrow",
context: "standalone"
});
}
},
validate: function(_date, value, _options) {
return value >= 0 && value <= 6;
},
set: function(date, _flags, value, options) {
date = setUTCDay(date, value, options);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["y", "R", "u", "q", "Q", "M", "L", "I", "d", "D", "E", "i", "e", "t", "T"]
},
i: {
priority: 90,
parse: function(string, token, match3, _options) {
var valueCallback = function(value) {
if (value === 0) {
return 7;
}
return value;
};
switch (token) {
case "i":
case "ii":
return parseNDigits(token.length, string);
case "io":
return match3.ordinalNumber(string, {
unit: "day"
});
case "iii":
return match3.day(string, {
width: "abbreviated",
context: "formatting",
valueCallback
}) || match3.day(string, {
width: "short",
context: "formatting",
valueCallback
}) || match3.day(string, {
width: "narrow",
context: "formatting",
valueCallback
});
case "iiiii":
return match3.day(string, {
width: "narrow",
context: "formatting",
valueCallback
});
case "iiiiii":
return match3.day(string, {
width: "short",
context: "formatting",
valueCallback
}) || match3.day(string, {
width: "narrow",
context: "formatting",
valueCallback
});
case "iiii":
default:
return match3.day(string, {
width: "wide",
context: "formatting",
valueCallback
}) || match3.day(string, {
width: "abbreviated",
context: "formatting",
valueCallback
}) || match3.day(string, {
width: "short",
context: "formatting",
valueCallback
}) || match3.day(string, {
width: "narrow",
context: "formatting",
valueCallback
});
}
},
validate: function(_date, value, _options) {
return value >= 1 && value <= 7;
},
set: function(date, _flags, value, options) {
date = setUTCISODay(date, value, options);
date.setUTCHours(0, 0, 0, 0);
return date;
},
incompatibleTokens: ["y", "Y", "u", "q", "Q", "M", "L", "w", "d", "D", "E", "e", "c", "t", "T"]
},
a: {
priority: 80,
parse: function(string, token, match3, _options) {
switch (token) {
case "a":
case "aa":
case "aaa":
return match3.dayPeriod(string, {
width: "abbreviated",
context: "formatting"
}) || match3.dayPeriod(string, {
width: "narrow",
context: "formatting"
});
case "aaaaa":
return match3.dayPeriod(string, {
width: "narrow",
context: "formatting"
});
case "aaaa":
default:
return match3.dayPeriod(string, {
width: "wide",
context: "formatting"
}) || match3.dayPeriod(string, {
width: "abbreviated",
context: "formatting"
}) || match3.dayPeriod(string, {
width: "narrow",
context: "formatting"
});
}
},
set: function(date, _flags, value, _options) {
date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
return date;
},
incompatibleTokens: ["b", "B", "H", "k", "t", "T"]
},
b: {
priority: 80,
parse: function(string, token, match3, _options) {
switch (token) {
case "b":
case "bb":
case "bbb":
return match3.dayPeriod(string, {
width: "abbreviated",
context: "formatting"
}) || match3.dayPeriod(string, {
width: "narrow",
context: "formatting"
});
case "bbbbb":
return match3.dayPeriod(string, {
width: "narrow",
context: "formatting"
});
case "bbbb":
default:
return match3.dayPeriod(string, {
width: "wide",
context: "formatting"
}) || match3.dayPeriod(string, {
width: "abbreviated",
context: "formatting"
}) || match3.dayPeriod(string, {
width: "narrow",
context: "formatting"
});
}
},
set: function(date, _flags, value, _options) {
date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
return date;
},
incompatibleTokens: ["a", "B", "H", "k", "t", "T"]
},
B: {
priority: 80,
parse: function(string, token, match3, _options) {
switch (token) {
case "B":
case "BB":
case "BBB":
return match3.dayPeriod(string, {
width: "abbreviated",
context: "formatting"
}) || match3.dayPeriod(string, {
width: "narrow",
context: "formatting"
});
case "BBBBB":
return match3.dayPeriod(string, {
width: "narrow",
context: "formatting"
});
case "BBBB":
default:
return match3.dayPeriod(string, {
width: "wide",
context: "formatting"
}) || match3.dayPeriod(string, {
width: "abbreviated",
context: "formatting"
}) || match3.dayPeriod(string, {
width: "narrow",
context: "formatting"
});
}
},
set: function(date, _flags, value, _options) {
date.setUTCHours(dayPeriodEnumToHours(value), 0, 0, 0);
return date;
},
incompatibleTokens: ["a", "b", "t", "T"]
},
h: {
priority: 70,
parse: function(string, token, match3, _options) {
switch (token) {
case "h":
return parseNumericPattern(numericPatterns.hour12h, string);
case "ho":
return match3.ordinalNumber(string, {
unit: "hour"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(_date, value, _options) {
return value >= 1 && value <= 12;
},
set: function(date, _flags, value, _options) {
var isPM = date.getUTCHours() >= 12;
if (isPM && value < 12) {
date.setUTCHours(value + 12, 0, 0, 0);
} else if (!isPM && value === 12) {
date.setUTCHours(0, 0, 0, 0);
} else {
date.setUTCHours(value, 0, 0, 0);
}
return date;
},
incompatibleTokens: ["H", "K", "k", "t", "T"]
},
H: {
priority: 70,
parse: function(string, token, match3, _options) {
switch (token) {
case "H":
return parseNumericPattern(numericPatterns.hour23h, string);
case "Ho":
return match3.ordinalNumber(string, {
unit: "hour"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(_date, value, _options) {
return value >= 0 && value <= 23;
},
set: function(date, _flags, value, _options) {
date.setUTCHours(value, 0, 0, 0);
return date;
},
incompatibleTokens: ["a", "b", "h", "K", "k", "t", "T"]
},
K: {
priority: 70,
parse: function(string, token, match3, _options) {
switch (token) {
case "K":
return parseNumericPattern(numericPatterns.hour11h, string);
case "Ko":
return match3.ordinalNumber(string, {
unit: "hour"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(_date, value, _options) {
return value >= 0 && value <= 11;
},
set: function(date, _flags, value, _options) {
var isPM = date.getUTCHours() >= 12;
if (isPM && value < 12) {
date.setUTCHours(value + 12, 0, 0, 0);
} else {
date.setUTCHours(value, 0, 0, 0);
}
return date;
},
incompatibleTokens: ["h", "H", "k", "t", "T"]
},
k: {
priority: 70,
parse: function(string, token, match3, _options) {
switch (token) {
case "k":
return parseNumericPattern(numericPatterns.hour24h, string);
case "ko":
return match3.ordinalNumber(string, {
unit: "hour"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(_date, value, _options) {
return value >= 1 && value <= 24;
},
set: function(date, _flags, value, _options) {
var hours = value <= 24 ? value % 24 : value;
date.setUTCHours(hours, 0, 0, 0);
return date;
},
incompatibleTokens: ["a", "b", "h", "H", "K", "t", "T"]
},
m: {
priority: 60,
parse: function(string, token, match3, _options) {
switch (token) {
case "m":
return parseNumericPattern(numericPatterns.minute, string);
case "mo":
return match3.ordinalNumber(string, {
unit: "minute"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(_date, value, _options) {
return value >= 0 && value <= 59;
},
set: function(date, _flags, value, _options) {
date.setUTCMinutes(value, 0, 0);
return date;
},
incompatibleTokens: ["t", "T"]
},
s: {
priority: 50,
parse: function(string, token, match3, _options) {
switch (token) {
case "s":
return parseNumericPattern(numericPatterns.second, string);
case "so":
return match3.ordinalNumber(string, {
unit: "second"
});
default:
return parseNDigits(token.length, string);
}
},
validate: function(_date, value, _options) {
return value >= 0 && value <= 59;
},
set: function(date, _flags, value, _options) {
date.setUTCSeconds(value, 0);
return date;
},
incompatibleTokens: ["t", "T"]
},
S: {
priority: 30,
parse: function(string, token, _match, _options) {
var valueCallback = function(value) {
return Math.floor(value * Math.pow(10, -token.length + 3));
};
return parseNDigits(token.length, string, valueCallback);
},
set: function(date, _flags, value, _options) {
date.setUTCMilliseconds(value);
return date;
},
incompatibleTokens: ["t", "T"]
},
X: {
priority: 10,
parse: function(string, token, _match, _options) {
switch (token) {
case "X":
return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);
case "XX":
return parseTimezonePattern(timezonePatterns.basic, string);
case "XXXX":
return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);
case "XXXXX":
return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);
case "XXX":
default:
return parseTimezonePattern(timezonePatterns.extended, string);
}
},
set: function(date, flags, value, _options) {
if (flags.timestampIsSet) {
return date;
}
return new Date(date.getTime() - value);
},
incompatibleTokens: ["t", "T", "x"]
},
x: {
priority: 10,
parse: function(string, token, _match, _options) {
switch (token) {
case "x":
return parseTimezonePattern(timezonePatterns.basicOptionalMinutes, string);
case "xx":
return parseTimezonePattern(timezonePatterns.basic, string);
case "xxxx":
return parseTimezonePattern(timezonePatterns.basicOptionalSeconds, string);
case "xxxxx":
return parseTimezonePattern(timezonePatterns.extendedOptionalSeconds, string);
case "xxx":
default:
return parseTimezonePattern(timezonePatterns.extended, string);
}
},
set: function(date, flags, value, _options) {
if (flags.timestampIsSet) {
return date;
}
return new Date(date.getTime() - value);
},
incompatibleTokens: ["t", "T", "X"]
},
t: {
priority: 40,
parse: function(string, _token, _match, _options) {
return parseAnyDigitsSigned(string);
},
set: function(_date, _flags, value, _options) {
return [new Date(value * 1e3), {
timestampIsSet: true
}];
},
incompatibleTokens: "*"
},
T: {
priority: 20,
parse: function(string, _token, _match, _options) {
return parseAnyDigitsSigned(string);
},
set: function(_date, _flags, value, _options) {
return [new Date(value), {
timestampIsSet: true
}];
},
incompatibleTokens: "*"
}
};
parsers_default = parsers;
}
});
// node_modules/date-fns/esm/parse/index.js
function parse2(dirtyDateString, dirtyFormatString, dirtyReferenceDate, dirtyOptions) {
requiredArgs(3, arguments);
var dateString = String(dirtyDateString);
var formatString = String(dirtyFormatString);
var options = dirtyOptions || {};
var locale2 = options.locale || en_US_default;
if (!locale2.match) {
throw new RangeError("locale must contain match property");
}
var localeFirstWeekContainsDate = locale2.options && locale2.options.firstWeekContainsDate;
var defaultFirstWeekContainsDate = localeFirstWeekContainsDate == null ? 1 : toInteger(localeFirstWeekContainsDate);
var firstWeekContainsDate = options.firstWeekContainsDate == null ? defaultFirstWeekContainsDate : toInteger(options.firstWeekContainsDate);
if (!(firstWeekContainsDate >= 1 && firstWeekContainsDate <= 7)) {
throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
}
var localeWeekStartsOn = locale2.options && locale2.options.weekStartsOn;
var defaultWeekStartsOn = localeWeekStartsOn == null ? 0 : toInteger(localeWeekStartsOn);
var weekStartsOn = options.weekStartsOn == null ? defaultWeekStartsOn : toInteger(options.weekStartsOn);
if (!(weekStartsOn >= 0 && weekStartsOn <= 6)) {
throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
}
if (formatString === "") {
if (dateString === "") {
return toDate(dirtyReferenceDate);
} else {
return new Date(NaN);
}
}
var subFnOptions = {
firstWeekContainsDate,
weekStartsOn,
locale: locale2
};
var setters = [{
priority: TIMEZONE_UNIT_PRIORITY,
subPriority: -1,
set: dateToSystemTimezone,
index: 0
}];
var i5;
var tokens = formatString.match(longFormattingTokensRegExp2).map(function(substring) {
var firstCharacter2 = substring[0];
if (firstCharacter2 === "p" || firstCharacter2 === "P") {
var longFormatter = longFormatters_default[firstCharacter2];
return longFormatter(substring, locale2.formatLong, subFnOptions);
}
return substring;
}).join("").match(formattingTokensRegExp2);
var usedTokens = [];
for (i5 = 0; i5 < tokens.length; i5++) {
var token = tokens[i5];
if (!options.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token)) {
throwProtectedError(token, formatString, dirtyDateString);
}
if (!options.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {
throwProtectedError(token, formatString, dirtyDateString);
}
var firstCharacter = token[0];
var parser = parsers_default[firstCharacter];
if (parser) {
var incompatibleTokens = parser.incompatibleTokens;
if (Array.isArray(incompatibleTokens)) {
var incompatibleToken = void 0;
for (var _i2 = 0; _i2 < usedTokens.length; _i2++) {
var usedToken = usedTokens[_i2].token;
if (incompatibleTokens.indexOf(usedToken) !== -1 || usedToken === firstCharacter) {
incompatibleToken = usedTokens[_i2];
break;
}
}
if (incompatibleToken) {
throw new RangeError("The format string mustn't contain `".concat(incompatibleToken.fullToken, "` and `").concat(token, "` at the same time"));
}
} else if (parser.incompatibleTokens === "*" && usedTokens.length) {
throw new RangeError("The format string mustn't contain `".concat(token, "` and any other token at the same time"));
}
usedTokens.push({
token: firstCharacter,
fullToken: token
});
var parseResult = parser.parse(dateString, token, locale2.match, subFnOptions);
if (!parseResult) {
return new Date(NaN);
}
setters.push({
priority: parser.priority,
subPriority: parser.subPriority || 0,
set: parser.set,
validate: parser.validate,
value: parseResult.value,
index: setters.length
});
dateString = parseResult.rest;
} else {
if (firstCharacter.match(unescapedLatinCharacterRegExp2)) {
throw new RangeError("Format string contains an unescaped latin alphabet character `" + firstCharacter + "`");
}
if (token === "''") {
token = "'";
} else if (firstCharacter === "'") {
token = cleanEscapedString2(token);
}
if (dateString.indexOf(token) === 0) {
dateString = dateString.slice(token.length);
} else {
return new Date(NaN);
}
}
}
if (dateString.length > 0 && notWhitespaceRegExp.test(dateString)) {
return new Date(NaN);
}
var uniquePrioritySetters = setters.map(function(setter2) {
return setter2.priority;
}).sort(function(a5, b4) {
return b4 - a5;
}).filter(function(priority, index3, array) {
return array.indexOf(priority) === index3;
}).map(function(priority) {
return setters.filter(function(setter2) {
return setter2.priority === priority;
}).sort(function(a5, b4) {
return b4.subPriority - a5.subPriority;
});
}).map(function(setterArray) {
return setterArray[0];
});
var date = toDate(dirtyReferenceDate);
if (isNaN(date)) {
return new Date(NaN);
}
var utcDate = subMilliseconds(date, getTimezoneOffsetInMilliseconds(date));
var flags = {};
for (i5 = 0; i5 < uniquePrioritySetters.length; i5++) {
var setter = uniquePrioritySetters[i5];
if (setter.validate && !setter.validate(utcDate, setter.value, subFnOptions)) {
return new Date(NaN);
}
var result = setter.set(utcDate, flags, setter.value, subFnOptions);
if (result[0]) {
utcDate = result[0];
assign(flags, result[1]);
} else {
utcDate = result;
}
}
return utcDate;
}
function dateToSystemTimezone(date, flags) {
if (flags.timestampIsSet) {
return date;
}
var convertedDate = new Date(0);
convertedDate.setFullYear(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
convertedDate.setHours(date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());
return convertedDate;
}
function cleanEscapedString2(input) {
return input.match(escapedStringRegExp2)[1].replace(doubleQuoteRegExp2, "'");
}
var TIMEZONE_UNIT_PRIORITY, formattingTokensRegExp2, longFormattingTokensRegExp2, escapedStringRegExp2, doubleQuoteRegExp2, notWhitespaceRegExp, unescapedLatinCharacterRegExp2;
var init_parse = __esm({
"node_modules/date-fns/esm/parse/index.js"() {
init_en_US();
init_subMilliseconds();
init_toDate();
init_assign();
init_longFormatters();
init_getTimezoneOffsetInMilliseconds();
init_protectedTokens();
init_toInteger();
init_parsers();
init_requiredArgs();
TIMEZONE_UNIT_PRIORITY = 10;
formattingTokensRegExp2 = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
longFormattingTokensRegExp2 = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
escapedStringRegExp2 = /^'([^]*?)'?$/;
doubleQuoteRegExp2 = /''/g;
notWhitespaceRegExp = /\S/;
unescapedLatinCharacterRegExp2 = /[a-zA-Z]/;
}
});
// node_modules/date-fns/esm/startOfHour/index.js
function startOfHour(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setMinutes(0, 0, 0);
return date;
}
var init_startOfHour = __esm({
"node_modules/date-fns/esm/startOfHour/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/startOfSecond/index.js
function startOfSecond(dirtyDate) {
requiredArgs(1, arguments);
var date = toDate(dirtyDate);
date.setMilliseconds(0);
return date;
}
var init_startOfSecond = __esm({
"node_modules/date-fns/esm/startOfSecond/index.js"() {
init_toDate();
init_requiredArgs();
}
});
// node_modules/date-fns/esm/parseISO/index.js
function parseISO(argument, dirtyOptions) {
requiredArgs(1, arguments);
var options = dirtyOptions || {};
var additionalDigits = options.additionalDigits == null ? 2 : toInteger(options.additionalDigits);
if (additionalDigits !== 2 && additionalDigits !== 1 && additionalDigits !== 0) {
throw new RangeError("additionalDigits must be 0, 1 or 2");
}
if (!(typeof argument === "string" || Object.prototype.toString.call(argument) === "[object String]")) {
return new Date(NaN);
}
var dateStrings = splitDateString(argument);
var date;
if (dateStrings.date) {
var parseYearResult = parseYear(dateStrings.date, additionalDigits);
date = parseDate(parseYearResult.restDateString, parseYearResult.year);
}
if (!date || isNaN(date.getTime())) {
return new Date(NaN);
}
var timestamp = date.getTime();
var time = 0;
var offset3;
if (dateStrings.time) {
time = parseTime(dateStrings.time);
if (isNaN(time)) {
return new Date(NaN);
}
}
if (dateStrings.timezone) {
offset3 = parseTimezone(dateStrings.timezone);
if (isNaN(offset3)) {
return new Date(NaN);
}
} else {
var dirtyDate = new Date(timestamp + time);
var result = new Date(0);
result.setFullYear(dirtyDate.getUTCFullYear(), dirtyDate.getUTCMonth(), dirtyDate.getUTCDate());
result.setHours(dirtyDate.getUTCHours(), dirtyDate.getUTCMinutes(), dirtyDate.getUTCSeconds(), dirtyDate.getUTCMilliseconds());
return result;
}
return new Date(timestamp + time + offset3);
}
function splitDateString(dateString) {
var dateStrings = {};
var array = dateString.split(patterns.dateTimeDelimiter);
var timeString;
if (array.length > 2) {
return dateStrings;
}
if (/:/.test(array[0])) {
timeString = array[0];
} else {
dateStrings.date = array[0];
timeString = array[1];
if (patterns.timeZoneDelimiter.test(dateStrings.date)) {
dateStrings.date = dateString.split(patterns.timeZoneDelimiter)[0];
timeString = dateString.substr(dateStrings.date.length, dateString.length);
}
}
if (timeString) {
var token = patterns.timezone.exec(timeString);
if (token) {
dateStrings.time = timeString.replace(token[1], "");
dateStrings.timezone = token[1];
} else {
dateStrings.time = timeString;
}
}
return dateStrings;
}
function parseYear(dateString, additionalDigits) {
var regex2 = new RegExp("^(?:(\\d{4}|[+-]\\d{" + (4 + additionalDigits) + "})|(\\d{2}|[+-]\\d{" + (2 + additionalDigits) + "})$)");
var captures = dateString.match(regex2);
if (!captures)
return {
year: NaN,
restDateString: ""
};
var year = captures[1] ? parseInt(captures[1]) : null;
var century = captures[2] ? parseInt(captures[2]) : null;
return {
year: century === null ? year : century * 100,
restDateString: dateString.slice((captures[1] || captures[2]).length)
};
}
function parseDate(dateString, year) {
if (year === null)
return new Date(NaN);
var captures = dateString.match(dateRegex);
if (!captures)
return new Date(NaN);
var isWeekDate = !!captures[4];
var dayOfYear = parseDateUnit(captures[1]);
var month = parseDateUnit(captures[2]) - 1;
var day = parseDateUnit(captures[3]);
var week = parseDateUnit(captures[4]);
var dayOfWeek2 = parseDateUnit(captures[5]) - 1;
if (isWeekDate) {
if (!validateWeekDate(year, week, dayOfWeek2)) {
return new Date(NaN);
}
return dayOfISOWeekYear(year, week, dayOfWeek2);
} else {
var date = new Date(0);
if (!validateDate(year, month, day) || !validateDayOfYearDate(year, dayOfYear)) {
return new Date(NaN);
}
date.setUTCFullYear(year, month, Math.max(dayOfYear, day));
return date;
}
}
function parseDateUnit(value) {
return value ? parseInt(value) : 1;
}
function parseTime(timeString) {
var captures = timeString.match(timeRegex);
if (!captures)
return NaN;
var hours = parseTimeUnit(captures[1]);
var minutes = parseTimeUnit(captures[2]);
var seconds = parseTimeUnit(captures[3]);
if (!validateTime(hours, minutes, seconds)) {
return NaN;
}
return hours * millisecondsInHour + minutes * millisecondsInMinute + seconds * 1e3;
}
function parseTimeUnit(value) {
return value && parseFloat(value.replace(",", ".")) || 0;
}
function parseTimezone(timezoneString) {
if (timezoneString === "Z")
return 0;
var captures = timezoneString.match(timezoneRegex);
if (!captures)
return 0;
var sign2 = captures[1] === "+" ? -1 : 1;
var hours = parseInt(captures[2]);
var minutes = captures[3] && parseInt(captures[3]) || 0;
if (!validateTimezone(hours, minutes)) {
return NaN;
}
return sign2 * (hours * millisecondsInHour + minutes * millisecondsInMinute);
}
function dayOfISOWeekYear(isoWeekYear, week, day) {
var date = new Date(0);
date.setUTCFullYear(isoWeekYear, 0, 4);
var fourthOfJanuaryDay = date.getUTCDay() || 7;
var diff = (week - 1) * 7 + day + 1 - fourthOfJanuaryDay;
date.setUTCDate(date.getUTCDate() + diff);
return date;
}
function isLeapYearIndex2(year) {
return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
}
function validateDate(year, month, date) {
return month >= 0 && month <= 11 && date >= 1 && date <= (daysInMonths[month] || (isLeapYearIndex2(year) ? 29 : 28));
}
function validateDayOfYearDate(year, dayOfYear) {
return dayOfYear >= 1 && dayOfYear <= (isLeapYearIndex2(year) ? 366 : 365);
}
function validateWeekDate(_year, week, day) {
return week >= 1 && week <= 53 && day >= 0 && day <= 6;
}
function validateTime(hours, minutes, seconds) {
if (hours === 24) {
return minutes === 0 && seconds === 0;
}
return seconds >= 0 && seconds < 60 && minutes >= 0 && minutes < 60 && hours >= 0 && hours < 25;
}
function validateTimezone(_hours, minutes) {
return minutes >= 0 && minutes <= 59;
}
var patterns, dateRegex, timeRegex, timezoneRegex, daysInMonths;
var init_parseISO = __esm({
"node_modules/date-fns/esm/parseISO/index.js"() {
init_constants();
init_requiredArgs();
init_toInteger();
patterns = {
dateTimeDelimiter: /[T ]/,
timeZoneDelimiter: /[Z ]/i,
timezone: /([Z+-].*)$/
};
dateRegex = /^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/;
timeRegex = /^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/;
timezoneRegex = /^([+-])(\d{2})(?::?(\d{2}))?$/;
daysInMonths = [31, null, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
}
});
// node_modules/date-fns/esm/index.js
var init_esm = __esm({
"node_modules/date-fns/esm/index.js"() {
init_addDays();
init_addHours();
init_addMilliseconds();
init_addMinutes();
init_addMonths();
init_addQuarters();
init_addSeconds();
init_addWeeks();
init_addYears();
init_differenceInDays();
init_differenceInHours();
init_differenceInMilliseconds();
init_differenceInMinutes();
init_differenceInMonths();
init_differenceInQuarters();
init_differenceInSeconds();
init_differenceInWeeks();
init_differenceInYears();
init_endOfDay();
init_endOfHour();
init_endOfMinute();
init_endOfMonth();
init_endOfQuarter();
init_endOfSecond();
init_endOfWeek();
init_endOfYear();
init_format();
init_isValid();
init_parse();
init_parseISO();
init_startOfDay();
init_startOfHour();
init_startOfMinute();
init_startOfMonth();
init_startOfQuarter();
init_startOfSecond();
init_startOfWeek();
init_startOfYear();
init_toDate();
init_constants();
}
});
// node_modules/chartkick/node_modules/chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.esm.js
var FORMATS;
var init_chartjs_adapter_date_fns_esm = __esm({
"node_modules/chartkick/node_modules/chartjs-adapter-date-fns/dist/chartjs-adapter-date-fns.esm.js"() {
init_chart_esm();
init_esm();
FORMATS = {
datetime: "MMM d, yyyy, h:mm:ss aaaa",
millisecond: "h:mm:ss.SSS aaaa",
second: "h:mm:ss aaaa",
minute: "h:mm aaaa",
hour: "ha",
day: "MMM d",
week: "PP",
month: "MMM yyyy",
quarter: "qqq - yyyy",
year: "yyyy"
};
adapters._date.override({
_id: "date-fns",
formats: function() {
return FORMATS;
},
parse: function(value, fmt) {
if (value === null || typeof value === "undefined") {
return null;
}
const type = typeof value;
if (type === "number" || value instanceof Date) {
value = toDate(value);
} else if (type === "string") {
if (typeof fmt === "string") {
value = parse2(value, fmt, new Date(), this.options);
} else {
value = parseISO(value, this.options);
}
}
return isValid(value) ? value.getTime() : null;
},
format: function(time, fmt) {
return format(time, fmt, this.options);
},
add: function(time, amount, unit) {
switch (unit) {
case "millisecond":
return addMilliseconds(time, amount);
case "second":
return addSeconds(time, amount);
case "minute":
return addMinutes(time, amount);
case "hour":
return addHours(time, amount);
case "day":
return addDays(time, amount);
case "week":
return addWeeks(time, amount);
case "month":
return addMonths(time, amount);
case "quarter":
return addQuarters(time, amount);
case "year":
return addYears(time, amount);
default:
return time;
}
},
diff: function(max2, min2, unit) {
switch (unit) {
case "millisecond":
return differenceInMilliseconds(max2, min2);
case "second":
return differenceInSeconds(max2, min2);
case "minute":
return differenceInMinutes(max2, min2);
case "hour":
return differenceInHours(max2, min2);
case "day":
return differenceInDays(max2, min2);
case "week":
return differenceInWeeks(max2, min2);
case "month":
return differenceInMonths(max2, min2);
case "quarter":
return differenceInQuarters(max2, min2);
case "year":
return differenceInYears(max2, min2);
default:
return 0;
}
},
startOf: function(time, unit, weekday) {
switch (unit) {
case "second":
return startOfSecond(time);
case "minute":
return startOfMinute(time);
case "hour":
return startOfHour(time);
case "day":
return startOfDay(time);
case "week":
return startOfWeek(time);
case "isoWeek":
return startOfWeek(time, { weekStartsOn: +weekday });
case "month":
return startOfMonth(time);
case "quarter":
return startOfQuarter(time);
case "year":
return startOfYear(time);
default:
return time;
}
},
endOf: function(time, unit) {
switch (unit) {
case "second":
return endOfSecond(time);
case "minute":
return endOfMinute(time);
case "hour":
return endOfHour(time);
case "day":
return endOfDay(time);
case "week":
return endOfWeek(time);
case "month":
return endOfMonth(time);
case "quarter":
return endOfQuarter(time);
case "year":
return endOfYear(time);
default:
return time;
}
}
});
}
});
// node_modules/chartkick/chart.js/chart.esm.js
var import_chartkick;
var init_chart_esm2 = __esm({
"node_modules/chartkick/chart.js/chart.esm.js"() {
import_chartkick = __toESM(require_chartkick());
init_auto_esm();
init_chartjs_adapter_date_fns_esm();
import_chartkick.default.use(auto_esm_default);
}
});
// node_modules/mapkick/dist/mapkick.bundle.js
var init_mapkick_bundle = __esm({
"node_modules/mapkick/dist/mapkick.bundle.js"() {
(function(global2, factory) {
typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.Mapkick = factory());
})(void 0, function() {
"use strict";
function styleInject(css2, ref) {
if (ref === void 0) {
ref = {};
}
var insertAt = ref.insertAt;
if (!css2 || typeof document === "undefined") {
return;
}
var head = document.head || document.getElementsByTagName("head")[0];
var style2 = document.createElement("style");
style2.type = "text/css";
if (insertAt === "top") {
if (head.firstChild) {
head.insertBefore(style2, head.firstChild);
} else {
head.appendChild(style2);
}
} else {
head.appendChild(style2);
}
if (style2.styleSheet) {
style2.styleSheet.cssText = css2;
} else {
style2.appendChild(document.createTextNode(css2));
}
}
var css_248z = `.mapboxgl-map{font:12px/20px Helvetica Neue,Arial,Helvetica,sans-serif;overflow:hidden;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mapboxgl-canvas{position:absolute;left:0;top:0}.mapboxgl-map:-webkit-full-screen{width:100%;height:100%}.mapboxgl-canary{background-color:salmon}.mapboxgl-canvas-container.mapboxgl-interactive,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass{cursor:-webkit-grab;cursor:-moz-grab;cursor:grab;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.mapboxgl-canvas-container.mapboxgl-interactive.mapboxgl-track-pointer{cursor:pointer}.mapboxgl-canvas-container.mapboxgl-interactive:active,.mapboxgl-ctrl-group button.mapboxgl-ctrl-compass:active{cursor:-webkit-grabbing;cursor:-moz-grabbing;cursor:grabbing}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate .mapboxgl-canvas{touch-action:pan-x pan-y}.mapboxgl-canvas-container.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:pinch-zoom}.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan,.mapboxgl-canvas-container.mapboxgl-touch-zoom-rotate.mapboxgl-touch-drag-pan .mapboxgl-canvas{touch-action:none}.mapboxgl-ctrl-bottom-left,.mapboxgl-ctrl-bottom-right,.mapboxgl-ctrl-top-left,.mapboxgl-ctrl-top-right{position:absolute;pointer-events:none;z-index:2}.mapboxgl-ctrl-top-left{top:0;left:0}.mapboxgl-ctrl-top-right{top:0;right:0}.mapboxgl-ctrl-bottom-left{bottom:0;left:0}.mapboxgl-ctrl-bottom-right{right:0;bottom:0}.mapboxgl-ctrl{clear:both;pointer-events:auto;transform:translate(0)}.mapboxgl-ctrl-top-left .mapboxgl-ctrl{margin:10px 0 0 10px;float:left}.mapboxgl-ctrl-top-right .mapboxgl-ctrl{margin:10px 10px 0 0;float:right}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl{margin:0 0 10px 10px;float:left}.mapboxgl-ctrl-bottom-right .mapboxgl-ctrl{margin:0 10px 10px 0;float:right}.mapboxgl-ctrl-group{border-radius:4px;background:#fff}.mapboxgl-ctrl-group:not(:empty){-moz-box-shadow:0 0 2px rgba(0,0,0,.1);-webkit-box-shadow:0 0 2px rgba(0,0,0,.1);box-shadow:0 0 0 2px rgba(0,0,0,.1)}@media (-ms-high-contrast:active){.mapboxgl-ctrl-group:not(:empty){box-shadow:0 0 0 2px ButtonText}}.mapboxgl-ctrl-group button{width:29px;height:29px;display:block;padding:0;outline:none;border:0;box-sizing:border-box;background-color:transparent;cursor:pointer}.mapboxgl-ctrl-group button+button{border-top:1px solid #ddd}.mapboxgl-ctrl button .mapboxgl-ctrl-icon{display:block;width:100%;height:100%;background-repeat:no-repeat;background-position:50%}@media (-ms-high-contrast:active){.mapboxgl-ctrl-icon{background-color:transparent}.mapboxgl-ctrl-group button+button{border-top:1px solid ButtonText}}.mapboxgl-ctrl button::-moz-focus-inner{border:0;padding:0}.mapboxgl-ctrl-attrib-button:focus,.mapboxgl-ctrl-group button:focus{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl button:disabled{cursor:not-allowed}.mapboxgl-ctrl button:disabled .mapboxgl-ctrl-icon{opacity:.25}.mapboxgl-ctrl button:not(:disabled):hover{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-group button:focus:focus-visible{box-shadow:0 0 2px 2px #0096ff}.mapboxgl-ctrl-group button:focus:not(:focus-visible){box-shadow:none}.mapboxgl-ctrl-group button:focus:first-child{border-radius:4px 4px 0 0}.mapboxgl-ctrl-group button:focus:last-child{border-radius:0 0 4px 4px}.mapboxgl-ctrl-group button:focus:only-child{border-radius:inherit}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 13c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h9c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-9z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14.5 8.5c-.75 0-1.5.75-1.5 1.5v3h-3c-.75 0-1.5.75-1.5 1.5S9.25 16 10 16h3v3c0 .75.75 1.5 1.5 1.5S16 19.75 16 19v-3h3c.75 0 1.5-.75 1.5-1.5S19.75 13 19 13h-3v-3c0-.75-.75-1.5-1.5-1.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-fullscreen .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M24 16v5.5c0 1.75-.75 2.5-2.5 2.5H16v-1l3-1.5-4-5.5 1-1 5.5 4 1.5-3h1zM6 16l1.5 3 5.5-4 1 1-4 5.5 3 1.5v1H7.5C5.75 24 5 23.25 5 21.5V16h1zm7-11v1l-3 1.5 4 5.5-1 1-5.5-4L6 13H5V7.5C5 5.75 5.75 5 7.5 5H13zm11 2.5c0-1.75-.75-2.5-2.5-2.5H16v1l3 1.5-4 5.5 1 1 5.5-4 1.5 3h1V7.5z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-shrink .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M18.5 16c-1.75 0-2.5.75-2.5 2.5V24h1l1.5-3 5.5 4 1-1-4-5.5 3-1.5v-1h-5.5zM13 18.5c0-1.75-.75-2.5-2.5-2.5H5v1l3 1.5L4 24l1 1 5.5-4 1.5 3h1v-5.5zm3-8c0 1.75.75 2.5 2.5 2.5H24v-1l-3-1.5L25 5l-1-1-5.5 4L17 5h-1v5.5zM10.5 13c1.75 0 2.5-.75 2.5-2.5V5h-1l-1.5 3L5 4 4 5l4 5.5L5 12v1h5.5z'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23999'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E")}}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23aaa'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-waiting .mapboxgl-ctrl-icon{-webkit-animation:mapboxgl-spin 2s linear infinite;-moz-animation:mapboxgl-spin 2s infinite linear;-o-animation:mapboxgl-spin 2s infinite linear;-ms-animation:mapboxgl-spin 2s infinite linear;animation:mapboxgl-spin 2s linear infinite}@media (-ms-high-contrast:active){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23fff'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23999'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-active-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e58978'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%2333b5e5'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate.mapboxgl-ctrl-geolocate-background-error .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23e54e33'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3C/svg%3E")}.mapboxgl-ctrl button.mapboxgl-ctrl-geolocate:disabled .mapboxgl-ctrl-icon{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill='%23666'%3E%3Cpath d='M10 4C9 4 9 5 9 5v.1A5 5 0 005.1 9H5s-1 0-1 1 1 1 1 1h.1A5 5 0 009 14.9v.1s0 1 1 1 1-1 1-1v-.1a5 5 0 003.9-3.9h.1s1 0 1-1-1-1-1-1h-.1A5 5 0 0011 5.1V5s0-1-1-1zm0 2.5a3.5 3.5 0 110 7 3.5 3.5 0 110-7z'/%3E%3Ccircle cx='10' cy='10' r='2'/%3E%3Cpath d='M14 5l1 1-9 9-1-1 9-9z' fill='red'/%3E%3C/svg%3E")}}@-webkit-keyframes mapboxgl-spin{0%{-webkit-transform:rotate(0deg)}to{-webkit-transform:rotate(1turn)}}@-moz-keyframes mapboxgl-spin{0%{-moz-transform:rotate(0deg)}to{-moz-transform:rotate(1turn)}}@-o-keyframes mapboxgl-spin{0%{-o-transform:rotate(0deg)}to{-o-transform:rotate(1turn)}}@-ms-keyframes mapboxgl-spin{0%{-ms-transform:rotate(0deg)}to{-ms-transform:rotate(1turn)}}@keyframes mapboxgl-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}a.mapboxgl-ctrl-logo{width:88px;height:23px;margin:0 0 -4px -4px;display:block;background-repeat:no-repeat;cursor:pointer;overflow:hidden;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg opacity='.3' stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg opacity='.9' fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}a.mapboxgl-ctrl-logo.mapboxgl-compact{width:23px}@media (-ms-high-contrast:active){a.mapboxgl-ctrl-logo{background-color:transparent;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23000' stroke-width='3'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cg fill='%23fff'%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/g%3E%3C/svg%3E")}}@media (-ms-high-contrast:black-on-white){a.mapboxgl-ctrl-logo{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='88' height='23' viewBox='0 0 88 23' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' fill-rule='evenodd'%3E%3Cdefs%3E%3Cpath id='a' d='M11.5 2.25c5.105 0 9.25 4.145 9.25 9.25s-4.145 9.25-9.25 9.25-9.25-4.145-9.25-9.25 4.145-9.25 9.25-9.25zM6.997 15.983c-.051-.338-.828-5.802 2.233-8.873a4.395 4.395 0 013.13-1.28c1.27 0 2.49.51 3.39 1.42.91.9 1.42 2.12 1.42 3.39 0 1.18-.449 2.301-1.28 3.13C12.72 16.93 7 16 7 16l-.003-.017zM15.3 10.5l-2 .8-.8 2-.8-2-2-.8 2-.8.8-2 .8 2 2 .8z'/%3E%3Cpath id='b' d='M50.63 8c.13 0 .23.1.23.23V9c.7-.76 1.7-1.18 2.73-1.18 2.17 0 3.95 1.85 3.95 4.17s-1.77 4.19-3.94 4.19c-1.04 0-2.03-.43-2.74-1.18v3.77c0 .13-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V8.23c0-.12.1-.23.23-.23h1.4zm-3.86.01c.01 0 .01 0 .01-.01.13 0 .22.1.22.22v7.55c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V15c-.7.76-1.69 1.19-2.73 1.19-2.17 0-3.94-1.87-3.94-4.19 0-2.32 1.77-4.19 3.94-4.19 1.03 0 2.02.43 2.73 1.18v-.75c0-.12.1-.23.23-.23h1.4zm26.375-.19a4.24 4.24 0 00-4.16 3.29c-.13.59-.13 1.19 0 1.77a4.233 4.233 0 004.17 3.3c2.35 0 4.26-1.87 4.26-4.19 0-2.32-1.9-4.17-4.27-4.17zM60.63 5c.13 0 .23.1.23.23v3.76c.7-.76 1.7-1.18 2.73-1.18 1.88 0 3.45 1.4 3.84 3.28.13.59.13 1.2 0 1.8-.39 1.88-1.96 3.29-3.84 3.29-1.03 0-2.02-.43-2.73-1.18v.77c0 .12-.1.23-.23.23h-1.4c-.13 0-.23-.1-.23-.23V5.23c0-.12.1-.23.23-.23h1.4zm-34 11h-1.4c-.13 0-.23-.11-.23-.23V8.22c.01-.13.1-.22.23-.22h1.4c.13 0 .22.11.23.22v.68c.5-.68 1.3-1.09 2.16-1.1h.03c1.09 0 2.09.6 2.6 1.55.45-.95 1.4-1.55 2.44-1.56 1.62 0 2.93 1.25 2.9 2.78l.03 5.2c0 .13-.1.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.8 0-1.46.7-1.59 1.62l.01 4.68c0 .13-.11.23-.23.23h-1.41c-.13 0-.23-.11-.23-.23v-4.59c0-.98-.74-1.71-1.62-1.71-.85 0-1.54.79-1.6 1.8v4.5c0 .13-.1.23-.23.23zm53.615 0h-1.61c-.04 0-.08-.01-.12-.03-.09-.06-.13-.19-.06-.28l2.43-3.71-2.39-3.65a.213.213 0 01-.03-.12c0-.12.09-.21.21-.21h1.61c.13 0 .24.06.3.17l1.41 2.37 1.4-2.37a.34.34 0 01.3-.17h1.6c.04 0 .08.01.12.03.09.06.13.19.06.28l-2.37 3.65 2.43 3.7c0 .05.01.09.01.13 0 .12-.09.21-.21.21h-1.61c-.13 0-.24-.06-.3-.17l-1.44-2.42-1.44 2.42a.34.34 0 01-.3.17zm-7.12-1.49c-1.33 0-2.42-1.12-2.42-2.51 0-1.39 1.08-2.52 2.42-2.52 1.33 0 2.42 1.12 2.42 2.51 0 1.39-1.08 2.51-2.42 2.52zm-19.865 0c-1.32 0-2.39-1.11-2.42-2.48v-.07c.02-1.38 1.09-2.49 2.4-2.49 1.32 0 2.41 1.12 2.41 2.51 0 1.39-1.07 2.52-2.39 2.53zm-8.11-2.48c-.01 1.37-1.09 2.47-2.41 2.47s-2.42-1.12-2.42-2.51c0-1.39 1.08-2.52 2.4-2.52 1.33 0 2.39 1.11 2.41 2.48l.02.08zm18.12 2.47c-1.32 0-2.39-1.11-2.41-2.48v-.06c.02-1.38 1.09-2.48 2.41-2.48s2.42 1.12 2.42 2.51c0 1.39-1.09 2.51-2.42 2.51z'/%3E%3C/defs%3E%3Cmask id='c'%3E%3Crect width='100%25' height='100%25' fill='%23fff'/%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/mask%3E%3Cg stroke='%23fff' stroke-width='3' fill='%23fff'%3E%3Ccircle mask='url(%23c)' cx='11.5' cy='11.5' r='9.25'/%3E%3Cuse xlink:href='%23b' mask='url(%23c)'/%3E%3C/g%3E%3Cuse xlink:href='%23a'/%3E%3Cuse xlink:href='%23b'/%3E%3C/svg%3E")}}.mapboxgl-ctrl.mapboxgl-ctrl-attrib{padding:0 5px;background-color:hsla(0,0%,100%,.5);margin:0}@media screen{.mapboxgl-ctrl-attrib.mapboxgl-compact{min-height:20px;padding:2px 24px 2px 0;margin:10px;position:relative;background-color:#fff;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 28px 2px 8px;visibility:visible}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show,.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact-show{padding:2px 8px 2px 28px;border-radius:12px}.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-inner{display:none}.mapboxgl-ctrl-attrib-button{display:none;cursor:pointer;position:absolute;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E");background-color:hsla(0,0%,100%,.5);width:24px;height:24px;box-sizing:border-box;border-radius:12px;outline:none;top:0;right:0;border:0}.mapboxgl-ctrl-bottom-left .mapboxgl-ctrl-attrib-button,.mapboxgl-ctrl-top-left .mapboxgl-ctrl-attrib-button{left:0}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-inner,.mapboxgl-ctrl-attrib.mapboxgl-compact .mapboxgl-ctrl-attrib-button{display:block}.mapboxgl-ctrl-attrib.mapboxgl-compact-show .mapboxgl-ctrl-attrib-button{background-color:rgba(0,0,0,.05)}.mapboxgl-ctrl-bottom-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;right:0}.mapboxgl-ctrl-top-right>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;right:0}.mapboxgl-ctrl-top-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{top:0;left:0}.mapboxgl-ctrl-bottom-left>.mapboxgl-ctrl-attrib.mapboxgl-compact:after{bottom:0;left:0}}@media screen and (-ms-high-contrast:active){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd' fill='%23fff'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}@media screen and (-ms-high-contrast:black-on-white){.mapboxgl-ctrl-attrib.mapboxgl-compact:after{background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg width='24' height='24' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg' fill-rule='evenodd'%3E%3Cpath d='M4 10a6 6 0 1012 0 6 6 0 10-12 0m5-3a1 1 0 102 0 1 1 0 10-2 0m0 3a1 1 0 112 0v3a1 1 0 11-2 0'/%3E%3C/svg%3E")}}.mapboxgl-ctrl-attrib a{color:rgba(0,0,0,.75);text-decoration:none}.mapboxgl-ctrl-attrib a:hover{color:inherit;text-decoration:underline}.mapboxgl-ctrl-attrib .mapbox-improve-map{font-weight:700;margin-left:2px}.mapboxgl-attrib-empty{display:none}.mapboxgl-ctrl-scale{background-color:hsla(0,0%,100%,.75);font-size:10px;border:2px solid #333;border-top:#333;padding:0 5px;color:#333;box-sizing:border-box}.mapboxgl-popup{position:absolute;top:0;left:0;display:-webkit-flex;display:flex;will-change:transform;pointer-events:none}.mapboxgl-popup-anchor-top,.mapboxgl-popup-anchor-top-left,.mapboxgl-popup-anchor-top-right{-webkit-flex-direction:column;flex-direction:column}.mapboxgl-popup-anchor-bottom,.mapboxgl-popup-anchor-bottom-left,.mapboxgl-popup-anchor-bottom-right{-webkit-flex-direction:column-reverse;flex-direction:column-reverse}.mapboxgl-popup-anchor-left{-webkit-flex-direction:row;flex-direction:row}.mapboxgl-popup-anchor-right{-webkit-flex-direction:row-reverse;flex-direction:row-reverse}.mapboxgl-popup-tip{width:0;height:0;border:10px solid transparent;z-index:1}.mapboxgl-popup-anchor-top .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-top:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-top:none;border-left:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-top:none;border-right:none;border-bottom-color:#fff}.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-bottom:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-tip{-webkit-align-self:flex-start;align-self:flex-start;border-bottom:none;border-left:none;border-top-color:#fff}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-tip{-webkit-align-self:flex-end;align-self:flex-end;border-bottom:none;border-right:none;border-top-color:#fff}.mapboxgl-popup-anchor-left .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-left:none;border-right-color:#fff}.mapboxgl-popup-anchor-right .mapboxgl-popup-tip{-webkit-align-self:center;align-self:center;border-right:none;border-left-color:#fff}.mapboxgl-popup-close-button{position:absolute;right:0;top:0;border:0;border-radius:0 3px 0 0;cursor:pointer;background-color:transparent}.mapboxgl-popup-close-button:hover{background-color:rgba(0,0,0,.05)}.mapboxgl-popup-content{position:relative;background:#fff;border-radius:3px;box-shadow:0 1px 2px rgba(0,0,0,.1);padding:10px 10px 15px;pointer-events:auto}.mapboxgl-popup-anchor-top-left .mapboxgl-popup-content{border-top-left-radius:0}.mapboxgl-popup-anchor-top-right .mapboxgl-popup-content{border-top-right-radius:0}.mapboxgl-popup-anchor-bottom-left .mapboxgl-popup-content{border-bottom-left-radius:0}.mapboxgl-popup-anchor-bottom-right .mapboxgl-popup-content{border-bottom-right-radius:0}.mapboxgl-popup-track-pointer{display:none}.mapboxgl-popup-track-pointer *{pointer-events:none;user-select:none}.mapboxgl-map:hover .mapboxgl-popup-track-pointer{display:flex}.mapboxgl-map:active .mapboxgl-popup-track-pointer{display:none}.mapboxgl-marker{position:absolute;top:0;left:0;will-change:transform}.mapboxgl-user-location-dot,.mapboxgl-user-location-dot:before{background-color:#1da1f2;width:15px;height:15px;border-radius:50%}.mapboxgl-user-location-dot:before{content:"";position:absolute;-webkit-animation:mapboxgl-user-location-dot-pulse 2s infinite;-moz-animation:mapboxgl-user-location-dot-pulse 2s infinite;-ms-animation:mapboxgl-user-location-dot-pulse 2s infinite;animation:mapboxgl-user-location-dot-pulse 2s infinite}.mapboxgl-user-location-dot:after{border-radius:50%;border:2px solid #fff;content:"";height:19px;left:-2px;position:absolute;top:-2px;width:19px;box-sizing:border-box;box-shadow:0 0 3px rgba(0,0,0,.35)}@-webkit-keyframes mapboxgl-user-location-dot-pulse{0%{-webkit-transform:scale(1);opacity:1}70%{-webkit-transform:scale(3);opacity:0}to{-webkit-transform:scale(1);opacity:0}}@-ms-keyframes mapboxgl-user-location-dot-pulse{0%{-ms-transform:scale(1);opacity:1}70%{-ms-transform:scale(3);opacity:0}to{-ms-transform:scale(1);opacity:0}}@keyframes mapboxgl-user-location-dot-pulse{0%{transform:scale(1);opacity:1}70%{transform:scale(3);opacity:0}to{transform:scale(1);opacity:0}}.mapboxgl-user-location-dot-stale{background-color:#aaa}.mapboxgl-user-location-dot-stale:after{display:none}.mapboxgl-user-location-accuracy-circle{background-color:rgba(29,161,242,.2);width:1px;height:1px;border-radius:100%}.mapboxgl-crosshair,.mapboxgl-crosshair .mapboxgl-interactive,.mapboxgl-crosshair .mapboxgl-interactive:active{cursor:crosshair}.mapboxgl-boxzoom{position:absolute;top:0;left:0;width:0;height:0;background:#fff;border:2px dotted #202020;opacity:.5}@media print{.mapbox-improve-map{display:none}}`;
styleInject(css_248z);
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
var mapboxGlExports = {};
var mapboxGl = {
get exports() {
return mapboxGlExports;
},
set exports(v4) {
mapboxGlExports = v4;
}
};
(function(module2, exports2) {
(function(global2, factory) {
module2.exports = factory();
})(commonjsGlobal, function() {
var shared, worker, mapboxgl2;
function define2(_3, chunk2) {
if (!shared) {
shared = chunk2;
} else if (!worker) {
worker = chunk2;
} else {
var workerBundleString = "var sharedChunk = {}; (" + shared + ")(sharedChunk); (" + worker + ")(sharedChunk);";
var sharedChunk = {};
shared(sharedChunk);
mapboxgl2 = chunk2(sharedChunk);
if (typeof window !== "undefined") {
mapboxgl2.workerUrl = window.URL.createObjectURL(new Blob([workerBundleString], { type: "text/javascript" }));
}
}
}
define2(["exports"], function(t5) {
function e5(t6, e6) {
return t6(e6 = { exports: {} }, e6.exports), e6.exports;
}
var r6 = n7;
function n7(t6, e6, r7, n8) {
this.cx = 3 * t6, this.bx = 3 * (r7 - t6) - this.cx, this.ax = 1 - this.cx - this.bx, this.cy = 3 * e6, this.by = 3 * (n8 - e6) - this.cy, this.ay = 1 - this.cy - this.by, this.p1x = t6, this.p1y = n8, this.p2x = r7, this.p2y = n8;
}
n7.prototype.sampleCurveX = function(t6) {
return ((this.ax * t6 + this.bx) * t6 + this.cx) * t6;
}, n7.prototype.sampleCurveY = function(t6) {
return ((this.ay * t6 + this.by) * t6 + this.cy) * t6;
}, n7.prototype.sampleCurveDerivativeX = function(t6) {
return (3 * this.ax * t6 + 2 * this.bx) * t6 + this.cx;
}, n7.prototype.solveCurveX = function(t6, e6) {
var r7, n8, i6, a6, o6;
for (void 0 === e6 && (e6 = 1e-6), i6 = t6, o6 = 0; o6 < 8; o6++) {
if (a6 = this.sampleCurveX(i6) - t6, Math.abs(a6) < e6) {
return i6;
}
var s7 = this.sampleCurveDerivativeX(i6);
if (Math.abs(s7) < 1e-6) {
break;
}
i6 -= a6 / s7;
}
if ((i6 = t6) < (r7 = 0)) {
return r7;
}
if (i6 > (n8 = 1)) {
return n8;
}
for (; r7 < n8; ) {
if (a6 = this.sampleCurveX(i6), Math.abs(a6 - t6) < e6) {
return i6;
}
t6 > a6 ? r7 = i6 : n8 = i6, i6 = 0.5 * (n8 - r7) + r7;
}
return i6;
}, n7.prototype.solve = function(t6, e6) {
return this.sampleCurveY(this.solveCurveX(t6, e6));
};
var i5 = a5;
function a5(t6, e6) {
this.x = t6, this.y = e6;
}
a5.prototype = { clone: function() {
return new a5(this.x, this.y);
}, add: function(t6) {
return this.clone()._add(t6);
}, sub: function(t6) {
return this.clone()._sub(t6);
}, multByPoint: function(t6) {
return this.clone()._multByPoint(t6);
}, divByPoint: function(t6) {
return this.clone()._divByPoint(t6);
}, mult: function(t6) {
return this.clone()._mult(t6);
}, div: function(t6) {
return this.clone()._div(t6);
}, rotate: function(t6) {
return this.clone()._rotate(t6);
}, rotateAround: function(t6, e6) {
return this.clone()._rotateAround(t6, e6);
}, matMult: function(t6) {
return this.clone()._matMult(t6);
}, unit: function() {
return this.clone()._unit();
}, perp: function() {
return this.clone()._perp();
}, round: function() {
return this.clone()._round();
}, mag: function() {
return Math.sqrt(this.x * this.x + this.y * this.y);
}, equals: function(t6) {
return this.x === t6.x && this.y === t6.y;
}, dist: function(t6) {
return Math.sqrt(this.distSqr(t6));
}, distSqr: function(t6) {
var e6 = t6.x - this.x, r7 = t6.y - this.y;
return e6 * e6 + r7 * r7;
}, angle: function() {
return Math.atan2(this.y, this.x);
}, angleTo: function(t6) {
return Math.atan2(this.y - t6.y, this.x - t6.x);
}, angleWith: function(t6) {
return this.angleWithSep(t6.x, t6.y);
}, angleWithSep: function(t6, e6) {
return Math.atan2(this.x * e6 - this.y * t6, this.x * t6 + this.y * e6);
}, _matMult: function(t6) {
var e6 = t6[2] * this.x + t6[3] * this.y;
return this.x = t6[0] * this.x + t6[1] * this.y, this.y = e6, this;
}, _add: function(t6) {
return this.x += t6.x, this.y += t6.y, this;
}, _sub: function(t6) {
return this.x -= t6.x, this.y -= t6.y, this;
}, _mult: function(t6) {
return this.x *= t6, this.y *= t6, this;
}, _div: function(t6) {
return this.x /= t6, this.y /= t6, this;
}, _multByPoint: function(t6) {
return this.x *= t6.x, this.y *= t6.y, this;
}, _divByPoint: function(t6) {
return this.x /= t6.x, this.y /= t6.y, this;
}, _unit: function() {
return this._div(this.mag()), this;
}, _perp: function() {
var t6 = this.y;
return this.y = this.x, this.x = -t6, this;
}, _rotate: function(t6) {
var e6 = Math.cos(t6), r7 = Math.sin(t6), n8 = r7 * this.x + e6 * this.y;
return this.x = e6 * this.x - r7 * this.y, this.y = n8, this;
}, _rotateAround: function(t6, e6) {
var r7 = Math.cos(t6), n8 = Math.sin(t6), i6 = e6.y + n8 * (this.x - e6.x) + r7 * (this.y - e6.y);
return this.x = e6.x + r7 * (this.x - e6.x) - n8 * (this.y - e6.y), this.y = i6, this;
}, _round: function() {
return this.x = Math.round(this.x), this.y = Math.round(this.y), this;
} }, a5.convert = function(t6) {
return t6 instanceof a5 ? t6 : Array.isArray(t6) ? new a5(t6[0], t6[1]) : t6;
};
var o5 = "undefined" != typeof self ? self : {}, s6 = Math.pow(2, 53) - 1;
function u4(t6, e6, n8, i6) {
var a6 = new r6(t6, e6, n8, i6);
return function(t7) {
return a6.solve(t7);
};
}
var l7 = u4(0.25, 0.1, 0.25, 1);
function p4(t6, e6, r7) {
return Math.min(r7, Math.max(e6, t6));
}
function c4(t6, e6, r7) {
var n8 = r7 - e6, i6 = ((t6 - e6) % n8 + n8) % n8 + e6;
return i6 === e6 ? r7 : i6;
}
function h6(t6) {
var arguments$1 = arguments;
for (var e6 = [], r7 = arguments.length - 1; r7-- > 0; ) {
e6[r7] = arguments$1[r7 + 1];
}
for (var n8 = 0, i6 = e6; n8 < i6.length; n8 += 1) {
var a6 = i6[n8];
for (var o6 in a6) {
t6[o6] = a6[o6];
}
}
return t6;
}
var f4 = 1;
function y4() {
return f4++;
}
function d4() {
return function t6(e6) {
return e6 ? (e6 ^ 16 * Math.random() >> e6 / 4).toString(16) : ([1e7] + -[1e3] + -4e3 + -8e3 + -1e11).replace(/[018]/g, t6);
}();
}
function m4(t6) {
return !!t6 && /^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(t6);
}
function v4(t6, e6) {
t6.forEach(function(t7) {
e6[t7] && (e6[t7] = e6[t7].bind(e6));
});
}
function g4(t6, e6) {
return -1 !== t6.indexOf(e6, t6.length - e6.length);
}
function x4(t6, e6, r7) {
var n8 = {};
for (var i6 in t6) {
n8[i6] = e6.call(r7 || this, t6[i6], i6, t6);
}
return n8;
}
function b4(t6, e6, r7) {
var n8 = {};
for (var i6 in t6) {
e6.call(r7 || this, t6[i6], i6, t6) && (n8[i6] = t6[i6]);
}
return n8;
}
function w4(t6) {
return Array.isArray(t6) ? t6.map(w4) : "object" == typeof t6 && t6 ? x4(t6, w4) : t6;
}
var _3 = {};
function A4(t6) {
_3[t6] || ("undefined" != typeof console && console.warn(t6), _3[t6] = true);
}
function S4(t6, e6, r7) {
return (r7.y - t6.y) * (e6.x - t6.x) > (e6.y - t6.y) * (r7.x - t6.x);
}
function k4(t6) {
for (var e6 = 0, r7 = 0, n8 = t6.length, i6 = n8 - 1, a6 = void 0, o6 = void 0; r7 < n8; i6 = r7++) {
e6 += ((o6 = t6[i6]).x - (a6 = t6[r7]).x) * (a6.y + o6.y);
}
return e6;
}
function I4() {
return "undefined" != typeof WorkerGlobalScope && "undefined" != typeof self && self instanceof WorkerGlobalScope;
}
function z4(t6) {
var e6 = {};
if (t6.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g, function(t7, r8, n8, i6) {
var a6 = n8 || i6;
return e6[r8] = !a6 || a6.toLowerCase(), "";
}), e6["max-age"]) {
var r7 = parseInt(e6["max-age"], 10);
isNaN(r7) ? delete e6["max-age"] : e6["max-age"] = r7;
}
return e6;
}
var C4 = null;
function E3(t6) {
if (null == C4) {
var e6 = t6.navigator ? t6.navigator.userAgent : null;
C4 = !!t6.safari || !(!e6 || !(/\b(iPad|iPhone|iPod)\b/.test(e6) || e6.match("Safari") && !e6.match("Chrome")));
}
return C4;
}
function P4(t6) {
try {
var e6 = o5[t6];
return e6.setItem("_mapbox_test_", 1), e6.removeItem("_mapbox_test_"), true;
} catch (t$1) {
return false;
}
}
var M4, B3, T4, V3, F3 = o5.performance && o5.performance.now ? o5.performance.now.bind(o5.performance) : Date.now.bind(Date), D4 = o5.requestAnimationFrame || o5.mozRequestAnimationFrame || o5.webkitRequestAnimationFrame || o5.msRequestAnimationFrame, L4 = o5.cancelAnimationFrame || o5.mozCancelAnimationFrame || o5.webkitCancelAnimationFrame || o5.msCancelAnimationFrame, O4 = { now: F3, frame: function(t6) {
var e6 = D4(t6);
return { cancel: function() {
return L4(e6);
} };
}, getImageData: function(t6, e6) {
void 0 === e6 && (e6 = 0);
var r7 = o5.document.createElement("canvas"), n8 = r7.getContext("2d");
if (!n8) {
throw new Error("failed to create canvas 2d context");
}
return r7.width = t6.width, r7.height = t6.height, n8.drawImage(t6, 0, 0, t6.width, t6.height), n8.getImageData(-e6, -e6, t6.width + 2 * e6, t6.height + 2 * e6);
}, resolveURL: function(t6) {
return M4 || (M4 = o5.document.createElement("a")), M4.href = t6, M4.href;
}, hardwareConcurrency: o5.navigator && o5.navigator.hardwareConcurrency || 4, get devicePixelRatio() {
return o5.devicePixelRatio;
}, get prefersReducedMotion() {
return !!o5.matchMedia && (null == B3 && (B3 = o5.matchMedia("(prefers-reduced-motion: reduce)")), B3.matches);
} }, R3 = { API_URL: "https://api.mapbox.com", get EVENTS_URL() {
return this.API_URL ? 0 === this.API_URL.indexOf("https://api.mapbox.cn") ? "https://events.mapbox.cn/events/v2" : 0 === this.API_URL.indexOf("https://api.mapbox.com") ? "https://events.mapbox.com/events/v2" : null : null;
}, FEEDBACK_URL: "https://apps.mapbox.com/feedback", REQUIRE_ACCESS_TOKEN: true, ACCESS_TOKEN: null, MAX_PARALLEL_IMAGE_REQUESTS: 16 }, U3 = { supported: false, testSupport: function(t6) {
!j4 && V3 && (q4 ? N4(t6) : T4 = t6);
} }, j4 = false, q4 = false;
function N4(t6) {
var e6 = t6.createTexture();
t6.bindTexture(t6.TEXTURE_2D, e6);
try {
if (t6.texImage2D(t6.TEXTURE_2D, 0, t6.RGBA, t6.RGBA, t6.UNSIGNED_BYTE, V3), t6.isContextLost()) {
return;
}
U3.supported = true;
} catch (t$1) {
}
t6.deleteTexture(e6), j4 = true;
}
o5.document && ((V3 = o5.document.createElement("img")).onload = function() {
T4 && N4(T4), T4 = null, q4 = true;
}, V3.onerror = function() {
j4 = true, T4 = null;
}, V3.src = "data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");
var K3 = "01", G3 = function(t6, e6) {
this._transformRequestFn = t6, this._customAccessToken = e6, this._createSkuToken();
};
function Z2(t6) {
return 0 === t6.indexOf("mapbox:");
}
G3.prototype._createSkuToken = function() {
var t6 = function() {
for (var t7 = "", e6 = 0; e6 < 10; e6++) {
t7 += "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"[Math.floor(62 * Math.random())];
}
return { token: ["1", K3, t7].join(""), tokenExpiresAt: Date.now() + 432e5 };
}();
this._skuToken = t6.token, this._skuTokenExpiresAt = t6.tokenExpiresAt;
}, G3.prototype._isSkuTokenExpired = function() {
return Date.now() > this._skuTokenExpiresAt;
}, G3.prototype.transformRequest = function(t6, e6) {
return this._transformRequestFn && this._transformRequestFn(t6, e6) || { url: t6 };
}, G3.prototype.normalizeStyleURL = function(t6, e6) {
if (!Z2(t6)) {
return t6;
}
var r7 = Y2(t6);
return r7.path = "/styles/v1" + r7.path, this._makeAPIURL(r7, this._customAccessToken || e6);
}, G3.prototype.normalizeGlyphsURL = function(t6, e6) {
if (!Z2(t6)) {
return t6;
}
var r7 = Y2(t6);
return r7.path = "/fonts/v1" + r7.path, this._makeAPIURL(r7, this._customAccessToken || e6);
}, G3.prototype.normalizeSourceURL = function(t6, e6) {
if (!Z2(t6)) {
return t6;
}
var r7 = Y2(t6);
return r7.path = "/v4/" + r7.authority + ".json", r7.params.push("secure"), this._makeAPIURL(r7, this._customAccessToken || e6);
}, G3.prototype.normalizeSpriteURL = function(t6, e6, r7, n8) {
var i6 = Y2(t6);
return Z2(t6) ? (i6.path = "/styles/v1" + i6.path + "/sprite" + e6 + r7, this._makeAPIURL(i6, this._customAccessToken || n8)) : (i6.path += "" + e6 + r7, $3(i6));
}, G3.prototype.normalizeTileURL = function(t6, e6) {
if (this._isSkuTokenExpired() && this._createSkuToken(), t6 && !Z2(t6)) {
return t6;
}
var r7 = Y2(t6);
r7.path = r7.path.replace(/(\.(png|jpg)\d*)(?=$)/, (O4.devicePixelRatio >= 2 || 512 === e6 ? "@2x" : "") + (U3.supported ? ".webp" : "$1")), r7.path = r7.path.replace(/^.+\/v4\//, "/"), r7.path = "/v4" + r7.path;
var n8 = this._customAccessToken || function(t7) {
for (var e7 = 0, r8 = t7; e7 < r8.length; e7 += 1) {
var n9 = r8[e7].match(/^access_token=(.*)$/);
if (n9) {
return n9[1];
}
}
return null;
}(r7.params) || R3.ACCESS_TOKEN;
return R3.REQUIRE_ACCESS_TOKEN && n8 && this._skuToken && r7.params.push("sku=" + this._skuToken), this._makeAPIURL(r7, n8);
}, G3.prototype.canonicalizeTileURL = function(t6, e6) {
var r7 = Y2(t6);
if (!r7.path.match(/(^\/v4\/)/) || !r7.path.match(/\.[\w]+$/)) {
return t6;
}
var n8 = "mapbox://tiles/";
n8 += r7.path.replace("/v4/", "");
var i6 = r7.params;
return e6 && (i6 = i6.filter(function(t7) {
return !t7.match(/^access_token=/);
})), i6.length && (n8 += "?" + i6.join("&")), n8;
}, G3.prototype.canonicalizeTileset = function(t6, e6) {
for (var r7 = !!e6 && Z2(e6), n8 = [], i6 = 0, a6 = t6.tiles || []; i6 < a6.length; i6 += 1) {
var o6 = a6[i6];
J3(o6) ? n8.push(this.canonicalizeTileURL(o6, r7)) : n8.push(o6);
}
return n8;
}, G3.prototype._makeAPIURL = function(t6, e6) {
var r7 = "See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes", n8 = Y2(R3.API_URL);
if (t6.protocol = n8.protocol, t6.authority = n8.authority, "http" === t6.protocol) {
var i6 = t6.params.indexOf("secure");
i6 >= 0 && t6.params.splice(i6, 1);
}
if ("/" !== n8.path && (t6.path = "" + n8.path + t6.path), !R3.REQUIRE_ACCESS_TOKEN) {
return $3(t6);
}
if (!(e6 = e6 || R3.ACCESS_TOKEN)) {
throw new Error("An API access token is required to use Mapbox GL. " + r7);
}
if ("s" === e6[0]) {
throw new Error("Use a public access token (pk.*) with Mapbox GL, not a secret access token (sk.*). " + r7);
}
return t6.params = t6.params.filter(function(t7) {
return -1 === t7.indexOf("access_token");
}), t6.params.push("access_token=" + e6), $3(t6);
};
var X3 = /^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;
function J3(t6) {
return X3.test(t6);
}
var H4 = /^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;
function Y2(t6) {
var e6 = t6.match(H4);
if (!e6) {
throw new Error("Unable to parse URL object");
}
return { protocol: e6[1], authority: e6[2], path: e6[3] || "/", params: e6[4] ? e6[4].split("&") : [] };
}
function $3(t6) {
var e6 = t6.params.length ? "?" + t6.params.join("&") : "";
return t6.protocol + "://" + t6.authority + t6.path + e6;
}
function W3(t6) {
if (!t6) {
return null;
}
var e6 = t6.split(".");
if (!e6 || 3 !== e6.length) {
return null;
}
try {
return JSON.parse(decodeURIComponent(o5.atob(e6[1]).split("").map(function(t7) {
return "%" + ("00" + t7.charCodeAt(0).toString(16)).slice(-2);
}).join("")));
} catch (t$1) {
return null;
}
}
var Q2 = function(t6) {
this.type = t6, this.anonId = null, this.eventData = {}, this.queue = [], this.pendingRequest = null;
};
Q2.prototype.getStorageKey = function(t6) {
var e6, r7 = W3(R3.ACCESS_TOKEN);
return e6 = r7 && r7.u ? o5.btoa(encodeURIComponent(r7.u).replace(/%([0-9A-F]{2})/g, function(t7, e7) {
return String.fromCharCode(Number("0x" + e7));
})) : R3.ACCESS_TOKEN || "", t6 ? "mapbox.eventData." + t6 + ":" + e6 : "mapbox.eventData:" + e6;
}, Q2.prototype.fetchEventData = function() {
var t6 = P4("localStorage"), e6 = this.getStorageKey(), r7 = this.getStorageKey("uuid");
if (t6) {
try {
var n8 = o5.localStorage.getItem(e6);
n8 && (this.eventData = JSON.parse(n8));
var i6 = o5.localStorage.getItem(r7);
i6 && (this.anonId = i6);
} catch (t$1) {
A4("Unable to read from LocalStorage");
}
}
}, Q2.prototype.saveEventData = function() {
var t6 = P4("localStorage"), e6 = this.getStorageKey(), r7 = this.getStorageKey("uuid");
if (t6) {
try {
o5.localStorage.setItem(r7, this.anonId), Object.keys(this.eventData).length >= 1 && o5.localStorage.setItem(e6, JSON.stringify(this.eventData));
} catch (t$1) {
A4("Unable to write to LocalStorage");
}
}
}, Q2.prototype.processRequests = function(t6) {
}, Q2.prototype.postEvent = function(t6, e6, r7, n8) {
var i6 = this;
if (R3.EVENTS_URL) {
var a6 = Y2(R3.EVENTS_URL);
a6.params.push("access_token=" + (n8 || R3.ACCESS_TOKEN || ""));
var o6 = { event: this.type, created: new Date(t6).toISOString(), sdkIdentifier: "mapbox-gl-js", sdkVersion: "1.13.3", skuId: K3, userId: this.anonId }, s7 = e6 ? h6(o6, e6) : o6, u5 = { url: $3(a6), headers: { "Content-Type": "text/plain" }, body: JSON.stringify([s7]) };
this.pendingRequest = wt2(u5, function(t7) {
i6.pendingRequest = null, r7(t7), i6.saveEventData(), i6.processRequests(n8);
});
}
}, Q2.prototype.queueRequest = function(t6, e6) {
this.queue.push(t6), this.processRequests(e6);
};
var tt3, et2, rt2 = function(t6) {
function e6() {
t6.call(this, "map.load"), this.success = {}, this.skuToken = "";
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.postMapLoadEvent = function(t7, e7, r7, n8) {
this.skuToken = r7;
var i6 = !(!n8 && !R3.ACCESS_TOKEN), a6 = Array.isArray(t7) && t7.some(function(t8) {
return Z2(t8) || J3(t8);
});
R3.EVENTS_URL && i6 && a6 && this.queueRequest({ id: e7, timestamp: Date.now() }, n8);
}, e6.prototype.processRequests = function(t7) {
var e7 = this;
if (!this.pendingRequest && 0 !== this.queue.length) {
var r7 = this.queue.shift(), n8 = r7.id, i6 = r7.timestamp;
n8 && this.success[n8] || (this.anonId || this.fetchEventData(), m4(this.anonId) || (this.anonId = d4()), this.postEvent(i6, { skuToken: this.skuToken }, function(t8) {
t8 || n8 && (e7.success[n8] = true);
}, t7));
}
}, e6;
}(Q2), nt2 = new (function(t6) {
function e6(e7) {
t6.call(this, "appUserTurnstile"), this._customAccessToken = e7;
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.postTurnstileEvent = function(t7, e7) {
R3.EVENTS_URL && R3.ACCESS_TOKEN && Array.isArray(t7) && t7.some(function(t8) {
return Z2(t8) || J3(t8);
}) && this.queueRequest(Date.now(), e7);
}, e6.prototype.processRequests = function(t7) {
var e7 = this;
if (!this.pendingRequest && 0 !== this.queue.length) {
this.anonId && this.eventData.lastSuccess && this.eventData.tokenU || this.fetchEventData();
var r7 = W3(R3.ACCESS_TOKEN), n8 = r7 ? r7.u : R3.ACCESS_TOKEN, i6 = n8 !== this.eventData.tokenU;
m4(this.anonId) || (this.anonId = d4(), i6 = true);
var a6 = this.queue.shift();
if (this.eventData.lastSuccess) {
var o6 = new Date(this.eventData.lastSuccess), s7 = new Date(a6), u5 = (a6 - this.eventData.lastSuccess) / 864e5;
i6 = i6 || u5 >= 1 || u5 < -1 || o6.getDate() !== s7.getDate();
} else {
i6 = true;
}
if (!i6) {
return this.processRequests();
}
this.postEvent(a6, { "enabled.telemetry": false }, function(t8) {
t8 || (e7.eventData.lastSuccess = a6, e7.eventData.tokenU = n8);
}, t7);
}
}, e6;
}(Q2))(), it2 = nt2.postTurnstileEvent.bind(nt2), at2 = new rt2(), ot2 = at2.postMapLoadEvent.bind(at2), st2 = 500, ut2 = 50;
function lt2() {
o5.caches && !tt3 && (tt3 = o5.caches.open("mapbox-tiles"));
}
function pt2(t6) {
var e6 = t6.indexOf("?");
return e6 < 0 ? t6 : t6.slice(0, e6);
}
var ct2, ht2 = 1 / 0;
function ft2() {
return null == ct2 && (ct2 = o5.OffscreenCanvas && new o5.OffscreenCanvas(1, 1).getContext("2d") && "function" == typeof o5.createImageBitmap), ct2;
}
var yt2 = { Unknown: "Unknown", Style: "Style", Source: "Source", Tile: "Tile", Glyphs: "Glyphs", SpriteImage: "SpriteImage", SpriteJSON: "SpriteJSON", Image: "Image" };
"function" == typeof Object.freeze && Object.freeze(yt2);
var dt2 = function(t6) {
function e6(e7, r7, n8) {
401 === r7 && J3(n8) && (e7 += ": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"), t6.call(this, e7), this.status = r7, this.url = n8, this.name = this.constructor.name, this.message = e7;
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.toString = function() {
return this.name + ": " + this.message + " (" + this.status + "): " + this.url;
}, e6;
}(Error), mt2 = I4() ? function() {
return self.worker && self.worker.referrer;
} : function() {
return ("blob:" === o5.location.protocol ? o5.parent : o5).location.href;
};
var vt2, gt2, xt2 = function(t6, e6) {
if (!(/^file:/.test(r7 = t6.url) || /^file:/.test(mt2()) && !/^\w+:/.test(r7))) {
if (o5.fetch && o5.Request && o5.AbortController && o5.Request.prototype.hasOwnProperty("signal")) {
return function(t7, e7) {
var r8, n8 = new o5.AbortController(), i6 = new o5.Request(t7.url, { method: t7.method || "GET", body: t7.body, credentials: t7.credentials, headers: t7.headers, referrer: mt2(), signal: n8.signal }), a6 = false, s7 = false, u5 = (r8 = i6.url).indexOf("sku=") > 0 && J3(r8);
"json" === t7.type && i6.headers.set("Accept", "application/json");
var l8 = function(r9, n9, a7) {
if (!s7) {
if (r9 && "SecurityError" !== r9.message && A4(r9), n9 && a7) {
return p5(n9);
}
var l9 = Date.now();
o5.fetch(i6).then(function(r10) {
if (r10.ok) {
var n10 = u5 ? r10.clone() : null;
return p5(r10, n10, l9);
}
return e7(new dt2(r10.statusText, r10.status, t7.url));
}).catch(function(t8) {
20 !== t8.code && e7(new Error(t8.message));
});
}
}, p5 = function(r9, n9, u6) {
("arrayBuffer" === t7.type ? r9.arrayBuffer() : "json" === t7.type ? r9.json() : r9.text()).then(function(t8) {
s7 || (n9 && u6 && function(t9, e8, r10) {
if (lt2(), tt3) {
var n10 = { status: e8.status, statusText: e8.statusText, headers: new o5.Headers() };
e8.headers.forEach(function(t10, e9) {
return n10.headers.set(e9, t10);
});
var i7 = z4(e8.headers.get("Cache-Control") || "");
i7["no-store"] || (i7["max-age"] && n10.headers.set("Expires", new Date(r10 + 1e3 * i7["max-age"]).toUTCString()), new Date(n10.headers.get("Expires")).getTime() - r10 < 42e4 || function(t10, e9) {
if (void 0 === et2) {
try {
new Response(new ReadableStream()), et2 = true;
} catch (t$1) {
et2 = false;
}
}
et2 ? e9(t10.body) : t10.blob().then(e9);
}(e8, function(e9) {
var r11 = new o5.Response(e9, n10);
lt2(), tt3 && tt3.then(function(e10) {
return e10.put(pt2(t9.url), r11);
}).catch(function(t10) {
return A4(t10.message);
});
}));
}
}(i6, n9, u6), a6 = true, e7(null, t8, r9.headers.get("Cache-Control"), r9.headers.get("Expires")));
}).catch(function(t8) {
s7 || e7(new Error(t8.message));
});
};
return u5 ? function(t8, e8) {
if (lt2(), !tt3) {
return e8(null);
}
var r9 = pt2(t8.url);
tt3.then(function(t9) {
t9.match(r9).then(function(n9) {
var i7 = function(t10) {
if (!t10) {
return false;
}
var e9 = new Date(t10.headers.get("Expires") || 0), r10 = z4(t10.headers.get("Cache-Control") || "");
return e9 > Date.now() && !r10["no-cache"];
}(n9);
t9.delete(r9), i7 && t9.put(r9, n9.clone()), e8(null, n9, i7);
}).catch(e8);
}).catch(e8);
}(i6, l8) : l8(null, null), { cancel: function() {
s7 = true, a6 || n8.abort();
} };
}(t6, e6);
}
if (I4() && self.worker && self.worker.actor) {
return self.worker.actor.send("getResource", t6, e6, void 0, true);
}
}
var r7;
return function(t7, e7) {
var r8 = new o5.XMLHttpRequest();
for (var n8 in r8.open(t7.method || "GET", t7.url, true), "arrayBuffer" === t7.type && (r8.responseType = "arraybuffer"), t7.headers) {
r8.setRequestHeader(n8, t7.headers[n8]);
}
return "json" === t7.type && (r8.responseType = "text", r8.setRequestHeader("Accept", "application/json")), r8.withCredentials = "include" === t7.credentials, r8.onerror = function() {
e7(new Error(r8.statusText));
}, r8.onload = function() {
if ((r8.status >= 200 && r8.status < 300 || 0 === r8.status) && null !== r8.response) {
var n9 = r8.response;
if ("json" === t7.type) {
try {
n9 = JSON.parse(r8.response);
} catch (t$1) {
return e7(t$1);
}
}
e7(null, n9, r8.getResponseHeader("Cache-Control"), r8.getResponseHeader("Expires"));
} else {
e7(new dt2(r8.statusText, r8.status, t7.url));
}
}, r8.send(t7.body), { cancel: function() {
return r8.abort();
} };
}(t6, e6);
}, bt2 = function(t6, e6) {
return xt2(h6(t6, { type: "arrayBuffer" }), e6);
}, wt2 = function(t6, e6) {
return xt2(h6(t6, { method: "POST" }), e6);
}, _t2 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";
vt2 = [], gt2 = 0;
var At2 = function(t6, e6) {
if (U3.supported && (t6.headers || (t6.headers = {}), t6.headers.accept = "image/webp,*/*"), gt2 >= R3.MAX_PARALLEL_IMAGE_REQUESTS) {
var r7 = { requestParameters: t6, callback: e6, cancelled: false, cancel: function() {
this.cancelled = true;
} };
return vt2.push(r7), r7;
}
gt2++;
var n8 = false, i6 = function() {
if (!n8) {
for (n8 = true, gt2--; vt2.length && gt2 < R3.MAX_PARALLEL_IMAGE_REQUESTS; ) {
var t7 = vt2.shift();
t7.cancelled || (t7.cancel = At2(t7.requestParameters, t7.callback).cancel);
}
}
}, a6 = bt2(t6, function(t7, r8, n9, a7) {
i6(), t7 ? e6(t7) : r8 && (ft2() ? function(t8, e7) {
var r9 = new o5.Blob([new Uint8Array(t8)], { type: "image/png" });
o5.createImageBitmap(r9).then(function(t9) {
e7(null, t9);
}).catch(function(t9) {
e7(new Error("Could not load image because of " + t9.message + ". Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));
});
}(r8, e6) : function(t8, e7, r9, n10) {
var i7 = new o5.Image(), a8 = o5.URL;
i7.onload = function() {
e7(null, i7), a8.revokeObjectURL(i7.src), i7.onload = null, o5.requestAnimationFrame(function() {
i7.src = _t2;
});
}, i7.onerror = function() {
return e7(new Error("Could not load image. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported."));
};
var s7 = new o5.Blob([new Uint8Array(t8)], { type: "image/png" });
i7.cacheControl = r9, i7.expires = n10, i7.src = t8.byteLength ? a8.createObjectURL(s7) : _t2;
}(r8, e6, n9, a7));
});
return { cancel: function() {
a6.cancel(), i6();
} };
};
function St2(t6, e6, r7) {
r7[t6] && -1 !== r7[t6].indexOf(e6) || (r7[t6] = r7[t6] || [], r7[t6].push(e6));
}
function kt2(t6, e6, r7) {
if (r7 && r7[t6]) {
var n8 = r7[t6].indexOf(e6);
-1 !== n8 && r7[t6].splice(n8, 1);
}
}
var It2 = function(t6, e6) {
void 0 === e6 && (e6 = {}), h6(this, e6), this.type = t6;
}, zt2 = function(t6) {
function e6(e7, r7) {
void 0 === r7 && (r7 = {}), t6.call(this, "error", h6({ error: e7 }, r7));
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6;
}(It2), Ct2 = function() {
};
Ct2.prototype.on = function(t6, e6) {
return this._listeners = this._listeners || {}, St2(t6, e6, this._listeners), this;
}, Ct2.prototype.off = function(t6, e6) {
return kt2(t6, e6, this._listeners), kt2(t6, e6, this._oneTimeListeners), this;
}, Ct2.prototype.once = function(t6, e6) {
return this._oneTimeListeners = this._oneTimeListeners || {}, St2(t6, e6, this._oneTimeListeners), this;
}, Ct2.prototype.fire = function(t6, e6) {
"string" == typeof t6 && (t6 = new It2(t6, e6 || {}));
var r7 = t6.type;
if (this.listens(r7)) {
t6.target = this;
for (var n8 = 0, i6 = this._listeners && this._listeners[r7] ? this._listeners[r7].slice() : []; n8 < i6.length; n8 += 1) {
i6[n8].call(this, t6);
}
for (var a6 = 0, o6 = this._oneTimeListeners && this._oneTimeListeners[r7] ? this._oneTimeListeners[r7].slice() : []; a6 < o6.length; a6 += 1) {
var s7 = o6[a6];
kt2(r7, s7, this._oneTimeListeners), s7.call(this, t6);
}
var u5 = this._eventedParent;
u5 && (h6(t6, "function" == typeof this._eventedParentData ? this._eventedParentData() : this._eventedParentData), u5.fire(t6));
} else {
t6 instanceof zt2 && console.error(t6.error);
}
return this;
}, Ct2.prototype.listens = function(t6) {
return this._listeners && this._listeners[t6] && this._listeners[t6].length > 0 || this._oneTimeListeners && this._oneTimeListeners[t6] && this._oneTimeListeners[t6].length > 0 || this._eventedParent && this._eventedParent.listens(t6);
}, Ct2.prototype.setEventedParent = function(t6, e6) {
return this._eventedParent = t6, this._eventedParentData = e6, this;
};
var Et2 = { $version: 8, $root: { version: { required: true, type: "enum", values: [8] }, name: { type: "string" }, metadata: { type: "*" }, center: { type: "array", value: "number" }, zoom: { type: "number" }, bearing: { type: "number", default: 0, period: 360, units: "degrees" }, pitch: { type: "number", default: 0, units: "degrees" }, light: { type: "light" }, sources: { required: true, type: "sources" }, sprite: { type: "string" }, glyphs: { type: "string" }, transition: { type: "transition" }, layers: { required: true, type: "array", value: "layer" } }, sources: { "*": { type: "source" } }, source: ["source_vector", "source_raster", "source_raster_dem", "source_geojson", "source_video", "source_image"], source_vector: { type: { required: true, type: "enum", values: { vector: {} } }, url: { type: "string" }, tiles: { type: "array", value: "string" }, bounds: { type: "array", value: "number", length: 4, default: [-180, -85.051129, 180, 85.051129] }, scheme: { type: "enum", values: { xyz: {}, tms: {} }, default: "xyz" }, minzoom: { type: "number", default: 0 }, maxzoom: { type: "number", default: 22 }, attribution: { type: "string" }, promoteId: { type: "promoteId" }, volatile: { type: "boolean", default: false }, "*": { type: "*" } }, source_raster: { type: { required: true, type: "enum", values: { raster: {} } }, url: { type: "string" }, tiles: { type: "array", value: "string" }, bounds: { type: "array", value: "number", length: 4, default: [-180, -85.051129, 180, 85.051129] }, minzoom: { type: "number", default: 0 }, maxzoom: { type: "number", default: 22 }, tileSize: { type: "number", default: 512, units: "pixels" }, scheme: { type: "enum", values: { xyz: {}, tms: {} }, default: "xyz" }, attribution: { type: "string" }, volatile: { type: "boolean", default: false }, "*": { type: "*" } }, source_raster_dem: { type: { required: true, type: "enum", values: { "raster-dem": {} } }, url: { type: "string" }, tiles: { type: "array", value: "string" }, bounds: { type: "array", value: "number", length: 4, default: [-180, -85.051129, 180, 85.051129] }, minzoom: { type: "number", default: 0 }, maxzoom: { type: "number", default: 22 }, tileSize: { type: "number", default: 512, units: "pixels" }, attribution: { type: "string" }, encoding: { type: "enum", values: { terrarium: {}, mapbox: {} }, default: "mapbox" }, volatile: { type: "boolean", default: false }, "*": { type: "*" } }, source_geojson: { type: { required: true, type: "enum", values: { geojson: {} } }, data: { type: "*" }, maxzoom: { type: "number", default: 18 }, attribution: { type: "string" }, buffer: { type: "number", default: 128, maximum: 512, minimum: 0 }, filter: { type: "*" }, tolerance: { type: "number", default: 0.375 }, cluster: { type: "boolean", default: false }, clusterRadius: { type: "number", default: 50, minimum: 0 }, clusterMaxZoom: { type: "number" }, clusterMinPoints: { type: "number" }, clusterProperties: { type: "*" }, lineMetrics: { type: "boolean", default: false }, generateId: { type: "boolean", default: false }, promoteId: { type: "promoteId" } }, source_video: { type: { required: true, type: "enum", values: { video: {} } }, urls: { required: true, type: "array", value: "string" }, coordinates: { required: true, type: "array", length: 4, value: { type: "array", length: 2, value: "number" } } }, source_image: { type: { required: true, type: "enum", values: { image: {} } }, url: { required: true, type: "string" }, coordinates: { required: true, type: "array", length: 4, value: { type: "array", length: 2, value: "number" } } }, layer: { id: { type: "string", required: true }, type: { type: "enum", values: { fill: {}, line: {}, symbol: {}, circle: {}, heatmap: {}, "fill-extrusion": {}, raster: {}, hillshade: {}, background: {} }, required: true }, metadata: { type: "*" }, source: { type: "string" }, "source-layer": { type: "string" }, minzoom: { type: "number", minimum: 0, maximum: 24 }, maxzoom: { type: "number", minimum: 0, maximum: 24 }, filter: { type: "filter" }, layout: { type: "layout" }, paint: { type: "paint" } }, layout: ["layout_fill", "layout_line", "layout_circle", "layout_heatmap", "layout_fill-extrusion", "layout_symbol", "layout_raster", "layout_hillshade", "layout_background"], layout_background: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_fill: { "fill-sort-key": { type: "number", expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_circle: { "circle-sort-key": { type: "number", expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_heatmap: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, "layout_fill-extrusion": { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_line: { "line-cap": { type: "enum", values: { butt: {}, round: {}, square: {} }, default: "butt", expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-join": { type: "enum", values: { bevel: {}, round: {}, miter: {} }, default: "miter", expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "line-miter-limit": { type: "number", default: 2, requires: [{ "line-join": "miter" }], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-round-limit": { type: "number", default: 1.05, requires: [{ "line-join": "round" }], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-sort-key": { type: "number", expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_symbol: { "symbol-placement": { type: "enum", values: { point: {}, line: {}, "line-center": {} }, default: "point", expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "symbol-spacing": { type: "number", default: 250, minimum: 1, units: "pixels", requires: [{ "symbol-placement": "line" }], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "symbol-avoid-edges": { type: "boolean", default: false, expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "symbol-sort-key": { type: "number", expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "symbol-z-order": { type: "enum", values: { auto: {}, "viewport-y": {}, source: {} }, default: "auto", expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-allow-overlap": { type: "boolean", default: false, requires: ["icon-image"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-ignore-placement": { type: "boolean", default: false, requires: ["icon-image"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-optional": { type: "boolean", default: false, requires: ["icon-image", "text-field"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-rotation-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["icon-image"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-size": { type: "number", default: 1, minimum: 0, units: "factor of the original icon size", requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-text-fit": { type: "enum", values: { none: {}, width: {}, height: {}, both: {} }, default: "none", requires: ["icon-image", "text-field"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-text-fit-padding": { type: "array", value: "number", length: 4, default: [0, 0, 0, 0], units: "pixels", requires: ["icon-image", "text-field", { "icon-text-fit": ["both", "width", "height"] }], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-image": { type: "resolvedImage", tokens: true, expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-rotate": { type: "number", default: 0, period: 360, units: "degrees", requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-padding": { type: "number", default: 2, minimum: 0, units: "pixels", requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-keep-upright": { type: "boolean", default: false, requires: ["icon-image", { "icon-rotation-alignment": "map" }, { "symbol-placement": ["line", "line-center"] }], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-offset": { type: "array", value: "number", length: 2, default: [0, 0], requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-anchor": { type: "enum", values: { center: {}, left: {}, right: {}, top: {}, bottom: {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, default: "center", requires: ["icon-image"], expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "icon-pitch-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["icon-image"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-pitch-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["text-field"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-rotation-alignment": { type: "enum", values: { map: {}, viewport: {}, auto: {} }, default: "auto", requires: ["text-field"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-field": { type: "formatted", default: "", tokens: true, expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-font": { type: "array", value: "string", default: ["Open Sans Regular", "Arial Unicode MS Regular"], requires: ["text-field"], expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-size": { type: "number", default: 16, minimum: 0, units: "pixels", requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-max-width": { type: "number", default: 10, minimum: 0, units: "ems", requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-line-height": { type: "number", default: 1.2, units: "ems", requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-letter-spacing": { type: "number", default: 0, units: "ems", requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-justify": { type: "enum", values: { auto: {}, left: {}, center: {}, right: {} }, default: "center", requires: ["text-field"], expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-radial-offset": { type: "number", units: "ems", default: 0, requires: ["text-field"], "property-type": "data-driven", expression: { interpolated: true, parameters: ["zoom", "feature"] } }, "text-variable-anchor": { type: "array", value: "enum", values: { center: {}, left: {}, right: {}, top: {}, bottom: {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, requires: ["text-field", { "symbol-placement": ["point"] }], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-anchor": { type: "enum", values: { center: {}, left: {}, right: {}, top: {}, bottom: {}, "top-left": {}, "top-right": {}, "bottom-left": {}, "bottom-right": {} }, default: "center", requires: ["text-field", { "!": "text-variable-anchor" }], expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-max-angle": { type: "number", default: 45, units: "degrees", requires: ["text-field", { "symbol-placement": ["line", "line-center"] }], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-writing-mode": { type: "array", value: "enum", values: { horizontal: {}, vertical: {} }, requires: ["text-field", { "symbol-placement": ["point"] }], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-rotate": { type: "number", default: 0, period: 360, units: "degrees", requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-padding": { type: "number", default: 2, minimum: 0, units: "pixels", requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-keep-upright": { type: "boolean", default: true, requires: ["text-field", { "text-rotation-alignment": "map" }, { "symbol-placement": ["line", "line-center"] }], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-transform": { type: "enum", values: { none: {}, uppercase: {}, lowercase: {} }, default: "none", requires: ["text-field"], expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-offset": { type: "array", value: "number", units: "ems", length: 2, default: [0, 0], requires: ["text-field", { "!": "text-radial-offset" }], expression: { interpolated: true, parameters: ["zoom", "feature"] }, "property-type": "data-driven" }, "text-allow-overlap": { type: "boolean", default: false, requires: ["text-field"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-ignore-placement": { type: "boolean", default: false, requires: ["text-field"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-optional": { type: "boolean", default: false, requires: ["text-field", "icon-image"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_raster: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, layout_hillshade: { visibility: { type: "enum", values: { visible: {}, none: {} }, default: "visible", "property-type": "constant" } }, filter: { type: "array", value: "*" }, filter_operator: { type: "enum", values: { "==": {}, "!=": {}, ">": {}, ">=": {}, "<": {}, "<=": {}, in: {}, "!in": {}, all: {}, any: {}, none: {}, has: {}, "!has": {}, within: {} } }, geometry_type: { type: "enum", values: { Point: {}, LineString: {}, Polygon: {} } }, function: { expression: { type: "expression" }, stops: { type: "array", value: "function_stop" }, base: { type: "number", default: 1, minimum: 0 }, property: { type: "string", default: "$zoom" }, type: { type: "enum", values: { identity: {}, exponential: {}, interval: {}, categorical: {} }, default: "exponential" }, colorSpace: { type: "enum", values: { rgb: {}, lab: {}, hcl: {} }, default: "rgb" }, default: { type: "*", required: false } }, function_stop: { type: "array", minimum: 0, maximum: 24, value: ["number", "color"], length: 2 }, expression: { type: "array", value: "*", minimum: 1 }, light: { anchor: { type: "enum", default: "viewport", values: { map: {}, viewport: {} }, "property-type": "data-constant", transition: false, expression: { interpolated: false, parameters: ["zoom"] } }, position: { type: "array", default: [1.15, 210, 30], length: 3, value: "number", "property-type": "data-constant", transition: true, expression: { interpolated: true, parameters: ["zoom"] } }, color: { type: "color", "property-type": "data-constant", default: "#ffffff", expression: { interpolated: true, parameters: ["zoom"] }, transition: true }, intensity: { type: "number", "property-type": "data-constant", default: 0.5, minimum: 0, maximum: 1, expression: { interpolated: true, parameters: ["zoom"] }, transition: true } }, paint: ["paint_fill", "paint_line", "paint_circle", "paint_heatmap", "paint_fill-extrusion", "paint_symbol", "paint_raster", "paint_hillshade", "paint_background"], paint_fill: { "fill-antialias": { type: "boolean", default: true, expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-color": { type: "color", default: "#000000", transition: true, requires: [{ "!": "fill-pattern" }], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-outline-color": { type: "color", transition: true, requires: [{ "!": "fill-pattern" }, { "fill-antialias": true }], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["fill-translate"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-pattern": { type: "resolvedImage", transition: true, expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "cross-faded-data-driven" } }, "paint_fill-extrusion": { "fill-extrusion-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-extrusion-color": { type: "color", default: "#000000", transition: true, requires: [{ "!": "fill-extrusion-pattern" }], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-extrusion-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-extrusion-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["fill-extrusion-translate"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "fill-extrusion-pattern": { type: "resolvedImage", transition: true, expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "cross-faded-data-driven" }, "fill-extrusion-height": { type: "number", default: 0, minimum: 0, units: "meters", transition: true, expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-extrusion-base": { type: "number", default: 0, minimum: 0, units: "meters", transition: true, requires: ["fill-extrusion-height"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "fill-extrusion-vertical-gradient": { type: "boolean", default: true, transition: false, expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_line: { "line-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-color": { type: "color", default: "#000000", transition: true, requires: [{ "!": "line-pattern" }], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["line-translate"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "line-width": { type: "number", default: 1, minimum: 0, transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-gap-width": { type: "number", default: 0, minimum: 0, transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-offset": { type: "number", default: 0, transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-blur": { type: "number", default: 0, minimum: 0, transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "line-dasharray": { type: "array", value: "number", minimum: 0, transition: true, units: "line widths", requires: [{ "!": "line-pattern" }], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "cross-faded" }, "line-pattern": { type: "resolvedImage", transition: true, expression: { interpolated: false, parameters: ["zoom", "feature"] }, "property-type": "cross-faded-data-driven" }, "line-gradient": { type: "color", transition: false, requires: [{ "!": "line-dasharray" }, { "!": "line-pattern" }, { source: "geojson", has: { lineMetrics: true } }], expression: { interpolated: true, parameters: ["line-progress"] }, "property-type": "color-ramp" } }, paint_circle: { "circle-radius": { type: "number", default: 5, minimum: 0, transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-color": { type: "color", default: "#000000", transition: true, expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-blur": { type: "number", default: 0, transition: true, expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "circle-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["circle-translate"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "circle-pitch-scale": { type: "enum", values: { map: {}, viewport: {} }, default: "map", expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "circle-pitch-alignment": { type: "enum", values: { map: {}, viewport: {} }, default: "viewport", expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "circle-stroke-width": { type: "number", default: 0, minimum: 0, transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-stroke-color": { type: "color", default: "#000000", transition: true, expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "circle-stroke-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" } }, paint_heatmap: { "heatmap-radius": { type: "number", default: 30, minimum: 1, transition: true, units: "pixels", expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "heatmap-weight": { type: "number", default: 1, minimum: 0, transition: false, expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "heatmap-intensity": { type: "number", default: 1, minimum: 0, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "heatmap-color": { type: "color", default: ["interpolate", ["linear"], ["heatmap-density"], 0, "rgba(0, 0, 255, 0)", 0.1, "royalblue", 0.3, "cyan", 0.5, "lime", 0.7, "yellow", 1, "red"], transition: false, expression: { interpolated: true, parameters: ["heatmap-density"] }, "property-type": "color-ramp" }, "heatmap-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_symbol: { "icon-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-color": { type: "color", default: "#000000", transition: true, requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-halo-color": { type: "color", default: "rgba(0, 0, 0, 0)", transition: true, requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-halo-width": { type: "number", default: 0, minimum: 0, transition: true, units: "pixels", requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-halo-blur": { type: "number", default: 0, minimum: 0, transition: true, units: "pixels", requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "icon-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: true, units: "pixels", requires: ["icon-image"], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "icon-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["icon-image", "icon-translate"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-color": { type: "color", default: "#000000", transition: true, overridable: true, requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-halo-color": { type: "color", default: "rgba(0, 0, 0, 0)", transition: true, requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-halo-width": { type: "number", default: 0, minimum: 0, transition: true, units: "pixels", requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-halo-blur": { type: "number", default: 0, minimum: 0, transition: true, units: "pixels", requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom", "feature", "feature-state"] }, "property-type": "data-driven" }, "text-translate": { type: "array", value: "number", length: 2, default: [0, 0], transition: true, units: "pixels", requires: ["text-field"], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "text-translate-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "map", requires: ["text-field", "text-translate"], expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_raster: { "raster-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-hue-rotate": { type: "number", default: 0, period: 360, transition: true, units: "degrees", expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-brightness-min": { type: "number", default: 0, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-brightness-max": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-saturation": { type: "number", default: 0, minimum: -1, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-contrast": { type: "number", default: 0, minimum: -1, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-resampling": { type: "enum", values: { linear: {}, nearest: {} }, default: "linear", expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "raster-fade-duration": { type: "number", default: 300, minimum: 0, transition: false, units: "milliseconds", expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_hillshade: { "hillshade-illumination-direction": { type: "number", default: 335, minimum: 0, maximum: 359, transition: false, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-illumination-anchor": { type: "enum", values: { map: {}, viewport: {} }, default: "viewport", expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-exaggeration": { type: "number", default: 0.5, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-shadow-color": { type: "color", default: "#000000", transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-highlight-color": { type: "color", default: "#FFFFFF", transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "hillshade-accent-color": { type: "color", default: "#000000", transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" } }, paint_background: { "background-color": { type: "color", default: "#000000", transition: true, requires: [{ "!": "background-pattern" }], expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" }, "background-pattern": { type: "resolvedImage", transition: true, expression: { interpolated: false, parameters: ["zoom"] }, "property-type": "cross-faded" }, "background-opacity": { type: "number", default: 1, minimum: 0, maximum: 1, transition: true, expression: { interpolated: true, parameters: ["zoom"] }, "property-type": "data-constant" } }, transition: { duration: { type: "number", default: 300, minimum: 0, units: "milliseconds" }, delay: { type: "number", default: 0, minimum: 0, units: "milliseconds" } }, "property-type": { "data-driven": { type: "property-type" }, "cross-faded": { type: "property-type" }, "cross-faded-data-driven": { type: "property-type" }, "color-ramp": { type: "property-type" }, "data-constant": { type: "property-type" }, constant: { type: "property-type" } }, promoteId: { "*": { type: "string" } } }, Pt2 = function(t6, e6, r7, n8) {
this.message = (t6 ? t6 + ": " : "") + r7, n8 && (this.identifier = n8), null != e6 && e6.__line__ && (this.line = e6.__line__);
};
function Mt2(t6) {
var e6 = t6.value;
return e6 ? [new Pt2(t6.key, e6, "constants have been deprecated as of v8")] : [];
}
function Bt2(t6) {
var arguments$1 = arguments;
for (var e6 = [], r7 = arguments.length - 1; r7-- > 0; ) {
e6[r7] = arguments$1[r7 + 1];
}
for (var n8 = 0, i6 = e6; n8 < i6.length; n8 += 1) {
var a6 = i6[n8];
for (var o6 in a6) {
t6[o6] = a6[o6];
}
}
return t6;
}
function Tt2(t6) {
return t6 instanceof Number || t6 instanceof String || t6 instanceof Boolean ? t6.valueOf() : t6;
}
function Vt2(t6) {
if (Array.isArray(t6)) {
return t6.map(Vt2);
}
if (t6 instanceof Object && !(t6 instanceof Number || t6 instanceof String || t6 instanceof Boolean)) {
var e6 = {};
for (var r7 in t6) {
e6[r7] = Vt2(t6[r7]);
}
return e6;
}
return Tt2(t6);
}
var Ft2 = function(t6) {
function e6(e7, r7) {
t6.call(this, r7), this.message = r7, this.key = e7;
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6;
}(Error), Dt2 = function(t6, e6) {
void 0 === e6 && (e6 = []), this.parent = t6, this.bindings = {};
for (var r7 = 0, n8 = e6; r7 < n8.length; r7 += 1) {
var i6 = n8[r7];
this.bindings[i6[0]] = i6[1];
}
};
Dt2.prototype.concat = function(t6) {
return new Dt2(this, t6);
}, Dt2.prototype.get = function(t6) {
if (this.bindings[t6]) {
return this.bindings[t6];
}
if (this.parent) {
return this.parent.get(t6);
}
throw new Error(t6 + " not found in scope.");
}, Dt2.prototype.has = function(t6) {
return !!this.bindings[t6] || !!this.parent && this.parent.has(t6);
};
var Lt2 = { kind: "null" }, Ot2 = { kind: "number" }, Rt2 = { kind: "string" }, Ut2 = { kind: "boolean" }, jt2 = { kind: "color" }, qt2 = { kind: "object" }, Nt2 = { kind: "value" }, Kt2 = { kind: "collator" }, Gt2 = { kind: "formatted" }, Zt2 = { kind: "resolvedImage" };
function Xt2(t6, e6) {
return { kind: "array", itemType: t6, N: e6 };
}
function Jt2(t6) {
if ("array" === t6.kind) {
var e6 = Jt2(t6.itemType);
return "number" == typeof t6.N ? "array<" + e6 + ", " + t6.N + ">" : "value" === t6.itemType.kind ? "array" : "array<" + e6 + ">";
}
return t6.kind;
}
var Ht2 = [Lt2, Ot2, Rt2, Ut2, jt2, Gt2, qt2, Xt2(Nt2), Zt2];
function Yt2(t6, e6) {
if ("error" === e6.kind) {
return null;
}
if ("array" === t6.kind) {
if ("array" === e6.kind && (0 === e6.N && "value" === e6.itemType.kind || !Yt2(t6.itemType, e6.itemType)) && ("number" != typeof t6.N || t6.N === e6.N)) {
return null;
}
} else {
if (t6.kind === e6.kind) {
return null;
}
if ("value" === t6.kind) {
for (var r7 = 0, n8 = Ht2; r7 < n8.length; r7 += 1) {
if (!Yt2(n8[r7], e6)) {
return null;
}
}
}
}
return "Expected " + Jt2(t6) + " but found " + Jt2(e6) + " instead.";
}
function $t2(t6, e6) {
return e6.some(function(e7) {
return e7.kind === t6.kind;
});
}
function Wt2(t6, e6) {
return e6.some(function(e7) {
return "null" === e7 ? null === t6 : "array" === e7 ? Array.isArray(t6) : "object" === e7 ? t6 && !Array.isArray(t6) && "object" == typeof t6 : e7 === typeof t6;
});
}
var Qt2 = e5(function(t6, e6) {
var r7 = { transparent: [0, 0, 0, 0], aliceblue: [240, 248, 255, 1], antiquewhite: [250, 235, 215, 1], aqua: [0, 255, 255, 1], aquamarine: [127, 255, 212, 1], azure: [240, 255, 255, 1], beige: [245, 245, 220, 1], bisque: [255, 228, 196, 1], black: [0, 0, 0, 1], blanchedalmond: [255, 235, 205, 1], blue: [0, 0, 255, 1], blueviolet: [138, 43, 226, 1], brown: [165, 42, 42, 1], burlywood: [222, 184, 135, 1], cadetblue: [95, 158, 160, 1], chartreuse: [127, 255, 0, 1], chocolate: [210, 105, 30, 1], coral: [255, 127, 80, 1], cornflowerblue: [100, 149, 237, 1], cornsilk: [255, 248, 220, 1], crimson: [220, 20, 60, 1], cyan: [0, 255, 255, 1], darkblue: [0, 0, 139, 1], darkcyan: [0, 139, 139, 1], darkgoldenrod: [184, 134, 11, 1], darkgray: [169, 169, 169, 1], darkgreen: [0, 100, 0, 1], darkgrey: [169, 169, 169, 1], darkkhaki: [189, 183, 107, 1], darkmagenta: [139, 0, 139, 1], darkolivegreen: [85, 107, 47, 1], darkorange: [255, 140, 0, 1], darkorchid: [153, 50, 204, 1], darkred: [139, 0, 0, 1], darksalmon: [233, 150, 122, 1], darkseagreen: [143, 188, 143, 1], darkslateblue: [72, 61, 139, 1], darkslategray: [47, 79, 79, 1], darkslategrey: [47, 79, 79, 1], darkturquoise: [0, 206, 209, 1], darkviolet: [148, 0, 211, 1], deeppink: [255, 20, 147, 1], deepskyblue: [0, 191, 255, 1], dimgray: [105, 105, 105, 1], dimgrey: [105, 105, 105, 1], dodgerblue: [30, 144, 255, 1], firebrick: [178, 34, 34, 1], floralwhite: [255, 250, 240, 1], forestgreen: [34, 139, 34, 1], fuchsia: [255, 0, 255, 1], gainsboro: [220, 220, 220, 1], ghostwhite: [248, 248, 255, 1], gold: [255, 215, 0, 1], goldenrod: [218, 165, 32, 1], gray: [128, 128, 128, 1], green: [0, 128, 0, 1], greenyellow: [173, 255, 47, 1], grey: [128, 128, 128, 1], honeydew: [240, 255, 240, 1], hotpink: [255, 105, 180, 1], indianred: [205, 92, 92, 1], indigo: [75, 0, 130, 1], ivory: [255, 255, 240, 1], khaki: [240, 230, 140, 1], lavender: [230, 230, 250, 1], lavenderblush: [255, 240, 245, 1], lawngreen: [124, 252, 0, 1], lemonchiffon: [255, 250, 205, 1], lightblue: [173, 216, 230, 1], lightcoral: [240, 128, 128, 1], lightcyan: [224, 255, 255, 1], lightgoldenrodyellow: [250, 250, 210, 1], lightgray: [211, 211, 211, 1], lightgreen: [144, 238, 144, 1], lightgrey: [211, 211, 211, 1], lightpink: [255, 182, 193, 1], lightsalmon: [255, 160, 122, 1], lightseagreen: [32, 178, 170, 1], lightskyblue: [135, 206, 250, 1], lightslategray: [119, 136, 153, 1], lightslategrey: [119, 136, 153, 1], lightsteelblue: [176, 196, 222, 1], lightyellow: [255, 255, 224, 1], lime: [0, 255, 0, 1], limegreen: [50, 205, 50, 1], linen: [250, 240, 230, 1], magenta: [255, 0, 255, 1], maroon: [128, 0, 0, 1], mediumaquamarine: [102, 205, 170, 1], mediumblue: [0, 0, 205, 1], mediumorchid: [186, 85, 211, 1], mediumpurple: [147, 112, 219, 1], mediumseagreen: [60, 179, 113, 1], mediumslateblue: [123, 104, 238, 1], mediumspringgreen: [0, 250, 154, 1], mediumturquoise: [72, 209, 204, 1], mediumvioletred: [199, 21, 133, 1], midnightblue: [25, 25, 112, 1], mintcream: [245, 255, 250, 1], mistyrose: [255, 228, 225, 1], moccasin: [255, 228, 181, 1], navajowhite: [255, 222, 173, 1], navy: [0, 0, 128, 1], oldlace: [253, 245, 230, 1], olive: [128, 128, 0, 1], olivedrab: [107, 142, 35, 1], orange: [255, 165, 0, 1], orangered: [255, 69, 0, 1], orchid: [218, 112, 214, 1], palegoldenrod: [238, 232, 170, 1], palegreen: [152, 251, 152, 1], paleturquoise: [175, 238, 238, 1], palevioletred: [219, 112, 147, 1], papayawhip: [255, 239, 213, 1], peachpuff: [255, 218, 185, 1], peru: [205, 133, 63, 1], pink: [255, 192, 203, 1], plum: [221, 160, 221, 1], powderblue: [176, 224, 230, 1], purple: [128, 0, 128, 1], rebeccapurple: [102, 51, 153, 1], red: [255, 0, 0, 1], rosybrown: [188, 143, 143, 1], royalblue: [65, 105, 225, 1], saddlebrown: [139, 69, 19, 1], salmon: [250, 128, 114, 1], sandybrown: [244, 164, 96, 1], seagreen: [46, 139, 87, 1], seashell: [255, 245, 238, 1], sienna: [160, 82, 45, 1], silver: [192, 192, 192, 1], skyblue: [135, 206, 235, 1], slateblue: [106, 90, 205, 1], slategray: [112, 128, 144, 1], slategrey: [112, 128, 144, 1], snow: [255, 250, 250, 1], springgreen: [0, 255, 127, 1], steelblue: [70, 130, 180, 1], tan: [210, 180, 140, 1], teal: [0, 128, 128, 1], thistle: [216, 191, 216, 1], tomato: [255, 99, 71, 1], turquoise: [64, 224, 208, 1], violet: [238, 130, 238, 1], wheat: [245, 222, 179, 1], white: [255, 255, 255, 1], whitesmoke: [245, 245, 245, 1], yellow: [255, 255, 0, 1], yellowgreen: [154, 205, 50, 1] };
function n8(t7) {
return (t7 = Math.round(t7)) < 0 ? 0 : t7 > 255 ? 255 : t7;
}
function i6(t7) {
return n8("%" === t7[t7.length - 1] ? parseFloat(t7) / 100 * 255 : parseInt(t7));
}
function a6(t7) {
return (e7 = "%" === t7[t7.length - 1] ? parseFloat(t7) / 100 : parseFloat(t7)) < 0 ? 0 : e7 > 1 ? 1 : e7;
var e7;
}
function o6(t7, e7, r8) {
return r8 < 0 ? r8 += 1 : r8 > 1 && (r8 -= 1), 6 * r8 < 1 ? t7 + (e7 - t7) * r8 * 6 : 2 * r8 < 1 ? e7 : 3 * r8 < 2 ? t7 + (e7 - t7) * (2 / 3 - r8) * 6 : t7;
}
try {
e6.parseCSSColor = function(t7) {
var e7, s7 = t7.replace(/ /g, "").toLowerCase();
if (s7 in r7) {
return r7[s7].slice();
}
if ("#" === s7[0]) {
return 4 === s7.length ? (e7 = parseInt(s7.substr(1), 16)) >= 0 && e7 <= 4095 ? [(3840 & e7) >> 4 | (3840 & e7) >> 8, 240 & e7 | (240 & e7) >> 4, 15 & e7 | (15 & e7) << 4, 1] : null : 7 === s7.length && (e7 = parseInt(s7.substr(1), 16)) >= 0 && e7 <= 16777215 ? [(16711680 & e7) >> 16, (65280 & e7) >> 8, 255 & e7, 1] : null;
}
var u5 = s7.indexOf("("), l8 = s7.indexOf(")");
if (-1 !== u5 && l8 + 1 === s7.length) {
var p5 = s7.substr(0, u5), c5 = s7.substr(u5 + 1, l8 - (u5 + 1)).split(","), h7 = 1;
switch (p5) {
case "rgba":
if (4 !== c5.length) {
return null;
}
h7 = a6(c5.pop());
case "rgb":
return 3 !== c5.length ? null : [i6(c5[0]), i6(c5[1]), i6(c5[2]), h7];
case "hsla":
if (4 !== c5.length) {
return null;
}
h7 = a6(c5.pop());
case "hsl":
if (3 !== c5.length) {
return null;
}
var f5 = (parseFloat(c5[0]) % 360 + 360) % 360 / 360, y5 = a6(c5[1]), d5 = a6(c5[2]), m5 = d5 <= 0.5 ? d5 * (y5 + 1) : d5 + y5 - d5 * y5, v5 = 2 * d5 - m5;
return [n8(255 * o6(v5, m5, f5 + 1 / 3)), n8(255 * o6(v5, m5, f5)), n8(255 * o6(v5, m5, f5 - 1 / 3)), h7];
default:
return null;
}
}
return null;
};
} catch (t$1) {
}
}).parseCSSColor, te2 = function(t6, e6, r7, n8) {
void 0 === n8 && (n8 = 1), this.r = t6, this.g = e6, this.b = r7, this.a = n8;
};
te2.parse = function(t6) {
if (t6) {
if (t6 instanceof te2) {
return t6;
}
if ("string" == typeof t6) {
var e6 = Qt2(t6);
if (e6) {
return new te2(e6[0] / 255 * e6[3], e6[1] / 255 * e6[3], e6[2] / 255 * e6[3], e6[3]);
}
}
}
}, te2.prototype.toString = function() {
var t6 = this.toArray(), e6 = t6[1], r7 = t6[2], n8 = t6[3];
return "rgba(" + Math.round(t6[0]) + "," + Math.round(e6) + "," + Math.round(r7) + "," + n8 + ")";
}, te2.prototype.toArray = function() {
var t6 = this.a;
return 0 === t6 ? [0, 0, 0, 0] : [255 * this.r / t6, 255 * this.g / t6, 255 * this.b / t6, t6];
}, te2.black = new te2(0, 0, 0, 1), te2.white = new te2(1, 1, 1, 1), te2.transparent = new te2(0, 0, 0, 0), te2.red = new te2(1, 0, 0, 1);
var ee2 = function(t6, e6, r7) {
this.sensitivity = t6 ? e6 ? "variant" : "case" : e6 ? "accent" : "base", this.locale = r7, this.collator = new Intl.Collator(this.locale ? this.locale : [], { sensitivity: this.sensitivity, usage: "search" });
};
ee2.prototype.compare = function(t6, e6) {
return this.collator.compare(t6, e6);
}, ee2.prototype.resolvedLocale = function() {
return new Intl.Collator(this.locale ? this.locale : []).resolvedOptions().locale;
};
var re2 = function(t6, e6, r7, n8, i6) {
this.text = t6, this.image = e6, this.scale = r7, this.fontStack = n8, this.textColor = i6;
}, ne2 = function(t6) {
this.sections = t6;
};
ne2.fromString = function(t6) {
return new ne2([new re2(t6, null, null, null, null)]);
}, ne2.prototype.isEmpty = function() {
return 0 === this.sections.length || !this.sections.some(function(t6) {
return 0 !== t6.text.length || t6.image && 0 !== t6.image.name.length;
});
}, ne2.factory = function(t6) {
return t6 instanceof ne2 ? t6 : ne2.fromString(t6);
}, ne2.prototype.toString = function() {
return 0 === this.sections.length ? "" : this.sections.map(function(t6) {
return t6.text;
}).join("");
}, ne2.prototype.serialize = function() {
for (var t6 = ["format"], e6 = 0, r7 = this.sections; e6 < r7.length; e6 += 1) {
var n8 = r7[e6];
if (n8.image) {
t6.push(["image", n8.image.name]);
} else {
t6.push(n8.text);
var i6 = {};
n8.fontStack && (i6["text-font"] = ["literal", n8.fontStack.split(",")]), n8.scale && (i6["font-scale"] = n8.scale), n8.textColor && (i6["text-color"] = ["rgba"].concat(n8.textColor.toArray())), t6.push(i6);
}
}
return t6;
};
var ie4 = function(t6) {
this.name = t6.name, this.available = t6.available;
};
function ae2(t6, e6, r7, n8) {
return "number" == typeof t6 && t6 >= 0 && t6 <= 255 && "number" == typeof e6 && e6 >= 0 && e6 <= 255 && "number" == typeof r7 && r7 >= 0 && r7 <= 255 ? void 0 === n8 || "number" == typeof n8 && n8 >= 0 && n8 <= 1 ? null : "Invalid rgba value [" + [t6, e6, r7, n8].join(", ") + "]: 'a' must be between 0 and 1." : "Invalid rgba value [" + ("number" == typeof n8 ? [t6, e6, r7, n8] : [t6, e6, r7]).join(", ") + "]: 'r', 'g', and 'b' must be between 0 and 255.";
}
function oe2(t6) {
if (null === t6) {
return true;
}
if ("string" == typeof t6) {
return true;
}
if ("boolean" == typeof t6) {
return true;
}
if ("number" == typeof t6) {
return true;
}
if (t6 instanceof te2) {
return true;
}
if (t6 instanceof ee2) {
return true;
}
if (t6 instanceof ne2) {
return true;
}
if (t6 instanceof ie4) {
return true;
}
if (Array.isArray(t6)) {
for (var e6 = 0, r7 = t6; e6 < r7.length; e6 += 1) {
if (!oe2(r7[e6])) {
return false;
}
}
return true;
}
if ("object" == typeof t6) {
for (var n8 in t6) {
if (!oe2(t6[n8])) {
return false;
}
}
return true;
}
return false;
}
function se2(t6) {
if (null === t6) {
return Lt2;
}
if ("string" == typeof t6) {
return Rt2;
}
if ("boolean" == typeof t6) {
return Ut2;
}
if ("number" == typeof t6) {
return Ot2;
}
if (t6 instanceof te2) {
return jt2;
}
if (t6 instanceof ee2) {
return Kt2;
}
if (t6 instanceof ne2) {
return Gt2;
}
if (t6 instanceof ie4) {
return Zt2;
}
if (Array.isArray(t6)) {
for (var e6, r7 = t6.length, n8 = 0, i6 = t6; n8 < i6.length; n8 += 1) {
var a6 = se2(i6[n8]);
if (e6) {
if (e6 === a6) {
continue;
}
e6 = Nt2;
break;
}
e6 = a6;
}
return Xt2(e6 || Nt2, r7);
}
return qt2;
}
function ue2(t6) {
var e6 = typeof t6;
return null === t6 ? "" : "string" === e6 || "number" === e6 || "boolean" === e6 ? String(t6) : t6 instanceof te2 || t6 instanceof ne2 || t6 instanceof ie4 ? t6.toString() : JSON.stringify(t6);
}
ie4.prototype.toString = function() {
return this.name;
}, ie4.fromString = function(t6) {
return t6 ? new ie4({ name: t6, available: false }) : null;
}, ie4.prototype.serialize = function() {
return ["image", this.name];
};
var le2 = function(t6, e6) {
this.type = t6, this.value = e6;
};
le2.parse = function(t6, e6) {
if (2 !== t6.length) {
return e6.error("'literal' expression requires exactly one argument, but found " + (t6.length - 1) + " instead.");
}
if (!oe2(t6[1])) {
return e6.error("invalid value");
}
var r7 = t6[1], n8 = se2(r7), i6 = e6.expectedType;
return "array" !== n8.kind || 0 !== n8.N || !i6 || "array" !== i6.kind || "number" == typeof i6.N && 0 !== i6.N || (n8 = i6), new le2(n8, r7);
}, le2.prototype.evaluate = function() {
return this.value;
}, le2.prototype.eachChild = function() {
}, le2.prototype.outputDefined = function() {
return true;
}, le2.prototype.serialize = function() {
return "array" === this.type.kind || "object" === this.type.kind ? ["literal", this.value] : this.value instanceof te2 ? ["rgba"].concat(this.value.toArray()) : this.value instanceof ne2 ? this.value.serialize() : this.value;
};
var pe2 = function(t6) {
this.name = "ExpressionEvaluationError", this.message = t6;
};
pe2.prototype.toJSON = function() {
return this.message;
};
var ce2 = { string: Rt2, number: Ot2, boolean: Ut2, object: qt2 }, he2 = function(t6, e6) {
this.type = t6, this.args = e6;
};
he2.parse = function(t6, e6) {
if (t6.length < 2) {
return e6.error("Expected at least one argument.");
}
var r7, n8 = 1, i6 = t6[0];
if ("array" === i6) {
var a6, o6;
if (t6.length > 2) {
var s7 = t6[1];
if ("string" != typeof s7 || !(s7 in ce2) || "object" === s7) {
return e6.error('The item type argument of "array" must be one of string, number, boolean', 1);
}
a6 = ce2[s7], n8++;
} else {
a6 = Nt2;
}
if (t6.length > 3) {
if (null !== t6[2] && ("number" != typeof t6[2] || t6[2] < 0 || t6[2] !== Math.floor(t6[2]))) {
return e6.error('The length argument to "array" must be a positive integer literal', 2);
}
o6 = t6[2], n8++;
}
r7 = Xt2(a6, o6);
} else {
r7 = ce2[i6];
}
for (var u5 = []; n8 < t6.length; n8++) {
var l8 = e6.parse(t6[n8], n8, Nt2);
if (!l8) {
return null;
}
u5.push(l8);
}
return new he2(r7, u5);
}, he2.prototype.evaluate = function(t6) {
for (var e6 = 0; e6 < this.args.length; e6++) {
var r7 = this.args[e6].evaluate(t6);
if (!Yt2(this.type, se2(r7))) {
return r7;
}
if (e6 === this.args.length - 1) {
throw new pe2("Expected value to be of type " + Jt2(this.type) + ", but found " + Jt2(se2(r7)) + " instead.");
}
}
return null;
}, he2.prototype.eachChild = function(t6) {
this.args.forEach(t6);
}, he2.prototype.outputDefined = function() {
return this.args.every(function(t6) {
return t6.outputDefined();
});
}, he2.prototype.serialize = function() {
var t6 = this.type, e6 = [t6.kind];
if ("array" === t6.kind) {
var r7 = t6.itemType;
if ("string" === r7.kind || "number" === r7.kind || "boolean" === r7.kind) {
e6.push(r7.kind);
var n8 = t6.N;
("number" == typeof n8 || this.args.length > 1) && e6.push(n8);
}
}
return e6.concat(this.args.map(function(t7) {
return t7.serialize();
}));
};
var fe2 = function(t6) {
this.type = Gt2, this.sections = t6;
};
fe2.parse = function(t6, e6) {
if (t6.length < 2) {
return e6.error("Expected at least one argument.");
}
var r7 = t6[1];
if (!Array.isArray(r7) && "object" == typeof r7) {
return e6.error("First argument must be an image or text section.");
}
for (var n8 = [], i6 = false, a6 = 1; a6 <= t6.length - 1; ++a6) {
var o6 = t6[a6];
if (i6 && "object" == typeof o6 && !Array.isArray(o6)) {
i6 = false;
var s7 = null;
if (o6["font-scale"] && !(s7 = e6.parse(o6["font-scale"], 1, Ot2))) {
return null;
}
var u5 = null;
if (o6["text-font"] && !(u5 = e6.parse(o6["text-font"], 1, Xt2(Rt2)))) {
return null;
}
var l8 = null;
if (o6["text-color"] && !(l8 = e6.parse(o6["text-color"], 1, jt2))) {
return null;
}
var p5 = n8[n8.length - 1];
p5.scale = s7, p5.font = u5, p5.textColor = l8;
} else {
var c5 = e6.parse(t6[a6], 1, Nt2);
if (!c5) {
return null;
}
var h7 = c5.type.kind;
if ("string" !== h7 && "value" !== h7 && "null" !== h7 && "resolvedImage" !== h7) {
return e6.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");
}
i6 = true, n8.push({ content: c5, scale: null, font: null, textColor: null });
}
}
return new fe2(n8);
}, fe2.prototype.evaluate = function(t6) {
return new ne2(this.sections.map(function(e6) {
var r7 = e6.content.evaluate(t6);
return se2(r7) === Zt2 ? new re2("", r7, null, null, null) : new re2(ue2(r7), null, e6.scale ? e6.scale.evaluate(t6) : null, e6.font ? e6.font.evaluate(t6).join(",") : null, e6.textColor ? e6.textColor.evaluate(t6) : null);
}));
}, fe2.prototype.eachChild = function(t6) {
for (var e6 = 0, r7 = this.sections; e6 < r7.length; e6 += 1) {
var n8 = r7[e6];
t6(n8.content), n8.scale && t6(n8.scale), n8.font && t6(n8.font), n8.textColor && t6(n8.textColor);
}
}, fe2.prototype.outputDefined = function() {
return false;
}, fe2.prototype.serialize = function() {
for (var t6 = ["format"], e6 = 0, r7 = this.sections; e6 < r7.length; e6 += 1) {
var n8 = r7[e6];
t6.push(n8.content.serialize());
var i6 = {};
n8.scale && (i6["font-scale"] = n8.scale.serialize()), n8.font && (i6["text-font"] = n8.font.serialize()), n8.textColor && (i6["text-color"] = n8.textColor.serialize()), t6.push(i6);
}
return t6;
};
var ye2 = function(t6) {
this.type = Zt2, this.input = t6;
};
ye2.parse = function(t6, e6) {
if (2 !== t6.length) {
return e6.error("Expected two arguments.");
}
var r7 = e6.parse(t6[1], 1, Rt2);
return r7 ? new ye2(r7) : e6.error("No image name provided.");
}, ye2.prototype.evaluate = function(t6) {
var e6 = this.input.evaluate(t6), r7 = ie4.fromString(e6);
return r7 && t6.availableImages && (r7.available = t6.availableImages.indexOf(e6) > -1), r7;
}, ye2.prototype.eachChild = function(t6) {
t6(this.input);
}, ye2.prototype.outputDefined = function() {
return false;
}, ye2.prototype.serialize = function() {
return ["image", this.input.serialize()];
};
var de2 = { "to-boolean": Ut2, "to-color": jt2, "to-number": Ot2, "to-string": Rt2 }, me2 = function(t6, e6) {
this.type = t6, this.args = e6;
};
me2.parse = function(t6, e6) {
if (t6.length < 2) {
return e6.error("Expected at least one argument.");
}
var r7 = t6[0];
if (("to-boolean" === r7 || "to-string" === r7) && 2 !== t6.length) {
return e6.error("Expected one argument.");
}
for (var n8 = de2[r7], i6 = [], a6 = 1; a6 < t6.length; a6++) {
var o6 = e6.parse(t6[a6], a6, Nt2);
if (!o6) {
return null;
}
i6.push(o6);
}
return new me2(n8, i6);
}, me2.prototype.evaluate = function(t6) {
if ("boolean" === this.type.kind) {
return Boolean(this.args[0].evaluate(t6));
}
if ("color" === this.type.kind) {
for (var e6, r7, n8 = 0, i6 = this.args; n8 < i6.length; n8 += 1) {
if (r7 = null, (e6 = i6[n8].evaluate(t6)) instanceof te2) {
return e6;
}
if ("string" == typeof e6) {
var a6 = t6.parseColor(e6);
if (a6) {
return a6;
}
} else if (Array.isArray(e6) && !(r7 = e6.length < 3 || e6.length > 4 ? "Invalid rbga value " + JSON.stringify(e6) + ": expected an array containing either three or four numeric values." : ae2(e6[0], e6[1], e6[2], e6[3]))) {
return new te2(e6[0] / 255, e6[1] / 255, e6[2] / 255, e6[3]);
}
}
throw new pe2(r7 || "Could not parse color from value '" + ("string" == typeof e6 ? e6 : String(JSON.stringify(e6))) + "'");
}
if ("number" === this.type.kind) {
for (var o6 = null, s7 = 0, u5 = this.args; s7 < u5.length; s7 += 1) {
if (null === (o6 = u5[s7].evaluate(t6))) {
return 0;
}
var l8 = Number(o6);
if (!isNaN(l8)) {
return l8;
}
}
throw new pe2("Could not convert " + JSON.stringify(o6) + " to number.");
}
return "formatted" === this.type.kind ? ne2.fromString(ue2(this.args[0].evaluate(t6))) : "resolvedImage" === this.type.kind ? ie4.fromString(ue2(this.args[0].evaluate(t6))) : ue2(this.args[0].evaluate(t6));
}, me2.prototype.eachChild = function(t6) {
this.args.forEach(t6);
}, me2.prototype.outputDefined = function() {
return this.args.every(function(t6) {
return t6.outputDefined();
});
}, me2.prototype.serialize = function() {
if ("formatted" === this.type.kind) {
return new fe2([{ content: this.args[0], scale: null, font: null, textColor: null }]).serialize();
}
if ("resolvedImage" === this.type.kind) {
return new ye2(this.args[0]).serialize();
}
var t6 = ["to-" + this.type.kind];
return this.eachChild(function(e6) {
t6.push(e6.serialize());
}), t6;
};
var ve2 = ["Unknown", "Point", "LineString", "Polygon"], ge2 = function() {
this.globals = null, this.feature = null, this.featureState = null, this.formattedSection = null, this._parseColorCache = {}, this.availableImages = null, this.canonical = null;
};
ge2.prototype.id = function() {
return this.feature && "id" in this.feature ? this.feature.id : null;
}, ge2.prototype.geometryType = function() {
return this.feature ? "number" == typeof this.feature.type ? ve2[this.feature.type] : this.feature.type : null;
}, ge2.prototype.geometry = function() {
return this.feature && "geometry" in this.feature ? this.feature.geometry : null;
}, ge2.prototype.canonicalID = function() {
return this.canonical;
}, ge2.prototype.properties = function() {
return this.feature && this.feature.properties || {};
}, ge2.prototype.parseColor = function(t6) {
var e6 = this._parseColorCache[t6];
return e6 || (e6 = this._parseColorCache[t6] = te2.parse(t6)), e6;
};
var xe2 = function(t6, e6, r7, n8) {
this.name = t6, this.type = e6, this._evaluate = r7, this.args = n8;
};
xe2.prototype.evaluate = function(t6) {
return this._evaluate(t6, this.args);
}, xe2.prototype.eachChild = function(t6) {
this.args.forEach(t6);
}, xe2.prototype.outputDefined = function() {
return false;
}, xe2.prototype.serialize = function() {
return [this.name].concat(this.args.map(function(t6) {
return t6.serialize();
}));
}, xe2.parse = function(t6, e6) {
var r7, n8 = t6[0], i6 = xe2.definitions[n8];
if (!i6) {
return e6.error('Unknown expression "' + n8 + '". If you wanted a literal array, use ["literal", [...]].', 0);
}
for (var a6 = Array.isArray(i6) ? i6[0] : i6.type, o6 = Array.isArray(i6) ? [[i6[1], i6[2]]] : i6.overloads, s7 = o6.filter(function(e7) {
var r8 = e7[0];
return !Array.isArray(r8) || r8.length === t6.length - 1;
}), u5 = null, l8 = 0, p5 = s7; l8 < p5.length; l8 += 1) {
var c5 = p5[l8], h7 = c5[0], f5 = c5[1];
u5 = new je2(e6.registry, e6.path, null, e6.scope);
for (var y5 = [], d5 = false, m5 = 1; m5 < t6.length; m5++) {
var v5 = t6[m5], g5 = Array.isArray(h7) ? h7[m5 - 1] : h7.type, x5 = u5.parse(v5, 1 + y5.length, g5);
if (!x5) {
d5 = true;
break;
}
y5.push(x5);
}
if (!d5) {
if (Array.isArray(h7) && h7.length !== y5.length) {
u5.error("Expected " + h7.length + " arguments, but found " + y5.length + " instead.");
} else {
for (var b5 = 0; b5 < y5.length; b5++) {
var w5 = Array.isArray(h7) ? h7[b5] : h7.type, _4 = y5[b5];
u5.concat(b5 + 1).checkSubtype(w5, _4.type);
}
if (0 === u5.errors.length) {
return new xe2(n8, a6, f5, y5);
}
}
}
}
if (1 === s7.length) {
(r7 = e6.errors).push.apply(r7, u5.errors);
} else {
for (var A5 = (s7.length ? s7 : o6).map(function(t7) {
var e7;
return e7 = t7[0], Array.isArray(e7) ? "(" + e7.map(Jt2).join(", ") + ")" : "(" + Jt2(e7.type) + "...)";
}).join(" | "), S5 = [], k5 = 1; k5 < t6.length; k5++) {
var I5 = e6.parse(t6[k5], 1 + S5.length);
if (!I5) {
return null;
}
S5.push(Jt2(I5.type));
}
e6.error("Expected arguments of type " + A5 + ", but found (" + S5.join(", ") + ") instead.");
}
return null;
}, xe2.register = function(t6, e6) {
for (var r7 in xe2.definitions = e6, e6) {
t6[r7] = xe2;
}
};
var be2 = function(t6, e6, r7) {
this.type = Kt2, this.locale = r7, this.caseSensitive = t6, this.diacriticSensitive = e6;
};
function we2(t6, e6) {
t6[0] = Math.min(t6[0], e6[0]), t6[1] = Math.min(t6[1], e6[1]), t6[2] = Math.max(t6[2], e6[0]), t6[3] = Math.max(t6[3], e6[1]);
}
function _e2(t6, e6) {
return !(t6[0] <= e6[0] || t6[2] >= e6[2] || t6[1] <= e6[1] || t6[3] >= e6[3]);
}
function Ae2(t6, e6) {
var r7 = (180 + t6[0]) / 360, n8 = (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + t6[1] * Math.PI / 360))) / 360, i6 = Math.pow(2, e6.z);
return [Math.round(r7 * i6 * 8192), Math.round(n8 * i6 * 8192)];
}
function Se2(t6, e6, r7) {
return e6[1] > t6[1] != r7[1] > t6[1] && t6[0] < (r7[0] - e6[0]) * (t6[1] - e6[1]) / (r7[1] - e6[1]) + e6[0];
}
function ke2(t6, e6) {
for (var r7, n8, i6, a6, o6, s7, u5, l8 = false, p5 = 0, c5 = e6.length; p5 < c5; p5++) {
for (var h7 = e6[p5], f5 = 0, y5 = h7.length; f5 < y5 - 1; f5++) {
if ((a6 = (r7 = t6)[0] - (n8 = h7[f5])[0]) * (u5 = r7[1] - (i6 = h7[f5 + 1])[1]) - (s7 = r7[0] - i6[0]) * (o6 = r7[1] - n8[1]) == 0 && a6 * s7 <= 0 && o6 * u5 <= 0) {
return false;
}
Se2(t6, h7[f5], h7[f5 + 1]) && (l8 = !l8);
}
}
return l8;
}
function Ie2(t6, e6) {
for (var r7 = 0; r7 < e6.length; r7++) {
if (ke2(t6, e6[r7])) {
return true;
}
}
return false;
}
function ze2(t6, e6, r7, n8) {
var i6 = n8[0] - r7[0], a6 = n8[1] - r7[1], o6 = (t6[0] - r7[0]) * a6 - i6 * (t6[1] - r7[1]), s7 = (e6[0] - r7[0]) * a6 - i6 * (e6[1] - r7[1]);
return o6 > 0 && s7 < 0 || o6 < 0 && s7 > 0;
}
function Ce2(t6, e6, r7) {
for (var n8 = 0, i6 = r7; n8 < i6.length; n8 += 1) {
for (var a6 = i6[n8], o6 = 0; o6 < a6.length - 1; ++o6) {
if (0 != (c5 = [(p5 = a6[o6 + 1])[0] - (l8 = a6[o6])[0], p5[1] - l8[1]])[0] * (h7 = [(u5 = e6)[0] - (s7 = t6)[0], u5[1] - s7[1]])[1] - c5[1] * h7[0] && ze2(s7, u5, l8, p5) && ze2(l8, p5, s7, u5)) {
return true;
}
}
}
var s7, u5, l8, p5, c5, h7;
return false;
}
function Ee2(t6, e6) {
for (var r7 = 0; r7 < t6.length; ++r7) {
if (!ke2(t6[r7], e6)) {
return false;
}
}
for (var n8 = 0; n8 < t6.length - 1; ++n8) {
if (Ce2(t6[n8], t6[n8 + 1], e6)) {
return false;
}
}
return true;
}
function Pe2(t6, e6) {
for (var r7 = 0; r7 < e6.length; r7++) {
if (Ee2(t6, e6[r7])) {
return true;
}
}
return false;
}
function Me2(t6, e6, r7) {
for (var n8 = [], i6 = 0; i6 < t6.length; i6++) {
for (var a6 = [], o6 = 0; o6 < t6[i6].length; o6++) {
var s7 = Ae2(t6[i6][o6], r7);
we2(e6, s7), a6.push(s7);
}
n8.push(a6);
}
return n8;
}
function Be2(t6, e6, r7) {
for (var n8 = [], i6 = 0; i6 < t6.length; i6++) {
var a6 = Me2(t6[i6], e6, r7);
n8.push(a6);
}
return n8;
}
function Te2(t6, e6, r7, n8) {
if (t6[0] < r7[0] || t6[0] > r7[2]) {
var i6 = 0.5 * n8, a6 = t6[0] - r7[0] > i6 ? -n8 : r7[0] - t6[0] > i6 ? n8 : 0;
0 === a6 && (a6 = t6[0] - r7[2] > i6 ? -n8 : r7[2] - t6[0] > i6 ? n8 : 0), t6[0] += a6;
}
we2(e6, t6);
}
function Ve2(t6, e6, r7, n8) {
for (var i6 = 8192 * Math.pow(2, n8.z), a6 = [8192 * n8.x, 8192 * n8.y], o6 = [], s7 = 0, u5 = t6; s7 < u5.length; s7 += 1) {
for (var l8 = 0, p5 = u5[s7]; l8 < p5.length; l8 += 1) {
var c5 = p5[l8], h7 = [c5.x + a6[0], c5.y + a6[1]];
Te2(h7, e6, r7, i6), o6.push(h7);
}
}
return o6;
}
function Fe2(t6, e6, r7, n8) {
for (var i6, a6 = 8192 * Math.pow(2, n8.z), o6 = [8192 * n8.x, 8192 * n8.y], s7 = [], u5 = 0, l8 = t6; u5 < l8.length; u5 += 1) {
for (var p5 = [], c5 = 0, h7 = l8[u5]; c5 < h7.length; c5 += 1) {
var f5 = h7[c5], y5 = [f5.x + o6[0], f5.y + o6[1]];
we2(e6, y5), p5.push(y5);
}
s7.push(p5);
}
if (e6[2] - e6[0] <= a6 / 2) {
(i6 = e6)[0] = i6[1] = 1 / 0, i6[2] = i6[3] = -1 / 0;
for (var d5 = 0, m5 = s7; d5 < m5.length; d5 += 1) {
for (var v5 = 0, g5 = m5[d5]; v5 < g5.length; v5 += 1) {
Te2(g5[v5], e6, r7, a6);
}
}
}
return s7;
}
be2.parse = function(t6, e6) {
if (2 !== t6.length) {
return e6.error("Expected one argument.");
}
var r7 = t6[1];
if ("object" != typeof r7 || Array.isArray(r7)) {
return e6.error("Collator options argument must be an object.");
}
var n8 = e6.parse(void 0 !== r7["case-sensitive"] && r7["case-sensitive"], 1, Ut2);
if (!n8) {
return null;
}
var i6 = e6.parse(void 0 !== r7["diacritic-sensitive"] && r7["diacritic-sensitive"], 1, Ut2);
if (!i6) {
return null;
}
var a6 = null;
return r7.locale && !(a6 = e6.parse(r7.locale, 1, Rt2)) ? null : new be2(n8, i6, a6);
}, be2.prototype.evaluate = function(t6) {
return new ee2(this.caseSensitive.evaluate(t6), this.diacriticSensitive.evaluate(t6), this.locale ? this.locale.evaluate(t6) : null);
}, be2.prototype.eachChild = function(t6) {
t6(this.caseSensitive), t6(this.diacriticSensitive), this.locale && t6(this.locale);
}, be2.prototype.outputDefined = function() {
return false;
}, be2.prototype.serialize = function() {
var t6 = {};
return t6["case-sensitive"] = this.caseSensitive.serialize(), t6["diacritic-sensitive"] = this.diacriticSensitive.serialize(), this.locale && (t6.locale = this.locale.serialize()), ["collator", t6];
};
var De2 = function(t6, e6) {
this.type = Ut2, this.geojson = t6, this.geometries = e6;
};
function Le2(t6) {
if (t6 instanceof xe2) {
if ("get" === t6.name && 1 === t6.args.length) {
return false;
}
if ("feature-state" === t6.name) {
return false;
}
if ("has" === t6.name && 1 === t6.args.length) {
return false;
}
if ("properties" === t6.name || "geometry-type" === t6.name || "id" === t6.name) {
return false;
}
if (/^filter-/.test(t6.name)) {
return false;
}
}
if (t6 instanceof De2) {
return false;
}
var e6 = true;
return t6.eachChild(function(t7) {
e6 && !Le2(t7) && (e6 = false);
}), e6;
}
function Oe2(t6) {
if (t6 instanceof xe2 && "feature-state" === t6.name) {
return false;
}
var e6 = true;
return t6.eachChild(function(t7) {
e6 && !Oe2(t7) && (e6 = false);
}), e6;
}
function Re2(t6, e6) {
if (t6 instanceof xe2 && e6.indexOf(t6.name) >= 0) {
return false;
}
var r7 = true;
return t6.eachChild(function(t7) {
r7 && !Re2(t7, e6) && (r7 = false);
}), r7;
}
De2.parse = function(t6, e6) {
if (2 !== t6.length) {
return e6.error("'within' expression requires exactly one argument, but found " + (t6.length - 1) + " instead.");
}
if (oe2(t6[1])) {
var r7 = t6[1];
if ("FeatureCollection" === r7.type) {
for (var n8 = 0; n8 < r7.features.length; ++n8) {
var i6 = r7.features[n8].geometry.type;
if ("Polygon" === i6 || "MultiPolygon" === i6) {
return new De2(r7, r7.features[n8].geometry);
}
}
} else if ("Feature" === r7.type) {
var a6 = r7.geometry.type;
if ("Polygon" === a6 || "MultiPolygon" === a6) {
return new De2(r7, r7.geometry);
}
} else if ("Polygon" === r7.type || "MultiPolygon" === r7.type) {
return new De2(r7, r7);
}
}
return e6.error("'within' expression requires valid geojson object that contains polygon geometry type.");
}, De2.prototype.evaluate = function(t6) {
if (null != t6.geometry() && null != t6.canonicalID()) {
if ("Point" === t6.geometryType()) {
return function(t7, e6) {
var r7 = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n8 = [1 / 0, 1 / 0, -1 / 0, -1 / 0], i6 = t7.canonicalID();
if ("Polygon" === e6.type) {
var a6 = Me2(e6.coordinates, n8, i6), o6 = Ve2(t7.geometry(), r7, n8, i6);
if (!_e2(r7, n8)) {
return false;
}
for (var s7 = 0, u5 = o6; s7 < u5.length; s7 += 1) {
if (!ke2(u5[s7], a6)) {
return false;
}
}
}
if ("MultiPolygon" === e6.type) {
var l8 = Be2(e6.coordinates, n8, i6), p5 = Ve2(t7.geometry(), r7, n8, i6);
if (!_e2(r7, n8)) {
return false;
}
for (var c5 = 0, h7 = p5; c5 < h7.length; c5 += 1) {
if (!Ie2(h7[c5], l8)) {
return false;
}
}
}
return true;
}(t6, this.geometries);
}
if ("LineString" === t6.geometryType()) {
return function(t7, e6) {
var r7 = [1 / 0, 1 / 0, -1 / 0, -1 / 0], n8 = [1 / 0, 1 / 0, -1 / 0, -1 / 0], i6 = t7.canonicalID();
if ("Polygon" === e6.type) {
var a6 = Me2(e6.coordinates, n8, i6), o6 = Fe2(t7.geometry(), r7, n8, i6);
if (!_e2(r7, n8)) {
return false;
}
for (var s7 = 0, u5 = o6; s7 < u5.length; s7 += 1) {
if (!Ee2(u5[s7], a6)) {
return false;
}
}
}
if ("MultiPolygon" === e6.type) {
var l8 = Be2(e6.coordinates, n8, i6), p5 = Fe2(t7.geometry(), r7, n8, i6);
if (!_e2(r7, n8)) {
return false;
}
for (var c5 = 0, h7 = p5; c5 < h7.length; c5 += 1) {
if (!Pe2(h7[c5], l8)) {
return false;
}
}
}
return true;
}(t6, this.geometries);
}
}
return false;
}, De2.prototype.eachChild = function() {
}, De2.prototype.outputDefined = function() {
return true;
}, De2.prototype.serialize = function() {
return ["within", this.geojson];
};
var Ue2 = function(t6, e6) {
this.type = e6.type, this.name = t6, this.boundExpression = e6;
};
Ue2.parse = function(t6, e6) {
if (2 !== t6.length || "string" != typeof t6[1]) {
return e6.error("'var' expression requires exactly one string literal argument.");
}
var r7 = t6[1];
return e6.scope.has(r7) ? new Ue2(r7, e6.scope.get(r7)) : e6.error('Unknown variable "' + r7 + '". Make sure "' + r7 + '" has been bound in an enclosing "let" expression before using it.', 1);
}, Ue2.prototype.evaluate = function(t6) {
return this.boundExpression.evaluate(t6);
}, Ue2.prototype.eachChild = function() {
}, Ue2.prototype.outputDefined = function() {
return false;
}, Ue2.prototype.serialize = function() {
return ["var", this.name];
};
var je2 = function(t6, e6, r7, n8, i6) {
void 0 === e6 && (e6 = []), void 0 === n8 && (n8 = new Dt2()), void 0 === i6 && (i6 = []), this.registry = t6, this.path = e6, this.key = e6.map(function(t7) {
return "[" + t7 + "]";
}).join(""), this.scope = n8, this.errors = i6, this.expectedType = r7;
};
function qe2(t6, e6) {
for (var r7, n8 = t6.length - 1, i6 = 0, a6 = n8, o6 = 0; i6 <= a6; ) {
if ((r7 = t6[o6 = Math.floor((i6 + a6) / 2)]) <= e6) {
if (o6 === n8 || e6 < t6[o6 + 1]) {
return o6;
}
i6 = o6 + 1;
} else {
if (!(r7 > e6)) {
throw new pe2("Input is not a number.");
}
a6 = o6 - 1;
}
}
return 0;
}
je2.prototype.parse = function(t6, e6, r7, n8, i6) {
return void 0 === i6 && (i6 = {}), e6 ? this.concat(e6, r7, n8)._parse(t6, i6) : this._parse(t6, i6);
}, je2.prototype._parse = function(t6, e6) {
function r7(t7, e7, r8) {
return "assert" === r8 ? new he2(e7, [t7]) : "coerce" === r8 ? new me2(e7, [t7]) : t7;
}
if (null !== t6 && "string" != typeof t6 && "boolean" != typeof t6 && "number" != typeof t6 || (t6 = ["literal", t6]), Array.isArray(t6)) {
if (0 === t6.length) {
return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');
}
var n8 = t6[0];
if ("string" != typeof n8) {
return this.error("Expression name must be a string, but found " + typeof n8 + ' instead. If you wanted a literal array, use ["literal", [...]].', 0), null;
}
var i6 = this.registry[n8];
if (i6) {
var a6 = i6.parse(t6, this);
if (!a6) {
return null;
}
if (this.expectedType) {
var o6 = this.expectedType, s7 = a6.type;
if ("string" !== o6.kind && "number" !== o6.kind && "boolean" !== o6.kind && "object" !== o6.kind && "array" !== o6.kind || "value" !== s7.kind) {
if ("color" !== o6.kind && "formatted" !== o6.kind && "resolvedImage" !== o6.kind || "value" !== s7.kind && "string" !== s7.kind) {
if (this.checkSubtype(o6, s7)) {
return null;
}
} else {
a6 = r7(a6, o6, e6.typeAnnotation || "coerce");
}
} else {
a6 = r7(a6, o6, e6.typeAnnotation || "assert");
}
}
if (!(a6 instanceof le2) && "resolvedImage" !== a6.type.kind && function t7(e7) {
if (e7 instanceof Ue2) {
return t7(e7.boundExpression);
}
if (e7 instanceof xe2 && "error" === e7.name) {
return false;
}
if (e7 instanceof be2) {
return false;
}
if (e7 instanceof De2) {
return false;
}
var r8 = e7 instanceof me2 || e7 instanceof he2, n9 = true;
return e7.eachChild(function(e8) {
n9 = r8 ? n9 && t7(e8) : n9 && e8 instanceof le2;
}), !!n9 && Le2(e7) && Re2(e7, ["zoom", "heatmap-density", "line-progress", "accumulated", "is-supported-script"]);
}(a6)) {
var u5 = new ge2();
try {
a6 = new le2(a6.type, a6.evaluate(u5));
} catch (t$1) {
return this.error(t$1.message), null;
}
}
return a6;
}
return this.error('Unknown expression "' + n8 + '". If you wanted a literal array, use ["literal", [...]].', 0);
}
return this.error(void 0 === t6 ? "'undefined' value invalid. Use null instead." : "object" == typeof t6 ? 'Bare objects invalid. Use ["literal", {...}] instead.' : "Expected an array, but found " + typeof t6 + " instead.");
}, je2.prototype.concat = function(t6, e6, r7) {
var n8 = "number" == typeof t6 ? this.path.concat(t6) : this.path, i6 = r7 ? this.scope.concat(r7) : this.scope;
return new je2(this.registry, n8, e6 || null, i6, this.errors);
}, je2.prototype.error = function(t6) {
var arguments$1 = arguments;
for (var e6 = [], r7 = arguments.length - 1; r7-- > 0; ) {
e6[r7] = arguments$1[r7 + 1];
}
var n8 = "" + this.key + e6.map(function(t7) {
return "[" + t7 + "]";
}).join("");
this.errors.push(new Ft2(n8, t6));
}, je2.prototype.checkSubtype = function(t6, e6) {
var r7 = Yt2(t6, e6);
return r7 && this.error(r7), r7;
};
var Ne2 = function(t6, e6, r7) {
this.type = t6, this.input = e6, this.labels = [], this.outputs = [];
for (var n8 = 0, i6 = r7; n8 < i6.length; n8 += 1) {
var a6 = i6[n8], o6 = a6[1];
this.labels.push(a6[0]), this.outputs.push(o6);
}
};
function Ke2(t6, e6, r7) {
return t6 * (1 - r7) + e6 * r7;
}
Ne2.parse = function(t6, e6) {
if (t6.length - 1 < 4) {
return e6.error("Expected at least 4 arguments, but found only " + (t6.length - 1) + ".");
}
if ((t6.length - 1) % 2 != 0) {
return e6.error("Expected an even number of arguments.");
}
var r7 = e6.parse(t6[1], 1, Ot2);
if (!r7) {
return null;
}
var n8 = [], i6 = null;
e6.expectedType && "value" !== e6.expectedType.kind && (i6 = e6.expectedType);
for (var a6 = 1; a6 < t6.length; a6 += 2) {
var o6 = 1 === a6 ? -1 / 0 : t6[a6], s7 = t6[a6 + 1], u5 = a6, l8 = a6 + 1;
if ("number" != typeof o6) {
return e6.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.', u5);
}
if (n8.length && n8[n8.length - 1][0] >= o6) {
return e6.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.', u5);
}
var p5 = e6.parse(s7, l8, i6);
if (!p5) {
return null;
}
i6 = i6 || p5.type, n8.push([o6, p5]);
}
return new Ne2(i6, r7, n8);
}, Ne2.prototype.evaluate = function(t6) {
var e6 = this.labels, r7 = this.outputs;
if (1 === e6.length) {
return r7[0].evaluate(t6);
}
var n8 = this.input.evaluate(t6);
if (n8 <= e6[0]) {
return r7[0].evaluate(t6);
}
var i6 = e6.length;
return n8 >= e6[i6 - 1] ? r7[i6 - 1].evaluate(t6) : r7[qe2(e6, n8)].evaluate(t6);
}, Ne2.prototype.eachChild = function(t6) {
t6(this.input);
for (var e6 = 0, r7 = this.outputs; e6 < r7.length; e6 += 1) {
t6(r7[e6]);
}
}, Ne2.prototype.outputDefined = function() {
return this.outputs.every(function(t6) {
return t6.outputDefined();
});
}, Ne2.prototype.serialize = function() {
for (var t6 = ["step", this.input.serialize()], e6 = 0; e6 < this.labels.length; e6++) {
e6 > 0 && t6.push(this.labels[e6]), t6.push(this.outputs[e6].serialize());
}
return t6;
};
var Ge2 = Object.freeze({ __proto__: null, number: Ke2, color: function(t6, e6, r7) {
return new te2(Ke2(t6.r, e6.r, r7), Ke2(t6.g, e6.g, r7), Ke2(t6.b, e6.b, r7), Ke2(t6.a, e6.a, r7));
}, array: function(t6, e6, r7) {
return t6.map(function(t7, n8) {
return Ke2(t7, e6[n8], r7);
});
} }), Ze2 = 6 / 29 * 3 * (6 / 29), Xe2 = Math.PI / 180, Je2 = 180 / Math.PI;
function He2(t6) {
return t6 > 0.008856451679035631 ? Math.pow(t6, 1 / 3) : t6 / Ze2 + 4 / 29;
}
function Ye2(t6) {
return t6 > 6 / 29 ? t6 * t6 * t6 : Ze2 * (t6 - 4 / 29);
}
function $e2(t6) {
return 255 * (t6 <= 31308e-7 ? 12.92 * t6 : 1.055 * Math.pow(t6, 1 / 2.4) - 0.055);
}
function We2(t6) {
return (t6 /= 255) <= 0.04045 ? t6 / 12.92 : Math.pow((t6 + 0.055) / 1.055, 2.4);
}
function Qe2(t6) {
var e6 = We2(t6.r), r7 = We2(t6.g), n8 = We2(t6.b), i6 = He2((0.4124564 * e6 + 0.3575761 * r7 + 0.1804375 * n8) / 0.95047), a6 = He2((0.2126729 * e6 + 0.7151522 * r7 + 0.072175 * n8) / 1);
return { l: 116 * a6 - 16, a: 500 * (i6 - a6), b: 200 * (a6 - He2((0.0193339 * e6 + 0.119192 * r7 + 0.9503041 * n8) / 1.08883)), alpha: t6.a };
}
function tr2(t6) {
var e6 = (t6.l + 16) / 116, r7 = isNaN(t6.a) ? e6 : e6 + t6.a / 500, n8 = isNaN(t6.b) ? e6 : e6 - t6.b / 200;
return e6 = 1 * Ye2(e6), r7 = 0.95047 * Ye2(r7), n8 = 1.08883 * Ye2(n8), new te2($e2(3.2404542 * r7 - 1.5371385 * e6 - 0.4985314 * n8), $e2(-0.969266 * r7 + 1.8760108 * e6 + 0.041556 * n8), $e2(0.0556434 * r7 - 0.2040259 * e6 + 1.0572252 * n8), t6.alpha);
}
function er(t6, e6, r7) {
var n8 = e6 - t6;
return t6 + r7 * (n8 > 180 || n8 < -180 ? n8 - 360 * Math.round(n8 / 360) : n8);
}
var rr = { forward: Qe2, reverse: tr2, interpolate: function(t6, e6, r7) {
return { l: Ke2(t6.l, e6.l, r7), a: Ke2(t6.a, e6.a, r7), b: Ke2(t6.b, e6.b, r7), alpha: Ke2(t6.alpha, e6.alpha, r7) };
} }, nr = { forward: function(t6) {
var e6 = Qe2(t6), r7 = e6.l, n8 = e6.a, i6 = e6.b, a6 = Math.atan2(i6, n8) * Je2;
return { h: a6 < 0 ? a6 + 360 : a6, c: Math.sqrt(n8 * n8 + i6 * i6), l: r7, alpha: t6.a };
}, reverse: function(t6) {
var e6 = t6.h * Xe2, r7 = t6.c;
return tr2({ l: t6.l, a: Math.cos(e6) * r7, b: Math.sin(e6) * r7, alpha: t6.alpha });
}, interpolate: function(t6, e6, r7) {
return { h: er(t6.h, e6.h, r7), c: Ke2(t6.c, e6.c, r7), l: Ke2(t6.l, e6.l, r7), alpha: Ke2(t6.alpha, e6.alpha, r7) };
} }, ir = Object.freeze({ __proto__: null, lab: rr, hcl: nr }), ar = function(t6, e6, r7, n8, i6) {
this.type = t6, this.operator = e6, this.interpolation = r7, this.input = n8, this.labels = [], this.outputs = [];
for (var a6 = 0, o6 = i6; a6 < o6.length; a6 += 1) {
var s7 = o6[a6], u5 = s7[1];
this.labels.push(s7[0]), this.outputs.push(u5);
}
};
function or(t6, e6, r7, n8) {
var i6 = n8 - r7, a6 = t6 - r7;
return 0 === i6 ? 0 : 1 === e6 ? a6 / i6 : (Math.pow(e6, a6) - 1) / (Math.pow(e6, i6) - 1);
}
ar.interpolationFactor = function(t6, e6, n8, i6) {
var a6 = 0;
if ("exponential" === t6.name) {
a6 = or(e6, t6.base, n8, i6);
} else if ("linear" === t6.name) {
a6 = or(e6, 1, n8, i6);
} else if ("cubic-bezier" === t6.name) {
var o6 = t6.controlPoints;
a6 = new r6(o6[0], o6[1], o6[2], o6[3]).solve(or(e6, 1, n8, i6));
}
return a6;
}, ar.parse = function(t6, e6) {
var r7 = t6[0], n8 = t6[1], i6 = t6[2], a6 = t6.slice(3);
if (!Array.isArray(n8) || 0 === n8.length) {
return e6.error("Expected an interpolation type expression.", 1);
}
if ("linear" === n8[0]) {
n8 = { name: "linear" };
} else if ("exponential" === n8[0]) {
var o6 = n8[1];
if ("number" != typeof o6) {
return e6.error("Exponential interpolation requires a numeric base.", 1, 1);
}
n8 = { name: "exponential", base: o6 };
} else {
if ("cubic-bezier" !== n8[0]) {
return e6.error("Unknown interpolation type " + String(n8[0]), 1, 0);
}
var s7 = n8.slice(1);
if (4 !== s7.length || s7.some(function(t7) {
return "number" != typeof t7 || t7 < 0 || t7 > 1;
})) {
return e6.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.", 1);
}
n8 = { name: "cubic-bezier", controlPoints: s7 };
}
if (t6.length - 1 < 4) {
return e6.error("Expected at least 4 arguments, but found only " + (t6.length - 1) + ".");
}
if ((t6.length - 1) % 2 != 0) {
return e6.error("Expected an even number of arguments.");
}
if (!(i6 = e6.parse(i6, 2, Ot2))) {
return null;
}
var u5 = [], l8 = null;
"interpolate-hcl" === r7 || "interpolate-lab" === r7 ? l8 = jt2 : e6.expectedType && "value" !== e6.expectedType.kind && (l8 = e6.expectedType);
for (var p5 = 0; p5 < a6.length; p5 += 2) {
var c5 = a6[p5], h7 = a6[p5 + 1], f5 = p5 + 3, y5 = p5 + 4;
if ("number" != typeof c5) {
return e6.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.', f5);
}
if (u5.length && u5[u5.length - 1][0] >= c5) {
return e6.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.', f5);
}
var d5 = e6.parse(h7, y5, l8);
if (!d5) {
return null;
}
l8 = l8 || d5.type, u5.push([c5, d5]);
}
return "number" === l8.kind || "color" === l8.kind || "array" === l8.kind && "number" === l8.itemType.kind && "number" == typeof l8.N ? new ar(l8, r7, n8, i6, u5) : e6.error("Type " + Jt2(l8) + " is not interpolatable.");
}, ar.prototype.evaluate = function(t6) {
var e6 = this.labels, r7 = this.outputs;
if (1 === e6.length) {
return r7[0].evaluate(t6);
}
var n8 = this.input.evaluate(t6);
if (n8 <= e6[0]) {
return r7[0].evaluate(t6);
}
var i6 = e6.length;
if (n8 >= e6[i6 - 1]) {
return r7[i6 - 1].evaluate(t6);
}
var a6 = qe2(e6, n8), o6 = ar.interpolationFactor(this.interpolation, n8, e6[a6], e6[a6 + 1]), s7 = r7[a6].evaluate(t6), u5 = r7[a6 + 1].evaluate(t6);
return "interpolate" === this.operator ? Ge2[this.type.kind.toLowerCase()](s7, u5, o6) : "interpolate-hcl" === this.operator ? nr.reverse(nr.interpolate(nr.forward(s7), nr.forward(u5), o6)) : rr.reverse(rr.interpolate(rr.forward(s7), rr.forward(u5), o6));
}, ar.prototype.eachChild = function(t6) {
t6(this.input);
for (var e6 = 0, r7 = this.outputs; e6 < r7.length; e6 += 1) {
t6(r7[e6]);
}
}, ar.prototype.outputDefined = function() {
return this.outputs.every(function(t6) {
return t6.outputDefined();
});
}, ar.prototype.serialize = function() {
var t6;
t6 = "linear" === this.interpolation.name ? ["linear"] : "exponential" === this.interpolation.name ? 1 === this.interpolation.base ? ["linear"] : ["exponential", this.interpolation.base] : ["cubic-bezier"].concat(this.interpolation.controlPoints);
for (var e6 = [this.operator, t6, this.input.serialize()], r7 = 0; r7 < this.labels.length; r7++) {
e6.push(this.labels[r7], this.outputs[r7].serialize());
}
return e6;
};
var sr = function(t6, e6) {
this.type = t6, this.args = e6;
};
sr.parse = function(t6, e6) {
if (t6.length < 2) {
return e6.error("Expectected at least one argument.");
}
var r7 = null, n8 = e6.expectedType;
n8 && "value" !== n8.kind && (r7 = n8);
for (var i6 = [], a6 = 0, o6 = t6.slice(1); a6 < o6.length; a6 += 1) {
var s7 = e6.parse(o6[a6], 1 + i6.length, r7, void 0, { typeAnnotation: "omit" });
if (!s7) {
return null;
}
r7 = r7 || s7.type, i6.push(s7);
}
var u5 = n8 && i6.some(function(t7) {
return Yt2(n8, t7.type);
});
return new sr(u5 ? Nt2 : r7, i6);
}, sr.prototype.evaluate = function(t6) {
for (var e6, r7 = null, n8 = 0, i6 = 0, a6 = this.args; i6 < a6.length && (n8++, (r7 = a6[i6].evaluate(t6)) && r7 instanceof ie4 && !r7.available && (e6 || (e6 = r7.name), r7 = null, n8 === this.args.length && (r7 = e6)), null === r7); i6 += 1) {
}
return r7;
}, sr.prototype.eachChild = function(t6) {
this.args.forEach(t6);
}, sr.prototype.outputDefined = function() {
return this.args.every(function(t6) {
return t6.outputDefined();
});
}, sr.prototype.serialize = function() {
var t6 = ["coalesce"];
return this.eachChild(function(e6) {
t6.push(e6.serialize());
}), t6;
};
var ur = function(t6, e6) {
this.type = e6.type, this.bindings = [].concat(t6), this.result = e6;
};
ur.prototype.evaluate = function(t6) {
return this.result.evaluate(t6);
}, ur.prototype.eachChild = function(t6) {
for (var e6 = 0, r7 = this.bindings; e6 < r7.length; e6 += 1) {
t6(r7[e6][1]);
}
t6(this.result);
}, ur.parse = function(t6, e6) {
if (t6.length < 4) {
return e6.error("Expected at least 3 arguments, but found " + (t6.length - 1) + " instead.");
}
for (var r7 = [], n8 = 1; n8 < t6.length - 1; n8 += 2) {
var i6 = t6[n8];
if ("string" != typeof i6) {
return e6.error("Expected string, but found " + typeof i6 + " instead.", n8);
}
if (/[^a-zA-Z0-9_]/.test(i6)) {
return e6.error("Variable names must contain only alphanumeric characters or '_'.", n8);
}
var a6 = e6.parse(t6[n8 + 1], n8 + 1);
if (!a6) {
return null;
}
r7.push([i6, a6]);
}
var o6 = e6.parse(t6[t6.length - 1], t6.length - 1, e6.expectedType, r7);
return o6 ? new ur(r7, o6) : null;
}, ur.prototype.outputDefined = function() {
return this.result.outputDefined();
}, ur.prototype.serialize = function() {
for (var t6 = ["let"], e6 = 0, r7 = this.bindings; e6 < r7.length; e6 += 1) {
var n8 = r7[e6];
t6.push(n8[0], n8[1].serialize());
}
return t6.push(this.result.serialize()), t6;
};
var lr = function(t6, e6, r7) {
this.type = t6, this.index = e6, this.input = r7;
};
lr.parse = function(t6, e6) {
if (3 !== t6.length) {
return e6.error("Expected 2 arguments, but found " + (t6.length - 1) + " instead.");
}
var r7 = e6.parse(t6[1], 1, Ot2), n8 = e6.parse(t6[2], 2, Xt2(e6.expectedType || Nt2));
return r7 && n8 ? new lr(n8.type.itemType, r7, n8) : null;
}, lr.prototype.evaluate = function(t6) {
var e6 = this.index.evaluate(t6), r7 = this.input.evaluate(t6);
if (e6 < 0) {
throw new pe2("Array index out of bounds: " + e6 + " < 0.");
}
if (e6 >= r7.length) {
throw new pe2("Array index out of bounds: " + e6 + " > " + (r7.length - 1) + ".");
}
if (e6 !== Math.floor(e6)) {
throw new pe2("Array index must be an integer, but found " + e6 + " instead.");
}
return r7[e6];
}, lr.prototype.eachChild = function(t6) {
t6(this.index), t6(this.input);
}, lr.prototype.outputDefined = function() {
return false;
}, lr.prototype.serialize = function() {
return ["at", this.index.serialize(), this.input.serialize()];
};
var pr = function(t6, e6) {
this.type = Ut2, this.needle = t6, this.haystack = e6;
};
pr.parse = function(t6, e6) {
if (3 !== t6.length) {
return e6.error("Expected 2 arguments, but found " + (t6.length - 1) + " instead.");
}
var r7 = e6.parse(t6[1], 1, Nt2), n8 = e6.parse(t6[2], 2, Nt2);
return r7 && n8 ? $t2(r7.type, [Ut2, Rt2, Ot2, Lt2, Nt2]) ? new pr(r7, n8) : e6.error("Expected first argument to be of type boolean, string, number or null, but found " + Jt2(r7.type) + " instead") : null;
}, pr.prototype.evaluate = function(t6) {
var e6 = this.needle.evaluate(t6), r7 = this.haystack.evaluate(t6);
if (!r7) {
return false;
}
if (!Wt2(e6, ["boolean", "string", "number", "null"])) {
throw new pe2("Expected first argument to be of type boolean, string, number or null, but found " + Jt2(se2(e6)) + " instead.");
}
if (!Wt2(r7, ["string", "array"])) {
throw new pe2("Expected second argument to be of type array or string, but found " + Jt2(se2(r7)) + " instead.");
}
return r7.indexOf(e6) >= 0;
}, pr.prototype.eachChild = function(t6) {
t6(this.needle), t6(this.haystack);
}, pr.prototype.outputDefined = function() {
return true;
}, pr.prototype.serialize = function() {
return ["in", this.needle.serialize(), this.haystack.serialize()];
};
var cr = function(t6, e6, r7) {
this.type = Ot2, this.needle = t6, this.haystack = e6, this.fromIndex = r7;
};
cr.parse = function(t6, e6) {
if (t6.length <= 2 || t6.length >= 5) {
return e6.error("Expected 3 or 4 arguments, but found " + (t6.length - 1) + " instead.");
}
var r7 = e6.parse(t6[1], 1, Nt2), n8 = e6.parse(t6[2], 2, Nt2);
if (!r7 || !n8) {
return null;
}
if (!$t2(r7.type, [Ut2, Rt2, Ot2, Lt2, Nt2])) {
return e6.error("Expected first argument to be of type boolean, string, number or null, but found " + Jt2(r7.type) + " instead");
}
if (4 === t6.length) {
var i6 = e6.parse(t6[3], 3, Ot2);
return i6 ? new cr(r7, n8, i6) : null;
}
return new cr(r7, n8);
}, cr.prototype.evaluate = function(t6) {
var e6 = this.needle.evaluate(t6), r7 = this.haystack.evaluate(t6);
if (!Wt2(e6, ["boolean", "string", "number", "null"])) {
throw new pe2("Expected first argument to be of type boolean, string, number or null, but found " + Jt2(se2(e6)) + " instead.");
}
if (!Wt2(r7, ["string", "array"])) {
throw new pe2("Expected second argument to be of type array or string, but found " + Jt2(se2(r7)) + " instead.");
}
if (this.fromIndex) {
var n8 = this.fromIndex.evaluate(t6);
return r7.indexOf(e6, n8);
}
return r7.indexOf(e6);
}, cr.prototype.eachChild = function(t6) {
t6(this.needle), t6(this.haystack), this.fromIndex && t6(this.fromIndex);
}, cr.prototype.outputDefined = function() {
return false;
}, cr.prototype.serialize = function() {
if (null != this.fromIndex && void 0 !== this.fromIndex) {
var t6 = this.fromIndex.serialize();
return ["index-of", this.needle.serialize(), this.haystack.serialize(), t6];
}
return ["index-of", this.needle.serialize(), this.haystack.serialize()];
};
var hr = function(t6, e6, r7, n8, i6, a6) {
this.inputType = t6, this.type = e6, this.input = r7, this.cases = n8, this.outputs = i6, this.otherwise = a6;
};
hr.parse = function(t6, e6) {
if (t6.length < 5) {
return e6.error("Expected at least 4 arguments, but found only " + (t6.length - 1) + ".");
}
if (t6.length % 2 != 1) {
return e6.error("Expected an even number of arguments.");
}
var r7, n8;
e6.expectedType && "value" !== e6.expectedType.kind && (n8 = e6.expectedType);
for (var i6 = {}, a6 = [], o6 = 2; o6 < t6.length - 1; o6 += 2) {
var s7 = t6[o6], u5 = t6[o6 + 1];
Array.isArray(s7) || (s7 = [s7]);
var l8 = e6.concat(o6);
if (0 === s7.length) {
return l8.error("Expected at least one branch label.");
}
for (var p5 = 0, c5 = s7; p5 < c5.length; p5 += 1) {
var h7 = c5[p5];
if ("number" != typeof h7 && "string" != typeof h7) {
return l8.error("Branch labels must be numbers or strings.");
}
if ("number" == typeof h7 && Math.abs(h7) > Number.MAX_SAFE_INTEGER) {
return l8.error("Branch labels must be integers no larger than " + Number.MAX_SAFE_INTEGER + ".");
}
if ("number" == typeof h7 && Math.floor(h7) !== h7) {
return l8.error("Numeric branch labels must be integer values.");
}
if (r7) {
if (l8.checkSubtype(r7, se2(h7))) {
return null;
}
} else {
r7 = se2(h7);
}
if (void 0 !== i6[String(h7)]) {
return l8.error("Branch labels must be unique.");
}
i6[String(h7)] = a6.length;
}
var f5 = e6.parse(u5, o6, n8);
if (!f5) {
return null;
}
n8 = n8 || f5.type, a6.push(f5);
}
var y5 = e6.parse(t6[1], 1, Nt2);
if (!y5) {
return null;
}
var d5 = e6.parse(t6[t6.length - 1], t6.length - 1, n8);
return d5 ? "value" !== y5.type.kind && e6.concat(1).checkSubtype(r7, y5.type) ? null : new hr(r7, n8, y5, i6, a6, d5) : null;
}, hr.prototype.evaluate = function(t6) {
var e6 = this.input.evaluate(t6);
return (se2(e6) === this.inputType && this.outputs[this.cases[e6]] || this.otherwise).evaluate(t6);
}, hr.prototype.eachChild = function(t6) {
t6(this.input), this.outputs.forEach(t6), t6(this.otherwise);
}, hr.prototype.outputDefined = function() {
return this.outputs.every(function(t6) {
return t6.outputDefined();
}) && this.otherwise.outputDefined();
}, hr.prototype.serialize = function() {
for (var t6 = this, e6 = ["match", this.input.serialize()], r7 = [], n8 = {}, i6 = 0, a6 = Object.keys(this.cases).sort(); i6 < a6.length; i6 += 1) {
var o6 = a6[i6];
void 0 === (c5 = n8[this.cases[o6]]) ? (n8[this.cases[o6]] = r7.length, r7.push([this.cases[o6], [o6]])) : r7[c5][1].push(o6);
}
for (var s7 = function(e7) {
return "number" === t6.inputType.kind ? Number(e7) : e7;
}, u5 = 0, l8 = r7; u5 < l8.length; u5 += 1) {
var p5 = l8[u5], c5 = p5[0], h7 = p5[1];
e6.push(1 === h7.length ? s7(h7[0]) : h7.map(s7)), e6.push(this.outputs[outputIndex$1].serialize());
}
return e6.push(this.otherwise.serialize()), e6;
};
var fr = function(t6, e6, r7) {
this.type = t6, this.branches = e6, this.otherwise = r7;
};
fr.parse = function(t6, e6) {
if (t6.length < 4) {
return e6.error("Expected at least 3 arguments, but found only " + (t6.length - 1) + ".");
}
if (t6.length % 2 != 0) {
return e6.error("Expected an odd number of arguments.");
}
var r7;
e6.expectedType && "value" !== e6.expectedType.kind && (r7 = e6.expectedType);
for (var n8 = [], i6 = 1; i6 < t6.length - 1; i6 += 2) {
var a6 = e6.parse(t6[i6], i6, Ut2);
if (!a6) {
return null;
}
var o6 = e6.parse(t6[i6 + 1], i6 + 1, r7);
if (!o6) {
return null;
}
n8.push([a6, o6]), r7 = r7 || o6.type;
}
var s7 = e6.parse(t6[t6.length - 1], t6.length - 1, r7);
return s7 ? new fr(r7, n8, s7) : null;
}, fr.prototype.evaluate = function(t6) {
for (var e6 = 0, r7 = this.branches; e6 < r7.length; e6 += 1) {
var n8 = r7[e6], i6 = n8[1];
if (n8[0].evaluate(t6)) {
return i6.evaluate(t6);
}
}
return this.otherwise.evaluate(t6);
}, fr.prototype.eachChild = function(t6) {
for (var e6 = 0, r7 = this.branches; e6 < r7.length; e6 += 1) {
var n8 = r7[e6], i6 = n8[1];
t6(n8[0]), t6(i6);
}
t6(this.otherwise);
}, fr.prototype.outputDefined = function() {
return this.branches.every(function(t6) {
return t6[1].outputDefined();
}) && this.otherwise.outputDefined();
}, fr.prototype.serialize = function() {
var t6 = ["case"];
return this.eachChild(function(e6) {
t6.push(e6.serialize());
}), t6;
};
var yr = function(t6, e6, r7, n8) {
this.type = t6, this.input = e6, this.beginIndex = r7, this.endIndex = n8;
};
function dr(t6, e6) {
return "==" === t6 || "!=" === t6 ? "boolean" === e6.kind || "string" === e6.kind || "number" === e6.kind || "null" === e6.kind || "value" === e6.kind : "string" === e6.kind || "number" === e6.kind || "value" === e6.kind;
}
function mr(t6, e6, r7, n8) {
return 0 === n8.compare(e6, r7);
}
function vr(t6, e6, r7) {
var n8 = "==" !== t6 && "!=" !== t6;
return function() {
function i6(t7, e7, r8) {
this.type = Ut2, this.lhs = t7, this.rhs = e7, this.collator = r8, this.hasUntypedArgument = "value" === t7.type.kind || "value" === e7.type.kind;
}
return i6.parse = function(t7, e7) {
if (3 !== t7.length && 4 !== t7.length) {
return e7.error("Expected two or three arguments.");
}
var r8 = t7[0], a6 = e7.parse(t7[1], 1, Nt2);
if (!a6) {
return null;
}
if (!dr(r8, a6.type)) {
return e7.concat(1).error('"' + r8 + `" comparisons are not supported for type '` + Jt2(a6.type) + "'.");
}
var o6 = e7.parse(t7[2], 2, Nt2);
if (!o6) {
return null;
}
if (!dr(r8, o6.type)) {
return e7.concat(2).error('"' + r8 + `" comparisons are not supported for type '` + Jt2(o6.type) + "'.");
}
if (a6.type.kind !== o6.type.kind && "value" !== a6.type.kind && "value" !== o6.type.kind) {
return e7.error("Cannot compare types '" + Jt2(a6.type) + "' and '" + Jt2(o6.type) + "'.");
}
n8 && ("value" === a6.type.kind && "value" !== o6.type.kind ? a6 = new he2(o6.type, [a6]) : "value" !== a6.type.kind && "value" === o6.type.kind && (o6 = new he2(a6.type, [o6])));
var s7 = null;
if (4 === t7.length) {
if ("string" !== a6.type.kind && "string" !== o6.type.kind && "value" !== a6.type.kind && "value" !== o6.type.kind) {
return e7.error("Cannot use collator to compare non-string types.");
}
if (!(s7 = e7.parse(t7[3], 3, Kt2))) {
return null;
}
}
return new i6(a6, o6, s7);
}, i6.prototype.evaluate = function(i7) {
var a6 = this.lhs.evaluate(i7), o6 = this.rhs.evaluate(i7);
if (n8 && this.hasUntypedArgument) {
var s7 = se2(a6), u5 = se2(o6);
if (s7.kind !== u5.kind || "string" !== s7.kind && "number" !== s7.kind) {
throw new pe2('Expected arguments for "' + t6 + '" to be (string, string) or (number, number), but found (' + s7.kind + ", " + u5.kind + ") instead.");
}
}
if (this.collator && !n8 && this.hasUntypedArgument) {
var l8 = se2(a6), p5 = se2(o6);
if ("string" !== l8.kind || "string" !== p5.kind) {
return e6(i7, a6, o6);
}
}
return this.collator ? r7(i7, a6, o6, this.collator.evaluate(i7)) : e6(i7, a6, o6);
}, i6.prototype.eachChild = function(t7) {
t7(this.lhs), t7(this.rhs), this.collator && t7(this.collator);
}, i6.prototype.outputDefined = function() {
return true;
}, i6.prototype.serialize = function() {
var e7 = [t6];
return this.eachChild(function(t7) {
e7.push(t7.serialize());
}), e7;
}, i6;
}();
}
yr.parse = function(t6, e6) {
if (t6.length <= 2 || t6.length >= 5) {
return e6.error("Expected 3 or 4 arguments, but found " + (t6.length - 1) + " instead.");
}
var r7 = e6.parse(t6[1], 1, Nt2), n8 = e6.parse(t6[2], 2, Ot2);
if (!r7 || !n8) {
return null;
}
if (!$t2(r7.type, [Xt2(Nt2), Rt2, Nt2])) {
return e6.error("Expected first argument to be of type array or string, but found " + Jt2(r7.type) + " instead");
}
if (4 === t6.length) {
var i6 = e6.parse(t6[3], 3, Ot2);
return i6 ? new yr(r7.type, r7, n8, i6) : null;
}
return new yr(r7.type, r7, n8);
}, yr.prototype.evaluate = function(t6) {
var e6 = this.input.evaluate(t6), r7 = this.beginIndex.evaluate(t6);
if (!Wt2(e6, ["string", "array"])) {
throw new pe2("Expected first argument to be of type array or string, but found " + Jt2(se2(e6)) + " instead.");
}
if (this.endIndex) {
var n8 = this.endIndex.evaluate(t6);
return e6.slice(r7, n8);
}
return e6.slice(r7);
}, yr.prototype.eachChild = function(t6) {
t6(this.input), t6(this.beginIndex), this.endIndex && t6(this.endIndex);
}, yr.prototype.outputDefined = function() {
return false;
}, yr.prototype.serialize = function() {
if (null != this.endIndex && void 0 !== this.endIndex) {
var t6 = this.endIndex.serialize();
return ["slice", this.input.serialize(), this.beginIndex.serialize(), t6];
}
return ["slice", this.input.serialize(), this.beginIndex.serialize()];
};
var gr = vr("==", function(t6, e6, r7) {
return e6 === r7;
}, mr), xr = vr("!=", function(t6, e6, r7) {
return e6 !== r7;
}, function(t6, e6, r7, n8) {
return !mr(0, e6, r7, n8);
}), br = vr("<", function(t6, e6, r7) {
return e6 < r7;
}, function(t6, e6, r7, n8) {
return n8.compare(e6, r7) < 0;
}), wr = vr(">", function(t6, e6, r7) {
return e6 > r7;
}, function(t6, e6, r7, n8) {
return n8.compare(e6, r7) > 0;
}), _r = vr("<=", function(t6, e6, r7) {
return e6 <= r7;
}, function(t6, e6, r7, n8) {
return n8.compare(e6, r7) <= 0;
}), Ar = vr(">=", function(t6, e6, r7) {
return e6 >= r7;
}, function(t6, e6, r7, n8) {
return n8.compare(e6, r7) >= 0;
}), Sr = function(t6, e6, r7, n8, i6) {
this.type = Rt2, this.number = t6, this.locale = e6, this.currency = r7, this.minFractionDigits = n8, this.maxFractionDigits = i6;
};
Sr.parse = function(t6, e6) {
if (3 !== t6.length) {
return e6.error("Expected two arguments.");
}
var r7 = e6.parse(t6[1], 1, Ot2);
if (!r7) {
return null;
}
var n8 = t6[2];
if ("object" != typeof n8 || Array.isArray(n8)) {
return e6.error("NumberFormat options argument must be an object.");
}
var i6 = null;
if (n8.locale && !(i6 = e6.parse(n8.locale, 1, Rt2))) {
return null;
}
var a6 = null;
if (n8.currency && !(a6 = e6.parse(n8.currency, 1, Rt2))) {
return null;
}
var o6 = null;
if (n8["min-fraction-digits"] && !(o6 = e6.parse(n8["min-fraction-digits"], 1, Ot2))) {
return null;
}
var s7 = null;
return n8["max-fraction-digits"] && !(s7 = e6.parse(n8["max-fraction-digits"], 1, Ot2)) ? null : new Sr(r7, i6, a6, o6, s7);
}, Sr.prototype.evaluate = function(t6) {
return new Intl.NumberFormat(this.locale ? this.locale.evaluate(t6) : [], { style: this.currency ? "currency" : "decimal", currency: this.currency ? this.currency.evaluate(t6) : void 0, minimumFractionDigits: this.minFractionDigits ? this.minFractionDigits.evaluate(t6) : void 0, maximumFractionDigits: this.maxFractionDigits ? this.maxFractionDigits.evaluate(t6) : void 0 }).format(this.number.evaluate(t6));
}, Sr.prototype.eachChild = function(t6) {
t6(this.number), this.locale && t6(this.locale), this.currency && t6(this.currency), this.minFractionDigits && t6(this.minFractionDigits), this.maxFractionDigits && t6(this.maxFractionDigits);
}, Sr.prototype.outputDefined = function() {
return false;
}, Sr.prototype.serialize = function() {
var t6 = {};
return this.locale && (t6.locale = this.locale.serialize()), this.currency && (t6.currency = this.currency.serialize()), this.minFractionDigits && (t6["min-fraction-digits"] = this.minFractionDigits.serialize()), this.maxFractionDigits && (t6["max-fraction-digits"] = this.maxFractionDigits.serialize()), ["number-format", this.number.serialize(), t6];
};
var kr = function(t6) {
this.type = Ot2, this.input = t6;
};
kr.parse = function(t6, e6) {
if (2 !== t6.length) {
return e6.error("Expected 1 argument, but found " + (t6.length - 1) + " instead.");
}
var r7 = e6.parse(t6[1], 1);
return r7 ? "array" !== r7.type.kind && "string" !== r7.type.kind && "value" !== r7.type.kind ? e6.error("Expected argument of type string or array, but found " + Jt2(r7.type) + " instead.") : new kr(r7) : null;
}, kr.prototype.evaluate = function(t6) {
var e6 = this.input.evaluate(t6);
if ("string" == typeof e6) {
return e6.length;
}
if (Array.isArray(e6)) {
return e6.length;
}
throw new pe2("Expected value to be of type string or array, but found " + Jt2(se2(e6)) + " instead.");
}, kr.prototype.eachChild = function(t6) {
t6(this.input);
}, kr.prototype.outputDefined = function() {
return false;
}, kr.prototype.serialize = function() {
var t6 = ["length"];
return this.eachChild(function(e6) {
t6.push(e6.serialize());
}), t6;
};
var Ir = { "==": gr, "!=": xr, ">": wr, "<": br, ">=": Ar, "<=": _r, array: he2, at: lr, boolean: he2, case: fr, coalesce: sr, collator: be2, format: fe2, image: ye2, in: pr, "index-of": cr, interpolate: ar, "interpolate-hcl": ar, "interpolate-lab": ar, length: kr, let: ur, literal: le2, match: hr, number: he2, "number-format": Sr, object: he2, slice: yr, step: Ne2, string: he2, "to-boolean": me2, "to-color": me2, "to-number": me2, "to-string": me2, var: Ue2, within: De2 };
function zr(t6, e6) {
var r7 = e6[0], n8 = e6[1], i6 = e6[2], a6 = e6[3];
r7 = r7.evaluate(t6), n8 = n8.evaluate(t6), i6 = i6.evaluate(t6);
var o6 = a6 ? a6.evaluate(t6) : 1, s7 = ae2(r7, n8, i6, o6);
if (s7) {
throw new pe2(s7);
}
return new te2(r7 / 255 * o6, n8 / 255 * o6, i6 / 255 * o6, o6);
}
function Cr(t6, e6) {
return t6 in e6;
}
function Er(t6, e6) {
var r7 = e6[t6];
return void 0 === r7 ? null : r7;
}
function Pr(t6) {
return { type: t6 };
}
function Mr(t6) {
return { result: "success", value: t6 };
}
function Br(t6) {
return { result: "error", value: t6 };
}
function Tr(t6) {
return "data-driven" === t6["property-type"] || "cross-faded-data-driven" === t6["property-type"];
}
function Vr(t6) {
return !!t6.expression && t6.expression.parameters.indexOf("zoom") > -1;
}
function Fr(t6) {
return !!t6.expression && t6.expression.interpolated;
}
function Dr(t6) {
return t6 instanceof Number ? "number" : t6 instanceof String ? "string" : t6 instanceof Boolean ? "boolean" : Array.isArray(t6) ? "array" : null === t6 ? "null" : typeof t6;
}
function Lr(t6) {
return "object" == typeof t6 && null !== t6 && !Array.isArray(t6);
}
function Or(t6) {
return t6;
}
function Rr(t6, e6, r7) {
return void 0 !== t6 ? t6 : void 0 !== e6 ? e6 : void 0 !== r7 ? r7 : void 0;
}
function Ur(t6, e6, r7, n8, i6) {
return Rr(typeof r7 === i6 ? n8[r7] : void 0, t6.default, e6.default);
}
function jr(t6, e6, r7) {
if ("number" !== Dr(r7)) {
return Rr(t6.default, e6.default);
}
var n8 = t6.stops.length;
if (1 === n8) {
return t6.stops[0][1];
}
if (r7 <= t6.stops[0][0]) {
return t6.stops[0][1];
}
if (r7 >= t6.stops[n8 - 1][0]) {
return t6.stops[n8 - 1][1];
}
var i6 = qe2(t6.stops.map(function(t7) {
return t7[0];
}), r7);
return t6.stops[i6][1];
}
function qr(t6, e6, r7) {
var n8 = void 0 !== t6.base ? t6.base : 1;
if ("number" !== Dr(r7)) {
return Rr(t6.default, e6.default);
}
var i6 = t6.stops.length;
if (1 === i6) {
return t6.stops[0][1];
}
if (r7 <= t6.stops[0][0]) {
return t6.stops[0][1];
}
if (r7 >= t6.stops[i6 - 1][0]) {
return t6.stops[i6 - 1][1];
}
var a6 = qe2(t6.stops.map(function(t7) {
return t7[0];
}), r7), o6 = function(t7, e7, r8, n9) {
var i7 = n9 - r8, a7 = t7 - r8;
return 0 === i7 ? 0 : 1 === e7 ? a7 / i7 : (Math.pow(e7, a7) - 1) / (Math.pow(e7, i7) - 1);
}(r7, n8, t6.stops[a6][0], t6.stops[a6 + 1][0]), s7 = t6.stops[a6][1], u5 = t6.stops[a6 + 1][1], l8 = Ge2[e6.type] || Or;
if (t6.colorSpace && "rgb" !== t6.colorSpace) {
var p5 = ir[t6.colorSpace];
l8 = function(t7, e7) {
return p5.reverse(p5.interpolate(p5.forward(t7), p5.forward(e7), o6));
};
}
return "function" == typeof s7.evaluate ? { evaluate: function() {
var arguments$1 = arguments;
for (var t7 = [], e7 = arguments.length; e7--; ) {
t7[e7] = arguments$1[e7];
}
var r8 = s7.evaluate.apply(void 0, t7), n9 = u5.evaluate.apply(void 0, t7);
if (void 0 !== r8 && void 0 !== n9) {
return l8(r8, n9, o6);
}
} } : l8(s7, u5, o6);
}
function Nr(t6, e6, r7) {
return "color" === e6.type ? r7 = te2.parse(r7) : "formatted" === e6.type ? r7 = ne2.fromString(r7.toString()) : "resolvedImage" === e6.type ? r7 = ie4.fromString(r7.toString()) : Dr(r7) === e6.type || "enum" === e6.type && e6.values[r7] || (r7 = void 0), Rr(r7, t6.default, e6.default);
}
xe2.register(Ir, { error: [{ kind: "error" }, [Rt2], function(t6, e6) {
throw new pe2(e6[0].evaluate(t6));
}], typeof: [Rt2, [Nt2], function(t6, e6) {
return Jt2(se2(e6[0].evaluate(t6)));
}], "to-rgba": [Xt2(Ot2, 4), [jt2], function(t6, e6) {
return e6[0].evaluate(t6).toArray();
}], rgb: [jt2, [Ot2, Ot2, Ot2], zr], rgba: [jt2, [Ot2, Ot2, Ot2, Ot2], zr], has: { type: Ut2, overloads: [[[Rt2], function(t6, e6) {
return Cr(e6[0].evaluate(t6), t6.properties());
}], [[Rt2, qt2], function(t6, e6) {
var r7 = e6[1];
return Cr(e6[0].evaluate(t6), r7.evaluate(t6));
}]] }, get: { type: Nt2, overloads: [[[Rt2], function(t6, e6) {
return Er(e6[0].evaluate(t6), t6.properties());
}], [[Rt2, qt2], function(t6, e6) {
var r7 = e6[1];
return Er(e6[0].evaluate(t6), r7.evaluate(t6));
}]] }, "feature-state": [Nt2, [Rt2], function(t6, e6) {
return Er(e6[0].evaluate(t6), t6.featureState || {});
}], properties: [qt2, [], function(t6) {
return t6.properties();
}], "geometry-type": [Rt2, [], function(t6) {
return t6.geometryType();
}], id: [Nt2, [], function(t6) {
return t6.id();
}], zoom: [Ot2, [], function(t6) {
return t6.globals.zoom;
}], "heatmap-density": [Ot2, [], function(t6) {
return t6.globals.heatmapDensity || 0;
}], "line-progress": [Ot2, [], function(t6) {
return t6.globals.lineProgress || 0;
}], accumulated: [Nt2, [], function(t6) {
return void 0 === t6.globals.accumulated ? null : t6.globals.accumulated;
}], "+": [Ot2, Pr(Ot2), function(t6, e6) {
for (var r7 = 0, n8 = 0, i6 = e6; n8 < i6.length; n8 += 1) {
r7 += i6[n8].evaluate(t6);
}
return r7;
}], "*": [Ot2, Pr(Ot2), function(t6, e6) {
for (var r7 = 1, n8 = 0, i6 = e6; n8 < i6.length; n8 += 1) {
r7 *= i6[n8].evaluate(t6);
}
return r7;
}], "-": { type: Ot2, overloads: [[[Ot2, Ot2], function(t6, e6) {
var r7 = e6[1];
return e6[0].evaluate(t6) - r7.evaluate(t6);
}], [[Ot2], function(t6, e6) {
return -e6[0].evaluate(t6);
}]] }, "/": [Ot2, [Ot2, Ot2], function(t6, e6) {
var r7 = e6[1];
return e6[0].evaluate(t6) / r7.evaluate(t6);
}], "%": [Ot2, [Ot2, Ot2], function(t6, e6) {
var r7 = e6[1];
return e6[0].evaluate(t6) % r7.evaluate(t6);
}], ln2: [Ot2, [], function() {
return Math.LN2;
}], pi: [Ot2, [], function() {
return Math.PI;
}], e: [Ot2, [], function() {
return Math.E;
}], "^": [Ot2, [Ot2, Ot2], function(t6, e6) {
var r7 = e6[1];
return Math.pow(e6[0].evaluate(t6), r7.evaluate(t6));
}], sqrt: [Ot2, [Ot2], function(t6, e6) {
return Math.sqrt(e6[0].evaluate(t6));
}], log10: [Ot2, [Ot2], function(t6, e6) {
return Math.log(e6[0].evaluate(t6)) / Math.LN10;
}], ln: [Ot2, [Ot2], function(t6, e6) {
return Math.log(e6[0].evaluate(t6));
}], log2: [Ot2, [Ot2], function(t6, e6) {
return Math.log(e6[0].evaluate(t6)) / Math.LN2;
}], sin: [Ot2, [Ot2], function(t6, e6) {
return Math.sin(e6[0].evaluate(t6));
}], cos: [Ot2, [Ot2], function(t6, e6) {
return Math.cos(e6[0].evaluate(t6));
}], tan: [Ot2, [Ot2], function(t6, e6) {
return Math.tan(e6[0].evaluate(t6));
}], asin: [Ot2, [Ot2], function(t6, e6) {
return Math.asin(e6[0].evaluate(t6));
}], acos: [Ot2, [Ot2], function(t6, e6) {
return Math.acos(e6[0].evaluate(t6));
}], atan: [Ot2, [Ot2], function(t6, e6) {
return Math.atan(e6[0].evaluate(t6));
}], min: [Ot2, Pr(Ot2), function(t6, e6) {
return Math.min.apply(Math, e6.map(function(e7) {
return e7.evaluate(t6);
}));
}], max: [Ot2, Pr(Ot2), function(t6, e6) {
return Math.max.apply(Math, e6.map(function(e7) {
return e7.evaluate(t6);
}));
}], abs: [Ot2, [Ot2], function(t6, e6) {
return Math.abs(e6[0].evaluate(t6));
}], round: [Ot2, [Ot2], function(t6, e6) {
var r7 = e6[0].evaluate(t6);
return r7 < 0 ? -Math.round(-r7) : Math.round(r7);
}], floor: [Ot2, [Ot2], function(t6, e6) {
return Math.floor(e6[0].evaluate(t6));
}], ceil: [Ot2, [Ot2], function(t6, e6) {
return Math.ceil(e6[0].evaluate(t6));
}], "filter-==": [Ut2, [Rt2, Nt2], function(t6, e6) {
var r7 = e6[0], n8 = e6[1];
return t6.properties()[r7.value] === n8.value;
}], "filter-id-==": [Ut2, [Nt2], function(t6, e6) {
var r7 = e6[0];
return t6.id() === r7.value;
}], "filter-type-==": [Ut2, [Rt2], function(t6, e6) {
var r7 = e6[0];
return t6.geometryType() === r7.value;
}], "filter-<": [Ut2, [Rt2, Nt2], function(t6, e6) {
var r7 = e6[0], n8 = e6[1], i6 = t6.properties()[r7.value], a6 = n8.value;
return typeof i6 == typeof a6 && i6 < a6;
}], "filter-id-<": [Ut2, [Nt2], function(t6, e6) {
var r7 = e6[0], n8 = t6.id(), i6 = r7.value;
return typeof n8 == typeof i6 && n8 < i6;
}], "filter->": [Ut2, [Rt2, Nt2], function(t6, e6) {
var r7 = e6[0], n8 = e6[1], i6 = t6.properties()[r7.value], a6 = n8.value;
return typeof i6 == typeof a6 && i6 > a6;
}], "filter-id->": [Ut2, [Nt2], function(t6, e6) {
var r7 = e6[0], n8 = t6.id(), i6 = r7.value;
return typeof n8 == typeof i6 && n8 > i6;
}], "filter-<=": [Ut2, [Rt2, Nt2], function(t6, e6) {
var r7 = e6[0], n8 = e6[1], i6 = t6.properties()[r7.value], a6 = n8.value;
return typeof i6 == typeof a6 && i6 <= a6;
}], "filter-id-<=": [Ut2, [Nt2], function(t6, e6) {
var r7 = e6[0], n8 = t6.id(), i6 = r7.value;
return typeof n8 == typeof i6 && n8 <= i6;
}], "filter->=": [Ut2, [Rt2, Nt2], function(t6, e6) {
var r7 = e6[0], n8 = e6[1], i6 = t6.properties()[r7.value], a6 = n8.value;
return typeof i6 == typeof a6 && i6 >= a6;
}], "filter-id->=": [Ut2, [Nt2], function(t6, e6) {
var r7 = e6[0], n8 = t6.id(), i6 = r7.value;
return typeof n8 == typeof i6 && n8 >= i6;
}], "filter-has": [Ut2, [Nt2], function(t6, e6) {
return e6[0].value in t6.properties();
}], "filter-has-id": [Ut2, [], function(t6) {
return null !== t6.id() && void 0 !== t6.id();
}], "filter-type-in": [Ut2, [Xt2(Rt2)], function(t6, e6) {
return e6[0].value.indexOf(t6.geometryType()) >= 0;
}], "filter-id-in": [Ut2, [Xt2(Nt2)], function(t6, e6) {
return e6[0].value.indexOf(t6.id()) >= 0;
}], "filter-in-small": [Ut2, [Rt2, Xt2(Nt2)], function(t6, e6) {
var r7 = e6[0];
return e6[1].value.indexOf(t6.properties()[r7.value]) >= 0;
}], "filter-in-large": [Ut2, [Rt2, Xt2(Nt2)], function(t6, e6) {
var r7 = e6[0], n8 = e6[1];
return function(t7, e7, r8, n9) {
for (; r8 <= n9; ) {
var i6 = r8 + n9 >> 1;
if (e7[i6] === t7) {
return true;
}
e7[i6] > t7 ? n9 = i6 - 1 : r8 = i6 + 1;
}
return false;
}(t6.properties()[r7.value], n8.value, 0, n8.value.length - 1);
}], all: { type: Ut2, overloads: [[[Ut2, Ut2], function(t6, e6) {
var r7 = e6[1];
return e6[0].evaluate(t6) && r7.evaluate(t6);
}], [Pr(Ut2), function(t6, e6) {
for (var r7 = 0, n8 = e6; r7 < n8.length; r7 += 1) {
if (!n8[r7].evaluate(t6)) {
return false;
}
}
return true;
}]] }, any: { type: Ut2, overloads: [[[Ut2, Ut2], function(t6, e6) {
var r7 = e6[1];
return e6[0].evaluate(t6) || r7.evaluate(t6);
}], [Pr(Ut2), function(t6, e6) {
for (var r7 = 0, n8 = e6; r7 < n8.length; r7 += 1) {
if (n8[r7].evaluate(t6)) {
return true;
}
}
return false;
}]] }, "!": [Ut2, [Ut2], function(t6, e6) {
return !e6[0].evaluate(t6);
}], "is-supported-script": [Ut2, [Rt2], function(t6, e6) {
var r7 = t6.globals && t6.globals.isSupportedScript;
return !r7 || r7(e6[0].evaluate(t6));
}], upcase: [Rt2, [Rt2], function(t6, e6) {
return e6[0].evaluate(t6).toUpperCase();
}], downcase: [Rt2, [Rt2], function(t6, e6) {
return e6[0].evaluate(t6).toLowerCase();
}], concat: [Rt2, Pr(Nt2), function(t6, e6) {
return e6.map(function(e7) {
return ue2(e7.evaluate(t6));
}).join("");
}], "resolved-locale": [Rt2, [Kt2], function(t6, e6) {
return e6[0].evaluate(t6).resolvedLocale();
}] });
var Kr = function(t6, e6) {
this.expression = t6, this._warningHistory = {}, this._evaluator = new ge2(), this._defaultValue = e6 ? function(t7) {
return "color" === t7.type && Lr(t7.default) ? new te2(0, 0, 0, 0) : "color" === t7.type ? te2.parse(t7.default) || null : void 0 === t7.default ? null : t7.default;
}(e6) : null, this._enumValues = e6 && "enum" === e6.type ? e6.values : null;
};
function Gr(t6) {
return Array.isArray(t6) && t6.length > 0 && "string" == typeof t6[0] && t6[0] in Ir;
}
function Zr(t6, e6) {
var r7 = new je2(Ir, [], e6 ? function(t7) {
var e7 = { color: jt2, string: Rt2, number: Ot2, enum: Rt2, boolean: Ut2, formatted: Gt2, resolvedImage: Zt2 };
return "array" === t7.type ? Xt2(e7[t7.value] || Nt2, t7.length) : e7[t7.type];
}(e6) : void 0), n8 = r7.parse(t6, void 0, void 0, void 0, e6 && "string" === e6.type ? { typeAnnotation: "coerce" } : void 0);
return n8 ? Mr(new Kr(n8, e6)) : Br(r7.errors);
}
Kr.prototype.evaluateWithoutErrorHandling = function(t6, e6, r7, n8, i6, a6) {
return this._evaluator.globals = t6, this._evaluator.feature = e6, this._evaluator.featureState = r7, this._evaluator.canonical = n8, this._evaluator.availableImages = i6 || null, this._evaluator.formattedSection = a6, this.expression.evaluate(this._evaluator);
}, Kr.prototype.evaluate = function(t6, e6, r7, n8, i6, a6) {
this._evaluator.globals = t6, this._evaluator.feature = e6 || null, this._evaluator.featureState = r7 || null, this._evaluator.canonical = n8, this._evaluator.availableImages = i6 || null, this._evaluator.formattedSection = a6 || null;
try {
var o6 = this.expression.evaluate(this._evaluator);
if (null == o6 || "number" == typeof o6 && o6 != o6) {
return this._defaultValue;
}
if (this._enumValues && !(o6 in this._enumValues)) {
throw new pe2("Expected value to be one of " + Object.keys(this._enumValues).map(function(t7) {
return JSON.stringify(t7);
}).join(", ") + ", but found " + JSON.stringify(o6) + " instead.");
}
return o6;
} catch (t$1) {
return this._warningHistory[t$1.message] || (this._warningHistory[t$1.message] = true, "undefined" != typeof console && console.warn(t$1.message)), this._defaultValue;
}
};
var Xr = function(t6, e6) {
this.kind = t6, this._styleExpression = e6, this.isStateDependent = "constant" !== t6 && !Oe2(e6.expression);
};
Xr.prototype.evaluateWithoutErrorHandling = function(t6, e6, r7, n8, i6, a6) {
return this._styleExpression.evaluateWithoutErrorHandling(t6, e6, r7, n8, i6, a6);
}, Xr.prototype.evaluate = function(t6, e6, r7, n8, i6, a6) {
return this._styleExpression.evaluate(t6, e6, r7, n8, i6, a6);
};
var Jr = function(t6, e6, r7, n8) {
this.kind = t6, this.zoomStops = r7, this._styleExpression = e6, this.isStateDependent = "camera" !== t6 && !Oe2(e6.expression), this.interpolationType = n8;
};
function Hr(t6, e6) {
if ("error" === (t6 = Zr(t6, e6)).result) {
return t6;
}
var r7 = t6.value.expression, n8 = Le2(r7);
if (!n8 && !Tr(e6)) {
return Br([new Ft2("", "data expressions not supported")]);
}
var i6 = Re2(r7, ["zoom"]);
if (!i6 && !Vr(e6)) {
return Br([new Ft2("", "zoom expressions not supported")]);
}
var a6 = function t7(e7) {
var r8 = null;
if (e7 instanceof ur) {
r8 = t7(e7.result);
} else if (e7 instanceof sr) {
for (var n9 = 0, i7 = e7.args; n9 < i7.length && !(r8 = t7(i7[n9])); n9 += 1) {
}
} else {
(e7 instanceof Ne2 || e7 instanceof ar) && e7.input instanceof xe2 && "zoom" === e7.input.name && (r8 = e7);
}
return r8 instanceof Ft2 || e7.eachChild(function(e8) {
var n10 = t7(e8);
n10 instanceof Ft2 ? r8 = n10 : !r8 && n10 ? r8 = new Ft2("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.') : r8 && n10 && r8 !== n10 && (r8 = new Ft2("", 'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'));
}), r8;
}(r7);
return a6 || i6 ? a6 instanceof Ft2 ? Br([a6]) : a6 instanceof ar && !Fr(e6) ? Br([new Ft2("", '"interpolate" expressions cannot be used with this property')]) : Mr(a6 ? new Jr(n8 ? "camera" : "composite", t6.value, a6.labels, a6 instanceof ar ? a6.interpolation : void 0) : new Xr(n8 ? "constant" : "source", t6.value)) : Br([new Ft2("", '"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);
}
Jr.prototype.evaluateWithoutErrorHandling = function(t6, e6, r7, n8, i6, a6) {
return this._styleExpression.evaluateWithoutErrorHandling(t6, e6, r7, n8, i6, a6);
}, Jr.prototype.evaluate = function(t6, e6, r7, n8, i6, a6) {
return this._styleExpression.evaluate(t6, e6, r7, n8, i6, a6);
}, Jr.prototype.interpolationFactor = function(t6, e6, r7) {
return this.interpolationType ? ar.interpolationFactor(this.interpolationType, t6, e6, r7) : 0;
};
var Yr = function(t6, e6) {
this._parameters = t6, this._specification = e6, Bt2(this, function t7(e7, r7) {
var n8, i6, a6, o6 = "color" === r7.type, s7 = e7.stops && "object" == typeof e7.stops[0][0], u5 = s7 || !(s7 || void 0 !== e7.property), l8 = e7.type || (Fr(r7) ? "exponential" : "interval");
if (o6 && ((e7 = Bt2({}, e7)).stops && (e7.stops = e7.stops.map(function(t8) {
return [t8[0], te2.parse(t8[1])];
})), e7.default = te2.parse(e7.default ? e7.default : r7.default)), e7.colorSpace && "rgb" !== e7.colorSpace && !ir[e7.colorSpace]) {
throw new Error("Unknown color space: " + e7.colorSpace);
}
if ("exponential" === l8) {
n8 = qr;
} else if ("interval" === l8) {
n8 = jr;
} else if ("categorical" === l8) {
n8 = Ur, i6 = /* @__PURE__ */ Object.create(null);
for (var p5 = 0, c5 = e7.stops; p5 < c5.length; p5 += 1) {
var h7 = c5[p5];
i6[h7[0]] = h7[1];
}
a6 = typeof e7.stops[0][0];
} else {
if ("identity" !== l8) {
throw new Error('Unknown function type "' + l8 + '"');
}
n8 = Nr;
}
if (s7) {
for (var f5 = {}, y5 = [], d5 = 0; d5 < e7.stops.length; d5++) {
var m5 = e7.stops[d5], v5 = m5[0].zoom;
void 0 === f5[v5] && (f5[v5] = { zoom: v5, type: e7.type, property: e7.property, default: e7.default, stops: [] }, y5.push(v5)), f5[v5].stops.push([m5[0].value, m5[1]]);
}
for (var g5 = [], x5 = 0, b5 = y5; x5 < b5.length; x5 += 1) {
var w5 = b5[x5];
g5.push([f5[w5].zoom, t7(f5[w5], r7)]);
}
var _4 = { name: "linear" };
return { kind: "composite", interpolationType: _4, interpolationFactor: ar.interpolationFactor.bind(void 0, _4), zoomStops: g5.map(function(t8) {
return t8[0];
}), evaluate: function(t8, n9) {
var i7 = t8.zoom;
return qr({ stops: g5, base: e7.base }, r7, i7).evaluate(i7, n9);
} };
}
if (u5) {
var A5 = "exponential" === l8 ? { name: "exponential", base: void 0 !== e7.base ? e7.base : 1 } : null;
return { kind: "camera", interpolationType: A5, interpolationFactor: ar.interpolationFactor.bind(void 0, A5), zoomStops: e7.stops.map(function(t8) {
return t8[0];
}), evaluate: function(t8) {
return n8(e7, r7, t8.zoom, i6, a6);
} };
}
return { kind: "source", evaluate: function(t8, o7) {
var s8 = o7 && o7.properties ? o7.properties[e7.property] : void 0;
return void 0 === s8 ? Rr(e7.default, r7.default) : n8(e7, r7, s8, i6, a6);
} };
}(this._parameters, this._specification));
};
function $r(t6) {
var e6 = t6.key, r7 = t6.value, n8 = t6.valueSpec || {}, i6 = t6.objectElementValidators || {}, a6 = t6.style, o6 = t6.styleSpec, s7 = [], u5 = Dr(r7);
if ("object" !== u5) {
return [new Pt2(e6, r7, "object expected, " + u5 + " found")];
}
for (var l8 in r7) {
var p5 = l8.split(".")[0], c5 = n8[p5] || n8["*"], h7 = void 0;
if (i6[p5]) {
h7 = i6[p5];
} else if (n8[p5]) {
h7 = An2;
} else if (i6["*"]) {
h7 = i6["*"];
} else {
if (!n8["*"]) {
s7.push(new Pt2(e6, r7[l8], 'unknown property "' + l8 + '"'));
continue;
}
h7 = An2;
}
s7 = s7.concat(h7({ key: (e6 ? e6 + "." : e6) + l8, value: r7[l8], valueSpec: c5, style: a6, styleSpec: o6, object: r7, objectKey: l8 }, r7));
}
for (var f5 in n8) {
i6[f5] || n8[f5].required && void 0 === n8[f5].default && void 0 === r7[f5] && s7.push(new Pt2(e6, r7, 'missing required property "' + f5 + '"'));
}
return s7;
}
function Wr(t6) {
var e6 = t6.value, r7 = t6.valueSpec, n8 = t6.style, i6 = t6.styleSpec, a6 = t6.key, o6 = t6.arrayElementValidator || An2;
if ("array" !== Dr(e6)) {
return [new Pt2(a6, e6, "array expected, " + Dr(e6) + " found")];
}
if (r7.length && e6.length !== r7.length) {
return [new Pt2(a6, e6, "array length " + r7.length + " expected, length " + e6.length + " found")];
}
if (r7["min-length"] && e6.length < r7["min-length"]) {
return [new Pt2(a6, e6, "array length at least " + r7["min-length"] + " expected, length " + e6.length + " found")];
}
var s7 = { type: r7.value, values: r7.values };
i6.$version < 7 && (s7.function = r7.function), "object" === Dr(r7.value) && (s7 = r7.value);
for (var u5 = [], l8 = 0; l8 < e6.length; l8++) {
u5 = u5.concat(o6({ array: e6, arrayIndex: l8, value: e6[l8], valueSpec: s7, style: n8, styleSpec: i6, key: a6 + "[" + l8 + "]" }));
}
return u5;
}
function Qr(t6) {
var e6 = t6.key, r7 = t6.value, n8 = t6.valueSpec, i6 = Dr(r7);
return "number" === i6 && r7 != r7 && (i6 = "NaN"), "number" !== i6 ? [new Pt2(e6, r7, "number expected, " + i6 + " found")] : "minimum" in n8 && r7 < n8.minimum ? [new Pt2(e6, r7, r7 + " is less than the minimum value " + n8.minimum)] : "maximum" in n8 && r7 > n8.maximum ? [new Pt2(e6, r7, r7 + " is greater than the maximum value " + n8.maximum)] : [];
}
function tn2(t6) {
var e6, r7, n8, i6 = t6.valueSpec, a6 = Tt2(t6.value.type), o6 = {}, s7 = "categorical" !== a6 && void 0 === t6.value.property, u5 = !s7, l8 = "array" === Dr(t6.value.stops) && "array" === Dr(t6.value.stops[0]) && "object" === Dr(t6.value.stops[0][0]), p5 = $r({ key: t6.key, value: t6.value, valueSpec: t6.styleSpec.function, style: t6.style, styleSpec: t6.styleSpec, objectElementValidators: { stops: function(t7) {
if ("identity" === a6) {
return [new Pt2(t7.key, t7.value, 'identity function may not have a "stops" property')];
}
var e7 = [], r8 = t7.value;
return e7 = e7.concat(Wr({ key: t7.key, value: r8, valueSpec: t7.valueSpec, style: t7.style, styleSpec: t7.styleSpec, arrayElementValidator: c5 })), "array" === Dr(r8) && 0 === r8.length && e7.push(new Pt2(t7.key, r8, "array must have at least one stop")), e7;
}, default: function(t7) {
return An2({ key: t7.key, value: t7.value, valueSpec: i6, style: t7.style, styleSpec: t7.styleSpec });
} } });
return "identity" === a6 && s7 && p5.push(new Pt2(t6.key, t6.value, 'missing required property "property"')), "identity" === a6 || t6.value.stops || p5.push(new Pt2(t6.key, t6.value, 'missing required property "stops"')), "exponential" === a6 && t6.valueSpec.expression && !Fr(t6.valueSpec) && p5.push(new Pt2(t6.key, t6.value, "exponential functions not supported")), t6.styleSpec.$version >= 8 && (u5 && !Tr(t6.valueSpec) ? p5.push(new Pt2(t6.key, t6.value, "property functions not supported")) : s7 && !Vr(t6.valueSpec) && p5.push(new Pt2(t6.key, t6.value, "zoom functions not supported"))), "categorical" !== a6 && !l8 || void 0 !== t6.value.property || p5.push(new Pt2(t6.key, t6.value, '"property" property is required')), p5;
function c5(t7) {
var e7 = [], a7 = t7.value, s8 = t7.key;
if ("array" !== Dr(a7)) {
return [new Pt2(s8, a7, "array expected, " + Dr(a7) + " found")];
}
if (2 !== a7.length) {
return [new Pt2(s8, a7, "array length 2 expected, length " + a7.length + " found")];
}
if (l8) {
if ("object" !== Dr(a7[0])) {
return [new Pt2(s8, a7, "object expected, " + Dr(a7[0]) + " found")];
}
if (void 0 === a7[0].zoom) {
return [new Pt2(s8, a7, "object stop key must have zoom")];
}
if (void 0 === a7[0].value) {
return [new Pt2(s8, a7, "object stop key must have value")];
}
if (n8 && n8 > Tt2(a7[0].zoom)) {
return [new Pt2(s8, a7[0].zoom, "stop zoom values must appear in ascending order")];
}
Tt2(a7[0].zoom) !== n8 && (n8 = Tt2(a7[0].zoom), r7 = void 0, o6 = {}), e7 = e7.concat($r({ key: s8 + "[0]", value: a7[0], valueSpec: { zoom: {} }, style: t7.style, styleSpec: t7.styleSpec, objectElementValidators: { zoom: Qr, value: h7 } }));
} else {
e7 = e7.concat(h7({ key: s8 + "[0]", value: a7[0], valueSpec: {}, style: t7.style, styleSpec: t7.styleSpec }, a7));
}
return Gr(Vt2(a7[1])) ? e7.concat([new Pt2(s8 + "[1]", a7[1], "expressions are not allowed in function stops.")]) : e7.concat(An2({ key: s8 + "[1]", value: a7[1], valueSpec: i6, style: t7.style, styleSpec: t7.styleSpec }));
}
function h7(t7, n9) {
var s8 = Dr(t7.value), u6 = Tt2(t7.value), l9 = null !== t7.value ? t7.value : n9;
if (e6) {
if (s8 !== e6) {
return [new Pt2(t7.key, l9, s8 + " stop domain type must match previous stop domain type " + e6)];
}
} else {
e6 = s8;
}
if ("number" !== s8 && "string" !== s8 && "boolean" !== s8) {
return [new Pt2(t7.key, l9, "stop domain value must be a number, string, or boolean")];
}
if ("number" !== s8 && "categorical" !== a6) {
var p6 = "number expected, " + s8 + " found";
return Tr(i6) && void 0 === a6 && (p6 += '\nIf you intended to use a categorical function, specify `"type": "categorical"`.'), [new Pt2(t7.key, l9, p6)];
}
return "categorical" !== a6 || "number" !== s8 || isFinite(u6) && Math.floor(u6) === u6 ? "categorical" !== a6 && "number" === s8 && void 0 !== r7 && u6 < r7 ? [new Pt2(t7.key, l9, "stop domain values must appear in ascending order")] : (r7 = u6, "categorical" === a6 && u6 in o6 ? [new Pt2(t7.key, l9, "stop domain values must be unique")] : (o6[u6] = true, [])) : [new Pt2(t7.key, l9, "integer expected, found " + u6)];
}
}
function en2(t6) {
var e6 = ("property" === t6.expressionContext ? Hr : Zr)(Vt2(t6.value), t6.valueSpec);
if ("error" === e6.result) {
return e6.value.map(function(e7) {
return new Pt2("" + t6.key + e7.key, t6.value, e7.message);
});
}
var r7 = e6.value.expression || e6.value._styleExpression.expression;
if ("property" === t6.expressionContext && "text-font" === t6.propertyKey && !r7.outputDefined()) {
return [new Pt2(t6.key, t6.value, 'Invalid data expression for "' + t6.propertyKey + '". Output values must be contained as literals within the expression.')];
}
if ("property" === t6.expressionContext && "layout" === t6.propertyType && !Oe2(r7)) {
return [new Pt2(t6.key, t6.value, '"feature-state" data expressions are not supported with layout properties.')];
}
if ("filter" === t6.expressionContext && !Oe2(r7)) {
return [new Pt2(t6.key, t6.value, '"feature-state" data expressions are not supported with filters.')];
}
if (t6.expressionContext && 0 === t6.expressionContext.indexOf("cluster")) {
if (!Re2(r7, ["zoom", "feature-state"])) {
return [new Pt2(t6.key, t6.value, '"zoom" and "feature-state" expressions are not supported with cluster properties.')];
}
if ("cluster-initial" === t6.expressionContext && !Le2(r7)) {
return [new Pt2(t6.key, t6.value, "Feature data expressions are not supported with initial expression part of cluster properties.")];
}
}
return [];
}
function rn2(t6) {
var e6 = t6.key, r7 = t6.value, n8 = t6.valueSpec, i6 = [];
return Array.isArray(n8.values) ? -1 === n8.values.indexOf(Tt2(r7)) && i6.push(new Pt2(e6, r7, "expected one of [" + n8.values.join(", ") + "], " + JSON.stringify(r7) + " found")) : -1 === Object.keys(n8.values).indexOf(Tt2(r7)) && i6.push(new Pt2(e6, r7, "expected one of [" + Object.keys(n8.values).join(", ") + "], " + JSON.stringify(r7) + " found")), i6;
}
function nn2(t6) {
if (true === t6 || false === t6) {
return true;
}
if (!Array.isArray(t6) || 0 === t6.length) {
return false;
}
switch (t6[0]) {
case "has":
return t6.length >= 2 && "$id" !== t6[1] && "$type" !== t6[1];
case "in":
return t6.length >= 3 && ("string" != typeof t6[1] || Array.isArray(t6[2]));
case "!in":
case "!has":
case "none":
return false;
case "==":
case "!=":
case ">":
case ">=":
case "<":
case "<=":
return 3 !== t6.length || Array.isArray(t6[1]) || Array.isArray(t6[2]);
case "any":
case "all":
for (var e6 = 0, r7 = t6.slice(1); e6 < r7.length; e6 += 1) {
var n8 = r7[e6];
if (!nn2(n8) && "boolean" != typeof n8) {
return false;
}
}
return true;
default:
return true;
}
}
Yr.deserialize = function(t6) {
return new Yr(t6._parameters, t6._specification);
}, Yr.serialize = function(t6) {
return { _parameters: t6._parameters, _specification: t6._specification };
};
var an2 = { type: "boolean", default: false, transition: false, "property-type": "data-driven", expression: { interpolated: false, parameters: ["zoom", "feature"] } };
function on3(t6) {
if (null == t6) {
return { filter: function() {
return true;
}, needGeometry: false };
}
nn2(t6) || (t6 = un2(t6));
var e6 = Zr(t6, an2);
if ("error" === e6.result) {
throw new Error(e6.value.map(function(t7) {
return t7.key + ": " + t7.message;
}).join(", "));
}
return { filter: function(t7, r7, n8) {
return e6.value.evaluate(t7, r7, {}, n8);
}, needGeometry: function t7(e7) {
if (!Array.isArray(e7)) {
return false;
}
if ("within" === e7[0]) {
return true;
}
for (var r7 = 1; r7 < e7.length; r7++) {
if (t7(e7[r7])) {
return true;
}
}
return false;
}(t6) };
}
function sn2(t6, e6) {
return t6 < e6 ? -1 : t6 > e6 ? 1 : 0;
}
function un2(t6) {
if (!t6) {
return true;
}
var e6, r7 = t6[0];
return t6.length <= 1 ? "any" !== r7 : "==" === r7 ? ln2(t6[1], t6[2], "==") : "!=" === r7 ? hn2(ln2(t6[1], t6[2], "==")) : "<" === r7 || ">" === r7 || "<=" === r7 || ">=" === r7 ? ln2(t6[1], t6[2], r7) : "any" === r7 ? (e6 = t6.slice(1), ["any"].concat(e6.map(un2))) : "all" === r7 ? ["all"].concat(t6.slice(1).map(un2)) : "none" === r7 ? ["all"].concat(t6.slice(1).map(un2).map(hn2)) : "in" === r7 ? pn2(t6[1], t6.slice(2)) : "!in" === r7 ? hn2(pn2(t6[1], t6.slice(2))) : "has" === r7 ? cn2(t6[1]) : "!has" === r7 ? hn2(cn2(t6[1])) : "within" !== r7 || t6;
}
function ln2(t6, e6, r7) {
switch (t6) {
case "$type":
return ["filter-type-" + r7, e6];
case "$id":
return ["filter-id-" + r7, e6];
default:
return ["filter-" + r7, t6, e6];
}
}
function pn2(t6, e6) {
if (0 === e6.length) {
return false;
}
switch (t6) {
case "$type":
return ["filter-type-in", ["literal", e6]];
case "$id":
return ["filter-id-in", ["literal", e6]];
default:
return e6.length > 200 && !e6.some(function(t7) {
return typeof t7 != typeof e6[0];
}) ? ["filter-in-large", t6, ["literal", e6.sort(sn2)]] : ["filter-in-small", t6, ["literal", e6]];
}
}
function cn2(t6) {
switch (t6) {
case "$type":
return true;
case "$id":
return ["filter-has-id"];
default:
return ["filter-has", t6];
}
}
function hn2(t6) {
return ["!", t6];
}
function fn3(t6) {
return nn2(Vt2(t6.value)) ? en2(Bt2({}, t6, { expressionContext: "filter", valueSpec: { value: "boolean" } })) : function t7(e6) {
var r7 = e6.value, n8 = e6.key;
if ("array" !== Dr(r7)) {
return [new Pt2(n8, r7, "array expected, " + Dr(r7) + " found")];
}
var i6, a6 = e6.styleSpec, o6 = [];
if (r7.length < 1) {
return [new Pt2(n8, r7, "filter array must have at least 1 element")];
}
switch (o6 = o6.concat(rn2({ key: n8 + "[0]", value: r7[0], valueSpec: a6.filter_operator, style: e6.style, styleSpec: e6.styleSpec })), Tt2(r7[0])) {
case "<":
case "<=":
case ">":
case ">=":
r7.length >= 2 && "$type" === Tt2(r7[1]) && o6.push(new Pt2(n8, r7, '"$type" cannot be use with operator "' + r7[0] + '"'));
case "==":
case "!=":
3 !== r7.length && o6.push(new Pt2(n8, r7, 'filter array for operator "' + r7[0] + '" must have 3 elements'));
case "in":
case "!in":
r7.length >= 2 && "string" !== (i6 = Dr(r7[1])) && o6.push(new Pt2(n8 + "[1]", r7[1], "string expected, " + i6 + " found"));
for (var s7 = 2; s7 < r7.length; s7++) {
i6 = Dr(r7[s7]), "$type" === Tt2(r7[1]) ? o6 = o6.concat(rn2({ key: n8 + "[" + s7 + "]", value: r7[s7], valueSpec: a6.geometry_type, style: e6.style, styleSpec: e6.styleSpec })) : "string" !== i6 && "number" !== i6 && "boolean" !== i6 && o6.push(new Pt2(n8 + "[" + s7 + "]", r7[s7], "string, number, or boolean expected, " + i6 + " found"));
}
break;
case "any":
case "all":
case "none":
for (var u5 = 1; u5 < r7.length; u5++) {
o6 = o6.concat(t7({ key: n8 + "[" + u5 + "]", value: r7[u5], style: e6.style, styleSpec: e6.styleSpec }));
}
break;
case "has":
case "!has":
i6 = Dr(r7[1]), 2 !== r7.length ? o6.push(new Pt2(n8, r7, 'filter array for "' + r7[0] + '" operator must have 2 elements')) : "string" !== i6 && o6.push(new Pt2(n8 + "[1]", r7[1], "string expected, " + i6 + " found"));
break;
case "within":
i6 = Dr(r7[1]), 2 !== r7.length ? o6.push(new Pt2(n8, r7, 'filter array for "' + r7[0] + '" operator must have 2 elements')) : "object" !== i6 && o6.push(new Pt2(n8 + "[1]", r7[1], "object expected, " + i6 + " found"));
}
return o6;
}(t6);
}
function yn2(t6, e6) {
var r7 = t6.key, n8 = t6.style, i6 = t6.styleSpec, a6 = t6.value, o6 = t6.objectKey, s7 = i6[e6 + "_" + t6.layerType];
if (!s7) {
return [];
}
var u5 = o6.match(/^(.*)-transition$/);
if ("paint" === e6 && u5 && s7[u5[1]] && s7[u5[1]].transition) {
return An2({ key: r7, value: a6, valueSpec: i6.transition, style: n8, styleSpec: i6 });
}
var l8, p5 = t6.valueSpec || s7[o6];
if (!p5) {
return [new Pt2(r7, a6, 'unknown property "' + o6 + '"')];
}
if ("string" === Dr(a6) && Tr(p5) && !p5.tokens && (l8 = /^{([^}]+)}$/.exec(a6))) {
return [new Pt2(r7, a6, '"' + o6 + '" does not support interpolation syntax\nUse an identity property function instead: `{ "type": "identity", "property": ' + JSON.stringify(l8[1]) + " }`.")];
}
var c5 = [];
return "symbol" === t6.layerType && ("text-field" === o6 && n8 && !n8.glyphs && c5.push(new Pt2(r7, a6, 'use of "text-field" requires a style "glyphs" property')), "text-font" === o6 && Lr(Vt2(a6)) && "identity" === Tt2(a6.type) && c5.push(new Pt2(r7, a6, '"text-font" does not support identity functions'))), c5.concat(An2({ key: t6.key, value: a6, valueSpec: p5, style: n8, styleSpec: i6, expressionContext: "property", propertyType: e6, propertyKey: o6 }));
}
function dn2(t6) {
return yn2(t6, "paint");
}
function mn2(t6) {
return yn2(t6, "layout");
}
function vn2(t6) {
var e6 = [], r7 = t6.value, n8 = t6.key, i6 = t6.style, a6 = t6.styleSpec;
r7.type || r7.ref || e6.push(new Pt2(n8, r7, 'either "type" or "ref" is required'));
var o6, s7 = Tt2(r7.type), u5 = Tt2(r7.ref);
if (r7.id) {
for (var l8 = Tt2(r7.id), p5 = 0; p5 < t6.arrayIndex; p5++) {
var c5 = i6.layers[p5];
Tt2(c5.id) === l8 && e6.push(new Pt2(n8, r7.id, 'duplicate layer id "' + r7.id + '", previously used at line ' + c5.id.__line__));
}
}
if ("ref" in r7) {
["type", "source", "source-layer", "filter", "layout"].forEach(function(t7) {
t7 in r7 && e6.push(new Pt2(n8, r7[t7], '"' + t7 + '" is prohibited for ref layers'));
}), i6.layers.forEach(function(t7) {
Tt2(t7.id) === u5 && (o6 = t7);
}), o6 ? o6.ref ? e6.push(new Pt2(n8, r7.ref, "ref cannot reference another ref layer")) : s7 = Tt2(o6.type) : e6.push(new Pt2(n8, r7.ref, 'ref layer "' + u5 + '" not found'));
} else if ("background" !== s7) {
if (r7.source) {
var h7 = i6.sources && i6.sources[r7.source], f5 = h7 && Tt2(h7.type);
h7 ? "vector" === f5 && "raster" === s7 ? e6.push(new Pt2(n8, r7.source, 'layer "' + r7.id + '" requires a raster source')) : "raster" === f5 && "raster" !== s7 ? e6.push(new Pt2(n8, r7.source, 'layer "' + r7.id + '" requires a vector source')) : "vector" !== f5 || r7["source-layer"] ? "raster-dem" === f5 && "hillshade" !== s7 ? e6.push(new Pt2(n8, r7.source, "raster-dem source can only be used with layer type 'hillshade'.")) : "line" !== s7 || !r7.paint || !r7.paint["line-gradient"] || "geojson" === f5 && h7.lineMetrics || e6.push(new Pt2(n8, r7, 'layer "' + r7.id + '" specifies a line-gradient, which requires a GeoJSON source with `lineMetrics` enabled.')) : e6.push(new Pt2(n8, r7, 'layer "' + r7.id + '" must specify a "source-layer"')) : e6.push(new Pt2(n8, r7.source, 'source "' + r7.source + '" not found'));
} else {
e6.push(new Pt2(n8, r7, 'missing required property "source"'));
}
}
return e6 = e6.concat($r({ key: n8, value: r7, valueSpec: a6.layer, style: t6.style, styleSpec: t6.styleSpec, objectElementValidators: { "*": function() {
return [];
}, type: function() {
return An2({ key: n8 + ".type", value: r7.type, valueSpec: a6.layer.type, style: t6.style, styleSpec: t6.styleSpec, object: r7, objectKey: "type" });
}, filter: fn3, layout: function(t7) {
return $r({ layer: r7, key: t7.key, value: t7.value, style: t7.style, styleSpec: t7.styleSpec, objectElementValidators: { "*": function(t8) {
return mn2(Bt2({ layerType: s7 }, t8));
} } });
}, paint: function(t7) {
return $r({ layer: r7, key: t7.key, value: t7.value, style: t7.style, styleSpec: t7.styleSpec, objectElementValidators: { "*": function(t8) {
return dn2(Bt2({ layerType: s7 }, t8));
} } });
} } }));
}
function gn2(t6) {
var e6 = t6.value, r7 = t6.key, n8 = Dr(e6);
return "string" !== n8 ? [new Pt2(r7, e6, "string expected, " + n8 + " found")] : [];
}
var xn2 = { promoteId: function(t6) {
var e6 = t6.key, r7 = t6.value;
if ("string" === Dr(r7)) {
return gn2({ key: e6, value: r7 });
}
var n8 = [];
for (var i6 in r7) {
n8.push.apply(n8, gn2({ key: e6 + "." + i6, value: r7[i6] }));
}
return n8;
} };
function bn2(t6) {
var e6 = t6.value, r7 = t6.key, n8 = t6.styleSpec, i6 = t6.style;
if (!e6.type) {
return [new Pt2(r7, e6, '"type" is required')];
}
var a6, o6 = Tt2(e6.type);
switch (o6) {
case "vector":
case "raster":
case "raster-dem":
return $r({ key: r7, value: e6, valueSpec: n8["source_" + o6.replace("-", "_")], style: t6.style, styleSpec: n8, objectElementValidators: xn2 });
case "geojson":
if (a6 = $r({ key: r7, value: e6, valueSpec: n8.source_geojson, style: i6, styleSpec: n8, objectElementValidators: xn2 }), e6.cluster) {
for (var s7 in e6.clusterProperties) {
var u5 = e6.clusterProperties[s7], l8 = u5[0], p5 = "string" == typeof l8 ? [l8, ["accumulated"], ["get", s7]] : l8;
a6.push.apply(a6, en2({ key: r7 + "." + s7 + ".map", value: u5[1], expressionContext: "cluster-map" })), a6.push.apply(a6, en2({ key: r7 + "." + s7 + ".reduce", value: p5, expressionContext: "cluster-reduce" }));
}
}
return a6;
case "video":
return $r({ key: r7, value: e6, valueSpec: n8.source_video, style: i6, styleSpec: n8 });
case "image":
return $r({ key: r7, value: e6, valueSpec: n8.source_image, style: i6, styleSpec: n8 });
case "canvas":
return [new Pt2(r7, null, "Please use runtime APIs to add canvas sources, rather than including them in stylesheets.", "source.canvas")];
default:
return rn2({ key: r7 + ".type", value: e6.type, valueSpec: { values: ["vector", "raster", "raster-dem", "geojson", "video", "image"] }, style: i6, styleSpec: n8 });
}
}
function wn2(t6) {
var e6 = t6.value, r7 = t6.styleSpec, n8 = r7.light, i6 = t6.style, a6 = [], o6 = Dr(e6);
if (void 0 === e6) {
return a6;
}
if ("object" !== o6) {
return a6.concat([new Pt2("light", e6, "object expected, " + o6 + " found")]);
}
for (var s7 in e6) {
var u5 = s7.match(/^(.*)-transition$/);
a6 = a6.concat(u5 && n8[u5[1]] && n8[u5[1]].transition ? An2({ key: s7, value: e6[s7], valueSpec: r7.transition, style: i6, styleSpec: r7 }) : n8[s7] ? An2({ key: s7, value: e6[s7], valueSpec: n8[s7], style: i6, styleSpec: r7 }) : [new Pt2(s7, e6[s7], 'unknown property "' + s7 + '"')]);
}
return a6;
}
var _n2 = { "*": function() {
return [];
}, array: Wr, boolean: function(t6) {
var e6 = t6.value, r7 = t6.key, n8 = Dr(e6);
return "boolean" !== n8 ? [new Pt2(r7, e6, "boolean expected, " + n8 + " found")] : [];
}, number: Qr, color: function(t6) {
var e6 = t6.key, r7 = t6.value, n8 = Dr(r7);
return "string" !== n8 ? [new Pt2(e6, r7, "color expected, " + n8 + " found")] : null === Qt2(r7) ? [new Pt2(e6, r7, 'color expected, "' + r7 + '" found')] : [];
}, constants: Mt2, enum: rn2, filter: fn3, function: tn2, layer: vn2, object: $r, source: bn2, light: wn2, string: gn2, formatted: function(t6) {
return 0 === gn2(t6).length ? [] : en2(t6);
}, resolvedImage: function(t6) {
return 0 === gn2(t6).length ? [] : en2(t6);
} };
function An2(t6) {
var e6 = t6.value, r7 = t6.valueSpec, n8 = t6.styleSpec;
return r7.expression && Lr(Tt2(e6)) ? tn2(t6) : r7.expression && Gr(Vt2(e6)) ? en2(t6) : r7.type && _n2[r7.type] ? _n2[r7.type](t6) : $r(Bt2({}, t6, { valueSpec: r7.type ? n8[r7.type] : r7 }));
}
function Sn2(t6) {
var e6 = t6.value, r7 = t6.key, n8 = gn2(t6);
return n8.length || (-1 === e6.indexOf("{fontstack}") && n8.push(new Pt2(r7, e6, '"glyphs" url must include a "{fontstack}" token')), -1 === e6.indexOf("{range}") && n8.push(new Pt2(r7, e6, '"glyphs" url must include a "{range}" token'))), n8;
}
function kn2(t6, e6) {
void 0 === e6 && (e6 = Et2);
var r7 = [];
return r7 = r7.concat(An2({ key: "", value: t6, valueSpec: e6.$root, styleSpec: e6, style: t6, objectElementValidators: { glyphs: Sn2, "*": function() {
return [];
} } })), t6.constants && (r7 = r7.concat(Mt2({ key: "constants", value: t6.constants, style: t6, styleSpec: e6 }))), In2(r7);
}
function In2(t6) {
return [].concat(t6).sort(function(t7, e6) {
return t7.line - e6.line;
});
}
function zn2(t6) {
return function() {
var arguments$1 = arguments;
for (var e6 = [], r7 = arguments.length; r7--; ) {
e6[r7] = arguments$1[r7];
}
return In2(t6.apply(this, e6));
};
}
kn2.source = zn2(bn2), kn2.light = zn2(wn2), kn2.layer = zn2(vn2), kn2.filter = zn2(fn3), kn2.paintProperty = zn2(dn2), kn2.layoutProperty = zn2(mn2);
var Cn2 = kn2, En2 = Cn2.light, Pn2 = Cn2.paintProperty, Mn2 = Cn2.layoutProperty;
function Bn2(t6, e6) {
var r7 = false;
if (e6 && e6.length) {
for (var n8 = 0, i6 = e6; n8 < i6.length; n8 += 1) {
t6.fire(new zt2(new Error(i6[n8].message))), r7 = true;
}
}
return r7;
}
var Tn2 = Vn2;
function Vn2(t6, e6, r7) {
var n8 = this.cells = [];
if (t6 instanceof ArrayBuffer) {
this.arrayBuffer = t6;
var i6 = new Int32Array(this.arrayBuffer);
t6 = i6[0], this.d = (e6 = i6[1]) + 2 * (r7 = i6[2]);
for (var a6 = 0; a6 < this.d * this.d; a6++) {
var o6 = i6[3 + a6], s7 = i6[3 + a6 + 1];
n8.push(o6 === s7 ? null : i6.subarray(o6, s7));
}
var u5 = i6[3 + n8.length + 1];
this.keys = i6.subarray(i6[3 + n8.length], u5), this.bboxes = i6.subarray(u5), this.insert = this._insertReadonly;
} else {
this.d = e6 + 2 * r7;
for (var l8 = 0; l8 < this.d * this.d; l8++) {
n8.push([]);
}
this.keys = [], this.bboxes = [];
}
this.n = e6, this.extent = t6, this.padding = r7, this.scale = e6 / t6, this.uid = 0;
var p5 = r7 / e6 * t6;
this.min = -p5, this.max = t6 + p5;
}
Vn2.prototype.insert = function(t6, e6, r7, n8, i6) {
this._forEachCell(e6, r7, n8, i6, this._insertCell, this.uid++), this.keys.push(t6), this.bboxes.push(e6), this.bboxes.push(r7), this.bboxes.push(n8), this.bboxes.push(i6);
}, Vn2.prototype._insertReadonly = function() {
throw "Cannot insert into a GridIndex created from an ArrayBuffer.";
}, Vn2.prototype._insertCell = function(t6, e6, r7, n8, i6, a6) {
this.cells[i6].push(a6);
}, Vn2.prototype.query = function(t6, e6, r7, n8, i6) {
var a6 = this.min, o6 = this.max;
if (t6 <= a6 && e6 <= a6 && o6 <= r7 && o6 <= n8 && !i6) {
return Array.prototype.slice.call(this.keys);
}
var s7 = [];
return this._forEachCell(t6, e6, r7, n8, this._queryCell, s7, {}, i6), s7;
}, Vn2.prototype._queryCell = function(t6, e6, r7, n8, i6, a6, o6, s7) {
var u5 = this.cells[i6];
if (null !== u5) {
for (var l8 = this.keys, p5 = this.bboxes, c5 = 0; c5 < u5.length; c5++) {
var h7 = u5[c5];
if (void 0 === o6[h7]) {
var f5 = 4 * h7;
(s7 ? s7(p5[f5 + 0], p5[f5 + 1], p5[f5 + 2], p5[f5 + 3]) : t6 <= p5[f5 + 2] && e6 <= p5[f5 + 3] && r7 >= p5[f5 + 0] && n8 >= p5[f5 + 1]) ? (o6[h7] = true, a6.push(l8[h7])) : o6[h7] = false;
}
}
}
}, Vn2.prototype._forEachCell = function(t6, e6, r7, n8, i6, a6, o6, s7) {
for (var u5 = this._convertToCellCoord(t6), l8 = this._convertToCellCoord(e6), p5 = this._convertToCellCoord(r7), c5 = this._convertToCellCoord(n8), h7 = u5; h7 <= p5; h7++) {
for (var f5 = l8; f5 <= c5; f5++) {
var y5 = this.d * f5 + h7;
if ((!s7 || s7(this._convertFromCellCoord(h7), this._convertFromCellCoord(f5), this._convertFromCellCoord(h7 + 1), this._convertFromCellCoord(f5 + 1))) && i6.call(this, t6, e6, r7, n8, y5, a6, o6, s7)) {
return;
}
}
}
}, Vn2.prototype._convertFromCellCoord = function(t6) {
return (t6 - this.padding) / this.scale;
}, Vn2.prototype._convertToCellCoord = function(t6) {
return Math.max(0, Math.min(this.d - 1, Math.floor(t6 * this.scale) + this.padding));
}, Vn2.prototype.toArrayBuffer = function() {
if (this.arrayBuffer) {
return this.arrayBuffer;
}
for (var t6 = this.cells, e6 = 3 + this.cells.length + 1 + 1, r7 = 0, n8 = 0; n8 < this.cells.length; n8++) {
r7 += this.cells[n8].length;
}
var i6 = new Int32Array(e6 + r7 + this.keys.length + this.bboxes.length);
i6[0] = this.extent, i6[1] = this.n, i6[2] = this.padding;
for (var a6 = e6, o6 = 0; o6 < t6.length; o6++) {
var s7 = t6[o6];
i6[3 + o6] = a6, i6.set(s7, a6), a6 += s7.length;
}
return i6[3 + t6.length] = a6, i6.set(this.keys, a6), i6[3 + t6.length + 1] = a6 += this.keys.length, i6.set(this.bboxes, a6), a6 += this.bboxes.length, i6.buffer;
};
var Fn2 = o5.ImageData, Dn2 = o5.ImageBitmap, Ln2 = {};
function On2(t6, e6, r7) {
void 0 === r7 && (r7 = {}), Object.defineProperty(e6, "_classRegistryKey", { value: t6, writeable: false }), Ln2[t6] = { klass: e6, omit: r7.omit || [], shallow: r7.shallow || [] };
}
for (var Rn2 in On2("Object", Object), Tn2.serialize = function(t6, e6) {
var r7 = t6.toArrayBuffer();
return e6 && e6.push(r7), { buffer: r7 };
}, Tn2.deserialize = function(t6) {
return new Tn2(t6.buffer);
}, On2("Grid", Tn2), On2("Color", te2), On2("Error", Error), On2("ResolvedImage", ie4), On2("StylePropertyFunction", Yr), On2("StyleExpression", Kr, { omit: ["_evaluator"] }), On2("ZoomDependentExpression", Jr), On2("ZoomConstantExpression", Xr), On2("CompoundExpression", xe2, { omit: ["_evaluate"] }), Ir) {
Ir[Rn2]._classRegistryKey || On2("Expression_" + Rn2, Ir[Rn2]);
}
function Un2(t6) {
return t6 && "undefined" != typeof ArrayBuffer && (t6 instanceof ArrayBuffer || t6.constructor && "ArrayBuffer" === t6.constructor.name);
}
function jn2(t6) {
return Dn2 && t6 instanceof Dn2;
}
function qn2(t6, e6) {
if (null == t6 || "boolean" == typeof t6 || "number" == typeof t6 || "string" == typeof t6 || t6 instanceof Boolean || t6 instanceof Number || t6 instanceof String || t6 instanceof Date || t6 instanceof RegExp) {
return t6;
}
if (Un2(t6) || jn2(t6)) {
return e6 && e6.push(t6), t6;
}
if (ArrayBuffer.isView(t6)) {
var r7 = t6;
return e6 && e6.push(r7.buffer), r7;
}
if (t6 instanceof Fn2) {
return e6 && e6.push(t6.data.buffer), t6;
}
if (Array.isArray(t6)) {
for (var n8 = [], i6 = 0, a6 = t6; i6 < a6.length; i6 += 1) {
n8.push(qn2(a6[i6], e6));
}
return n8;
}
if ("object" == typeof t6) {
var o6 = t6.constructor, s7 = o6._classRegistryKey;
if (!s7) {
throw new Error("can't serialize object of unregistered class");
}
var u5 = o6.serialize ? o6.serialize(t6, e6) : {};
if (!o6.serialize) {
for (var l8 in t6) {
if (t6.hasOwnProperty(l8) && !(Ln2[s7].omit.indexOf(l8) >= 0)) {
var p5 = t6[l8];
u5[l8] = Ln2[s7].shallow.indexOf(l8) >= 0 ? p5 : qn2(p5, e6);
}
}
t6 instanceof Error && (u5.message = t6.message);
}
if (u5.$name) {
throw new Error("$name property is reserved for worker serialization logic.");
}
return "Object" !== s7 && (u5.$name = s7), u5;
}
throw new Error("can't serialize object of type " + typeof t6);
}
function Nn2(t6) {
if (null == t6 || "boolean" == typeof t6 || "number" == typeof t6 || "string" == typeof t6 || t6 instanceof Boolean || t6 instanceof Number || t6 instanceof String || t6 instanceof Date || t6 instanceof RegExp || Un2(t6) || jn2(t6) || ArrayBuffer.isView(t6) || t6 instanceof Fn2) {
return t6;
}
if (Array.isArray(t6)) {
return t6.map(Nn2);
}
if ("object" == typeof t6) {
var e6 = t6.$name || "Object", r7 = Ln2[e6].klass;
if (!r7) {
throw new Error("can't deserialize unregistered class " + e6);
}
if (r7.deserialize) {
return r7.deserialize(t6);
}
for (var n8 = Object.create(r7.prototype), i6 = 0, a6 = Object.keys(t6); i6 < a6.length; i6 += 1) {
var o6 = a6[i6];
if ("$name" !== o6) {
var s7 = t6[o6];
n8[o6] = Ln2[e6].shallow.indexOf(o6) >= 0 ? s7 : Nn2(s7);
}
}
return n8;
}
throw new Error("can't deserialize object of type " + typeof t6);
}
var Kn2 = function() {
this.first = true;
};
Kn2.prototype.update = function(t6, e6) {
var r7 = Math.floor(t6);
return this.first ? (this.first = false, this.lastIntegerZoom = r7, this.lastIntegerZoomTime = 0, this.lastZoom = t6, this.lastFloorZoom = r7, true) : (this.lastFloorZoom > r7 ? (this.lastIntegerZoom = r7 + 1, this.lastIntegerZoomTime = e6) : this.lastFloorZoom < r7 && (this.lastIntegerZoom = r7, this.lastIntegerZoomTime = e6), t6 !== this.lastZoom && (this.lastZoom = t6, this.lastFloorZoom = r7, true));
};
var Gn2 = { "Latin-1 Supplement": function(t6) {
return t6 >= 128 && t6 <= 255;
}, Arabic: function(t6) {
return t6 >= 1536 && t6 <= 1791;
}, "Arabic Supplement": function(t6) {
return t6 >= 1872 && t6 <= 1919;
}, "Arabic Extended-A": function(t6) {
return t6 >= 2208 && t6 <= 2303;
}, "Hangul Jamo": function(t6) {
return t6 >= 4352 && t6 <= 4607;
}, "Unified Canadian Aboriginal Syllabics": function(t6) {
return t6 >= 5120 && t6 <= 5759;
}, Khmer: function(t6) {
return t6 >= 6016 && t6 <= 6143;
}, "Unified Canadian Aboriginal Syllabics Extended": function(t6) {
return t6 >= 6320 && t6 <= 6399;
}, "General Punctuation": function(t6) {
return t6 >= 8192 && t6 <= 8303;
}, "Letterlike Symbols": function(t6) {
return t6 >= 8448 && t6 <= 8527;
}, "Number Forms": function(t6) {
return t6 >= 8528 && t6 <= 8591;
}, "Miscellaneous Technical": function(t6) {
return t6 >= 8960 && t6 <= 9215;
}, "Control Pictures": function(t6) {
return t6 >= 9216 && t6 <= 9279;
}, "Optical Character Recognition": function(t6) {
return t6 >= 9280 && t6 <= 9311;
}, "Enclosed Alphanumerics": function(t6) {
return t6 >= 9312 && t6 <= 9471;
}, "Geometric Shapes": function(t6) {
return t6 >= 9632 && t6 <= 9727;
}, "Miscellaneous Symbols": function(t6) {
return t6 >= 9728 && t6 <= 9983;
}, "Miscellaneous Symbols and Arrows": function(t6) {
return t6 >= 11008 && t6 <= 11263;
}, "CJK Radicals Supplement": function(t6) {
return t6 >= 11904 && t6 <= 12031;
}, "Kangxi Radicals": function(t6) {
return t6 >= 12032 && t6 <= 12255;
}, "Ideographic Description Characters": function(t6) {
return t6 >= 12272 && t6 <= 12287;
}, "CJK Symbols and Punctuation": function(t6) {
return t6 >= 12288 && t6 <= 12351;
}, Hiragana: function(t6) {
return t6 >= 12352 && t6 <= 12447;
}, Katakana: function(t6) {
return t6 >= 12448 && t6 <= 12543;
}, Bopomofo: function(t6) {
return t6 >= 12544 && t6 <= 12591;
}, "Hangul Compatibility Jamo": function(t6) {
return t6 >= 12592 && t6 <= 12687;
}, Kanbun: function(t6) {
return t6 >= 12688 && t6 <= 12703;
}, "Bopomofo Extended": function(t6) {
return t6 >= 12704 && t6 <= 12735;
}, "CJK Strokes": function(t6) {
return t6 >= 12736 && t6 <= 12783;
}, "Katakana Phonetic Extensions": function(t6) {
return t6 >= 12784 && t6 <= 12799;
}, "Enclosed CJK Letters and Months": function(t6) {
return t6 >= 12800 && t6 <= 13055;
}, "CJK Compatibility": function(t6) {
return t6 >= 13056 && t6 <= 13311;
}, "CJK Unified Ideographs Extension A": function(t6) {
return t6 >= 13312 && t6 <= 19903;
}, "Yijing Hexagram Symbols": function(t6) {
return t6 >= 19904 && t6 <= 19967;
}, "CJK Unified Ideographs": function(t6) {
return t6 >= 19968 && t6 <= 40959;
}, "Yi Syllables": function(t6) {
return t6 >= 40960 && t6 <= 42127;
}, "Yi Radicals": function(t6) {
return t6 >= 42128 && t6 <= 42191;
}, "Hangul Jamo Extended-A": function(t6) {
return t6 >= 43360 && t6 <= 43391;
}, "Hangul Syllables": function(t6) {
return t6 >= 44032 && t6 <= 55215;
}, "Hangul Jamo Extended-B": function(t6) {
return t6 >= 55216 && t6 <= 55295;
}, "Private Use Area": function(t6) {
return t6 >= 57344 && t6 <= 63743;
}, "CJK Compatibility Ideographs": function(t6) {
return t6 >= 63744 && t6 <= 64255;
}, "Arabic Presentation Forms-A": function(t6) {
return t6 >= 64336 && t6 <= 65023;
}, "Vertical Forms": function(t6) {
return t6 >= 65040 && t6 <= 65055;
}, "CJK Compatibility Forms": function(t6) {
return t6 >= 65072 && t6 <= 65103;
}, "Small Form Variants": function(t6) {
return t6 >= 65104 && t6 <= 65135;
}, "Arabic Presentation Forms-B": function(t6) {
return t6 >= 65136 && t6 <= 65279;
}, "Halfwidth and Fullwidth Forms": function(t6) {
return t6 >= 65280 && t6 <= 65519;
} };
function Zn2(t6) {
for (var e6 = 0, r7 = t6; e6 < r7.length; e6 += 1) {
if (Xn2(r7[e6].charCodeAt(0))) {
return true;
}
}
return false;
}
function Xn2(t6) {
return !(746 !== t6 && 747 !== t6 && (t6 < 4352 || !(Gn2["Bopomofo Extended"](t6) || Gn2.Bopomofo(t6) || Gn2["CJK Compatibility Forms"](t6) && !(t6 >= 65097 && t6 <= 65103) || Gn2["CJK Compatibility Ideographs"](t6) || Gn2["CJK Compatibility"](t6) || Gn2["CJK Radicals Supplement"](t6) || Gn2["CJK Strokes"](t6) || !(!Gn2["CJK Symbols and Punctuation"](t6) || t6 >= 12296 && t6 <= 12305 || t6 >= 12308 && t6 <= 12319 || 12336 === t6) || Gn2["CJK Unified Ideographs Extension A"](t6) || Gn2["CJK Unified Ideographs"](t6) || Gn2["Enclosed CJK Letters and Months"](t6) || Gn2["Hangul Compatibility Jamo"](t6) || Gn2["Hangul Jamo Extended-A"](t6) || Gn2["Hangul Jamo Extended-B"](t6) || Gn2["Hangul Jamo"](t6) || Gn2["Hangul Syllables"](t6) || Gn2.Hiragana(t6) || Gn2["Ideographic Description Characters"](t6) || Gn2.Kanbun(t6) || Gn2["Kangxi Radicals"](t6) || Gn2["Katakana Phonetic Extensions"](t6) || Gn2.Katakana(t6) && 12540 !== t6 || !(!Gn2["Halfwidth and Fullwidth Forms"](t6) || 65288 === t6 || 65289 === t6 || 65293 === t6 || t6 >= 65306 && t6 <= 65310 || 65339 === t6 || 65341 === t6 || 65343 === t6 || t6 >= 65371 && t6 <= 65503 || 65507 === t6 || t6 >= 65512 && t6 <= 65519) || !(!Gn2["Small Form Variants"](t6) || t6 >= 65112 && t6 <= 65118 || t6 >= 65123 && t6 <= 65126) || Gn2["Unified Canadian Aboriginal Syllabics"](t6) || Gn2["Unified Canadian Aboriginal Syllabics Extended"](t6) || Gn2["Vertical Forms"](t6) || Gn2["Yijing Hexagram Symbols"](t6) || Gn2["Yi Syllables"](t6) || Gn2["Yi Radicals"](t6))));
}
function Jn2(t6) {
return !(Xn2(t6) || function(t7) {
return !!(Gn2["Latin-1 Supplement"](t7) && (167 === t7 || 169 === t7 || 174 === t7 || 177 === t7 || 188 === t7 || 189 === t7 || 190 === t7 || 215 === t7 || 247 === t7) || Gn2["General Punctuation"](t7) && (8214 === t7 || 8224 === t7 || 8225 === t7 || 8240 === t7 || 8241 === t7 || 8251 === t7 || 8252 === t7 || 8258 === t7 || 8263 === t7 || 8264 === t7 || 8265 === t7 || 8273 === t7) || Gn2["Letterlike Symbols"](t7) || Gn2["Number Forms"](t7) || Gn2["Miscellaneous Technical"](t7) && (t7 >= 8960 && t7 <= 8967 || t7 >= 8972 && t7 <= 8991 || t7 >= 8996 && t7 <= 9e3 || 9003 === t7 || t7 >= 9085 && t7 <= 9114 || t7 >= 9150 && t7 <= 9165 || 9167 === t7 || t7 >= 9169 && t7 <= 9179 || t7 >= 9186 && t7 <= 9215) || Gn2["Control Pictures"](t7) && 9251 !== t7 || Gn2["Optical Character Recognition"](t7) || Gn2["Enclosed Alphanumerics"](t7) || Gn2["Geometric Shapes"](t7) || Gn2["Miscellaneous Symbols"](t7) && !(t7 >= 9754 && t7 <= 9759) || Gn2["Miscellaneous Symbols and Arrows"](t7) && (t7 >= 11026 && t7 <= 11055 || t7 >= 11088 && t7 <= 11097 || t7 >= 11192 && t7 <= 11243) || Gn2["CJK Symbols and Punctuation"](t7) || Gn2.Katakana(t7) || Gn2["Private Use Area"](t7) || Gn2["CJK Compatibility Forms"](t7) || Gn2["Small Form Variants"](t7) || Gn2["Halfwidth and Fullwidth Forms"](t7) || 8734 === t7 || 8756 === t7 || 8757 === t7 || t7 >= 9984 && t7 <= 10087 || t7 >= 10102 && t7 <= 10131 || 65532 === t7 || 65533 === t7);
}(t6));
}
function Hn2(t6) {
return t6 >= 1424 && t6 <= 2303 || Gn2["Arabic Presentation Forms-A"](t6) || Gn2["Arabic Presentation Forms-B"](t6);
}
function Yn2(t6, e6) {
return !(!e6 && Hn2(t6) || t6 >= 2304 && t6 <= 3583 || t6 >= 3840 && t6 <= 4255 || Gn2.Khmer(t6));
}
function $n2(t6) {
for (var e6 = 0, r7 = t6; e6 < r7.length; e6 += 1) {
if (Hn2(r7[e6].charCodeAt(0))) {
return true;
}
}
return false;
}
var Wn2 = null, Qn2 = "unavailable", ti2 = null, ei2 = function(t6) {
t6 && "string" == typeof t6 && t6.indexOf("NetworkError") > -1 && (Qn2 = "error"), Wn2 && Wn2(t6);
};
function ri2() {
ni2.fire(new It2("pluginStateChange", { pluginStatus: Qn2, pluginURL: ti2 }));
}
var ni2 = new Ct2(), ii2 = function() {
return Qn2;
}, ai2 = function() {
if ("deferred" !== Qn2 || !ti2) {
throw new Error("rtl-text-plugin cannot be downloaded unless a pluginURL is specified");
}
Qn2 = "loading", ri2(), ti2 && bt2({ url: ti2 }, function(t6) {
t6 ? ei2(t6) : (Qn2 = "loaded", ri2());
});
}, oi2 = { applyArabicShaping: null, processBidirectionalText: null, processStyledBidirectionalText: null, isLoaded: function() {
return "loaded" === Qn2 || null != oi2.applyArabicShaping;
}, isLoading: function() {
return "loading" === Qn2;
}, setState: function(t6) {
Qn2 = t6.pluginStatus, ti2 = t6.pluginURL;
}, isParsed: function() {
return null != oi2.applyArabicShaping && null != oi2.processBidirectionalText && null != oi2.processStyledBidirectionalText;
}, getPluginURL: function() {
return ti2;
} }, si2 = function(t6, e6) {
this.zoom = t6, e6 ? (this.now = e6.now, this.fadeDuration = e6.fadeDuration, this.zoomHistory = e6.zoomHistory, this.transition = e6.transition) : (this.now = 0, this.fadeDuration = 0, this.zoomHistory = new Kn2(), this.transition = {});
};
si2.prototype.isSupportedScript = function(t6) {
return function(t7, e6) {
for (var r7 = 0, n8 = t7; r7 < n8.length; r7 += 1) {
if (!Yn2(n8[r7].charCodeAt(0), e6)) {
return false;
}
}
return true;
}(t6, oi2.isLoaded());
}, si2.prototype.crossFadingFactor = function() {
return 0 === this.fadeDuration ? 1 : Math.min((this.now - this.zoomHistory.lastIntegerZoomTime) / this.fadeDuration, 1);
}, si2.prototype.getCrossfadeParameters = function() {
var t6 = this.zoom, e6 = t6 - Math.floor(t6), r7 = this.crossFadingFactor();
return t6 > this.zoomHistory.lastIntegerZoom ? { fromScale: 2, toScale: 1, t: e6 + (1 - e6) * r7 } : { fromScale: 0.5, toScale: 1, t: 1 - (1 - r7) * e6 };
};
var ui2 = function(t6, e6) {
this.property = t6, this.value = e6, this.expression = function(t7, e7) {
if (Lr(t7)) {
return new Yr(t7, e7);
}
if (Gr(t7)) {
var r7 = Hr(t7, e7);
if ("error" === r7.result) {
throw new Error(r7.value.map(function(t8) {
return t8.key + ": " + t8.message;
}).join(", "));
}
return r7.value;
}
var n8 = t7;
return "string" == typeof t7 && "color" === e7.type && (n8 = te2.parse(t7)), { kind: "constant", evaluate: function() {
return n8;
} };
}(void 0 === e6 ? t6.specification.default : e6, t6.specification);
};
ui2.prototype.isDataDriven = function() {
return "source" === this.expression.kind || "composite" === this.expression.kind;
}, ui2.prototype.possiblyEvaluate = function(t6, e6, r7) {
return this.property.possiblyEvaluate(this, t6, e6, r7);
};
var li2 = function(t6) {
this.property = t6, this.value = new ui2(t6, void 0);
};
li2.prototype.transitioned = function(t6, e6) {
return new ci2(this.property, this.value, e6, h6({}, t6.transition, this.transition), t6.now);
}, li2.prototype.untransitioned = function() {
return new ci2(this.property, this.value, null, {}, 0);
};
var pi2 = function(t6) {
this._properties = t6, this._values = Object.create(t6.defaultTransitionablePropertyValues);
};
pi2.prototype.getValue = function(t6) {
return w4(this._values[t6].value.value);
}, pi2.prototype.setValue = function(t6, e6) {
this._values.hasOwnProperty(t6) || (this._values[t6] = new li2(this._values[t6].property)), this._values[t6].value = new ui2(this._values[t6].property, null === e6 ? void 0 : w4(e6));
}, pi2.prototype.getTransition = function(t6) {
return w4(this._values[t6].transition);
}, pi2.prototype.setTransition = function(t6, e6) {
this._values.hasOwnProperty(t6) || (this._values[t6] = new li2(this._values[t6].property)), this._values[t6].transition = w4(e6) || void 0;
}, pi2.prototype.serialize = function() {
for (var t6 = {}, e6 = 0, r7 = Object.keys(this._values); e6 < r7.length; e6 += 1) {
var n8 = r7[e6], i6 = this.getValue(n8);
void 0 !== i6 && (t6[n8] = i6);
var a6 = this.getTransition(n8);
void 0 !== a6 && (t6[n8 + "-transition"] = a6);
}
return t6;
}, pi2.prototype.transitioned = function(t6, e6) {
for (var r7 = new hi2(this._properties), n8 = 0, i6 = Object.keys(this._values); n8 < i6.length; n8 += 1) {
var a6 = i6[n8];
r7._values[a6] = this._values[a6].transitioned(t6, e6._values[a6]);
}
return r7;
}, pi2.prototype.untransitioned = function() {
for (var t6 = new hi2(this._properties), e6 = 0, r7 = Object.keys(this._values); e6 < r7.length; e6 += 1) {
var n8 = r7[e6];
t6._values[n8] = this._values[n8].untransitioned();
}
return t6;
};
var ci2 = function(t6, e6, r7, n8, i6) {
this.property = t6, this.value = e6, this.begin = i6 + n8.delay || 0, this.end = this.begin + n8.duration || 0, t6.specification.transition && (n8.delay || n8.duration) && (this.prior = r7);
};
ci2.prototype.possiblyEvaluate = function(t6, e6, r7) {
var n8 = t6.now || 0, i6 = this.value.possiblyEvaluate(t6, e6, r7), a6 = this.prior;
if (a6) {
if (n8 > this.end) {
return this.prior = null, i6;
}
if (this.value.isDataDriven()) {
return this.prior = null, i6;
}
if (n8 < this.begin) {
return a6.possiblyEvaluate(t6, e6, r7);
}
var o6 = (n8 - this.begin) / (this.end - this.begin);
return this.property.interpolate(a6.possiblyEvaluate(t6, e6, r7), i6, function(t7) {
if (t7 <= 0) {
return 0;
}
if (t7 >= 1) {
return 1;
}
var e7 = t7 * t7, r8 = e7 * t7;
return 4 * (t7 < 0.5 ? r8 : 3 * (t7 - e7) + r8 - 0.75);
}(o6));
}
return i6;
};
var hi2 = function(t6) {
this._properties = t6, this._values = Object.create(t6.defaultTransitioningPropertyValues);
};
hi2.prototype.possiblyEvaluate = function(t6, e6, r7) {
for (var n8 = new di2(this._properties), i6 = 0, a6 = Object.keys(this._values); i6 < a6.length; i6 += 1) {
var o6 = a6[i6];
n8._values[o6] = this._values[o6].possiblyEvaluate(t6, e6, r7);
}
return n8;
}, hi2.prototype.hasTransition = function() {
for (var t6 = 0, e6 = Object.keys(this._values); t6 < e6.length; t6 += 1) {
if (this._values[e6[t6]].prior) {
return true;
}
}
return false;
};
var fi2 = function(t6) {
this._properties = t6, this._values = Object.create(t6.defaultPropertyValues);
};
fi2.prototype.getValue = function(t6) {
return w4(this._values[t6].value);
}, fi2.prototype.setValue = function(t6, e6) {
this._values[t6] = new ui2(this._values[t6].property, null === e6 ? void 0 : w4(e6));
}, fi2.prototype.serialize = function() {
for (var t6 = {}, e6 = 0, r7 = Object.keys(this._values); e6 < r7.length; e6 += 1) {
var n8 = r7[e6], i6 = this.getValue(n8);
void 0 !== i6 && (t6[n8] = i6);
}
return t6;
}, fi2.prototype.possiblyEvaluate = function(t6, e6, r7) {
for (var n8 = new di2(this._properties), i6 = 0, a6 = Object.keys(this._values); i6 < a6.length; i6 += 1) {
var o6 = a6[i6];
n8._values[o6] = this._values[o6].possiblyEvaluate(t6, e6, r7);
}
return n8;
};
var yi2 = function(t6, e6, r7) {
this.property = t6, this.value = e6, this.parameters = r7;
};
yi2.prototype.isConstant = function() {
return "constant" === this.value.kind;
}, yi2.prototype.constantOr = function(t6) {
return "constant" === this.value.kind ? this.value.value : t6;
}, yi2.prototype.evaluate = function(t6, e6, r7, n8) {
return this.property.evaluate(this.value, this.parameters, t6, e6, r7, n8);
};
var di2 = function(t6) {
this._properties = t6, this._values = Object.create(t6.defaultPossiblyEvaluatedValues);
};
di2.prototype.get = function(t6) {
return this._values[t6];
};
var mi2 = function(t6) {
this.specification = t6;
};
mi2.prototype.possiblyEvaluate = function(t6, e6) {
return t6.expression.evaluate(e6);
}, mi2.prototype.interpolate = function(t6, e6, r7) {
var n8 = Ge2[this.specification.type];
return n8 ? n8(t6, e6, r7) : t6;
};
var vi2 = function(t6, e6) {
this.specification = t6, this.overrides = e6;
};
vi2.prototype.possiblyEvaluate = function(t6, e6, r7, n8) {
return new yi2(this, "constant" === t6.expression.kind || "camera" === t6.expression.kind ? { kind: "constant", value: t6.expression.evaluate(e6, null, {}, r7, n8) } : t6.expression, e6);
}, vi2.prototype.interpolate = function(t6, e6, r7) {
if ("constant" !== t6.value.kind || "constant" !== e6.value.kind) {
return t6;
}
if (void 0 === t6.value.value || void 0 === e6.value.value) {
return new yi2(this, { kind: "constant", value: void 0 }, t6.parameters);
}
var n8 = Ge2[this.specification.type];
return n8 ? new yi2(this, { kind: "constant", value: n8(t6.value.value, e6.value.value, r7) }, t6.parameters) : t6;
}, vi2.prototype.evaluate = function(t6, e6, r7, n8, i6, a6) {
return "constant" === t6.kind ? t6.value : t6.evaluate(e6, r7, n8, i6, a6);
};
var gi2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.possiblyEvaluate = function(t7, e7, r7, n8) {
if (void 0 === t7.value) {
return new yi2(this, { kind: "constant", value: void 0 }, e7);
}
if ("constant" === t7.expression.kind) {
var i6 = t7.expression.evaluate(e7, null, {}, r7, n8), a6 = "resolvedImage" === t7.property.specification.type && "string" != typeof i6 ? i6.name : i6, o6 = this._calculate(a6, a6, a6, e7);
return new yi2(this, { kind: "constant", value: o6 }, e7);
}
if ("camera" === t7.expression.kind) {
var s7 = this._calculate(t7.expression.evaluate({ zoom: e7.zoom - 1 }), t7.expression.evaluate({ zoom: e7.zoom }), t7.expression.evaluate({ zoom: e7.zoom + 1 }), e7);
return new yi2(this, { kind: "constant", value: s7 }, e7);
}
return new yi2(this, t7.expression, e7);
}, e6.prototype.evaluate = function(t7, e7, r7, n8, i6, a6) {
if ("source" === t7.kind) {
var o6 = t7.evaluate(e7, r7, n8, i6, a6);
return this._calculate(o6, o6, o6, e7);
}
return "composite" === t7.kind ? this._calculate(t7.evaluate({ zoom: Math.floor(e7.zoom) - 1 }, r7, n8), t7.evaluate({ zoom: Math.floor(e7.zoom) }, r7, n8), t7.evaluate({ zoom: Math.floor(e7.zoom) + 1 }, r7, n8), e7) : t7.value;
}, e6.prototype._calculate = function(t7, e7, r7, n8) {
return n8.zoom > n8.zoomHistory.lastIntegerZoom ? { from: t7, to: e7 } : { from: r7, to: e7 };
}, e6.prototype.interpolate = function(t7) {
return t7;
}, e6;
}(vi2), xi2 = function(t6) {
this.specification = t6;
};
xi2.prototype.possiblyEvaluate = function(t6, e6, r7, n8) {
if (void 0 !== t6.value) {
if ("constant" === t6.expression.kind) {
var i6 = t6.expression.evaluate(e6, null, {}, r7, n8);
return this._calculate(i6, i6, i6, e6);
}
return this._calculate(t6.expression.evaluate(new si2(Math.floor(e6.zoom - 1), e6)), t6.expression.evaluate(new si2(Math.floor(e6.zoom), e6)), t6.expression.evaluate(new si2(Math.floor(e6.zoom + 1), e6)), e6);
}
}, xi2.prototype._calculate = function(t6, e6, r7, n8) {
return n8.zoom > n8.zoomHistory.lastIntegerZoom ? { from: t6, to: e6 } : { from: r7, to: e6 };
}, xi2.prototype.interpolate = function(t6) {
return t6;
};
var bi2 = function(t6) {
this.specification = t6;
};
bi2.prototype.possiblyEvaluate = function(t6, e6, r7, n8) {
return !!t6.expression.evaluate(e6, null, {}, r7, n8);
}, bi2.prototype.interpolate = function() {
return false;
};
var wi2 = function(t6) {
for (var e6 in this.properties = t6, this.defaultPropertyValues = {}, this.defaultTransitionablePropertyValues = {}, this.defaultTransitioningPropertyValues = {}, this.defaultPossiblyEvaluatedValues = {}, this.overridableProperties = [], t6) {
var r7 = t6[e6];
r7.specification.overridable && this.overridableProperties.push(e6);
var n8 = this.defaultPropertyValues[e6] = new ui2(r7, void 0), i6 = this.defaultTransitionablePropertyValues[e6] = new li2(r7);
this.defaultTransitioningPropertyValues[e6] = i6.untransitioned(), this.defaultPossiblyEvaluatedValues[e6] = n8.possiblyEvaluate({});
}
};
On2("DataDrivenProperty", vi2), On2("DataConstantProperty", mi2), On2("CrossFadedDataDrivenProperty", gi2), On2("CrossFadedProperty", xi2), On2("ColorRampProperty", bi2);
var _i2 = function(t6) {
function e6(e7, r7) {
if (t6.call(this), this.id = e7.id, this.type = e7.type, this._featureFilter = { filter: function() {
return true;
}, needGeometry: false }, "custom" !== e7.type && (this.metadata = (e7 = e7).metadata, this.minzoom = e7.minzoom, this.maxzoom = e7.maxzoom, "background" !== e7.type && (this.source = e7.source, this.sourceLayer = e7["source-layer"], this.filter = e7.filter), r7.layout && (this._unevaluatedLayout = new fi2(r7.layout)), r7.paint)) {
for (var n8 in this._transitionablePaint = new pi2(r7.paint), e7.paint) {
this.setPaintProperty(n8, e7.paint[n8], { validate: false });
}
for (var i6 in e7.layout) {
this.setLayoutProperty(i6, e7.layout[i6], { validate: false });
}
this._transitioningPaint = this._transitionablePaint.untransitioned(), this.paint = new di2(r7.paint);
}
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getCrossfadeParameters = function() {
return this._crossfadeParameters;
}, e6.prototype.getLayoutProperty = function(t7) {
return "visibility" === t7 ? this.visibility : this._unevaluatedLayout.getValue(t7);
}, e6.prototype.setLayoutProperty = function(t7, e7, r7) {
void 0 === r7 && (r7 = {}), null != e7 && this._validate(Mn2, "layers." + this.id + ".layout." + t7, t7, e7, r7) || ("visibility" !== t7 ? this._unevaluatedLayout.setValue(t7, e7) : this.visibility = e7);
}, e6.prototype.getPaintProperty = function(t7) {
return g4(t7, "-transition") ? this._transitionablePaint.getTransition(t7.slice(0, -"-transition".length)) : this._transitionablePaint.getValue(t7);
}, e6.prototype.setPaintProperty = function(t7, e7, r7) {
if (void 0 === r7 && (r7 = {}), null != e7 && this._validate(Pn2, "layers." + this.id + ".paint." + t7, t7, e7, r7)) {
return false;
}
if (g4(t7, "-transition")) {
return this._transitionablePaint.setTransition(t7.slice(0, -"-transition".length), e7 || void 0), false;
}
var n8 = this._transitionablePaint._values[t7], i6 = "cross-faded-data-driven" === n8.property.specification["property-type"], a6 = n8.value.isDataDriven(), o6 = n8.value;
this._transitionablePaint.setValue(t7, e7), this._handleSpecialPaintPropertyUpdate(t7);
var s7 = this._transitionablePaint._values[t7].value;
return s7.isDataDriven() || a6 || i6 || this._handleOverridablePaintPropertyUpdate(t7, o6, s7);
}, e6.prototype._handleSpecialPaintPropertyUpdate = function(t7) {
}, e6.prototype._handleOverridablePaintPropertyUpdate = function(t7, e7, r7) {
return false;
}, e6.prototype.isHidden = function(t7) {
return !!(this.minzoom && t7 < this.minzoom) || !!(this.maxzoom && t7 >= this.maxzoom) || "none" === this.visibility;
}, e6.prototype.updateTransitions = function(t7) {
this._transitioningPaint = this._transitionablePaint.transitioned(t7, this._transitioningPaint);
}, e6.prototype.hasTransition = function() {
return this._transitioningPaint.hasTransition();
}, e6.prototype.recalculate = function(t7, e7) {
t7.getCrossfadeParameters && (this._crossfadeParameters = t7.getCrossfadeParameters()), this._unevaluatedLayout && (this.layout = this._unevaluatedLayout.possiblyEvaluate(t7, void 0, e7)), this.paint = this._transitioningPaint.possiblyEvaluate(t7, void 0, e7);
}, e6.prototype.serialize = function() {
var t7 = { id: this.id, type: this.type, source: this.source, "source-layer": this.sourceLayer, metadata: this.metadata, minzoom: this.minzoom, maxzoom: this.maxzoom, filter: this.filter, layout: this._unevaluatedLayout && this._unevaluatedLayout.serialize(), paint: this._transitionablePaint && this._transitionablePaint.serialize() };
return this.visibility && (t7.layout = t7.layout || {}, t7.layout.visibility = this.visibility), b4(t7, function(t8, e7) {
return !(void 0 === t8 || "layout" === e7 && !Object.keys(t8).length || "paint" === e7 && !Object.keys(t8).length);
});
}, e6.prototype._validate = function(t7, e7, r7, n8, i6) {
return void 0 === i6 && (i6 = {}), (!i6 || false !== i6.validate) && Bn2(this, t7.call(Cn2, { key: e7, layerType: this.type, objectKey: r7, value: n8, styleSpec: Et2, style: { glyphs: true, sprite: true } }));
}, e6.prototype.is3D = function() {
return false;
}, e6.prototype.isTileClipped = function() {
return false;
}, e6.prototype.hasOffscreenPass = function() {
return false;
}, e6.prototype.resize = function() {
}, e6.prototype.isStateDependent = function() {
for (var t7 in this.paint._values) {
var e7 = this.paint.get(t7);
if (e7 instanceof yi2 && Tr(e7.property.specification) && ("source" === e7.value.kind || "composite" === e7.value.kind) && e7.value.isStateDependent) {
return true;
}
}
return false;
}, e6;
}(Ct2), Ai2 = { Int8: Int8Array, Uint8: Uint8Array, Int16: Int16Array, Uint16: Uint16Array, Int32: Int32Array, Uint32: Uint32Array, Float32: Float32Array }, Si2 = function(t6, e6) {
this._structArray = t6, this._pos1 = e6 * this.size, this._pos2 = this._pos1 / 2, this._pos4 = this._pos1 / 4, this._pos8 = this._pos1 / 8;
}, ki2 = function() {
this.isTransferred = false, this.capacity = -1, this.resize(0);
};
function Ii2(t6, e6) {
void 0 === e6 && (e6 = 1);
var r7 = 0, n8 = 0;
return { members: t6.map(function(t7) {
var i6 = Ai2[t7.type].BYTES_PER_ELEMENT, a6 = r7 = zi2(r7, Math.max(e6, i6)), o6 = t7.components || 1;
return n8 = Math.max(n8, i6), r7 += i6 * o6, { name: t7.name, type: t7.type, components: o6, offset: a6 };
}), size: zi2(r7, Math.max(n8, e6)), alignment: e6 };
}
function zi2(t6, e6) {
return Math.ceil(t6 / e6) * e6;
}
ki2.serialize = function(t6, e6) {
return t6._trim(), e6 && (t6.isTransferred = true, e6.push(t6.arrayBuffer)), { length: t6.length, arrayBuffer: t6.arrayBuffer };
}, ki2.deserialize = function(t6) {
var e6 = Object.create(this.prototype);
return e6.arrayBuffer = t6.arrayBuffer, e6.length = t6.length, e6.capacity = t6.arrayBuffer.byteLength / e6.bytesPerElement, e6._refreshViews(), e6;
}, ki2.prototype._trim = function() {
this.length !== this.capacity && (this.capacity = this.length, this.arrayBuffer = this.arrayBuffer.slice(0, this.length * this.bytesPerElement), this._refreshViews());
}, ki2.prototype.clear = function() {
this.length = 0;
}, ki2.prototype.resize = function(t6) {
this.reserve(t6), this.length = t6;
}, ki2.prototype.reserve = function(t6) {
if (t6 > this.capacity) {
this.capacity = Math.max(t6, Math.floor(5 * this.capacity), 128), this.arrayBuffer = new ArrayBuffer(this.capacity * this.bytesPerElement);
var e6 = this.uint8;
this._refreshViews(), e6 && this.uint8.set(e6);
}
}, ki2.prototype._refreshViews = function() {
throw new Error("_refreshViews() must be implemented by each concrete StructArray layout");
};
var Ci2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7) {
var r7 = this.length;
return this.resize(r7 + 1), this.emplace(r7, t7, e7);
}, e6.prototype.emplace = function(t7, e7, r7) {
var n8 = 2 * t7;
return this.int16[n8 + 0] = e7, this.int16[n8 + 1] = r7, t7;
}, e6;
}(ki2);
Ci2.prototype.bytesPerElement = 4, On2("StructArrayLayout2i4", Ci2);
var Ei2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7, r7, n8) {
var i6 = this.length;
return this.resize(i6 + 1), this.emplace(i6, t7, e7, r7, n8);
}, e6.prototype.emplace = function(t7, e7, r7, n8, i6) {
var a6 = 4 * t7;
return this.int16[a6 + 0] = e7, this.int16[a6 + 1] = r7, this.int16[a6 + 2] = n8, this.int16[a6 + 3] = i6, t7;
}, e6;
}(ki2);
Ei2.prototype.bytesPerElement = 8, On2("StructArrayLayout4i8", Ei2);
var Pi2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7, r7, n8, i6, a6) {
var o6 = this.length;
return this.resize(o6 + 1), this.emplace(o6, t7, e7, r7, n8, i6, a6);
}, e6.prototype.emplace = function(t7, e7, r7, n8, i6, a6, o6) {
var s7 = 6 * t7;
return this.int16[s7 + 0] = e7, this.int16[s7 + 1] = r7, this.int16[s7 + 2] = n8, this.int16[s7 + 3] = i6, this.int16[s7 + 4] = a6, this.int16[s7 + 5] = o6, t7;
}, e6;
}(ki2);
Pi2.prototype.bytesPerElement = 12, On2("StructArrayLayout2i4i12", Pi2);
var Mi2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7, r7, n8, i6, a6) {
var o6 = this.length;
return this.resize(o6 + 1), this.emplace(o6, t7, e7, r7, n8, i6, a6);
}, e6.prototype.emplace = function(t7, e7, r7, n8, i6, a6, o6) {
var s7 = 4 * t7, u5 = 8 * t7;
return this.int16[s7 + 0] = e7, this.int16[s7 + 1] = r7, this.uint8[u5 + 4] = n8, this.uint8[u5 + 5] = i6, this.uint8[u5 + 6] = a6, this.uint8[u5 + 7] = o6, t7;
}, e6;
}(ki2);
Mi2.prototype.bytesPerElement = 8, On2("StructArrayLayout2i4ub8", Mi2);
var Bi2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7) {
var r7 = this.length;
return this.resize(r7 + 1), this.emplace(r7, t7, e7);
}, e6.prototype.emplace = function(t7, e7, r7) {
var n8 = 2 * t7;
return this.float32[n8 + 0] = e7, this.float32[n8 + 1] = r7, t7;
}, e6;
}(ki2);
Bi2.prototype.bytesPerElement = 8, On2("StructArrayLayout2f8", Bi2);
var Ti2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7, r7, n8, i6, a6, o6, s7, u5, l8) {
var p5 = this.length;
return this.resize(p5 + 1), this.emplace(p5, t7, e7, r7, n8, i6, a6, o6, s7, u5, l8);
}, e6.prototype.emplace = function(t7, e7, r7, n8, i6, a6, o6, s7, u5, l8, p5) {
var c5 = 10 * t7;
return this.uint16[c5 + 0] = e7, this.uint16[c5 + 1] = r7, this.uint16[c5 + 2] = n8, this.uint16[c5 + 3] = i6, this.uint16[c5 + 4] = a6, this.uint16[c5 + 5] = o6, this.uint16[c5 + 6] = s7, this.uint16[c5 + 7] = u5, this.uint16[c5 + 8] = l8, this.uint16[c5 + 9] = p5, t7;
}, e6;
}(ki2);
Ti2.prototype.bytesPerElement = 20, On2("StructArrayLayout10ui20", Ti2);
var Vi2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7, r7, n8, i6, a6, o6, s7, u5, l8, p5, c5) {
var h7 = this.length;
return this.resize(h7 + 1), this.emplace(h7, t7, e7, r7, n8, i6, a6, o6, s7, u5, l8, p5, c5);
}, e6.prototype.emplace = function(t7, e7, r7, n8, i6, a6, o6, s7, u5, l8, p5, c5, h7) {
var f5 = 12 * t7;
return this.int16[f5 + 0] = e7, this.int16[f5 + 1] = r7, this.int16[f5 + 2] = n8, this.int16[f5 + 3] = i6, this.uint16[f5 + 4] = a6, this.uint16[f5 + 5] = o6, this.uint16[f5 + 6] = s7, this.uint16[f5 + 7] = u5, this.int16[f5 + 8] = l8, this.int16[f5 + 9] = p5, this.int16[f5 + 10] = c5, this.int16[f5 + 11] = h7, t7;
}, e6;
}(ki2);
Vi2.prototype.bytesPerElement = 24, On2("StructArrayLayout4i4ui4i24", Vi2);
var Fi2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7, r7) {
var n8 = this.length;
return this.resize(n8 + 1), this.emplace(n8, t7, e7, r7);
}, e6.prototype.emplace = function(t7, e7, r7, n8) {
var i6 = 3 * t7;
return this.float32[i6 + 0] = e7, this.float32[i6 + 1] = r7, this.float32[i6 + 2] = n8, t7;
}, e6;
}(ki2);
Fi2.prototype.bytesPerElement = 12, On2("StructArrayLayout3f12", Fi2);
var Di2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7) {
var e7 = this.length;
return this.resize(e7 + 1), this.emplace(e7, t7);
}, e6.prototype.emplace = function(t7, e7) {
return this.uint32[1 * t7 + 0] = e7, t7;
}, e6;
}(ki2);
Di2.prototype.bytesPerElement = 4, On2("StructArrayLayout1ul4", Di2);
var Li2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7, r7, n8, i6, a6, o6, s7, u5) {
var l8 = this.length;
return this.resize(l8 + 1), this.emplace(l8, t7, e7, r7, n8, i6, a6, o6, s7, u5);
}, e6.prototype.emplace = function(t7, e7, r7, n8, i6, a6, o6, s7, u5, l8) {
var p5 = 10 * t7, c5 = 5 * t7;
return this.int16[p5 + 0] = e7, this.int16[p5 + 1] = r7, this.int16[p5 + 2] = n8, this.int16[p5 + 3] = i6, this.int16[p5 + 4] = a6, this.int16[p5 + 5] = o6, this.uint32[c5 + 3] = s7, this.uint16[p5 + 8] = u5, this.uint16[p5 + 9] = l8, t7;
}, e6;
}(ki2);
Li2.prototype.bytesPerElement = 20, On2("StructArrayLayout6i1ul2ui20", Li2);
var Oi2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7, r7, n8, i6, a6) {
var o6 = this.length;
return this.resize(o6 + 1), this.emplace(o6, t7, e7, r7, n8, i6, a6);
}, e6.prototype.emplace = function(t7, e7, r7, n8, i6, a6, o6) {
var s7 = 6 * t7;
return this.int16[s7 + 0] = e7, this.int16[s7 + 1] = r7, this.int16[s7 + 2] = n8, this.int16[s7 + 3] = i6, this.int16[s7 + 4] = a6, this.int16[s7 + 5] = o6, t7;
}, e6;
}(ki2);
Oi2.prototype.bytesPerElement = 12, On2("StructArrayLayout2i2i2i12", Oi2);
var Ri2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7, r7, n8, i6) {
var a6 = this.length;
return this.resize(a6 + 1), this.emplace(a6, t7, e7, r7, n8, i6);
}, e6.prototype.emplace = function(t7, e7, r7, n8, i6, a6) {
var o6 = 4 * t7, s7 = 8 * t7;
return this.float32[o6 + 0] = e7, this.float32[o6 + 1] = r7, this.float32[o6 + 2] = n8, this.int16[s7 + 6] = i6, this.int16[s7 + 7] = a6, t7;
}, e6;
}(ki2);
Ri2.prototype.bytesPerElement = 16, On2("StructArrayLayout2f1f2i16", Ri2);
var Ui2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7, r7, n8) {
var i6 = this.length;
return this.resize(i6 + 1), this.emplace(i6, t7, e7, r7, n8);
}, e6.prototype.emplace = function(t7, e7, r7, n8, i6) {
var a6 = 12 * t7, o6 = 3 * t7;
return this.uint8[a6 + 0] = e7, this.uint8[a6 + 1] = r7, this.float32[o6 + 1] = n8, this.float32[o6 + 2] = i6, t7;
}, e6;
}(ki2);
Ui2.prototype.bytesPerElement = 12, On2("StructArrayLayout2ub2f12", Ui2);
var ji2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7, r7) {
var n8 = this.length;
return this.resize(n8 + 1), this.emplace(n8, t7, e7, r7);
}, e6.prototype.emplace = function(t7, e7, r7, n8) {
var i6 = 3 * t7;
return this.uint16[i6 + 0] = e7, this.uint16[i6 + 1] = r7, this.uint16[i6 + 2] = n8, t7;
}, e6;
}(ki2);
ji2.prototype.bytesPerElement = 6, On2("StructArrayLayout3ui6", ji2);
var qi2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7, r7, n8, i6, a6, o6, s7, u5, l8, p5, c5, h7, f5, y5, d5, m5) {
var v5 = this.length;
return this.resize(v5 + 1), this.emplace(v5, t7, e7, r7, n8, i6, a6, o6, s7, u5, l8, p5, c5, h7, f5, y5, d5, m5);
}, e6.prototype.emplace = function(t7, e7, r7, n8, i6, a6, o6, s7, u5, l8, p5, c5, h7, f5, y5, d5, m5, v5) {
var g5 = 24 * t7, x5 = 12 * t7, b5 = 48 * t7;
return this.int16[g5 + 0] = e7, this.int16[g5 + 1] = r7, this.uint16[g5 + 2] = n8, this.uint16[g5 + 3] = i6, this.uint32[x5 + 2] = a6, this.uint32[x5 + 3] = o6, this.uint32[x5 + 4] = s7, this.uint16[g5 + 10] = u5, this.uint16[g5 + 11] = l8, this.uint16[g5 + 12] = p5, this.float32[x5 + 7] = c5, this.float32[x5 + 8] = h7, this.uint8[b5 + 36] = f5, this.uint8[b5 + 37] = y5, this.uint8[b5 + 38] = d5, this.uint32[x5 + 10] = m5, this.int16[g5 + 22] = v5, t7;
}, e6;
}(ki2);
qi2.prototype.bytesPerElement = 48, On2("StructArrayLayout2i2ui3ul3ui2f3ub1ul1i48", qi2);
var Ni2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7, r7, n8, i6, a6, o6, s7, u5, l8, p5, c5, h7, f5, y5, d5, m5, v5, g5, x5, b5, w5, _4, A5, S5, k5, I5, z5) {
var C5 = this.length;
return this.resize(C5 + 1), this.emplace(C5, t7, e7, r7, n8, i6, a6, o6, s7, u5, l8, p5, c5, h7, f5, y5, d5, m5, v5, g5, x5, b5, w5, _4, A5, S5, k5, I5, z5);
}, e6.prototype.emplace = function(t7, e7, r7, n8, i6, a6, o6, s7, u5, l8, p5, c5, h7, f5, y5, d5, m5, v5, g5, x5, b5, w5, _4, A5, S5, k5, I5, z5, C5) {
var E4 = 34 * t7, P5 = 17 * t7;
return this.int16[E4 + 0] = e7, this.int16[E4 + 1] = r7, this.int16[E4 + 2] = n8, this.int16[E4 + 3] = i6, this.int16[E4 + 4] = a6, this.int16[E4 + 5] = o6, this.int16[E4 + 6] = s7, this.int16[E4 + 7] = u5, this.uint16[E4 + 8] = l8, this.uint16[E4 + 9] = p5, this.uint16[E4 + 10] = c5, this.uint16[E4 + 11] = h7, this.uint16[E4 + 12] = f5, this.uint16[E4 + 13] = y5, this.uint16[E4 + 14] = d5, this.uint16[E4 + 15] = m5, this.uint16[E4 + 16] = v5, this.uint16[E4 + 17] = g5, this.uint16[E4 + 18] = x5, this.uint16[E4 + 19] = b5, this.uint16[E4 + 20] = w5, this.uint16[E4 + 21] = _4, this.uint16[E4 + 22] = A5, this.uint32[P5 + 12] = S5, this.float32[P5 + 13] = k5, this.float32[P5 + 14] = I5, this.float32[P5 + 15] = z5, this.float32[P5 + 16] = C5, t7;
}, e6;
}(ki2);
Ni2.prototype.bytesPerElement = 68, On2("StructArrayLayout8i15ui1ul4f68", Ni2);
var Ki2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7) {
var e7 = this.length;
return this.resize(e7 + 1), this.emplace(e7, t7);
}, e6.prototype.emplace = function(t7, e7) {
return this.float32[1 * t7 + 0] = e7, t7;
}, e6;
}(ki2);
Ki2.prototype.bytesPerElement = 4, On2("StructArrayLayout1f4", Ki2);
var Gi2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.int16 = new Int16Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7, r7) {
var n8 = this.length;
return this.resize(n8 + 1), this.emplace(n8, t7, e7, r7);
}, e6.prototype.emplace = function(t7, e7, r7, n8) {
var i6 = 3 * t7;
return this.int16[i6 + 0] = e7, this.int16[i6 + 1] = r7, this.int16[i6 + 2] = n8, t7;
}, e6;
}(ki2);
Gi2.prototype.bytesPerElement = 6, On2("StructArrayLayout3i6", Gi2);
var Zi2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.uint32 = new Uint32Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7, r7) {
var n8 = this.length;
return this.resize(n8 + 1), this.emplace(n8, t7, e7, r7);
}, e6.prototype.emplace = function(t7, e7, r7, n8) {
var i6 = 4 * t7;
return this.uint32[2 * t7 + 0] = e7, this.uint16[i6 + 2] = r7, this.uint16[i6 + 3] = n8, t7;
}, e6;
}(ki2);
Zi2.prototype.bytesPerElement = 8, On2("StructArrayLayout1ul2ui8", Zi2);
var Xi2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7) {
var r7 = this.length;
return this.resize(r7 + 1), this.emplace(r7, t7, e7);
}, e6.prototype.emplace = function(t7, e7, r7) {
var n8 = 2 * t7;
return this.uint16[n8 + 0] = e7, this.uint16[n8 + 1] = r7, t7;
}, e6;
}(ki2);
Xi2.prototype.bytesPerElement = 4, On2("StructArrayLayout2ui4", Xi2);
var Ji2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.uint16 = new Uint16Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7) {
var e7 = this.length;
return this.resize(e7 + 1), this.emplace(e7, t7);
}, e6.prototype.emplace = function(t7, e7) {
return this.uint16[1 * t7 + 0] = e7, t7;
}, e6;
}(ki2);
Ji2.prototype.bytesPerElement = 2, On2("StructArrayLayout1ui2", Ji2);
var Hi2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._refreshViews = function() {
this.uint8 = new Uint8Array(this.arrayBuffer), this.float32 = new Float32Array(this.arrayBuffer);
}, e6.prototype.emplaceBack = function(t7, e7, r7, n8) {
var i6 = this.length;
return this.resize(i6 + 1), this.emplace(i6, t7, e7, r7, n8);
}, e6.prototype.emplace = function(t7, e7, r7, n8, i6) {
var a6 = 4 * t7;
return this.float32[a6 + 0] = e7, this.float32[a6 + 1] = r7, this.float32[a6 + 2] = n8, this.float32[a6 + 3] = i6, t7;
}, e6;
}(ki2);
Hi2.prototype.bytesPerElement = 16, On2("StructArrayLayout4f16", Hi2);
var Yi2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6;
var r7 = { anchorPointX: { configurable: true }, anchorPointY: { configurable: true }, x1: { configurable: true }, y1: { configurable: true }, x2: { configurable: true }, y2: { configurable: true }, featureIndex: { configurable: true }, sourceLayerIndex: { configurable: true }, bucketIndex: { configurable: true }, anchorPoint: { configurable: true } };
return r7.anchorPointX.get = function() {
return this._structArray.int16[this._pos2 + 0];
}, r7.anchorPointY.get = function() {
return this._structArray.int16[this._pos2 + 1];
}, r7.x1.get = function() {
return this._structArray.int16[this._pos2 + 2];
}, r7.y1.get = function() {
return this._structArray.int16[this._pos2 + 3];
}, r7.x2.get = function() {
return this._structArray.int16[this._pos2 + 4];
}, r7.y2.get = function() {
return this._structArray.int16[this._pos2 + 5];
}, r7.featureIndex.get = function() {
return this._structArray.uint32[this._pos4 + 3];
}, r7.sourceLayerIndex.get = function() {
return this._structArray.uint16[this._pos2 + 8];
}, r7.bucketIndex.get = function() {
return this._structArray.uint16[this._pos2 + 9];
}, r7.anchorPoint.get = function() {
return new i5(this.anchorPointX, this.anchorPointY);
}, Object.defineProperties(e6.prototype, r7), e6;
}(Si2);
Yi2.prototype.size = 20;
var $i2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.get = function(t7) {
return new Yi2(this, t7);
}, e6;
}(Li2);
On2("CollisionBoxArray", $i2);
var Wi2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6;
var r7 = { anchorX: { configurable: true }, anchorY: { configurable: true }, glyphStartIndex: { configurable: true }, numGlyphs: { configurable: true }, vertexStartIndex: { configurable: true }, lineStartIndex: { configurable: true }, lineLength: { configurable: true }, segment: { configurable: true }, lowerSize: { configurable: true }, upperSize: { configurable: true }, lineOffsetX: { configurable: true }, lineOffsetY: { configurable: true }, writingMode: { configurable: true }, placedOrientation: { configurable: true }, hidden: { configurable: true }, crossTileID: { configurable: true }, associatedIconIndex: { configurable: true } };
return r7.anchorX.get = function() {
return this._structArray.int16[this._pos2 + 0];
}, r7.anchorY.get = function() {
return this._structArray.int16[this._pos2 + 1];
}, r7.glyphStartIndex.get = function() {
return this._structArray.uint16[this._pos2 + 2];
}, r7.numGlyphs.get = function() {
return this._structArray.uint16[this._pos2 + 3];
}, r7.vertexStartIndex.get = function() {
return this._structArray.uint32[this._pos4 + 2];
}, r7.lineStartIndex.get = function() {
return this._structArray.uint32[this._pos4 + 3];
}, r7.lineLength.get = function() {
return this._structArray.uint32[this._pos4 + 4];
}, r7.segment.get = function() {
return this._structArray.uint16[this._pos2 + 10];
}, r7.lowerSize.get = function() {
return this._structArray.uint16[this._pos2 + 11];
}, r7.upperSize.get = function() {
return this._structArray.uint16[this._pos2 + 12];
}, r7.lineOffsetX.get = function() {
return this._structArray.float32[this._pos4 + 7];
}, r7.lineOffsetY.get = function() {
return this._structArray.float32[this._pos4 + 8];
}, r7.writingMode.get = function() {
return this._structArray.uint8[this._pos1 + 36];
}, r7.placedOrientation.get = function() {
return this._structArray.uint8[this._pos1 + 37];
}, r7.placedOrientation.set = function(t7) {
this._structArray.uint8[this._pos1 + 37] = t7;
}, r7.hidden.get = function() {
return this._structArray.uint8[this._pos1 + 38];
}, r7.hidden.set = function(t7) {
this._structArray.uint8[this._pos1 + 38] = t7;
}, r7.crossTileID.get = function() {
return this._structArray.uint32[this._pos4 + 10];
}, r7.crossTileID.set = function(t7) {
this._structArray.uint32[this._pos4 + 10] = t7;
}, r7.associatedIconIndex.get = function() {
return this._structArray.int16[this._pos2 + 22];
}, Object.defineProperties(e6.prototype, r7), e6;
}(Si2);
Wi2.prototype.size = 48;
var Qi2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.get = function(t7) {
return new Wi2(this, t7);
}, e6;
}(qi2);
On2("PlacedSymbolArray", Qi2);
var ta2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6;
var r7 = { anchorX: { configurable: true }, anchorY: { configurable: true }, rightJustifiedTextSymbolIndex: { configurable: true }, centerJustifiedTextSymbolIndex: { configurable: true }, leftJustifiedTextSymbolIndex: { configurable: true }, verticalPlacedTextSymbolIndex: { configurable: true }, placedIconSymbolIndex: { configurable: true }, verticalPlacedIconSymbolIndex: { configurable: true }, key: { configurable: true }, textBoxStartIndex: { configurable: true }, textBoxEndIndex: { configurable: true }, verticalTextBoxStartIndex: { configurable: true }, verticalTextBoxEndIndex: { configurable: true }, iconBoxStartIndex: { configurable: true }, iconBoxEndIndex: { configurable: true }, verticalIconBoxStartIndex: { configurable: true }, verticalIconBoxEndIndex: { configurable: true }, featureIndex: { configurable: true }, numHorizontalGlyphVertices: { configurable: true }, numVerticalGlyphVertices: { configurable: true }, numIconVertices: { configurable: true }, numVerticalIconVertices: { configurable: true }, useRuntimeCollisionCircles: { configurable: true }, crossTileID: { configurable: true }, textBoxScale: { configurable: true }, textOffset0: { configurable: true }, textOffset1: { configurable: true }, collisionCircleDiameter: { configurable: true } };
return r7.anchorX.get = function() {
return this._structArray.int16[this._pos2 + 0];
}, r7.anchorY.get = function() {
return this._structArray.int16[this._pos2 + 1];
}, r7.rightJustifiedTextSymbolIndex.get = function() {
return this._structArray.int16[this._pos2 + 2];
}, r7.centerJustifiedTextSymbolIndex.get = function() {
return this._structArray.int16[this._pos2 + 3];
}, r7.leftJustifiedTextSymbolIndex.get = function() {
return this._structArray.int16[this._pos2 + 4];
}, r7.verticalPlacedTextSymbolIndex.get = function() {
return this._structArray.int16[this._pos2 + 5];
}, r7.placedIconSymbolIndex.get = function() {
return this._structArray.int16[this._pos2 + 6];
}, r7.verticalPlacedIconSymbolIndex.get = function() {
return this._structArray.int16[this._pos2 + 7];
}, r7.key.get = function() {
return this._structArray.uint16[this._pos2 + 8];
}, r7.textBoxStartIndex.get = function() {
return this._structArray.uint16[this._pos2 + 9];
}, r7.textBoxEndIndex.get = function() {
return this._structArray.uint16[this._pos2 + 10];
}, r7.verticalTextBoxStartIndex.get = function() {
return this._structArray.uint16[this._pos2 + 11];
}, r7.verticalTextBoxEndIndex.get = function() {
return this._structArray.uint16[this._pos2 + 12];
}, r7.iconBoxStartIndex.get = function() {
return this._structArray.uint16[this._pos2 + 13];
}, r7.iconBoxEndIndex.get = function() {
return this._structArray.uint16[this._pos2 + 14];
}, r7.verticalIconBoxStartIndex.get = function() {
return this._structArray.uint16[this._pos2 + 15];
}, r7.verticalIconBoxEndIndex.get = function() {
return this._structArray.uint16[this._pos2 + 16];
}, r7.featureIndex.get = function() {
return this._structArray.uint16[this._pos2 + 17];
}, r7.numHorizontalGlyphVertices.get = function() {
return this._structArray.uint16[this._pos2 + 18];
}, r7.numVerticalGlyphVertices.get = function() {
return this._structArray.uint16[this._pos2 + 19];
}, r7.numIconVertices.get = function() {
return this._structArray.uint16[this._pos2 + 20];
}, r7.numVerticalIconVertices.get = function() {
return this._structArray.uint16[this._pos2 + 21];
}, r7.useRuntimeCollisionCircles.get = function() {
return this._structArray.uint16[this._pos2 + 22];
}, r7.crossTileID.get = function() {
return this._structArray.uint32[this._pos4 + 12];
}, r7.crossTileID.set = function(t7) {
this._structArray.uint32[this._pos4 + 12] = t7;
}, r7.textBoxScale.get = function() {
return this._structArray.float32[this._pos4 + 13];
}, r7.textOffset0.get = function() {
return this._structArray.float32[this._pos4 + 14];
}, r7.textOffset1.get = function() {
return this._structArray.float32[this._pos4 + 15];
}, r7.collisionCircleDiameter.get = function() {
return this._structArray.float32[this._pos4 + 16];
}, Object.defineProperties(e6.prototype, r7), e6;
}(Si2);
ta2.prototype.size = 68;
var ea = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.get = function(t7) {
return new ta2(this, t7);
}, e6;
}(Ni2);
On2("SymbolInstanceArray", ea);
var ra = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getoffsetX = function(t7) {
return this.float32[1 * t7 + 0];
}, e6;
}(Ki2);
On2("GlyphOffsetArray", ra);
var na = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getx = function(t7) {
return this.int16[3 * t7 + 0];
}, e6.prototype.gety = function(t7) {
return this.int16[3 * t7 + 1];
}, e6.prototype.gettileUnitDistanceFromAnchor = function(t7) {
return this.int16[3 * t7 + 2];
}, e6;
}(Gi2);
On2("SymbolLineVertexArray", na);
var ia = function(t6) {
function e6() {
t6.apply(this, arguments);
}
t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6;
var r7 = { featureIndex: { configurable: true }, sourceLayerIndex: { configurable: true }, bucketIndex: { configurable: true } };
return r7.featureIndex.get = function() {
return this._structArray.uint32[this._pos4 + 0];
}, r7.sourceLayerIndex.get = function() {
return this._structArray.uint16[this._pos2 + 2];
}, r7.bucketIndex.get = function() {
return this._structArray.uint16[this._pos2 + 3];
}, Object.defineProperties(e6.prototype, r7), e6;
}(Si2);
ia.prototype.size = 8;
var aa = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.get = function(t7) {
return new ia(this, t7);
}, e6;
}(Zi2);
On2("FeatureIndexArray", aa);
var oa = Ii2([{ name: "a_pos", components: 2, type: "Int16" }], 4).members, sa = function(t6) {
void 0 === t6 && (t6 = []), this.segments = t6;
};
function ua(t6, e6) {
return 256 * (t6 = p4(Math.floor(t6), 0, 255)) + p4(Math.floor(e6), 0, 255);
}
sa.prototype.prepareSegment = function(t6, e6, r7, n8) {
var i6 = this.segments[this.segments.length - 1];
return t6 > sa.MAX_VERTEX_ARRAY_LENGTH && A4("Max vertices per segment is " + sa.MAX_VERTEX_ARRAY_LENGTH + ": bucket requested " + t6), (!i6 || i6.vertexLength + t6 > sa.MAX_VERTEX_ARRAY_LENGTH || i6.sortKey !== n8) && (i6 = { vertexOffset: e6.length, primitiveOffset: r7.length, vertexLength: 0, primitiveLength: 0 }, void 0 !== n8 && (i6.sortKey = n8), this.segments.push(i6)), i6;
}, sa.prototype.get = function() {
return this.segments;
}, sa.prototype.destroy = function() {
for (var t6 = 0, e6 = this.segments; t6 < e6.length; t6 += 1) {
var r7 = e6[t6];
for (var n8 in r7.vaos) {
r7.vaos[n8].destroy();
}
}
}, sa.simpleSegment = function(t6, e6, r7, n8) {
return new sa([{ vertexOffset: t6, primitiveOffset: e6, vertexLength: r7, primitiveLength: n8, vaos: {}, sortKey: 0 }]);
}, sa.MAX_VERTEX_ARRAY_LENGTH = Math.pow(2, 16) - 1, On2("SegmentVector", sa);
var la = Ii2([{ name: "a_pattern_from", components: 4, type: "Uint16" }, { name: "a_pattern_to", components: 4, type: "Uint16" }, { name: "a_pixel_ratio_from", components: 1, type: "Uint16" }, { name: "a_pixel_ratio_to", components: 1, type: "Uint16" }]), pa = e5(function(t6) {
t6.exports = function(t7, e6) {
var r7, n8, i6, a6, o6, s7, u5, l8;
for (n8 = t7.length - (r7 = 3 & t7.length), i6 = e6, o6 = 3432918353, s7 = 461845907, l8 = 0; l8 < n8; ) {
u5 = 255 & t7.charCodeAt(l8) | (255 & t7.charCodeAt(++l8)) << 8 | (255 & t7.charCodeAt(++l8)) << 16 | (255 & t7.charCodeAt(++l8)) << 24, ++l8, i6 = 27492 + (65535 & (a6 = 5 * (65535 & (i6 = (i6 ^= u5 = (65535 & (u5 = (u5 = (65535 & u5) * o6 + (((u5 >>> 16) * o6 & 65535) << 16) & 4294967295) << 15 | u5 >>> 17)) * s7 + (((u5 >>> 16) * s7 & 65535) << 16) & 4294967295) << 13 | i6 >>> 19)) + ((5 * (i6 >>> 16) & 65535) << 16) & 4294967295)) + ((58964 + (a6 >>> 16) & 65535) << 16);
}
switch (u5 = 0, r7) {
case 3:
u5 ^= (255 & t7.charCodeAt(l8 + 2)) << 16;
case 2:
u5 ^= (255 & t7.charCodeAt(l8 + 1)) << 8;
case 1:
i6 ^= u5 = (65535 & (u5 = (u5 = (65535 & (u5 ^= 255 & t7.charCodeAt(l8))) * o6 + (((u5 >>> 16) * o6 & 65535) << 16) & 4294967295) << 15 | u5 >>> 17)) * s7 + (((u5 >>> 16) * s7 & 65535) << 16) & 4294967295;
}
return i6 ^= t7.length, i6 = 2246822507 * (65535 & (i6 ^= i6 >>> 16)) + ((2246822507 * (i6 >>> 16) & 65535) << 16) & 4294967295, i6 = 3266489909 * (65535 & (i6 ^= i6 >>> 13)) + ((3266489909 * (i6 >>> 16) & 65535) << 16) & 4294967295, (i6 ^= i6 >>> 16) >>> 0;
};
}), ca = e5(function(t6) {
t6.exports = function(t7, e6) {
for (var r7, n8 = t7.length, i6 = e6 ^ n8, a6 = 0; n8 >= 4; ) {
r7 = 1540483477 * (65535 & (r7 = 255 & t7.charCodeAt(a6) | (255 & t7.charCodeAt(++a6)) << 8 | (255 & t7.charCodeAt(++a6)) << 16 | (255 & t7.charCodeAt(++a6)) << 24)) + ((1540483477 * (r7 >>> 16) & 65535) << 16), i6 = 1540483477 * (65535 & i6) + ((1540483477 * (i6 >>> 16) & 65535) << 16) ^ (r7 = 1540483477 * (65535 & (r7 ^= r7 >>> 24)) + ((1540483477 * (r7 >>> 16) & 65535) << 16)), n8 -= 4, ++a6;
}
switch (n8) {
case 3:
i6 ^= (255 & t7.charCodeAt(a6 + 2)) << 16;
case 2:
i6 ^= (255 & t7.charCodeAt(a6 + 1)) << 8;
case 1:
i6 = 1540483477 * (65535 & (i6 ^= 255 & t7.charCodeAt(a6))) + ((1540483477 * (i6 >>> 16) & 65535) << 16);
}
return i6 = 1540483477 * (65535 & (i6 ^= i6 >>> 13)) + ((1540483477 * (i6 >>> 16) & 65535) << 16), (i6 ^= i6 >>> 15) >>> 0;
};
}), ha = pa, fa = ca;
ha.murmur3 = pa, ha.murmur2 = fa;
var ya = function() {
this.ids = [], this.positions = [], this.indexed = false;
};
ya.prototype.add = function(t6, e6, r7, n8) {
this.ids.push(ma(t6)), this.positions.push(e6, r7, n8);
}, ya.prototype.getPositions = function(t6) {
for (var e6 = ma(t6), r7 = 0, n8 = this.ids.length - 1; r7 < n8; ) {
var i6 = r7 + n8 >> 1;
this.ids[i6] >= e6 ? n8 = i6 : r7 = i6 + 1;
}
for (var a6 = []; this.ids[r7] === e6; ) {
a6.push({ index: this.positions[3 * r7], start: this.positions[3 * r7 + 1], end: this.positions[3 * r7 + 2] }), r7++;
}
return a6;
}, ya.serialize = function(t6, e6) {
var r7 = new Float64Array(t6.ids), n8 = new Uint32Array(t6.positions);
return function t7(e7, r8, n9, i6) {
for (; n9 < i6; ) {
for (var a6 = e7[n9 + i6 >> 1], o6 = n9 - 1, s7 = i6 + 1; ; ) {
do {
o6++;
} while (e7[o6] < a6);
do {
s7--;
} while (e7[s7] > a6);
if (o6 >= s7) {
break;
}
va(e7, o6, s7), va(r8, 3 * o6, 3 * s7), va(r8, 3 * o6 + 1, 3 * s7 + 1), va(r8, 3 * o6 + 2, 3 * s7 + 2);
}
s7 - n9 < i6 - s7 ? (t7(e7, r8, n9, s7), n9 = s7 + 1) : (t7(e7, r8, s7 + 1, i6), i6 = s7);
}
}(r7, n8, 0, r7.length - 1), e6 && e6.push(r7.buffer, n8.buffer), { ids: r7, positions: n8 };
}, ya.deserialize = function(t6) {
var e6 = new ya();
return e6.ids = t6.ids, e6.positions = t6.positions, e6.indexed = true, e6;
};
var da = Math.pow(2, 53) - 1;
function ma(t6) {
var e6 = +t6;
return !isNaN(e6) && e6 <= da ? e6 : ha(String(t6));
}
function va(t6, e6, r7) {
var n8 = t6[e6];
t6[e6] = t6[r7], t6[r7] = n8;
}
On2("FeaturePositionMap", ya);
var ga = function(t6, e6) {
this.gl = t6.gl, this.location = e6;
}, xa = function(t6) {
function e6(e7, r7) {
t6.call(this, e7, r7), this.current = 0;
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.set = function(t7) {
this.current !== t7 && (this.current = t7, this.gl.uniform1i(this.location, t7));
}, e6;
}(ga), ba = function(t6) {
function e6(e7, r7) {
t6.call(this, e7, r7), this.current = 0;
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.set = function(t7) {
this.current !== t7 && (this.current = t7, this.gl.uniform1f(this.location, t7));
}, e6;
}(ga), wa = function(t6) {
function e6(e7, r7) {
t6.call(this, e7, r7), this.current = [0, 0];
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.set = function(t7) {
t7[0] === this.current[0] && t7[1] === this.current[1] || (this.current = t7, this.gl.uniform2f(this.location, t7[0], t7[1]));
}, e6;
}(ga), _a = function(t6) {
function e6(e7, r7) {
t6.call(this, e7, r7), this.current = [0, 0, 0];
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.set = function(t7) {
t7[0] === this.current[0] && t7[1] === this.current[1] && t7[2] === this.current[2] || (this.current = t7, this.gl.uniform3f(this.location, t7[0], t7[1], t7[2]));
}, e6;
}(ga), Aa = function(t6) {
function e6(e7, r7) {
t6.call(this, e7, r7), this.current = [0, 0, 0, 0];
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.set = function(t7) {
t7[0] === this.current[0] && t7[1] === this.current[1] && t7[2] === this.current[2] && t7[3] === this.current[3] || (this.current = t7, this.gl.uniform4f(this.location, t7[0], t7[1], t7[2], t7[3]));
}, e6;
}(ga), Sa = function(t6) {
function e6(e7, r7) {
t6.call(this, e7, r7), this.current = te2.transparent;
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.set = function(t7) {
t7.r === this.current.r && t7.g === this.current.g && t7.b === this.current.b && t7.a === this.current.a || (this.current = t7, this.gl.uniform4f(this.location, t7.r, t7.g, t7.b, t7.a));
}, e6;
}(ga), ka = new Float32Array(16), Ia = function(t6) {
function e6(e7, r7) {
t6.call(this, e7, r7), this.current = ka;
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.set = function(t7) {
if (t7[12] !== this.current[12] || t7[0] !== this.current[0]) {
return this.current = t7, void this.gl.uniformMatrix4fv(this.location, false, t7);
}
for (var e7 = 1; e7 < 16; e7++) {
if (t7[e7] !== this.current[e7]) {
this.current = t7, this.gl.uniformMatrix4fv(this.location, false, t7);
break;
}
}
}, e6;
}(ga);
function za(t6) {
return [ua(255 * t6.r, 255 * t6.g), ua(255 * t6.b, 255 * t6.a)];
}
var Ca = function(t6, e6, r7) {
this.value = t6, this.uniformNames = e6.map(function(t7) {
return "u_" + t7;
}), this.type = r7;
};
Ca.prototype.setUniform = function(t6, e6, r7) {
t6.set(r7.constantOr(this.value));
}, Ca.prototype.getBinding = function(t6, e6, r7) {
return "color" === this.type ? new Sa(t6, e6) : new ba(t6, e6);
};
var Ea = function(t6, e6) {
this.uniformNames = e6.map(function(t7) {
return "u_" + t7;
}), this.patternFrom = null, this.patternTo = null, this.pixelRatioFrom = 1, this.pixelRatioTo = 1;
};
Ea.prototype.setConstantPatternPositions = function(t6, e6) {
this.pixelRatioFrom = e6.pixelRatio, this.pixelRatioTo = t6.pixelRatio, this.patternFrom = e6.tlbr, this.patternTo = t6.tlbr;
}, Ea.prototype.setUniform = function(t6, e6, r7, n8) {
var i6 = "u_pattern_to" === n8 ? this.patternTo : "u_pattern_from" === n8 ? this.patternFrom : "u_pixel_ratio_to" === n8 ? this.pixelRatioTo : "u_pixel_ratio_from" === n8 ? this.pixelRatioFrom : null;
i6 && t6.set(i6);
}, Ea.prototype.getBinding = function(t6, e6, r7) {
return "u_pattern" === r7.substr(0, 9) ? new Aa(t6, e6) : new ba(t6, e6);
};
var Pa = function(t6, e6, r7, n8) {
this.expression = t6, this.type = r7, this.maxValue = 0, this.paintVertexAttributes = e6.map(function(t7) {
return { name: "a_" + t7, type: "Float32", components: "color" === r7 ? 2 : 1, offset: 0 };
}), this.paintVertexArray = new n8();
};
Pa.prototype.populatePaintArray = function(t6, e6, r7, n8, i6) {
var a6 = this.paintVertexArray.length, o6 = this.expression.evaluate(new si2(0), e6, {}, n8, [], i6);
this.paintVertexArray.resize(t6), this._setPaintValue(a6, t6, o6);
}, Pa.prototype.updatePaintArray = function(t6, e6, r7, n8) {
var i6 = this.expression.evaluate({ zoom: 0 }, r7, n8);
this._setPaintValue(t6, e6, i6);
}, Pa.prototype._setPaintValue = function(t6, e6, r7) {
if ("color" === this.type) {
for (var n8 = za(r7), i6 = t6; i6 < e6; i6++) {
this.paintVertexArray.emplace(i6, n8[0], n8[1]);
}
} else {
for (var a6 = t6; a6 < e6; a6++) {
this.paintVertexArray.emplace(a6, r7);
}
this.maxValue = Math.max(this.maxValue, Math.abs(r7));
}
}, Pa.prototype.upload = function(t6) {
this.paintVertexArray && this.paintVertexArray.arrayBuffer && (this.paintVertexBuffer && this.paintVertexBuffer.buffer ? this.paintVertexBuffer.updateData(this.paintVertexArray) : this.paintVertexBuffer = t6.createVertexBuffer(this.paintVertexArray, this.paintVertexAttributes, this.expression.isStateDependent));
}, Pa.prototype.destroy = function() {
this.paintVertexBuffer && this.paintVertexBuffer.destroy();
};
var Ma = function(t6, e6, r7, n8, i6, a6) {
this.expression = t6, this.uniformNames = e6.map(function(t7) {
return "u_" + t7 + "_t";
}), this.type = r7, this.useIntegerZoom = n8, this.zoom = i6, this.maxValue = 0, this.paintVertexAttributes = e6.map(function(t7) {
return { name: "a_" + t7, type: "Float32", components: "color" === r7 ? 4 : 2, offset: 0 };
}), this.paintVertexArray = new a6();
};
Ma.prototype.populatePaintArray = function(t6, e6, r7, n8, i6) {
var a6 = this.expression.evaluate(new si2(this.zoom), e6, {}, n8, [], i6), o6 = this.expression.evaluate(new si2(this.zoom + 1), e6, {}, n8, [], i6), s7 = this.paintVertexArray.length;
this.paintVertexArray.resize(t6), this._setPaintValue(s7, t6, a6, o6);
}, Ma.prototype.updatePaintArray = function(t6, e6, r7, n8) {
var i6 = this.expression.evaluate({ zoom: this.zoom }, r7, n8), a6 = this.expression.evaluate({ zoom: this.zoom + 1 }, r7, n8);
this._setPaintValue(t6, e6, i6, a6);
}, Ma.prototype._setPaintValue = function(t6, e6, r7, n8) {
if ("color" === this.type) {
for (var i6 = za(r7), a6 = za(n8), o6 = t6; o6 < e6; o6++) {
this.paintVertexArray.emplace(o6, i6[0], i6[1], a6[0], a6[1]);
}
} else {
for (var s7 = t6; s7 < e6; s7++) {
this.paintVertexArray.emplace(s7, r7, n8);
}
this.maxValue = Math.max(this.maxValue, Math.abs(r7), Math.abs(n8));
}
}, Ma.prototype.upload = function(t6) {
this.paintVertexArray && this.paintVertexArray.arrayBuffer && (this.paintVertexBuffer && this.paintVertexBuffer.buffer ? this.paintVertexBuffer.updateData(this.paintVertexArray) : this.paintVertexBuffer = t6.createVertexBuffer(this.paintVertexArray, this.paintVertexAttributes, this.expression.isStateDependent));
}, Ma.prototype.destroy = function() {
this.paintVertexBuffer && this.paintVertexBuffer.destroy();
}, Ma.prototype.setUniform = function(t6, e6) {
var r7 = this.useIntegerZoom ? Math.floor(e6.zoom) : e6.zoom, n8 = p4(this.expression.interpolationFactor(r7, this.zoom, this.zoom + 1), 0, 1);
t6.set(n8);
}, Ma.prototype.getBinding = function(t6, e6, r7) {
return new ba(t6, e6);
};
var Ba = function(t6, e6, r7, n8, i6, a6) {
this.expression = t6, this.type = e6, this.useIntegerZoom = r7, this.zoom = n8, this.layerId = a6, this.zoomInPaintVertexArray = new i6(), this.zoomOutPaintVertexArray = new i6();
};
Ba.prototype.populatePaintArray = function(t6, e6, r7) {
var n8 = this.zoomInPaintVertexArray.length;
this.zoomInPaintVertexArray.resize(t6), this.zoomOutPaintVertexArray.resize(t6), this._setPaintValues(n8, t6, e6.patterns && e6.patterns[this.layerId], r7);
}, Ba.prototype.updatePaintArray = function(t6, e6, r7, n8, i6) {
this._setPaintValues(t6, e6, r7.patterns && r7.patterns[this.layerId], i6);
}, Ba.prototype._setPaintValues = function(t6, e6, r7, n8) {
if (n8 && r7) {
var i6 = n8[r7.min], a6 = n8[r7.mid], o6 = n8[r7.max];
if (i6 && a6 && o6) {
for (var s7 = t6; s7 < e6; s7++) {
this.zoomInPaintVertexArray.emplace(s7, a6.tl[0], a6.tl[1], a6.br[0], a6.br[1], i6.tl[0], i6.tl[1], i6.br[0], i6.br[1], a6.pixelRatio, i6.pixelRatio), this.zoomOutPaintVertexArray.emplace(s7, a6.tl[0], a6.tl[1], a6.br[0], a6.br[1], o6.tl[0], o6.tl[1], o6.br[0], o6.br[1], a6.pixelRatio, o6.pixelRatio);
}
}
}
}, Ba.prototype.upload = function(t6) {
this.zoomInPaintVertexArray && this.zoomInPaintVertexArray.arrayBuffer && this.zoomOutPaintVertexArray && this.zoomOutPaintVertexArray.arrayBuffer && (this.zoomInPaintVertexBuffer = t6.createVertexBuffer(this.zoomInPaintVertexArray, la.members, this.expression.isStateDependent), this.zoomOutPaintVertexBuffer = t6.createVertexBuffer(this.zoomOutPaintVertexArray, la.members, this.expression.isStateDependent));
}, Ba.prototype.destroy = function() {
this.zoomOutPaintVertexBuffer && this.zoomOutPaintVertexBuffer.destroy(), this.zoomInPaintVertexBuffer && this.zoomInPaintVertexBuffer.destroy();
};
var Ta = function(t6, e6, r7) {
this.binders = {}, this._buffers = [];
var n8 = [];
for (var i6 in t6.paint._values) {
if (r7(i6)) {
var a6 = t6.paint.get(i6);
if (a6 instanceof yi2 && Tr(a6.property.specification)) {
var o6 = Fa(i6, t6.type), s7 = a6.value, u5 = a6.property.specification.type, l8 = a6.property.useIntegerZoom, p5 = a6.property.specification["property-type"], c5 = "cross-faded" === p5 || "cross-faded-data-driven" === p5;
if ("constant" === s7.kind) {
this.binders[i6] = c5 ? new Ea(s7.value, o6) : new Ca(s7.value, o6, u5), n8.push("/u_" + i6);
} else if ("source" === s7.kind || c5) {
var h7 = Da(i6, u5, "source");
this.binders[i6] = c5 ? new Ba(s7, u5, l8, e6, h7, t6.id) : new Pa(s7, o6, u5, h7), n8.push("/a_" + i6);
} else {
var f5 = Da(i6, u5, "composite");
this.binders[i6] = new Ma(s7, o6, u5, l8, e6, f5), n8.push("/z_" + i6);
}
}
}
}
this.cacheKey = n8.sort().join("");
};
Ta.prototype.getMaxValue = function(t6) {
var e6 = this.binders[t6];
return e6 instanceof Pa || e6 instanceof Ma ? e6.maxValue : 0;
}, Ta.prototype.populatePaintArrays = function(t6, e6, r7, n8, i6) {
for (var a6 in this.binders) {
var o6 = this.binders[a6];
(o6 instanceof Pa || o6 instanceof Ma || o6 instanceof Ba) && o6.populatePaintArray(t6, e6, r7, n8, i6);
}
}, Ta.prototype.setConstantPatternPositions = function(t6, e6) {
for (var r7 in this.binders) {
var n8 = this.binders[r7];
n8 instanceof Ea && n8.setConstantPatternPositions(t6, e6);
}
}, Ta.prototype.updatePaintArrays = function(t6, e6, r7, n8, i6) {
var a6 = false;
for (var o6 in t6) {
for (var s7 = 0, u5 = e6.getPositions(o6); s7 < u5.length; s7 += 1) {
var l8 = u5[s7], p5 = r7.feature(l8.index);
for (var c5 in this.binders) {
var h7 = this.binders[c5];
if ((h7 instanceof Pa || h7 instanceof Ma || h7 instanceof Ba) && true === h7.expression.isStateDependent) {
var f5 = n8.paint.get(c5);
h7.expression = f5.value, h7.updatePaintArray(l8.start, l8.end, p5, t6[o6], i6), a6 = true;
}
}
}
}
return a6;
}, Ta.prototype.defines = function() {
var t6 = [];
for (var e6 in this.binders) {
var r7 = this.binders[e6];
(r7 instanceof Ca || r7 instanceof Ea) && t6.push.apply(t6, r7.uniformNames.map(function(t7) {
return "#define HAS_UNIFORM_" + t7;
}));
}
return t6;
}, Ta.prototype.getBinderAttributes = function() {
var t6 = [];
for (var e6 in this.binders) {
var r7 = this.binders[e6];
if (r7 instanceof Pa || r7 instanceof Ma) {
for (var n8 = 0; n8 < r7.paintVertexAttributes.length; n8++) {
t6.push(r7.paintVertexAttributes[n8].name);
}
} else if (r7 instanceof Ba) {
for (var i6 = 0; i6 < la.members.length; i6++) {
t6.push(la.members[i6].name);
}
}
}
return t6;
}, Ta.prototype.getBinderUniforms = function() {
var t6 = [];
for (var e6 in this.binders) {
var r7 = this.binders[e6];
if (r7 instanceof Ca || r7 instanceof Ea || r7 instanceof Ma) {
for (var n8 = 0, i6 = r7.uniformNames; n8 < i6.length; n8 += 1) {
t6.push(i6[n8]);
}
}
}
return t6;
}, Ta.prototype.getPaintVertexBuffers = function() {
return this._buffers;
}, Ta.prototype.getUniforms = function(t6, e6) {
var r7 = [];
for (var n8 in this.binders) {
var i6 = this.binders[n8];
if (i6 instanceof Ca || i6 instanceof Ea || i6 instanceof Ma) {
for (var a6 = 0, o6 = i6.uniformNames; a6 < o6.length; a6 += 1) {
var s7 = o6[a6];
if (e6[s7]) {
var u5 = i6.getBinding(t6, e6[s7], s7);
r7.push({ name: s7, property: n8, binding: u5 });
}
}
}
}
return r7;
}, Ta.prototype.setUniforms = function(t6, e6, r7, n8) {
for (var i6 = 0, a6 = e6; i6 < a6.length; i6 += 1) {
var o6 = a6[i6], s7 = o6.name, u5 = o6.property;
this.binders[u5].setUniform(o6.binding, n8, r7.get(u5), s7);
}
}, Ta.prototype.updatePaintBuffers = function(t6) {
for (var e6 in this._buffers = [], this.binders) {
var r7 = this.binders[e6];
if (t6 && r7 instanceof Ba) {
var n8 = 2 === t6.fromScale ? r7.zoomInPaintVertexBuffer : r7.zoomOutPaintVertexBuffer;
n8 && this._buffers.push(n8);
} else {
(r7 instanceof Pa || r7 instanceof Ma) && r7.paintVertexBuffer && this._buffers.push(r7.paintVertexBuffer);
}
}
}, Ta.prototype.upload = function(t6) {
for (var e6 in this.binders) {
var r7 = this.binders[e6];
(r7 instanceof Pa || r7 instanceof Ma || r7 instanceof Ba) && r7.upload(t6);
}
this.updatePaintBuffers();
}, Ta.prototype.destroy = function() {
for (var t6 in this.binders) {
var e6 = this.binders[t6];
(e6 instanceof Pa || e6 instanceof Ma || e6 instanceof Ba) && e6.destroy();
}
};
var Va = function(t6, e6, r7) {
void 0 === r7 && (r7 = function() {
return true;
}), this.programConfigurations = {};
for (var n8 = 0, i6 = t6; n8 < i6.length; n8 += 1) {
var a6 = i6[n8];
this.programConfigurations[a6.id] = new Ta(a6, e6, r7);
}
this.needsUpload = false, this._featureMap = new ya(), this._bufferOffset = 0;
};
function Fa(t6, e6) {
return { "text-opacity": ["opacity"], "icon-opacity": ["opacity"], "text-color": ["fill_color"], "icon-color": ["fill_color"], "text-halo-color": ["halo_color"], "icon-halo-color": ["halo_color"], "text-halo-blur": ["halo_blur"], "icon-halo-blur": ["halo_blur"], "text-halo-width": ["halo_width"], "icon-halo-width": ["halo_width"], "line-gap-width": ["gapwidth"], "line-pattern": ["pattern_to", "pattern_from", "pixel_ratio_to", "pixel_ratio_from"], "fill-pattern": ["pattern_to", "pattern_from", "pixel_ratio_to", "pixel_ratio_from"], "fill-extrusion-pattern": ["pattern_to", "pattern_from", "pixel_ratio_to", "pixel_ratio_from"] }[t6] || [t6.replace(e6 + "-", "").replace(/-/g, "_")];
}
function Da(t6, e6, r7) {
var n8 = { color: { source: Bi2, composite: Hi2 }, number: { source: Ki2, composite: Bi2 } }, i6 = function(t7) {
return { "line-pattern": { source: Ti2, composite: Ti2 }, "fill-pattern": { source: Ti2, composite: Ti2 }, "fill-extrusion-pattern": { source: Ti2, composite: Ti2 } }[t7];
}(t6);
return i6 && i6[r7] || n8[e6][r7];
}
Va.prototype.populatePaintArrays = function(t6, e6, r7, n8, i6, a6) {
for (var o6 in this.programConfigurations) {
this.programConfigurations[o6].populatePaintArrays(t6, e6, n8, i6, a6);
}
void 0 !== e6.id && this._featureMap.add(e6.id, r7, this._bufferOffset, t6), this._bufferOffset = t6, this.needsUpload = true;
}, Va.prototype.updatePaintArrays = function(t6, e6, r7, n8) {
for (var i6 = 0, a6 = r7; i6 < a6.length; i6 += 1) {
var o6 = a6[i6];
this.needsUpload = this.programConfigurations[o6.id].updatePaintArrays(t6, this._featureMap, e6, o6, n8) || this.needsUpload;
}
}, Va.prototype.get = function(t6) {
return this.programConfigurations[t6];
}, Va.prototype.upload = function(t6) {
if (this.needsUpload) {
for (var e6 in this.programConfigurations) {
this.programConfigurations[e6].upload(t6);
}
this.needsUpload = false;
}
}, Va.prototype.destroy = function() {
for (var t6 in this.programConfigurations) {
this.programConfigurations[t6].destroy();
}
}, On2("ConstantBinder", Ca), On2("CrossFadedConstantBinder", Ea), On2("SourceExpressionBinder", Pa), On2("CrossFadedCompositeBinder", Ba), On2("CompositeExpressionBinder", Ma), On2("ProgramConfiguration", Ta, { omit: ["_buffers"] }), On2("ProgramConfigurationSet", Va);
var La = Math.pow(2, 14) - 1, Oa = -La - 1;
function Ra(t6) {
for (var e6 = 8192 / t6.extent, r7 = t6.loadGeometry(), n8 = 0; n8 < r7.length; n8++) {
for (var i6 = r7[n8], a6 = 0; a6 < i6.length; a6++) {
var o6 = i6[a6], s7 = Math.round(o6.x * e6), u5 = Math.round(o6.y * e6);
o6.x = p4(s7, Oa, La), o6.y = p4(u5, Oa, La), (s7 < o6.x || s7 > o6.x + 1 || u5 < o6.y || u5 > o6.y + 1) && A4("Geometry exceeds allowed extent, reduce your vector tile buffer size");
}
}
return r7;
}
function Ua(t6, e6) {
return { type: t6.type, id: t6.id, properties: t6.properties, geometry: e6 ? Ra(t6) : [] };
}
function ja(t6, e6, r7, n8, i6) {
t6.emplaceBack(2 * e6 + (n8 + 1) / 2, 2 * r7 + (i6 + 1) / 2);
}
var qa = function(t6) {
this.zoom = t6.zoom, this.overscaling = t6.overscaling, this.layers = t6.layers, this.layerIds = this.layers.map(function(t7) {
return t7.id;
}), this.index = t6.index, this.hasPattern = false, this.layoutVertexArray = new Ci2(), this.indexArray = new ji2(), this.segments = new sa(), this.programConfigurations = new Va(t6.layers, t6.zoom), this.stateDependentLayerIds = this.layers.filter(function(t7) {
return t7.isStateDependent();
}).map(function(t7) {
return t7.id;
});
};
function Na(t6, e6) {
for (var r7 = 0; r7 < t6.length; r7++) {
if (Wa(e6, t6[r7])) {
return true;
}
}
for (var n8 = 0; n8 < e6.length; n8++) {
if (Wa(t6, e6[n8])) {
return true;
}
}
return !!Xa(t6, e6);
}
function Ka(t6, e6, r7) {
return !!Wa(t6, e6) || !!Ha(e6, t6, r7);
}
function Ga(t6, e6) {
if (1 === t6.length) {
return $a(e6, t6[0]);
}
for (var r7 = 0; r7 < e6.length; r7++) {
for (var n8 = e6[r7], i6 = 0; i6 < n8.length; i6++) {
if (Wa(t6, n8[i6])) {
return true;
}
}
}
for (var a6 = 0; a6 < t6.length; a6++) {
if ($a(e6, t6[a6])) {
return true;
}
}
for (var o6 = 0; o6 < e6.length; o6++) {
if (Xa(t6, e6[o6])) {
return true;
}
}
return false;
}
function Za(t6, e6, r7) {
if (t6.length > 1) {
if (Xa(t6, e6)) {
return true;
}
for (var n8 = 0; n8 < e6.length; n8++) {
if (Ha(e6[n8], t6, r7)) {
return true;
}
}
}
for (var i6 = 0; i6 < t6.length; i6++) {
if (Ha(t6[i6], e6, r7)) {
return true;
}
}
return false;
}
function Xa(t6, e6) {
if (0 === t6.length || 0 === e6.length) {
return false;
}
for (var r7 = 0; r7 < t6.length - 1; r7++) {
for (var n8 = t6[r7], i6 = t6[r7 + 1], a6 = 0; a6 < e6.length - 1; a6++) {
if (Ja(n8, i6, e6[a6], e6[a6 + 1])) {
return true;
}
}
}
return false;
}
function Ja(t6, e6, r7, n8) {
return S4(t6, r7, n8) !== S4(e6, r7, n8) && S4(t6, e6, r7) !== S4(t6, e6, n8);
}
function Ha(t6, e6, r7) {
var n8 = r7 * r7;
if (1 === e6.length) {
return t6.distSqr(e6[0]) < n8;
}
for (var i6 = 1; i6 < e6.length; i6++) {
if (Ya(t6, e6[i6 - 1], e6[i6]) < n8) {
return true;
}
}
return false;
}
function Ya(t6, e6, r7) {
var n8 = e6.distSqr(r7);
if (0 === n8) {
return t6.distSqr(e6);
}
var i6 = ((t6.x - e6.x) * (r7.x - e6.x) + (t6.y - e6.y) * (r7.y - e6.y)) / n8;
return t6.distSqr(i6 < 0 ? e6 : i6 > 1 ? r7 : r7.sub(e6)._mult(i6)._add(e6));
}
function $a(t6, e6) {
for (var r7, n8, i6, a6 = false, o6 = 0; o6 < t6.length; o6++) {
for (var s7 = 0, u5 = (r7 = t6[o6]).length - 1; s7 < r7.length; u5 = s7++) {
(n8 = r7[s7]).y > e6.y != (i6 = r7[u5]).y > e6.y && e6.x < (i6.x - n8.x) * (e6.y - n8.y) / (i6.y - n8.y) + n8.x && (a6 = !a6);
}
}
return a6;
}
function Wa(t6, e6) {
for (var r7 = false, n8 = 0, i6 = t6.length - 1; n8 < t6.length; i6 = n8++) {
var a6 = t6[n8], o6 = t6[i6];
a6.y > e6.y != o6.y > e6.y && e6.x < (o6.x - a6.x) * (e6.y - a6.y) / (o6.y - a6.y) + a6.x && (r7 = !r7);
}
return r7;
}
function Qa(t6, e6, r7) {
var n8 = r7[0], i6 = r7[2];
if (t6.x < n8.x && e6.x < n8.x || t6.x > i6.x && e6.x > i6.x || t6.y < n8.y && e6.y < n8.y || t6.y > i6.y && e6.y > i6.y) {
return false;
}
var a6 = S4(t6, e6, r7[0]);
return a6 !== S4(t6, e6, r7[1]) || a6 !== S4(t6, e6, r7[2]) || a6 !== S4(t6, e6, r7[3]);
}
function to(t6, e6, r7) {
var n8 = e6.paint.get(t6).value;
return "constant" === n8.kind ? n8.value : r7.programConfigurations.get(e6.id).getMaxValue(t6);
}
function eo(t6) {
return Math.sqrt(t6[0] * t6[0] + t6[1] * t6[1]);
}
function ro(t6, e6, r7, n8, a6) {
if (!e6[0] && !e6[1]) {
return t6;
}
var o6 = i5.convert(e6)._mult(a6);
"viewport" === r7 && o6._rotate(-n8);
for (var s7 = [], u5 = 0; u5 < t6.length; u5++) {
s7.push(t6[u5].sub(o6));
}
return s7;
}
qa.prototype.populate = function(t6, e6, r7) {
var n8 = this.layers[0], i6 = [], a6 = null;
"circle" === n8.type && (a6 = n8.layout.get("circle-sort-key"));
for (var o6 = 0, s7 = t6; o6 < s7.length; o6 += 1) {
var u5 = s7[o6], l8 = u5.feature, p5 = u5.id, c5 = u5.index, h7 = u5.sourceLayerIndex, f5 = this.layers[0]._featureFilter.needGeometry, y5 = Ua(l8, f5);
if (this.layers[0]._featureFilter.filter(new si2(this.zoom), y5, r7)) {
var d5 = a6 ? a6.evaluate(y5, {}, r7) : void 0, m5 = { id: p5, properties: l8.properties, type: l8.type, sourceLayerIndex: h7, index: c5, geometry: f5 ? y5.geometry : Ra(l8), patterns: {}, sortKey: d5 };
i6.push(m5);
}
}
a6 && i6.sort(function(t7, e7) {
return t7.sortKey - e7.sortKey;
});
for (var v5 = 0, g5 = i6; v5 < g5.length; v5 += 1) {
var x5 = g5[v5], b5 = x5.geometry, w5 = x5.index, _4 = x5.sourceLayerIndex, A5 = t6[w5].feature;
this.addFeature(x5, b5, w5, r7), e6.featureIndex.insert(A5, b5, w5, _4, this.index);
}
}, qa.prototype.update = function(t6, e6, r7) {
this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(t6, e6, this.stateDependentLayers, r7);
}, qa.prototype.isEmpty = function() {
return 0 === this.layoutVertexArray.length;
}, qa.prototype.uploadPending = function() {
return !this.uploaded || this.programConfigurations.needsUpload;
}, qa.prototype.upload = function(t6) {
this.uploaded || (this.layoutVertexBuffer = t6.createVertexBuffer(this.layoutVertexArray, oa), this.indexBuffer = t6.createIndexBuffer(this.indexArray)), this.programConfigurations.upload(t6), this.uploaded = true;
}, qa.prototype.destroy = function() {
this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.programConfigurations.destroy(), this.segments.destroy());
}, qa.prototype.addFeature = function(t6, e6, r7, n8) {
for (var i6 = 0, a6 = e6; i6 < a6.length; i6 += 1) {
for (var o6 = 0, s7 = a6[i6]; o6 < s7.length; o6 += 1) {
var u5 = s7[o6], l8 = u5.x, p5 = u5.y;
if (!(l8 < 0 || l8 >= 8192 || p5 < 0 || p5 >= 8192)) {
var c5 = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray, t6.sortKey), h7 = c5.vertexLength;
ja(this.layoutVertexArray, l8, p5, -1, -1), ja(this.layoutVertexArray, l8, p5, 1, -1), ja(this.layoutVertexArray, l8, p5, 1, 1), ja(this.layoutVertexArray, l8, p5, -1, 1), this.indexArray.emplaceBack(h7, h7 + 1, h7 + 2), this.indexArray.emplaceBack(h7, h7 + 3, h7 + 2), c5.vertexLength += 4, c5.primitiveLength += 2;
}
}
}
this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, t6, r7, {}, n8);
}, On2("CircleBucket", qa, { omit: ["layers"] });
var no = new wi2({ "circle-sort-key": new vi2(Et2.layout_circle["circle-sort-key"]) }), io = { paint: new wi2({ "circle-radius": new vi2(Et2.paint_circle["circle-radius"]), "circle-color": new vi2(Et2.paint_circle["circle-color"]), "circle-blur": new vi2(Et2.paint_circle["circle-blur"]), "circle-opacity": new vi2(Et2.paint_circle["circle-opacity"]), "circle-translate": new mi2(Et2.paint_circle["circle-translate"]), "circle-translate-anchor": new mi2(Et2.paint_circle["circle-translate-anchor"]), "circle-pitch-scale": new mi2(Et2.paint_circle["circle-pitch-scale"]), "circle-pitch-alignment": new mi2(Et2.paint_circle["circle-pitch-alignment"]), "circle-stroke-width": new vi2(Et2.paint_circle["circle-stroke-width"]), "circle-stroke-color": new vi2(Et2.paint_circle["circle-stroke-color"]), "circle-stroke-opacity": new vi2(Et2.paint_circle["circle-stroke-opacity"]) }), layout: no }, ao = "undefined" != typeof Float32Array ? Float32Array : Array;
function oo(t6) {
return t6[0] = 1, t6[1] = 0, t6[2] = 0, t6[3] = 0, t6[4] = 0, t6[5] = 1, t6[6] = 0, t6[7] = 0, t6[8] = 0, t6[9] = 0, t6[10] = 1, t6[11] = 0, t6[12] = 0, t6[13] = 0, t6[14] = 0, t6[15] = 1, t6;
}
function so(t6, e6, r7) {
var n8 = e6[0], i6 = e6[1], a6 = e6[2], o6 = e6[3], s7 = e6[4], u5 = e6[5], l8 = e6[6], p5 = e6[7], c5 = e6[8], h7 = e6[9], f5 = e6[10], y5 = e6[11], d5 = e6[12], m5 = e6[13], v5 = e6[14], g5 = e6[15], x5 = r7[0], b5 = r7[1], w5 = r7[2], _4 = r7[3];
return t6[0] = x5 * n8 + b5 * s7 + w5 * c5 + _4 * d5, t6[1] = x5 * i6 + b5 * u5 + w5 * h7 + _4 * m5, t6[2] = x5 * a6 + b5 * l8 + w5 * f5 + _4 * v5, t6[3] = x5 * o6 + b5 * p5 + w5 * y5 + _4 * g5, t6[4] = (x5 = r7[4]) * n8 + (b5 = r7[5]) * s7 + (w5 = r7[6]) * c5 + (_4 = r7[7]) * d5, t6[5] = x5 * i6 + b5 * u5 + w5 * h7 + _4 * m5, t6[6] = x5 * a6 + b5 * l8 + w5 * f5 + _4 * v5, t6[7] = x5 * o6 + b5 * p5 + w5 * y5 + _4 * g5, t6[8] = (x5 = r7[8]) * n8 + (b5 = r7[9]) * s7 + (w5 = r7[10]) * c5 + (_4 = r7[11]) * d5, t6[9] = x5 * i6 + b5 * u5 + w5 * h7 + _4 * m5, t6[10] = x5 * a6 + b5 * l8 + w5 * f5 + _4 * v5, t6[11] = x5 * o6 + b5 * p5 + w5 * y5 + _4 * g5, t6[12] = (x5 = r7[12]) * n8 + (b5 = r7[13]) * s7 + (w5 = r7[14]) * c5 + (_4 = r7[15]) * d5, t6[13] = x5 * i6 + b5 * u5 + w5 * h7 + _4 * m5, t6[14] = x5 * a6 + b5 * l8 + w5 * f5 + _4 * v5, t6[15] = x5 * o6 + b5 * p5 + w5 * y5 + _4 * g5, t6;
}
Math.hypot || (Math.hypot = function() {
for (var t6 = arguments, e6 = 0, r7 = arguments.length; r7--; ) {
e6 += t6[r7] * t6[r7];
}
return Math.sqrt(e6);
});
var uo, lo = so;
function po(t6, e6, r7) {
var n8 = e6[0], i6 = e6[1], a6 = e6[2], o6 = e6[3];
return t6[0] = r7[0] * n8 + r7[4] * i6 + r7[8] * a6 + r7[12] * o6, t6[1] = r7[1] * n8 + r7[5] * i6 + r7[9] * a6 + r7[13] * o6, t6[2] = r7[2] * n8 + r7[6] * i6 + r7[10] * a6 + r7[14] * o6, t6[3] = r7[3] * n8 + r7[7] * i6 + r7[11] * a6 + r7[15] * o6, t6;
}
uo = new ao(3), ao != Float32Array && (uo[0] = 0, uo[1] = 0, uo[2] = 0), function() {
var t6 = new ao(4);
ao != Float32Array && (t6[0] = 0, t6[1] = 0, t6[2] = 0, t6[3] = 0);
}();
var co = (function() {
var t6 = new ao(2);
ao != Float32Array && (t6[0] = 0, t6[1] = 0);
}(), function(t6) {
function e6(e7) {
t6.call(this, e7, io);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.createBucket = function(t7) {
return new qa(t7);
}, e6.prototype.queryRadius = function(t7) {
var e7 = t7;
return to("circle-radius", this, e7) + to("circle-stroke-width", this, e7) + eo(this.paint.get("circle-translate"));
}, e6.prototype.queryIntersectsFeature = function(t7, e7, r7, n8, i6, a6, o6, s7) {
for (var u5 = ro(t7, this.paint.get("circle-translate"), this.paint.get("circle-translate-anchor"), a6.angle, o6), l8 = this.paint.get("circle-radius").evaluate(e7, r7) + this.paint.get("circle-stroke-width").evaluate(e7, r7), p5 = "map" === this.paint.get("circle-pitch-alignment"), c5 = p5 ? u5 : function(t8, e8) {
return t8.map(function(t9) {
return ho(t9, e8);
});
}(u5, s7), h7 = p5 ? l8 * o6 : l8, f5 = 0, y5 = n8; f5 < y5.length; f5 += 1) {
for (var d5 = 0, m5 = y5[f5]; d5 < m5.length; d5 += 1) {
var v5 = m5[d5], g5 = p5 ? v5 : ho(v5, s7), x5 = h7, b5 = po([], [v5.x, v5.y, 0, 1], s7);
if ("viewport" === this.paint.get("circle-pitch-scale") && "map" === this.paint.get("circle-pitch-alignment") ? x5 *= b5[3] / a6.cameraToCenterDistance : "map" === this.paint.get("circle-pitch-scale") && "viewport" === this.paint.get("circle-pitch-alignment") && (x5 *= a6.cameraToCenterDistance / b5[3]), Ka(c5, g5, x5)) {
return true;
}
}
}
return false;
}, e6;
}(_i2));
function ho(t6, e6) {
var r7 = po([], [t6.x, t6.y, 0, 1], e6);
return new i5(r7[0] / r7[3], r7[1] / r7[3]);
}
var fo = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6;
}(qa);
function yo(t6, e6, r7, n8) {
var i6 = e6.width, a6 = e6.height;
if (n8) {
if (n8 instanceof Uint8ClampedArray) {
n8 = new Uint8Array(n8.buffer);
} else if (n8.length !== i6 * a6 * r7) {
throw new RangeError("mismatched image size");
}
} else {
n8 = new Uint8Array(i6 * a6 * r7);
}
return t6.width = i6, t6.height = a6, t6.data = n8, t6;
}
function mo(t6, e6, r7) {
var n8 = e6.width, i6 = e6.height;
if (n8 !== t6.width || i6 !== t6.height) {
var a6 = yo({}, { width: n8, height: i6 }, r7);
vo(t6, a6, { x: 0, y: 0 }, { x: 0, y: 0 }, { width: Math.min(t6.width, n8), height: Math.min(t6.height, i6) }, r7), t6.width = n8, t6.height = i6, t6.data = a6.data;
}
}
function vo(t6, e6, r7, n8, i6, a6) {
if (0 === i6.width || 0 === i6.height) {
return e6;
}
if (i6.width > t6.width || i6.height > t6.height || r7.x > t6.width - i6.width || r7.y > t6.height - i6.height) {
throw new RangeError("out of range source coordinates for image copy");
}
if (i6.width > e6.width || i6.height > e6.height || n8.x > e6.width - i6.width || n8.y > e6.height - i6.height) {
throw new RangeError("out of range destination coordinates for image copy");
}
for (var o6 = t6.data, s7 = e6.data, u5 = 0; u5 < i6.height; u5++) {
for (var l8 = ((r7.y + u5) * t6.width + r7.x) * a6, p5 = ((n8.y + u5) * e6.width + n8.x) * a6, c5 = 0; c5 < i6.width * a6; c5++) {
s7[p5 + c5] = o6[l8 + c5];
}
}
return e6;
}
On2("HeatmapBucket", fo, { omit: ["layers"] });
var go = function(t6, e6) {
yo(this, t6, 1, e6);
};
go.prototype.resize = function(t6) {
mo(this, t6, 1);
}, go.prototype.clone = function() {
return new go({ width: this.width, height: this.height }, new Uint8Array(this.data));
}, go.copy = function(t6, e6, r7, n8, i6) {
vo(t6, e6, r7, n8, i6, 1);
};
var xo = function(t6, e6) {
yo(this, t6, 4, e6);
};
xo.prototype.resize = function(t6) {
mo(this, t6, 4);
}, xo.prototype.replace = function(t6, e6) {
e6 ? this.data.set(t6) : this.data = t6 instanceof Uint8ClampedArray ? new Uint8Array(t6.buffer) : t6;
}, xo.prototype.clone = function() {
return new xo({ width: this.width, height: this.height }, new Uint8Array(this.data));
}, xo.copy = function(t6, e6, r7, n8, i6) {
vo(t6, e6, r7, n8, i6, 4);
}, On2("AlphaImage", go), On2("RGBAImage", xo);
var bo = { paint: new wi2({ "heatmap-radius": new vi2(Et2.paint_heatmap["heatmap-radius"]), "heatmap-weight": new vi2(Et2.paint_heatmap["heatmap-weight"]), "heatmap-intensity": new mi2(Et2.paint_heatmap["heatmap-intensity"]), "heatmap-color": new bi2(Et2.paint_heatmap["heatmap-color"]), "heatmap-opacity": new mi2(Et2.paint_heatmap["heatmap-opacity"]) }) };
function wo(t6) {
var e6 = {}, r7 = t6.resolution || 256, n8 = t6.clips ? t6.clips.length : 1, i6 = t6.image || new xo({ width: r7, height: n8 }), a6 = function(r8, n9, a7) {
e6[t6.evaluationKey] = a7;
var o7 = t6.expression.evaluate(e6);
i6.data[r8 + n9 + 0] = Math.floor(255 * o7.r / o7.a), i6.data[r8 + n9 + 1] = Math.floor(255 * o7.g / o7.a), i6.data[r8 + n9 + 2] = Math.floor(255 * o7.b / o7.a), i6.data[r8 + n9 + 3] = Math.floor(255 * o7.a);
};
if (t6.clips) {
for (var o6 = 0, s7 = 0; o6 < n8; ++o6, s7 += 4 * r7) {
for (var u5 = 0, l8 = 0; u5 < r7; u5++, l8 += 4) {
var p5 = u5 / (r7 - 1), c5 = t6.clips[o6];
a6(s7, l8, c5.start * (1 - p5) + c5.end * p5);
}
}
} else {
for (var h7 = 0, f5 = 0; h7 < r7; h7++, f5 += 4) {
a6(0, f5, h7 / (r7 - 1));
}
}
return i6;
}
var _o = function(t6) {
function e6(e7) {
t6.call(this, e7, bo), this._updateColorRamp();
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.createBucket = function(t7) {
return new fo(t7);
}, e6.prototype._handleSpecialPaintPropertyUpdate = function(t7) {
"heatmap-color" === t7 && this._updateColorRamp();
}, e6.prototype._updateColorRamp = function() {
this.colorRamp = wo({ expression: this._transitionablePaint._values["heatmap-color"].value.expression, evaluationKey: "heatmapDensity", image: this.colorRamp }), this.colorRampTexture = null;
}, e6.prototype.resize = function() {
this.heatmapFbo && (this.heatmapFbo.destroy(), this.heatmapFbo = null);
}, e6.prototype.queryRadius = function() {
return 0;
}, e6.prototype.queryIntersectsFeature = function() {
return false;
}, e6.prototype.hasOffscreenPass = function() {
return 0 !== this.paint.get("heatmap-opacity") && "none" !== this.visibility;
}, e6;
}(_i2), Ao = { paint: new wi2({ "hillshade-illumination-direction": new mi2(Et2.paint_hillshade["hillshade-illumination-direction"]), "hillshade-illumination-anchor": new mi2(Et2.paint_hillshade["hillshade-illumination-anchor"]), "hillshade-exaggeration": new mi2(Et2.paint_hillshade["hillshade-exaggeration"]), "hillshade-shadow-color": new mi2(Et2.paint_hillshade["hillshade-shadow-color"]), "hillshade-highlight-color": new mi2(Et2.paint_hillshade["hillshade-highlight-color"]), "hillshade-accent-color": new mi2(Et2.paint_hillshade["hillshade-accent-color"]) }) }, So = function(t6) {
function e6(e7) {
t6.call(this, e7, Ao);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.hasOffscreenPass = function() {
return 0 !== this.paint.get("hillshade-exaggeration") && "none" !== this.visibility;
}, e6;
}(_i2), ko = Ii2([{ name: "a_pos", components: 2, type: "Int16" }], 4).members, Io = Co, zo = Co;
function Co(t6, e6, r7) {
r7 = r7 || 2;
var n8, i6, a6, o6, s7, u5, l8, p5 = e6 && e6.length, c5 = p5 ? e6[0] * r7 : t6.length, h7 = Eo(t6, 0, c5, r7, true), f5 = [];
if (!h7 || h7.next === h7.prev) {
return f5;
}
if (p5 && (h7 = function(t7, e7, r8, n9) {
var i7, a7, o7, s8 = [];
for (i7 = 0, a7 = e7.length; i7 < a7; i7++) {
(o7 = Eo(t7, e7[i7] * n9, i7 < a7 - 1 ? e7[i7 + 1] * n9 : t7.length, n9, false)) === o7.next && (o7.steiner = true), s8.push(Uo(o7));
}
for (s8.sort(Do), i7 = 0; i7 < s8.length; i7++) {
Lo(s8[i7], r8), r8 = Po(r8, r8.next);
}
return r8;
}(t6, e6, h7, r7)), t6.length > 80 * r7) {
n8 = a6 = t6[0], i6 = o6 = t6[1];
for (var y5 = r7; y5 < c5; y5 += r7) {
(s7 = t6[y5]) < n8 && (n8 = s7), (u5 = t6[y5 + 1]) < i6 && (i6 = u5), s7 > a6 && (a6 = s7), u5 > o6 && (o6 = u5);
}
l8 = 0 !== (l8 = Math.max(a6 - n8, o6 - i6)) ? 1 / l8 : 0;
}
return Mo(h7, f5, r7, n8, i6, l8), f5;
}
function Eo(t6, e6, r7, n8, i6) {
var a6, o6;
if (i6 === Qo(t6, e6, r7, n8) > 0) {
for (a6 = e6; a6 < r7; a6 += n8) {
o6 = Yo(a6, t6[a6], t6[a6 + 1], o6);
}
} else {
for (a6 = r7 - n8; a6 >= e6; a6 -= n8) {
o6 = Yo(a6, t6[a6], t6[a6 + 1], o6);
}
}
return o6 && Ko(o6, o6.next) && ($o(o6), o6 = o6.next), o6;
}
function Po(t6, e6) {
if (!t6) {
return t6;
}
e6 || (e6 = t6);
var r7, n8 = t6;
do {
if (r7 = false, n8.steiner || !Ko(n8, n8.next) && 0 !== No(n8.prev, n8, n8.next)) {
n8 = n8.next;
} else {
if ($o(n8), (n8 = e6 = n8.prev) === n8.next) {
break;
}
r7 = true;
}
} while (r7 || n8 !== e6);
return e6;
}
function Mo(t6, e6, r7, n8, i6, a6, o6) {
if (t6) {
!o6 && a6 && function(t7, e7, r8, n9) {
var i7 = t7;
do {
null === i7.z && (i7.z = Ro(i7.x, i7.y, e7, r8, n9)), i7.prevZ = i7.prev, i7.nextZ = i7.next, i7 = i7.next;
} while (i7 !== t7);
i7.prevZ.nextZ = null, i7.prevZ = null, function(t8) {
var e8, r9, n10, i8, a7, o7, s8, u6, l9 = 1;
do {
for (r9 = t8, t8 = null, a7 = null, o7 = 0; r9; ) {
for (o7++, n10 = r9, s8 = 0, e8 = 0; e8 < l9 && (s8++, n10 = n10.nextZ); e8++) {
}
for (u6 = l9; s8 > 0 || u6 > 0 && n10; ) {
0 !== s8 && (0 === u6 || !n10 || r9.z <= n10.z) ? (i8 = r9, r9 = r9.nextZ, s8--) : (i8 = n10, n10 = n10.nextZ, u6--), a7 ? a7.nextZ = i8 : t8 = i8, i8.prevZ = a7, a7 = i8;
}
r9 = n10;
}
a7.nextZ = null, l9 *= 2;
} while (o7 > 1);
}(i7);
}(t6, n8, i6, a6);
for (var s7, u5, l8 = t6; t6.prev !== t6.next; ) {
if (s7 = t6.prev, u5 = t6.next, a6 ? To(t6, n8, i6, a6) : Bo(t6)) {
e6.push(s7.i / r7), e6.push(t6.i / r7), e6.push(u5.i / r7), $o(t6), t6 = u5.next, l8 = u5.next;
} else if ((t6 = u5) === l8) {
o6 ? 1 === o6 ? Mo(t6 = Vo(Po(t6), e6, r7), e6, r7, n8, i6, a6, 2) : 2 === o6 && Fo(t6, e6, r7, n8, i6, a6) : Mo(Po(t6), e6, r7, n8, i6, a6, 1);
break;
}
}
}
}
function Bo(t6) {
var e6 = t6.prev, r7 = t6, n8 = t6.next;
if (No(e6, r7, n8) >= 0) {
return false;
}
for (var i6 = t6.next.next; i6 !== t6.prev; ) {
if (jo(e6.x, e6.y, r7.x, r7.y, n8.x, n8.y, i6.x, i6.y) && No(i6.prev, i6, i6.next) >= 0) {
return false;
}
i6 = i6.next;
}
return true;
}
function To(t6, e6, r7, n8) {
var i6 = t6.prev, a6 = t6, o6 = t6.next;
if (No(i6, a6, o6) >= 0) {
return false;
}
for (var s7 = i6.x > a6.x ? i6.x > o6.x ? i6.x : o6.x : a6.x > o6.x ? a6.x : o6.x, u5 = i6.y > a6.y ? i6.y > o6.y ? i6.y : o6.y : a6.y > o6.y ? a6.y : o6.y, l8 = Ro(i6.x < a6.x ? i6.x < o6.x ? i6.x : o6.x : a6.x < o6.x ? a6.x : o6.x, i6.y < a6.y ? i6.y < o6.y ? i6.y : o6.y : a6.y < o6.y ? a6.y : o6.y, e6, r7, n8), p5 = Ro(s7, u5, e6, r7, n8), c5 = t6.prevZ, h7 = t6.nextZ; c5 && c5.z >= l8 && h7 && h7.z <= p5; ) {
if (c5 !== t6.prev && c5 !== t6.next && jo(i6.x, i6.y, a6.x, a6.y, o6.x, o6.y, c5.x, c5.y) && No(c5.prev, c5, c5.next) >= 0) {
return false;
}
if (c5 = c5.prevZ, h7 !== t6.prev && h7 !== t6.next && jo(i6.x, i6.y, a6.x, a6.y, o6.x, o6.y, h7.x, h7.y) && No(h7.prev, h7, h7.next) >= 0) {
return false;
}
h7 = h7.nextZ;
}
for (; c5 && c5.z >= l8; ) {
if (c5 !== t6.prev && c5 !== t6.next && jo(i6.x, i6.y, a6.x, a6.y, o6.x, o6.y, c5.x, c5.y) && No(c5.prev, c5, c5.next) >= 0) {
return false;
}
c5 = c5.prevZ;
}
for (; h7 && h7.z <= p5; ) {
if (h7 !== t6.prev && h7 !== t6.next && jo(i6.x, i6.y, a6.x, a6.y, o6.x, o6.y, h7.x, h7.y) && No(h7.prev, h7, h7.next) >= 0) {
return false;
}
h7 = h7.nextZ;
}
return true;
}
function Vo(t6, e6, r7) {
var n8 = t6;
do {
var i6 = n8.prev, a6 = n8.next.next;
!Ko(i6, a6) && Go(i6, n8, n8.next, a6) && Jo(i6, a6) && Jo(a6, i6) && (e6.push(i6.i / r7), e6.push(n8.i / r7), e6.push(a6.i / r7), $o(n8), $o(n8.next), n8 = t6 = a6), n8 = n8.next;
} while (n8 !== t6);
return Po(n8);
}
function Fo(t6, e6, r7, n8, i6, a6) {
var o6 = t6;
do {
for (var s7 = o6.next.next; s7 !== o6.prev; ) {
if (o6.i !== s7.i && qo(o6, s7)) {
var u5 = Ho(o6, s7);
return o6 = Po(o6, o6.next), u5 = Po(u5, u5.next), Mo(o6, e6, r7, n8, i6, a6), void Mo(u5, e6, r7, n8, i6, a6);
}
s7 = s7.next;
}
o6 = o6.next;
} while (o6 !== t6);
}
function Do(t6, e6) {
return t6.x - e6.x;
}
function Lo(t6, e6) {
if (e6 = function(t7, e7) {
var r8, n8 = e7, i6 = t7.x, a6 = t7.y, o6 = -1 / 0;
do {
if (a6 <= n8.y && a6 >= n8.next.y && n8.next.y !== n8.y) {
var s7 = n8.x + (a6 - n8.y) * (n8.next.x - n8.x) / (n8.next.y - n8.y);
if (s7 <= i6 && s7 > o6) {
if (o6 = s7, s7 === i6) {
if (a6 === n8.y) {
return n8;
}
if (a6 === n8.next.y) {
return n8.next;
}
}
r8 = n8.x < n8.next.x ? n8 : n8.next;
}
}
n8 = n8.next;
} while (n8 !== e7);
if (!r8) {
return null;
}
if (i6 === o6) {
return r8;
}
var u5, l8 = r8, p5 = r8.x, c5 = r8.y, h7 = 1 / 0;
n8 = r8;
do {
i6 >= n8.x && n8.x >= p5 && i6 !== n8.x && jo(a6 < c5 ? i6 : o6, a6, p5, c5, a6 < c5 ? o6 : i6, a6, n8.x, n8.y) && (u5 = Math.abs(a6 - n8.y) / (i6 - n8.x), Jo(n8, t7) && (u5 < h7 || u5 === h7 && (n8.x > r8.x || n8.x === r8.x && Oo(r8, n8))) && (r8 = n8, h7 = u5)), n8 = n8.next;
} while (n8 !== l8);
return r8;
}(t6, e6)) {
var r7 = Ho(e6, t6);
Po(e6, e6.next), Po(r7, r7.next);
}
}
function Oo(t6, e6) {
return No(t6.prev, t6, e6.prev) < 0 && No(e6.next, t6, t6.next) < 0;
}
function Ro(t6, e6, r7, n8, i6) {
return (t6 = 1431655765 & ((t6 = 858993459 & ((t6 = 252645135 & ((t6 = 16711935 & ((t6 = 32767 * (t6 - r7) * i6) | t6 << 8)) | t6 << 4)) | t6 << 2)) | t6 << 1)) | (e6 = 1431655765 & ((e6 = 858993459 & ((e6 = 252645135 & ((e6 = 16711935 & ((e6 = 32767 * (e6 - n8) * i6) | e6 << 8)) | e6 << 4)) | e6 << 2)) | e6 << 1)) << 1;
}
function Uo(t6) {
var e6 = t6, r7 = t6;
do {
(e6.x < r7.x || e6.x === r7.x && e6.y < r7.y) && (r7 = e6), e6 = e6.next;
} while (e6 !== t6);
return r7;
}
function jo(t6, e6, r7, n8, i6, a6, o6, s7) {
return (i6 - o6) * (e6 - s7) - (t6 - o6) * (a6 - s7) >= 0 && (t6 - o6) * (n8 - s7) - (r7 - o6) * (e6 - s7) >= 0 && (r7 - o6) * (a6 - s7) - (i6 - o6) * (n8 - s7) >= 0;
}
function qo(t6, e6) {
return t6.next.i !== e6.i && t6.prev.i !== e6.i && !function(t7, e7) {
var r7 = t7;
do {
if (r7.i !== t7.i && r7.next.i !== t7.i && r7.i !== e7.i && r7.next.i !== e7.i && Go(r7, r7.next, t7, e7)) {
return true;
}
r7 = r7.next;
} while (r7 !== t7);
return false;
}(t6, e6) && (Jo(t6, e6) && Jo(e6, t6) && function(t7, e7) {
var r7 = t7, n8 = false, i6 = (t7.x + e7.x) / 2, a6 = (t7.y + e7.y) / 2;
do {
r7.y > a6 != r7.next.y > a6 && r7.next.y !== r7.y && i6 < (r7.next.x - r7.x) * (a6 - r7.y) / (r7.next.y - r7.y) + r7.x && (n8 = !n8), r7 = r7.next;
} while (r7 !== t7);
return n8;
}(t6, e6) && (No(t6.prev, t6, e6.prev) || No(t6, e6.prev, e6)) || Ko(t6, e6) && No(t6.prev, t6, t6.next) > 0 && No(e6.prev, e6, e6.next) > 0);
}
function No(t6, e6, r7) {
return (e6.y - t6.y) * (r7.x - e6.x) - (e6.x - t6.x) * (r7.y - e6.y);
}
function Ko(t6, e6) {
return t6.x === e6.x && t6.y === e6.y;
}
function Go(t6, e6, r7, n8) {
var i6 = Xo(No(t6, e6, r7)), a6 = Xo(No(t6, e6, n8)), o6 = Xo(No(r7, n8, t6)), s7 = Xo(No(r7, n8, e6));
return i6 !== a6 && o6 !== s7 || !(0 !== i6 || !Zo(t6, r7, e6)) || !(0 !== a6 || !Zo(t6, n8, e6)) || !(0 !== o6 || !Zo(r7, t6, n8)) || !(0 !== s7 || !Zo(r7, e6, n8));
}
function Zo(t6, e6, r7) {
return e6.x <= Math.max(t6.x, r7.x) && e6.x >= Math.min(t6.x, r7.x) && e6.y <= Math.max(t6.y, r7.y) && e6.y >= Math.min(t6.y, r7.y);
}
function Xo(t6) {
return t6 > 0 ? 1 : t6 < 0 ? -1 : 0;
}
function Jo(t6, e6) {
return No(t6.prev, t6, t6.next) < 0 ? No(t6, e6, t6.next) >= 0 && No(t6, t6.prev, e6) >= 0 : No(t6, e6, t6.prev) < 0 || No(t6, t6.next, e6) < 0;
}
function Ho(t6, e6) {
var r7 = new Wo(t6.i, t6.x, t6.y), n8 = new Wo(e6.i, e6.x, e6.y), i6 = t6.next, a6 = e6.prev;
return t6.next = e6, e6.prev = t6, r7.next = i6, i6.prev = r7, n8.next = r7, r7.prev = n8, a6.next = n8, n8.prev = a6, n8;
}
function Yo(t6, e6, r7, n8) {
var i6 = new Wo(t6, e6, r7);
return n8 ? (i6.next = n8.next, i6.prev = n8, n8.next.prev = i6, n8.next = i6) : (i6.prev = i6, i6.next = i6), i6;
}
function $o(t6) {
t6.next.prev = t6.prev, t6.prev.next = t6.next, t6.prevZ && (t6.prevZ.nextZ = t6.nextZ), t6.nextZ && (t6.nextZ.prevZ = t6.prevZ);
}
function Wo(t6, e6, r7) {
this.i = t6, this.x = e6, this.y = r7, this.prev = null, this.next = null, this.z = null, this.prevZ = null, this.nextZ = null, this.steiner = false;
}
function Qo(t6, e6, r7, n8) {
for (var i6 = 0, a6 = e6, o6 = r7 - n8; a6 < r7; a6 += n8) {
i6 += (t6[o6] - t6[a6]) * (t6[a6 + 1] + t6[o6 + 1]), o6 = a6;
}
return i6;
}
function ts2(t6, e6, r7, n8, i6) {
!function t7(e7, r8, n9, i7, a6) {
for (; i7 > n9; ) {
if (i7 - n9 > 600) {
var o6 = i7 - n9 + 1, s7 = r8 - n9 + 1, u5 = Math.log(o6), l8 = 0.5 * Math.exp(2 * u5 / 3), p5 = 0.5 * Math.sqrt(u5 * l8 * (o6 - l8) / o6) * (s7 - o6 / 2 < 0 ? -1 : 1);
t7(e7, r8, Math.max(n9, Math.floor(r8 - s7 * l8 / o6 + p5)), Math.min(i7, Math.floor(r8 + (o6 - s7) * l8 / o6 + p5)), a6);
}
var c5 = e7[r8], h7 = n9, f5 = i7;
for (es(e7, n9, r8), a6(e7[i7], c5) > 0 && es(e7, n9, i7); h7 < f5; ) {
for (es(e7, h7, f5), h7++, f5--; a6(e7[h7], c5) < 0; ) {
h7++;
}
for (; a6(e7[f5], c5) > 0; ) {
f5--;
}
}
0 === a6(e7[n9], c5) ? es(e7, n9, f5) : es(e7, ++f5, i7), f5 <= r8 && (n9 = f5 + 1), r8 <= f5 && (i7 = f5 - 1);
}
}(t6, e6, r7 || 0, n8 || t6.length - 1, i6 || rs);
}
function es(t6, e6, r7) {
var n8 = t6[e6];
t6[e6] = t6[r7], t6[r7] = n8;
}
function rs(t6, e6) {
return t6 < e6 ? -1 : t6 > e6 ? 1 : 0;
}
function ns(t6, e6) {
var r7 = t6.length;
if (r7 <= 1) {
return [t6];
}
for (var n8, i6, a6 = [], o6 = 0; o6 < r7; o6++) {
var s7 = k4(t6[o6]);
0 !== s7 && (t6[o6].area = Math.abs(s7), void 0 === i6 && (i6 = s7 < 0), i6 === s7 < 0 ? (n8 && a6.push(n8), n8 = [t6[o6]]) : n8.push(t6[o6]));
}
if (n8 && a6.push(n8), e6 > 1) {
for (var u5 = 0; u5 < a6.length; u5++) {
a6[u5].length <= e6 || (ts2(a6[u5], e6, 1, a6[u5].length - 1, is2), a6[u5] = a6[u5].slice(0, e6));
}
}
return a6;
}
function is2(t6, e6) {
return e6.area - t6.area;
}
function as(t6, e6, r7) {
for (var n8 = r7.patternDependencies, i6 = false, a6 = 0, o6 = e6; a6 < o6.length; a6 += 1) {
var s7 = o6[a6].paint.get(t6 + "-pattern");
s7.isConstant() || (i6 = true);
var u5 = s7.constantOr(null);
u5 && (i6 = true, n8[u5.to] = true, n8[u5.from] = true);
}
return i6;
}
function os2(t6, e6, r7, n8, i6) {
for (var a6 = i6.patternDependencies, o6 = 0, s7 = e6; o6 < s7.length; o6 += 1) {
var u5 = s7[o6], l8 = u5.paint.get(t6 + "-pattern").value;
if ("constant" !== l8.kind) {
var p5 = l8.evaluate({ zoom: n8 - 1 }, r7, {}, i6.availableImages), c5 = l8.evaluate({ zoom: n8 }, r7, {}, i6.availableImages), h7 = l8.evaluate({ zoom: n8 + 1 }, r7, {}, i6.availableImages);
c5 = c5 && c5.name ? c5.name : c5, h7 = h7 && h7.name ? h7.name : h7, a6[p5 = p5 && p5.name ? p5.name : p5] = true, a6[c5] = true, a6[h7] = true, r7.patterns[u5.id] = { min: p5, mid: c5, max: h7 };
}
}
return r7;
}
Co.deviation = function(t6, e6, r7, n8) {
var i6 = e6 && e6.length, a6 = Math.abs(Qo(t6, 0, i6 ? e6[0] * r7 : t6.length, r7));
if (i6) {
for (var o6 = 0, s7 = e6.length; o6 < s7; o6++) {
a6 -= Math.abs(Qo(t6, e6[o6] * r7, o6 < s7 - 1 ? e6[o6 + 1] * r7 : t6.length, r7));
}
}
var u5 = 0;
for (o6 = 0; o6 < n8.length; o6 += 3) {
var l8 = n8[o6] * r7, p5 = n8[o6 + 1] * r7, c5 = n8[o6 + 2] * r7;
u5 += Math.abs((t6[l8] - t6[c5]) * (t6[p5 + 1] - t6[l8 + 1]) - (t6[l8] - t6[p5]) * (t6[c5 + 1] - t6[l8 + 1]));
}
return 0 === a6 && 0 === u5 ? 0 : Math.abs((u5 - a6) / a6);
}, Co.flatten = function(t6) {
for (var e6 = t6[0][0].length, r7 = { vertices: [], holes: [], dimensions: e6 }, n8 = 0, i6 = 0; i6 < t6.length; i6++) {
for (var a6 = 0; a6 < t6[i6].length; a6++) {
for (var o6 = 0; o6 < e6; o6++) {
r7.vertices.push(t6[i6][a6][o6]);
}
}
i6 > 0 && r7.holes.push(n8 += t6[i6 - 1].length);
}
return r7;
}, Io.default = zo;
var ss = function(t6) {
this.zoom = t6.zoom, this.overscaling = t6.overscaling, this.layers = t6.layers, this.layerIds = this.layers.map(function(t7) {
return t7.id;
}), this.index = t6.index, this.hasPattern = false, this.patternFeatures = [], this.layoutVertexArray = new Ci2(), this.indexArray = new ji2(), this.indexArray2 = new Xi2(), this.programConfigurations = new Va(t6.layers, t6.zoom), this.segments = new sa(), this.segments2 = new sa(), this.stateDependentLayerIds = this.layers.filter(function(t7) {
return t7.isStateDependent();
}).map(function(t7) {
return t7.id;
});
};
ss.prototype.populate = function(t6, e6, r7) {
this.hasPattern = as("fill", this.layers, e6);
for (var n8 = this.layers[0].layout.get("fill-sort-key"), i6 = [], a6 = 0, o6 = t6; a6 < o6.length; a6 += 1) {
var s7 = o6[a6], u5 = s7.feature, l8 = s7.id, p5 = s7.index, c5 = s7.sourceLayerIndex, h7 = this.layers[0]._featureFilter.needGeometry, f5 = Ua(u5, h7);
if (this.layers[0]._featureFilter.filter(new si2(this.zoom), f5, r7)) {
var y5 = n8 ? n8.evaluate(f5, {}, r7, e6.availableImages) : void 0, d5 = { id: l8, properties: u5.properties, type: u5.type, sourceLayerIndex: c5, index: p5, geometry: h7 ? f5.geometry : Ra(u5), patterns: {}, sortKey: y5 };
i6.push(d5);
}
}
n8 && i6.sort(function(t7, e7) {
return t7.sortKey - e7.sortKey;
});
for (var m5 = 0, v5 = i6; m5 < v5.length; m5 += 1) {
var g5 = v5[m5], x5 = g5.geometry, b5 = g5.index, w5 = g5.sourceLayerIndex;
if (this.hasPattern) {
var _4 = os2("fill", this.layers, g5, this.zoom, e6);
this.patternFeatures.push(_4);
} else {
this.addFeature(g5, x5, b5, r7, {});
}
e6.featureIndex.insert(t6[b5].feature, x5, b5, w5, this.index);
}
}, ss.prototype.update = function(t6, e6, r7) {
this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(t6, e6, this.stateDependentLayers, r7);
}, ss.prototype.addFeatures = function(t6, e6, r7) {
for (var n8 = 0, i6 = this.patternFeatures; n8 < i6.length; n8 += 1) {
var a6 = i6[n8];
this.addFeature(a6, a6.geometry, a6.index, e6, r7);
}
}, ss.prototype.isEmpty = function() {
return 0 === this.layoutVertexArray.length;
}, ss.prototype.uploadPending = function() {
return !this.uploaded || this.programConfigurations.needsUpload;
}, ss.prototype.upload = function(t6) {
this.uploaded || (this.layoutVertexBuffer = t6.createVertexBuffer(this.layoutVertexArray, ko), this.indexBuffer = t6.createIndexBuffer(this.indexArray), this.indexBuffer2 = t6.createIndexBuffer(this.indexArray2)), this.programConfigurations.upload(t6), this.uploaded = true;
}, ss.prototype.destroy = function() {
this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.indexBuffer2.destroy(), this.programConfigurations.destroy(), this.segments.destroy(), this.segments2.destroy());
}, ss.prototype.addFeature = function(t6, e6, r7, n8, i6) {
for (var a6 = 0, o6 = ns(e6, 500); a6 < o6.length; a6 += 1) {
for (var s7 = o6[a6], u5 = 0, l8 = 0, p5 = s7; l8 < p5.length; l8 += 1) {
u5 += p5[l8].length;
}
for (var c5 = this.segments.prepareSegment(u5, this.layoutVertexArray, this.indexArray), h7 = c5.vertexLength, f5 = [], y5 = [], d5 = 0, m5 = s7; d5 < m5.length; d5 += 1) {
var v5 = m5[d5];
if (0 !== v5.length) {
v5 !== s7[0] && y5.push(f5.length / 2);
var g5 = this.segments2.prepareSegment(v5.length, this.layoutVertexArray, this.indexArray2), x5 = g5.vertexLength;
this.layoutVertexArray.emplaceBack(v5[0].x, v5[0].y), this.indexArray2.emplaceBack(x5 + v5.length - 1, x5), f5.push(v5[0].x), f5.push(v5[0].y);
for (var b5 = 1; b5 < v5.length; b5++) {
this.layoutVertexArray.emplaceBack(v5[b5].x, v5[b5].y), this.indexArray2.emplaceBack(x5 + b5 - 1, x5 + b5), f5.push(v5[b5].x), f5.push(v5[b5].y);
}
g5.vertexLength += v5.length, g5.primitiveLength += v5.length;
}
}
for (var w5 = Io(f5, y5), _4 = 0; _4 < w5.length; _4 += 3) {
this.indexArray.emplaceBack(h7 + w5[_4], h7 + w5[_4 + 1], h7 + w5[_4 + 2]);
}
c5.vertexLength += u5, c5.primitiveLength += w5.length / 3;
}
this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, t6, r7, i6, n8);
}, On2("FillBucket", ss, { omit: ["layers", "patternFeatures"] });
var us = new wi2({ "fill-sort-key": new vi2(Et2.layout_fill["fill-sort-key"]) }), ls = { paint: new wi2({ "fill-antialias": new mi2(Et2.paint_fill["fill-antialias"]), "fill-opacity": new vi2(Et2.paint_fill["fill-opacity"]), "fill-color": new vi2(Et2.paint_fill["fill-color"]), "fill-outline-color": new vi2(Et2.paint_fill["fill-outline-color"]), "fill-translate": new mi2(Et2.paint_fill["fill-translate"]), "fill-translate-anchor": new mi2(Et2.paint_fill["fill-translate-anchor"]), "fill-pattern": new gi2(Et2.paint_fill["fill-pattern"]) }), layout: us }, ps = function(t6) {
function e6(e7) {
t6.call(this, e7, ls);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.recalculate = function(e7, r7) {
t6.prototype.recalculate.call(this, e7, r7);
var n8 = this.paint._values["fill-outline-color"];
"constant" === n8.value.kind && void 0 === n8.value.value && (this.paint._values["fill-outline-color"] = this.paint._values["fill-color"]);
}, e6.prototype.createBucket = function(t7) {
return new ss(t7);
}, e6.prototype.queryRadius = function() {
return eo(this.paint.get("fill-translate"));
}, e6.prototype.queryIntersectsFeature = function(t7, e7, r7, n8, i6, a6, o6) {
return Ga(ro(t7, this.paint.get("fill-translate"), this.paint.get("fill-translate-anchor"), a6.angle, o6), n8);
}, e6.prototype.isTileClipped = function() {
return true;
}, e6;
}(_i2), cs = Ii2([{ name: "a_pos", components: 2, type: "Int16" }, { name: "a_normal_ed", components: 4, type: "Int16" }], 4).members, hs = fs;
function fs(t6, e6, r7, n8, i6) {
this.properties = {}, this.extent = r7, this.type = 0, this._pbf = t6, this._geometry = -1, this._keys = n8, this._values = i6, t6.readFields(ys, this, e6);
}
function ys(t6, e6, r7) {
1 == t6 ? e6.id = r7.readVarint() : 2 == t6 ? function(t7, e7) {
for (var r8 = t7.readVarint() + t7.pos; t7.pos < r8; ) {
var n8 = e7._keys[t7.readVarint()], i6 = e7._values[t7.readVarint()];
e7.properties[n8] = i6;
}
}(r7, e6) : 3 == t6 ? e6.type = r7.readVarint() : 4 == t6 && (e6._geometry = r7.pos);
}
function ds(t6) {
for (var e6, r7, n8 = 0, i6 = 0, a6 = t6.length, o6 = a6 - 1; i6 < a6; o6 = i6++) {
n8 += ((r7 = t6[o6]).x - (e6 = t6[i6]).x) * (e6.y + r7.y);
}
return n8;
}
fs.types = ["Unknown", "Point", "LineString", "Polygon"], fs.prototype.loadGeometry = function() {
var t6 = this._pbf;
t6.pos = this._geometry;
for (var e6, r7 = t6.readVarint() + t6.pos, n8 = 1, a6 = 0, o6 = 0, s7 = 0, u5 = []; t6.pos < r7; ) {
if (a6 <= 0) {
var l8 = t6.readVarint();
n8 = 7 & l8, a6 = l8 >> 3;
}
if (a6--, 1 === n8 || 2 === n8) {
o6 += t6.readSVarint(), s7 += t6.readSVarint(), 1 === n8 && (e6 && u5.push(e6), e6 = []), e6.push(new i5(o6, s7));
} else {
if (7 !== n8) {
throw new Error("unknown command " + n8);
}
e6 && e6.push(e6[0].clone());
}
}
return e6 && u5.push(e6), u5;
}, fs.prototype.bbox = function() {
var t6 = this._pbf;
t6.pos = this._geometry;
for (var e6 = t6.readVarint() + t6.pos, r7 = 1, n8 = 0, i6 = 0, a6 = 0, o6 = 1 / 0, s7 = -1 / 0, u5 = 1 / 0, l8 = -1 / 0; t6.pos < e6; ) {
if (n8 <= 0) {
var p5 = t6.readVarint();
r7 = 7 & p5, n8 = p5 >> 3;
}
if (n8--, 1 === r7 || 2 === r7) {
(i6 += t6.readSVarint()) < o6 && (o6 = i6), i6 > s7 && (s7 = i6), (a6 += t6.readSVarint()) < u5 && (u5 = a6), a6 > l8 && (l8 = a6);
} else if (7 !== r7) {
throw new Error("unknown command " + r7);
}
}
return [o6, u5, s7, l8];
}, fs.prototype.toGeoJSON = function(t6, e6, r7) {
var n8, i6, a6 = this.extent * Math.pow(2, r7), o6 = this.extent * t6, s7 = this.extent * e6, u5 = this.loadGeometry(), l8 = fs.types[this.type];
function p5(t7) {
for (var e7 = 0; e7 < t7.length; e7++) {
var r8 = t7[e7];
t7[e7] = [360 * (r8.x + o6) / a6 - 180, 360 / Math.PI * Math.atan(Math.exp((180 - 360 * (r8.y + s7) / a6) * Math.PI / 180)) - 90];
}
}
switch (this.type) {
case 1:
var c5 = [];
for (n8 = 0; n8 < u5.length; n8++) {
c5[n8] = u5[n8][0];
}
p5(u5 = c5);
break;
case 2:
for (n8 = 0; n8 < u5.length; n8++) {
p5(u5[n8]);
}
break;
case 3:
for (u5 = function(t7) {
var e7 = t7.length;
if (e7 <= 1) {
return [t7];
}
for (var r8, n9, i7 = [], a7 = 0; a7 < e7; a7++) {
var o7 = ds(t7[a7]);
0 !== o7 && (void 0 === n9 && (n9 = o7 < 0), n9 === o7 < 0 ? (r8 && i7.push(r8), r8 = [t7[a7]]) : r8.push(t7[a7]));
}
return r8 && i7.push(r8), i7;
}(u5), n8 = 0; n8 < u5.length; n8++) {
for (i6 = 0; i6 < u5[n8].length; i6++) {
p5(u5[n8][i6]);
}
}
}
1 === u5.length ? u5 = u5[0] : l8 = "Multi" + l8;
var h7 = { type: "Feature", geometry: { type: l8, coordinates: u5 }, properties: this.properties };
return "id" in this && (h7.id = this.id), h7;
};
var ms = vs;
function vs(t6, e6) {
this.version = 1, this.name = null, this.extent = 4096, this.length = 0, this._pbf = t6, this._keys = [], this._values = [], this._features = [], t6.readFields(gs, this, e6), this.length = this._features.length;
}
function gs(t6, e6, r7) {
15 === t6 ? e6.version = r7.readVarint() : 1 === t6 ? e6.name = r7.readString() : 5 === t6 ? e6.extent = r7.readVarint() : 2 === t6 ? e6._features.push(r7.pos) : 3 === t6 ? e6._keys.push(r7.readString()) : 4 === t6 && e6._values.push(function(t7) {
for (var e7 = null, r8 = t7.readVarint() + t7.pos; t7.pos < r8; ) {
var n8 = t7.readVarint() >> 3;
e7 = 1 === n8 ? t7.readString() : 2 === n8 ? t7.readFloat() : 3 === n8 ? t7.readDouble() : 4 === n8 ? t7.readVarint64() : 5 === n8 ? t7.readVarint() : 6 === n8 ? t7.readSVarint() : 7 === n8 ? t7.readBoolean() : null;
}
return e7;
}(r7));
}
function xs(t6, e6, r7) {
if (3 === t6) {
var n8 = new ms(r7, r7.readVarint() + r7.pos);
n8.length && (e6[n8.name] = n8);
}
}
vs.prototype.feature = function(t6) {
if (t6 < 0 || t6 >= this._features.length) {
throw new Error("feature index out of bounds");
}
this._pbf.pos = this._features[t6];
var e6 = this._pbf.readVarint() + this._pbf.pos;
return new hs(this._pbf, e6, this.extent, this._keys, this._values);
};
var bs = { VectorTile: function(t6, e6) {
this.layers = t6.readFields(xs, {}, e6);
}, VectorTileFeature: hs, VectorTileLayer: ms }, ws = bs.VectorTileFeature.types, _s = Math.pow(2, 13);
function As(t6, e6, r7, n8, i6, a6, o6, s7) {
t6.emplaceBack(e6, r7, 2 * Math.floor(n8 * _s) + o6, i6 * _s * 2, a6 * _s * 2, Math.round(s7));
}
var Ss = function(t6) {
this.zoom = t6.zoom, this.overscaling = t6.overscaling, this.layers = t6.layers, this.layerIds = this.layers.map(function(t7) {
return t7.id;
}), this.index = t6.index, this.hasPattern = false, this.layoutVertexArray = new Pi2(), this.indexArray = new ji2(), this.programConfigurations = new Va(t6.layers, t6.zoom), this.segments = new sa(), this.stateDependentLayerIds = this.layers.filter(function(t7) {
return t7.isStateDependent();
}).map(function(t7) {
return t7.id;
});
};
function ks(t6, e6) {
return t6.x === e6.x && (t6.x < 0 || t6.x > 8192) || t6.y === e6.y && (t6.y < 0 || t6.y > 8192);
}
Ss.prototype.populate = function(t6, e6, r7) {
this.features = [], this.hasPattern = as("fill-extrusion", this.layers, e6);
for (var n8 = 0, i6 = t6; n8 < i6.length; n8 += 1) {
var a6 = i6[n8], o6 = a6.feature, s7 = a6.id, u5 = a6.index, l8 = a6.sourceLayerIndex, p5 = this.layers[0]._featureFilter.needGeometry, c5 = Ua(o6, p5);
if (this.layers[0]._featureFilter.filter(new si2(this.zoom), c5, r7)) {
var h7 = { id: s7, sourceLayerIndex: l8, index: u5, geometry: p5 ? c5.geometry : Ra(o6), properties: o6.properties, type: o6.type, patterns: {} };
this.hasPattern ? this.features.push(os2("fill-extrusion", this.layers, h7, this.zoom, e6)) : this.addFeature(h7, h7.geometry, u5, r7, {}), e6.featureIndex.insert(o6, h7.geometry, u5, l8, this.index, true);
}
}
}, Ss.prototype.addFeatures = function(t6, e6, r7) {
for (var n8 = 0, i6 = this.features; n8 < i6.length; n8 += 1) {
var a6 = i6[n8];
this.addFeature(a6, a6.geometry, a6.index, e6, r7);
}
}, Ss.prototype.update = function(t6, e6, r7) {
this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(t6, e6, this.stateDependentLayers, r7);
}, Ss.prototype.isEmpty = function() {
return 0 === this.layoutVertexArray.length;
}, Ss.prototype.uploadPending = function() {
return !this.uploaded || this.programConfigurations.needsUpload;
}, Ss.prototype.upload = function(t6) {
this.uploaded || (this.layoutVertexBuffer = t6.createVertexBuffer(this.layoutVertexArray, cs), this.indexBuffer = t6.createIndexBuffer(this.indexArray)), this.programConfigurations.upload(t6), this.uploaded = true;
}, Ss.prototype.destroy = function() {
this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.programConfigurations.destroy(), this.segments.destroy());
}, Ss.prototype.addFeature = function(t6, e6, r7, n8, i6) {
for (var a6 = 0, o6 = ns(e6, 500); a6 < o6.length; a6 += 1) {
for (var s7 = o6[a6], u5 = 0, l8 = 0, p5 = s7; l8 < p5.length; l8 += 1) {
u5 += p5[l8].length;
}
for (var c5 = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray), h7 = 0, f5 = s7; h7 < f5.length; h7 += 1) {
var y5 = f5[h7];
if (0 !== y5.length && !((B4 = y5).every(function(t7) {
return t7.x < 0;
}) || B4.every(function(t7) {
return t7.x > 8192;
}) || B4.every(function(t7) {
return t7.y < 0;
}) || B4.every(function(t7) {
return t7.y > 8192;
}))) {
for (var d5 = 0, m5 = 0; m5 < y5.length; m5++) {
var v5 = y5[m5];
if (m5 >= 1) {
var g5 = y5[m5 - 1];
if (!ks(v5, g5)) {
c5.vertexLength + 4 > sa.MAX_VERTEX_ARRAY_LENGTH && (c5 = this.segments.prepareSegment(4, this.layoutVertexArray, this.indexArray));
var x5 = v5.sub(g5)._perp()._unit(), b5 = g5.dist(v5);
d5 + b5 > 32768 && (d5 = 0), As(this.layoutVertexArray, v5.x, v5.y, x5.x, x5.y, 0, 0, d5), As(this.layoutVertexArray, v5.x, v5.y, x5.x, x5.y, 0, 1, d5), As(this.layoutVertexArray, g5.x, g5.y, x5.x, x5.y, 0, 0, d5 += b5), As(this.layoutVertexArray, g5.x, g5.y, x5.x, x5.y, 0, 1, d5);
var w5 = c5.vertexLength;
this.indexArray.emplaceBack(w5, w5 + 2, w5 + 1), this.indexArray.emplaceBack(w5 + 1, w5 + 2, w5 + 3), c5.vertexLength += 4, c5.primitiveLength += 2;
}
}
}
}
}
if (c5.vertexLength + u5 > sa.MAX_VERTEX_ARRAY_LENGTH && (c5 = this.segments.prepareSegment(u5, this.layoutVertexArray, this.indexArray)), "Polygon" === ws[t6.type]) {
for (var _4 = [], A5 = [], S5 = c5.vertexLength, k5 = 0, I5 = s7; k5 < I5.length; k5 += 1) {
var z5 = I5[k5];
if (0 !== z5.length) {
z5 !== s7[0] && A5.push(_4.length / 2);
for (var C5 = 0; C5 < z5.length; C5++) {
var E4 = z5[C5];
As(this.layoutVertexArray, E4.x, E4.y, 0, 0, 1, 1, 0), _4.push(E4.x), _4.push(E4.y);
}
}
}
for (var P5 = Io(_4, A5), M5 = 0; M5 < P5.length; M5 += 3) {
this.indexArray.emplaceBack(S5 + P5[M5], S5 + P5[M5 + 2], S5 + P5[M5 + 1]);
}
c5.primitiveLength += P5.length / 3, c5.vertexLength += u5;
}
}
var B4;
this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, t6, r7, i6, n8);
}, On2("FillExtrusionBucket", Ss, { omit: ["layers", "features"] });
var Is = { paint: new wi2({ "fill-extrusion-opacity": new mi2(Et2["paint_fill-extrusion"]["fill-extrusion-opacity"]), "fill-extrusion-color": new vi2(Et2["paint_fill-extrusion"]["fill-extrusion-color"]), "fill-extrusion-translate": new mi2(Et2["paint_fill-extrusion"]["fill-extrusion-translate"]), "fill-extrusion-translate-anchor": new mi2(Et2["paint_fill-extrusion"]["fill-extrusion-translate-anchor"]), "fill-extrusion-pattern": new gi2(Et2["paint_fill-extrusion"]["fill-extrusion-pattern"]), "fill-extrusion-height": new vi2(Et2["paint_fill-extrusion"]["fill-extrusion-height"]), "fill-extrusion-base": new vi2(Et2["paint_fill-extrusion"]["fill-extrusion-base"]), "fill-extrusion-vertical-gradient": new mi2(Et2["paint_fill-extrusion"]["fill-extrusion-vertical-gradient"]) }) }, zs = function(t6) {
function e6(e7) {
t6.call(this, e7, Is);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.createBucket = function(t7) {
return new Ss(t7);
}, e6.prototype.queryRadius = function() {
return eo(this.paint.get("fill-extrusion-translate"));
}, e6.prototype.is3D = function() {
return true;
}, e6.prototype.queryIntersectsFeature = function(t7, e7, r7, n8, a6, o6, s7, u5) {
var l8 = ro(t7, this.paint.get("fill-extrusion-translate"), this.paint.get("fill-extrusion-translate-anchor"), o6.angle, s7), p5 = this.paint.get("fill-extrusion-height").evaluate(e7, r7), c5 = this.paint.get("fill-extrusion-base").evaluate(e7, r7), h7 = function(t8, e8, r8, n9) {
for (var a7 = [], o7 = 0, s8 = t8; o7 < s8.length; o7 += 1) {
var u6 = s8[o7], l9 = [u6.x, u6.y, 0, 1];
po(l9, l9, e8), a7.push(new i5(l9[0] / l9[3], l9[1] / l9[3]));
}
return a7;
}(l8, u5), f5 = function(t8, e8, r8, n9) {
for (var a7 = [], o7 = [], s8 = n9[8] * e8, u6 = n9[9] * e8, l9 = n9[10] * e8, p6 = n9[11] * e8, c6 = n9[8] * r8, h8 = n9[9] * r8, f6 = n9[10] * r8, y5 = n9[11] * r8, d5 = 0, m5 = t8; d5 < m5.length; d5 += 1) {
for (var v5 = [], g5 = [], x5 = 0, b5 = m5[d5]; x5 < b5.length; x5 += 1) {
var w5 = b5[x5], _4 = w5.x, A5 = w5.y, S5 = n9[0] * _4 + n9[4] * A5 + n9[12], k5 = n9[1] * _4 + n9[5] * A5 + n9[13], I5 = n9[2] * _4 + n9[6] * A5 + n9[14], z5 = n9[3] * _4 + n9[7] * A5 + n9[15], C5 = I5 + l9, E4 = z5 + p6, P5 = S5 + c6, M5 = k5 + h8, B4 = I5 + f6, T5 = z5 + y5, V4 = new i5((S5 + s8) / E4, (k5 + u6) / E4);
V4.z = C5 / E4, v5.push(V4);
var F4 = new i5(P5 / T5, M5 / T5);
F4.z = B4 / T5, g5.push(F4);
}
a7.push(v5), o7.push(g5);
}
return [a7, o7];
}(n8, c5, p5, u5);
return function(t8, e8, r8) {
var n9 = 1 / 0;
Ga(r8, e8) && (n9 = Es(r8, e8[0]));
for (var i6 = 0; i6 < e8.length; i6++) {
for (var a7 = e8[i6], o7 = t8[i6], s8 = 0; s8 < a7.length - 1; s8++) {
var u6 = a7[s8], l9 = [u6, a7[s8 + 1], o7[s8 + 1], o7[s8], u6];
Na(r8, l9) && (n9 = Math.min(n9, Es(r8, l9)));
}
}
return n9 !== 1 / 0 && n9;
}(f5[0], f5[1], h7);
}, e6;
}(_i2);
function Cs(t6, e6) {
return t6.x * e6.x + t6.y * e6.y;
}
function Es(t6, e6) {
if (1 === t6.length) {
for (var r7, n8 = 0, i6 = e6[n8++]; !r7 || i6.equals(r7); ) {
if (!(r7 = e6[n8++])) {
return 1 / 0;
}
}
for (; n8 < e6.length; n8++) {
var a6 = e6[n8], o6 = t6[0], s7 = r7.sub(i6), u5 = a6.sub(i6), l8 = o6.sub(i6), p5 = Cs(s7, s7), c5 = Cs(s7, u5), h7 = Cs(u5, u5), f5 = Cs(l8, s7), y5 = Cs(l8, u5), d5 = p5 * h7 - c5 * c5, m5 = (h7 * f5 - c5 * y5) / d5, v5 = (p5 * y5 - c5 * f5) / d5, g5 = i6.z * (1 - m5 - v5) + r7.z * m5 + a6.z * v5;
if (isFinite(g5)) {
return g5;
}
}
return 1 / 0;
}
for (var x5 = 1 / 0, b5 = 0, w5 = e6; b5 < w5.length; b5 += 1) {
x5 = Math.min(x5, w5[b5].z);
}
return x5;
}
var Ps = Ii2([{ name: "a_pos_normal", components: 2, type: "Int16" }, { name: "a_data", components: 4, type: "Uint8" }], 4).members, Ms = Ii2([{ name: "a_uv_x", components: 1, type: "Float32" }, { name: "a_split_index", components: 1, type: "Float32" }]).members, Bs = bs.VectorTileFeature.types, Ts = Math.cos(Math.PI / 180 * 37.5), Vs = Math.pow(2, 14) / 0.5, Fs = function(t6) {
var e6 = this;
this.zoom = t6.zoom, this.overscaling = t6.overscaling, this.layers = t6.layers, this.layerIds = this.layers.map(function(t7) {
return t7.id;
}), this.index = t6.index, this.hasPattern = false, this.patternFeatures = [], this.lineClipsArray = [], this.gradients = {}, this.layers.forEach(function(t7) {
e6.gradients[t7.id] = {};
}), this.layoutVertexArray = new Mi2(), this.layoutVertexArray2 = new Bi2(), this.indexArray = new ji2(), this.programConfigurations = new Va(t6.layers, t6.zoom), this.segments = new sa(), this.maxLineLength = 0, this.stateDependentLayerIds = this.layers.filter(function(t7) {
return t7.isStateDependent();
}).map(function(t7) {
return t7.id;
});
};
Fs.prototype.populate = function(t6, e6, r7) {
this.hasPattern = as("line", this.layers, e6);
for (var n8 = this.layers[0].layout.get("line-sort-key"), i6 = [], a6 = 0, o6 = t6; a6 < o6.length; a6 += 1) {
var s7 = o6[a6], u5 = s7.feature, l8 = s7.id, p5 = s7.index, c5 = s7.sourceLayerIndex, h7 = this.layers[0]._featureFilter.needGeometry, f5 = Ua(u5, h7);
if (this.layers[0]._featureFilter.filter(new si2(this.zoom), f5, r7)) {
var y5 = n8 ? n8.evaluate(f5, {}, r7) : void 0, d5 = { id: l8, properties: u5.properties, type: u5.type, sourceLayerIndex: c5, index: p5, geometry: h7 ? f5.geometry : Ra(u5), patterns: {}, sortKey: y5 };
i6.push(d5);
}
}
n8 && i6.sort(function(t7, e7) {
return t7.sortKey - e7.sortKey;
});
for (var m5 = 0, v5 = i6; m5 < v5.length; m5 += 1) {
var g5 = v5[m5], x5 = g5.geometry, b5 = g5.index, w5 = g5.sourceLayerIndex;
if (this.hasPattern) {
var _4 = os2("line", this.layers, g5, this.zoom, e6);
this.patternFeatures.push(_4);
} else {
this.addFeature(g5, x5, b5, r7, {});
}
e6.featureIndex.insert(t6[b5].feature, x5, b5, w5, this.index);
}
}, Fs.prototype.update = function(t6, e6, r7) {
this.stateDependentLayers.length && this.programConfigurations.updatePaintArrays(t6, e6, this.stateDependentLayers, r7);
}, Fs.prototype.addFeatures = function(t6, e6, r7) {
for (var n8 = 0, i6 = this.patternFeatures; n8 < i6.length; n8 += 1) {
var a6 = i6[n8];
this.addFeature(a6, a6.geometry, a6.index, e6, r7);
}
}, Fs.prototype.isEmpty = function() {
return 0 === this.layoutVertexArray.length;
}, Fs.prototype.uploadPending = function() {
return !this.uploaded || this.programConfigurations.needsUpload;
}, Fs.prototype.upload = function(t6) {
this.uploaded || (0 !== this.layoutVertexArray2.length && (this.layoutVertexBuffer2 = t6.createVertexBuffer(this.layoutVertexArray2, Ms)), this.layoutVertexBuffer = t6.createVertexBuffer(this.layoutVertexArray, Ps), this.indexBuffer = t6.createIndexBuffer(this.indexArray)), this.programConfigurations.upload(t6), this.uploaded = true;
}, Fs.prototype.destroy = function() {
this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.programConfigurations.destroy(), this.segments.destroy());
}, Fs.prototype.lineFeatureClips = function(t6) {
if (t6.properties && t6.properties.hasOwnProperty("mapbox_clip_start") && t6.properties.hasOwnProperty("mapbox_clip_end")) {
return { start: +t6.properties.mapbox_clip_start, end: +t6.properties.mapbox_clip_end };
}
}, Fs.prototype.addFeature = function(t6, e6, r7, n8, i6) {
var a6 = this.layers[0].layout, o6 = a6.get("line-join").evaluate(t6, {}), s7 = a6.get("line-cap"), u5 = a6.get("line-miter-limit"), l8 = a6.get("line-round-limit");
this.lineClips = this.lineFeatureClips(t6);
for (var p5 = 0, c5 = e6; p5 < c5.length; p5 += 1) {
this.addLine(c5[p5], t6, o6, s7, u5, l8);
}
this.programConfigurations.populatePaintArrays(this.layoutVertexArray.length, t6, r7, i6, n8);
}, Fs.prototype.addLine = function(t6, e6, r7, n8, i6, a6) {
if (this.distance = 0, this.scaledDistance = 0, this.totalDistance = 0, this.lineClips) {
this.lineClipsArray.push(this.lineClips);
for (var o6 = 0; o6 < t6.length - 1; o6++) {
this.totalDistance += t6[o6].dist(t6[o6 + 1]);
}
this.updateScaledDistance(), this.maxLineLength = Math.max(this.maxLineLength, this.totalDistance);
}
for (var s7 = "Polygon" === Bs[e6.type], u5 = t6.length; u5 >= 2 && t6[u5 - 1].equals(t6[u5 - 2]); ) {
u5--;
}
for (var l8 = 0; l8 < u5 - 1 && t6[l8].equals(t6[l8 + 1]); ) {
l8++;
}
if (!(u5 < (s7 ? 3 : 2))) {
"bevel" === r7 && (i6 = 1.05);
var p5, c5 = this.overscaling <= 16 ? 122880 / (512 * this.overscaling) : 0, h7 = this.segments.prepareSegment(10 * u5, this.layoutVertexArray, this.indexArray), f5 = void 0, y5 = void 0, d5 = void 0, m5 = void 0;
this.e1 = this.e2 = -1, s7 && (m5 = t6[l8].sub(p5 = t6[u5 - 2])._unit()._perp());
for (var v5 = l8; v5 < u5; v5++) {
if (!(y5 = v5 === u5 - 1 ? s7 ? t6[l8 + 1] : void 0 : t6[v5 + 1]) || !t6[v5].equals(y5)) {
m5 && (d5 = m5), p5 && (f5 = p5), p5 = t6[v5], m5 = y5 ? y5.sub(p5)._unit()._perp() : d5;
var g5 = (d5 = d5 || m5).add(m5);
0 === g5.x && 0 === g5.y || g5._unit();
var x5 = d5.x * m5.x + d5.y * m5.y, b5 = g5.x * m5.x + g5.y * m5.y, w5 = 0 !== b5 ? 1 / b5 : 1 / 0, _4 = 2 * Math.sqrt(2 - 2 * b5), A5 = b5 < Ts && f5 && y5, S5 = d5.x * m5.y - d5.y * m5.x > 0;
if (A5 && v5 > l8) {
var k5 = p5.dist(f5);
if (k5 > 2 * c5) {
var I5 = p5.sub(p5.sub(f5)._mult(c5 / k5)._round());
this.updateDistance(f5, I5), this.addCurrentVertex(I5, d5, 0, 0, h7), f5 = I5;
}
}
var z5 = f5 && y5, C5 = z5 ? r7 : s7 ? "butt" : n8;
if (z5 && "round" === C5 && (w5 < a6 ? C5 = "miter" : w5 <= 2 && (C5 = "fakeround")), "miter" === C5 && w5 > i6 && (C5 = "bevel"), "bevel" === C5 && (w5 > 2 && (C5 = "flipbevel"), w5 < i6 && (C5 = "miter")), f5 && this.updateDistance(f5, p5), "miter" === C5) {
g5._mult(w5), this.addCurrentVertex(p5, g5, 0, 0, h7);
} else if ("flipbevel" === C5) {
if (w5 > 100) {
g5 = m5.mult(-1);
} else {
var E4 = w5 * d5.add(m5).mag() / d5.sub(m5).mag();
g5._perp()._mult(E4 * (S5 ? -1 : 1));
}
this.addCurrentVertex(p5, g5, 0, 0, h7), this.addCurrentVertex(p5, g5.mult(-1), 0, 0, h7);
} else if ("bevel" === C5 || "fakeround" === C5) {
var P5 = -Math.sqrt(w5 * w5 - 1), M5 = S5 ? P5 : 0, B4 = S5 ? 0 : P5;
if (f5 && this.addCurrentVertex(p5, d5, M5, B4, h7), "fakeround" === C5) {
for (var T5 = Math.round(180 * _4 / Math.PI / 20), V4 = 1; V4 < T5; V4++) {
var F4 = V4 / T5;
if (0.5 !== F4) {
var D5 = F4 - 0.5;
F4 += F4 * D5 * (F4 - 1) * ((1.0904 + x5 * (x5 * (3.55645 - 1.43519 * x5) - 3.2452)) * D5 * D5 + (0.848013 + x5 * (0.215638 * x5 - 1.06021)));
}
var L5 = m5.sub(d5)._mult(F4)._add(d5)._unit()._mult(S5 ? -1 : 1);
this.addHalfVertex(p5, L5.x, L5.y, false, S5, 0, h7);
}
}
y5 && this.addCurrentVertex(p5, m5, -M5, -B4, h7);
} else if ("butt" === C5) {
this.addCurrentVertex(p5, g5, 0, 0, h7);
} else if ("square" === C5) {
var O5 = f5 ? 1 : -1;
this.addCurrentVertex(p5, g5, O5, O5, h7);
} else {
"round" === C5 && (f5 && (this.addCurrentVertex(p5, d5, 0, 0, h7), this.addCurrentVertex(p5, d5, 1, 1, h7, true)), y5 && (this.addCurrentVertex(p5, m5, -1, -1, h7, true), this.addCurrentVertex(p5, m5, 0, 0, h7)));
}
if (A5 && v5 < u5 - 1) {
var R4 = p5.dist(y5);
if (R4 > 2 * c5) {
var U4 = p5.add(y5.sub(p5)._mult(c5 / R4)._round());
this.updateDistance(p5, U4), this.addCurrentVertex(U4, m5, 0, 0, h7), p5 = U4;
}
}
}
}
}
}, Fs.prototype.addCurrentVertex = function(t6, e6, r7, n8, i6, a6) {
void 0 === a6 && (a6 = false);
var o6 = e6.y * n8 - e6.x, s7 = -e6.y - e6.x * n8;
this.addHalfVertex(t6, e6.x + e6.y * r7, e6.y - e6.x * r7, a6, false, r7, i6), this.addHalfVertex(t6, o6, s7, a6, true, -n8, i6), this.distance > Vs / 2 && 0 === this.totalDistance && (this.distance = 0, this.addCurrentVertex(t6, e6, r7, n8, i6, a6));
}, Fs.prototype.addHalfVertex = function(t6, e6, r7, n8, i6, a6, o6) {
var s7 = 0.5 * (this.lineClips ? this.scaledDistance * (Vs - 1) : this.scaledDistance);
this.layoutVertexArray.emplaceBack((t6.x << 1) + (n8 ? 1 : 0), (t6.y << 1) + (i6 ? 1 : 0), Math.round(63 * e6) + 128, Math.round(63 * r7) + 128, 1 + (0 === a6 ? 0 : a6 < 0 ? -1 : 1) | (63 & s7) << 2, s7 >> 6), this.lineClips && this.layoutVertexArray2.emplaceBack((this.scaledDistance - this.lineClips.start) / (this.lineClips.end - this.lineClips.start), this.lineClipsArray.length);
var u5 = o6.vertexLength++;
this.e1 >= 0 && this.e2 >= 0 && (this.indexArray.emplaceBack(this.e1, this.e2, u5), o6.primitiveLength++), i6 ? this.e2 = u5 : this.e1 = u5;
}, Fs.prototype.updateScaledDistance = function() {
this.scaledDistance = this.lineClips ? this.lineClips.start + (this.lineClips.end - this.lineClips.start) * this.distance / this.totalDistance : this.distance;
}, Fs.prototype.updateDistance = function(t6, e6) {
this.distance += t6.dist(e6), this.updateScaledDistance();
}, On2("LineBucket", Fs, { omit: ["layers", "patternFeatures"] });
var Ds = new wi2({ "line-cap": new mi2(Et2.layout_line["line-cap"]), "line-join": new vi2(Et2.layout_line["line-join"]), "line-miter-limit": new mi2(Et2.layout_line["line-miter-limit"]), "line-round-limit": new mi2(Et2.layout_line["line-round-limit"]), "line-sort-key": new vi2(Et2.layout_line["line-sort-key"]) }), Ls = { paint: new wi2({ "line-opacity": new vi2(Et2.paint_line["line-opacity"]), "line-color": new vi2(Et2.paint_line["line-color"]), "line-translate": new mi2(Et2.paint_line["line-translate"]), "line-translate-anchor": new mi2(Et2.paint_line["line-translate-anchor"]), "line-width": new vi2(Et2.paint_line["line-width"]), "line-gap-width": new vi2(Et2.paint_line["line-gap-width"]), "line-offset": new vi2(Et2.paint_line["line-offset"]), "line-blur": new vi2(Et2.paint_line["line-blur"]), "line-dasharray": new xi2(Et2.paint_line["line-dasharray"]), "line-pattern": new gi2(Et2.paint_line["line-pattern"]), "line-gradient": new bi2(Et2.paint_line["line-gradient"]) }), layout: Ds }, Os = new (function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.possiblyEvaluate = function(e7, r7) {
return r7 = new si2(Math.floor(r7.zoom), { now: r7.now, fadeDuration: r7.fadeDuration, zoomHistory: r7.zoomHistory, transition: r7.transition }), t6.prototype.possiblyEvaluate.call(this, e7, r7);
}, e6.prototype.evaluate = function(e7, r7, n8, i6) {
return r7 = h6({}, r7, { zoom: Math.floor(r7.zoom) }), t6.prototype.evaluate.call(this, e7, r7, n8, i6);
}, e6;
}(vi2))(Ls.paint.properties["line-width"].specification);
Os.useIntegerZoom = true;
var Rs = function(t6) {
function e6(e7) {
t6.call(this, e7, Ls), this.gradientVersion = 0;
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._handleSpecialPaintPropertyUpdate = function(t7) {
"line-gradient" === t7 && (this.stepInterpolant = this._transitionablePaint._values["line-gradient"].value.expression._styleExpression.expression instanceof Ne2, this.gradientVersion = (this.gradientVersion + 1) % s6);
}, e6.prototype.gradientExpression = function() {
return this._transitionablePaint._values["line-gradient"].value.expression;
}, e6.prototype.recalculate = function(e7, r7) {
t6.prototype.recalculate.call(this, e7, r7), this.paint._values["line-floorwidth"] = Os.possiblyEvaluate(this._transitioningPaint._values["line-width"].value, e7);
}, e6.prototype.createBucket = function(t7) {
return new Fs(t7);
}, e6.prototype.queryRadius = function(t7) {
var e7 = t7, r7 = Us(to("line-width", this, e7), to("line-gap-width", this, e7)), n8 = to("line-offset", this, e7);
return r7 / 2 + Math.abs(n8) + eo(this.paint.get("line-translate"));
}, e6.prototype.queryIntersectsFeature = function(t7, e7, r7, n8, a6, o6, s7) {
var u5 = ro(t7, this.paint.get("line-translate"), this.paint.get("line-translate-anchor"), o6.angle, s7), l8 = s7 / 2 * Us(this.paint.get("line-width").evaluate(e7, r7), this.paint.get("line-gap-width").evaluate(e7, r7)), p5 = this.paint.get("line-offset").evaluate(e7, r7);
return p5 && (n8 = function(t8, e8) {
for (var r8 = [], n9 = new i5(0, 0), a7 = 0; a7 < t8.length; a7++) {
for (var o7 = t8[a7], s8 = [], u6 = 0; u6 < o7.length; u6++) {
var l9 = o7[u6], p6 = o7[u6 + 1], c5 = 0 === u6 ? n9 : l9.sub(o7[u6 - 1])._unit()._perp(), h7 = u6 === o7.length - 1 ? n9 : p6.sub(l9)._unit()._perp(), f5 = c5._add(h7)._unit();
f5._mult(1 / (f5.x * h7.x + f5.y * h7.y)), s8.push(f5._mult(e8)._add(l9));
}
r8.push(s8);
}
return r8;
}(n8, p5 * s7)), function(t8, e8, r8) {
for (var n9 = 0; n9 < e8.length; n9++) {
var i6 = e8[n9];
if (t8.length >= 3) {
for (var a7 = 0; a7 < i6.length; a7++) {
if (Wa(t8, i6[a7])) {
return true;
}
}
}
if (Za(t8, i6, r8)) {
return true;
}
}
return false;
}(u5, n8, l8);
}, e6.prototype.isTileClipped = function() {
return true;
}, e6;
}(_i2);
function Us(t6, e6) {
return e6 > 0 ? e6 + 2 * t6 : t6;
}
var js = Ii2([{ name: "a_pos_offset", components: 4, type: "Int16" }, { name: "a_data", components: 4, type: "Uint16" }, { name: "a_pixeloffset", components: 4, type: "Int16" }], 4), qs = Ii2([{ name: "a_projected_pos", components: 3, type: "Float32" }], 4), Ns = (Ii2([{ name: "a_fade_opacity", components: 1, type: "Uint32" }], 4), Ii2([{ name: "a_placed", components: 2, type: "Uint8" }, { name: "a_shift", components: 2, type: "Float32" }])), Ks = (Ii2([{ type: "Int16", name: "anchorPointX" }, { type: "Int16", name: "anchorPointY" }, { type: "Int16", name: "x1" }, { type: "Int16", name: "y1" }, { type: "Int16", name: "x2" }, { type: "Int16", name: "y2" }, { type: "Uint32", name: "featureIndex" }, { type: "Uint16", name: "sourceLayerIndex" }, { type: "Uint16", name: "bucketIndex" }]), Ii2([{ name: "a_pos", components: 2, type: "Int16" }, { name: "a_anchor_pos", components: 2, type: "Int16" }, { name: "a_extrude", components: 2, type: "Int16" }], 4)), Gs = Ii2([{ name: "a_pos", components: 2, type: "Float32" }, { name: "a_radius", components: 1, type: "Float32" }, { name: "a_flags", components: 2, type: "Int16" }], 4);
function Zs(t6, e6, r7) {
return t6.sections.forEach(function(t7) {
t7.text = function(t8, e7, r8) {
var n8 = e7.layout.get("text-transform").evaluate(r8, {});
return "uppercase" === n8 ? t8 = t8.toLocaleUpperCase() : "lowercase" === n8 && (t8 = t8.toLocaleLowerCase()), oi2.applyArabicShaping && (t8 = oi2.applyArabicShaping(t8)), t8;
}(t7.text, e6, r7);
}), t6;
}
Ii2([{ name: "triangle", components: 3, type: "Uint16" }]), Ii2([{ type: "Int16", name: "anchorX" }, { type: "Int16", name: "anchorY" }, { type: "Uint16", name: "glyphStartIndex" }, { type: "Uint16", name: "numGlyphs" }, { type: "Uint32", name: "vertexStartIndex" }, { type: "Uint32", name: "lineStartIndex" }, { type: "Uint32", name: "lineLength" }, { type: "Uint16", name: "segment" }, { type: "Uint16", name: "lowerSize" }, { type: "Uint16", name: "upperSize" }, { type: "Float32", name: "lineOffsetX" }, { type: "Float32", name: "lineOffsetY" }, { type: "Uint8", name: "writingMode" }, { type: "Uint8", name: "placedOrientation" }, { type: "Uint8", name: "hidden" }, { type: "Uint32", name: "crossTileID" }, { type: "Int16", name: "associatedIconIndex" }]), Ii2([{ type: "Int16", name: "anchorX" }, { type: "Int16", name: "anchorY" }, { type: "Int16", name: "rightJustifiedTextSymbolIndex" }, { type: "Int16", name: "centerJustifiedTextSymbolIndex" }, { type: "Int16", name: "leftJustifiedTextSymbolIndex" }, { type: "Int16", name: "verticalPlacedTextSymbolIndex" }, { type: "Int16", name: "placedIconSymbolIndex" }, { type: "Int16", name: "verticalPlacedIconSymbolIndex" }, { type: "Uint16", name: "key" }, { type: "Uint16", name: "textBoxStartIndex" }, { type: "Uint16", name: "textBoxEndIndex" }, { type: "Uint16", name: "verticalTextBoxStartIndex" }, { type: "Uint16", name: "verticalTextBoxEndIndex" }, { type: "Uint16", name: "iconBoxStartIndex" }, { type: "Uint16", name: "iconBoxEndIndex" }, { type: "Uint16", name: "verticalIconBoxStartIndex" }, { type: "Uint16", name: "verticalIconBoxEndIndex" }, { type: "Uint16", name: "featureIndex" }, { type: "Uint16", name: "numHorizontalGlyphVertices" }, { type: "Uint16", name: "numVerticalGlyphVertices" }, { type: "Uint16", name: "numIconVertices" }, { type: "Uint16", name: "numVerticalIconVertices" }, { type: "Uint16", name: "useRuntimeCollisionCircles" }, { type: "Uint32", name: "crossTileID" }, { type: "Float32", name: "textBoxScale" }, { type: "Float32", components: 2, name: "textOffset" }, { type: "Float32", name: "collisionCircleDiameter" }]), Ii2([{ type: "Float32", name: "offsetX" }]), Ii2([{ type: "Int16", name: "x" }, { type: "Int16", name: "y" }, { type: "Int16", name: "tileUnitDistanceFromAnchor" }]);
var Xs = { "!": "\uFE15", "#": "\uFF03", $: "\uFF04", "%": "\uFF05", "&": "\uFF06", "(": "\uFE35", ")": "\uFE36", "*": "\uFF0A", "+": "\uFF0B", ",": "\uFE10", "-": "\uFE32", ".": "\u30FB", "/": "\uFF0F", ":": "\uFE13", ";": "\uFE14", "<": "\uFE3F", "=": "\uFF1D", ">": "\uFE40", "?": "\uFE16", "@": "\uFF20", "[": "\uFE47", "\\": "\uFF3C", "]": "\uFE48", "^": "\uFF3E", _: "\uFE33", "`": "\uFF40", "{": "\uFE37", "|": "\u2015", "}": "\uFE38", "~": "\uFF5E", "\xA2": "\uFFE0", "\xA3": "\uFFE1", "\xA5": "\uFFE5", "\xA6": "\uFFE4", "\xAC": "\uFFE2", "\xAF": "\uFFE3", "\u2013": "\uFE32", "\u2014": "\uFE31", "\u2018": "\uFE43", "\u2019": "\uFE44", "\u201C": "\uFE41", "\u201D": "\uFE42", "\u2026": "\uFE19", "\u2027": "\u30FB", "\u20A9": "\uFFE6", "\u3001": "\uFE11", "\u3002": "\uFE12", "\u3008": "\uFE3F", "\u3009": "\uFE40", "\u300A": "\uFE3D", "\u300B": "\uFE3E", "\u300C": "\uFE41", "\u300D": "\uFE42", "\u300E": "\uFE43", "\u300F": "\uFE44", "\u3010": "\uFE3B", "\u3011": "\uFE3C", "\u3014": "\uFE39", "\u3015": "\uFE3A", "\u3016": "\uFE17", "\u3017": "\uFE18", "\uFF01": "\uFE15", "\uFF08": "\uFE35", "\uFF09": "\uFE36", "\uFF0C": "\uFE10", "\uFF0D": "\uFE32", "\uFF0E": "\u30FB", "\uFF1A": "\uFE13", "\uFF1B": "\uFE14", "\uFF1C": "\uFE3F", "\uFF1E": "\uFE40", "\uFF1F": "\uFE16", "\uFF3B": "\uFE47", "\uFF3D": "\uFE48", "\uFF3F": "\uFE33", "\uFF5B": "\uFE37", "\uFF5C": "\u2015", "\uFF5D": "\uFE38", "\uFF5F": "\uFE35", "\uFF60": "\uFE36", "\uFF61": "\uFE12", "\uFF62": "\uFE41", "\uFF63": "\uFE42" }, Js = function(t6, e6, r7, n8, i6) {
var a6, o6, s7 = 8 * i6 - n8 - 1, u5 = (1 << s7) - 1, l8 = u5 >> 1, p5 = -7, c5 = r7 ? i6 - 1 : 0, h7 = r7 ? -1 : 1, f5 = t6[e6 + c5];
for (c5 += h7, a6 = f5 & (1 << -p5) - 1, f5 >>= -p5, p5 += s7; p5 > 0; a6 = 256 * a6 + t6[e6 + c5], c5 += h7, p5 -= 8) {
}
for (o6 = a6 & (1 << -p5) - 1, a6 >>= -p5, p5 += n8; p5 > 0; o6 = 256 * o6 + t6[e6 + c5], c5 += h7, p5 -= 8) {
}
if (0 === a6) {
a6 = 1 - l8;
} else {
if (a6 === u5) {
return o6 ? NaN : 1 / 0 * (f5 ? -1 : 1);
}
o6 += Math.pow(2, n8), a6 -= l8;
}
return (f5 ? -1 : 1) * o6 * Math.pow(2, a6 - n8);
}, Hs = function(t6, e6, r7, n8, i6, a6) {
var o6, s7, u5, l8 = 8 * a6 - i6 - 1, p5 = (1 << l8) - 1, c5 = p5 >> 1, h7 = 23 === i6 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, f5 = n8 ? 0 : a6 - 1, y5 = n8 ? 1 : -1, d5 = e6 < 0 || 0 === e6 && 1 / e6 < 0 ? 1 : 0;
for (e6 = Math.abs(e6), isNaN(e6) || e6 === 1 / 0 ? (s7 = isNaN(e6) ? 1 : 0, o6 = p5) : (o6 = Math.floor(Math.log(e6) / Math.LN2), e6 * (u5 = Math.pow(2, -o6)) < 1 && (o6--, u5 *= 2), (e6 += o6 + c5 >= 1 ? h7 / u5 : h7 * Math.pow(2, 1 - c5)) * u5 >= 2 && (o6++, u5 /= 2), o6 + c5 >= p5 ? (s7 = 0, o6 = p5) : o6 + c5 >= 1 ? (s7 = (e6 * u5 - 1) * Math.pow(2, i6), o6 += c5) : (s7 = e6 * Math.pow(2, c5 - 1) * Math.pow(2, i6), o6 = 0)); i6 >= 8; t6[r7 + f5] = 255 & s7, f5 += y5, s7 /= 256, i6 -= 8) {
}
for (o6 = o6 << i6 | s7, l8 += i6; l8 > 0; t6[r7 + f5] = 255 & o6, f5 += y5, o6 /= 256, l8 -= 8) {
}
t6[r7 + f5 - y5] |= 128 * d5;
}, Ys = $s;
function $s(t6) {
this.buf = ArrayBuffer.isView && ArrayBuffer.isView(t6) ? t6 : new Uint8Array(t6 || 0), this.pos = 0, this.type = 0, this.length = this.buf.length;
}
$s.Varint = 0, $s.Fixed64 = 1, $s.Bytes = 2, $s.Fixed32 = 5;
var Ws = "undefined" == typeof TextDecoder ? null : new TextDecoder("utf8");
function Qs(t6) {
return t6.type === $s.Bytes ? t6.readVarint() + t6.pos : t6.pos + 1;
}
function tu(t6, e6, r7) {
return r7 ? 4294967296 * e6 + (t6 >>> 0) : 4294967296 * (e6 >>> 0) + (t6 >>> 0);
}
function eu(t6, e6, r7) {
var n8 = e6 <= 16383 ? 1 : e6 <= 2097151 ? 2 : e6 <= 268435455 ? 3 : Math.floor(Math.log(e6) / (7 * Math.LN2));
r7.realloc(n8);
for (var i6 = r7.pos - 1; i6 >= t6; i6--) {
r7.buf[i6 + n8] = r7.buf[i6];
}
}
function ru(t6, e6) {
for (var r7 = 0; r7 < t6.length; r7++) {
e6.writeVarint(t6[r7]);
}
}
function nu(t6, e6) {
for (var r7 = 0; r7 < t6.length; r7++) {
e6.writeSVarint(t6[r7]);
}
}
function iu(t6, e6) {
for (var r7 = 0; r7 < t6.length; r7++) {
e6.writeFloat(t6[r7]);
}
}
function au(t6, e6) {
for (var r7 = 0; r7 < t6.length; r7++) {
e6.writeDouble(t6[r7]);
}
}
function ou(t6, e6) {
for (var r7 = 0; r7 < t6.length; r7++) {
e6.writeBoolean(t6[r7]);
}
}
function su(t6, e6) {
for (var r7 = 0; r7 < t6.length; r7++) {
e6.writeFixed32(t6[r7]);
}
}
function uu(t6, e6) {
for (var r7 = 0; r7 < t6.length; r7++) {
e6.writeSFixed32(t6[r7]);
}
}
function lu(t6, e6) {
for (var r7 = 0; r7 < t6.length; r7++) {
e6.writeFixed64(t6[r7]);
}
}
function pu(t6, e6) {
for (var r7 = 0; r7 < t6.length; r7++) {
e6.writeSFixed64(t6[r7]);
}
}
function cu(t6, e6) {
return (t6[e6] | t6[e6 + 1] << 8 | t6[e6 + 2] << 16) + 16777216 * t6[e6 + 3];
}
function hu(t6, e6, r7) {
t6[r7] = e6, t6[r7 + 1] = e6 >>> 8, t6[r7 + 2] = e6 >>> 16, t6[r7 + 3] = e6 >>> 24;
}
function fu(t6, e6) {
return (t6[e6] | t6[e6 + 1] << 8 | t6[e6 + 2] << 16) + (t6[e6 + 3] << 24);
}
function yu(t6, e6, r7) {
1 === t6 && r7.readMessage(du, e6);
}
function du(t6, e6, r7) {
if (3 === t6) {
var n8 = r7.readMessage(mu, {}), i6 = n8.width, a6 = n8.height, o6 = n8.left, s7 = n8.top, u5 = n8.advance;
e6.push({ id: n8.id, bitmap: new go({ width: i6 + 6, height: a6 + 6 }, n8.bitmap), metrics: { width: i6, height: a6, left: o6, top: s7, advance: u5 } });
}
}
function mu(t6, e6, r7) {
1 === t6 ? e6.id = r7.readVarint() : 2 === t6 ? e6.bitmap = r7.readBytes() : 3 === t6 ? e6.width = r7.readVarint() : 4 === t6 ? e6.height = r7.readVarint() : 5 === t6 ? e6.left = r7.readSVarint() : 6 === t6 ? e6.top = r7.readSVarint() : 7 === t6 && (e6.advance = r7.readVarint());
}
function vu(t6) {
for (var e6 = 0, r7 = 0, n8 = 0, i6 = t6; n8 < i6.length; n8 += 1) {
var a6 = i6[n8];
e6 += a6.w * a6.h, r7 = Math.max(r7, a6.w);
}
t6.sort(function(t7, e7) {
return e7.h - t7.h;
});
for (var o6 = [{ x: 0, y: 0, w: Math.max(Math.ceil(Math.sqrt(e6 / 0.95)), r7), h: 1 / 0 }], s7 = 0, u5 = 0, l8 = 0, p5 = t6; l8 < p5.length; l8 += 1) {
for (var c5 = p5[l8], h7 = o6.length - 1; h7 >= 0; h7--) {
var f5 = o6[h7];
if (!(c5.w > f5.w || c5.h > f5.h)) {
if (c5.x = f5.x, c5.y = f5.y, u5 = Math.max(u5, c5.y + c5.h), s7 = Math.max(s7, c5.x + c5.w), c5.w === f5.w && c5.h === f5.h) {
var y5 = o6.pop();
h7 < o6.length && (o6[h7] = y5);
} else {
c5.h === f5.h ? (f5.x += c5.w, f5.w -= c5.w) : c5.w === f5.w ? (f5.y += c5.h, f5.h -= c5.h) : (o6.push({ x: f5.x + c5.w, y: f5.y, w: f5.w - c5.w, h: c5.h }), f5.y += c5.h, f5.h -= c5.h);
}
break;
}
}
}
return { w: s7, h: u5, fill: e6 / (s7 * u5) || 0 };
}
$s.prototype = { destroy: function() {
this.buf = null;
}, readFields: function(t6, e6, r7) {
for (r7 = r7 || this.length; this.pos < r7; ) {
var n8 = this.readVarint(), i6 = n8 >> 3, a6 = this.pos;
this.type = 7 & n8, t6(i6, e6, this), this.pos === a6 && this.skip(n8);
}
return e6;
}, readMessage: function(t6, e6) {
return this.readFields(t6, e6, this.readVarint() + this.pos);
}, readFixed32: function() {
var t6 = cu(this.buf, this.pos);
return this.pos += 4, t6;
}, readSFixed32: function() {
var t6 = fu(this.buf, this.pos);
return this.pos += 4, t6;
}, readFixed64: function() {
var t6 = cu(this.buf, this.pos) + 4294967296 * cu(this.buf, this.pos + 4);
return this.pos += 8, t6;
}, readSFixed64: function() {
var t6 = cu(this.buf, this.pos) + 4294967296 * fu(this.buf, this.pos + 4);
return this.pos += 8, t6;
}, readFloat: function() {
var t6 = Js(this.buf, this.pos, true, 23, 4);
return this.pos += 4, t6;
}, readDouble: function() {
var t6 = Js(this.buf, this.pos, true, 52, 8);
return this.pos += 8, t6;
}, readVarint: function(t6) {
var e6, r7, n8 = this.buf;
return e6 = 127 & (r7 = n8[this.pos++]), r7 < 128 ? e6 : (e6 |= (127 & (r7 = n8[this.pos++])) << 7, r7 < 128 ? e6 : (e6 |= (127 & (r7 = n8[this.pos++])) << 14, r7 < 128 ? e6 : (e6 |= (127 & (r7 = n8[this.pos++])) << 21, r7 < 128 ? e6 : function(t7, e7, r8) {
var n9, i6, a6 = r8.buf;
if (n9 = (112 & (i6 = a6[r8.pos++])) >> 4, i6 < 128) {
return tu(t7, n9, e7);
}
if (n9 |= (127 & (i6 = a6[r8.pos++])) << 3, i6 < 128) {
return tu(t7, n9, e7);
}
if (n9 |= (127 & (i6 = a6[r8.pos++])) << 10, i6 < 128) {
return tu(t7, n9, e7);
}
if (n9 |= (127 & (i6 = a6[r8.pos++])) << 17, i6 < 128) {
return tu(t7, n9, e7);
}
if (n9 |= (127 & (i6 = a6[r8.pos++])) << 24, i6 < 128) {
return tu(t7, n9, e7);
}
if (n9 |= (1 & (i6 = a6[r8.pos++])) << 31, i6 < 128) {
return tu(t7, n9, e7);
}
throw new Error("Expected varint not more than 10 bytes");
}(e6 |= (15 & (r7 = n8[this.pos])) << 28, t6, this))));
}, readVarint64: function() {
return this.readVarint(true);
}, readSVarint: function() {
var t6 = this.readVarint();
return t6 % 2 == 1 ? (t6 + 1) / -2 : t6 / 2;
}, readBoolean: function() {
return Boolean(this.readVarint());
}, readString: function() {
var t6 = this.readVarint() + this.pos, e6 = this.pos;
return this.pos = t6, t6 - e6 >= 12 && Ws ? function(t7, e7, r7) {
return Ws.decode(t7.subarray(e7, r7));
}(this.buf, e6, t6) : function(t7, e7, r7) {
for (var n8 = "", i6 = e7; i6 < r7; ) {
var a6, o6, s7, u5 = t7[i6], l8 = null, p5 = u5 > 239 ? 4 : u5 > 223 ? 3 : u5 > 191 ? 2 : 1;
if (i6 + p5 > r7) {
break;
}
1 === p5 ? u5 < 128 && (l8 = u5) : 2 === p5 ? 128 == (192 & (a6 = t7[i6 + 1])) && (l8 = (31 & u5) << 6 | 63 & a6) <= 127 && (l8 = null) : 3 === p5 ? (o6 = t7[i6 + 2], 128 == (192 & (a6 = t7[i6 + 1])) && 128 == (192 & o6) && ((l8 = (15 & u5) << 12 | (63 & a6) << 6 | 63 & o6) <= 2047 || l8 >= 55296 && l8 <= 57343) && (l8 = null)) : 4 === p5 && (o6 = t7[i6 + 2], s7 = t7[i6 + 3], 128 == (192 & (a6 = t7[i6 + 1])) && 128 == (192 & o6) && 128 == (192 & s7) && ((l8 = (15 & u5) << 18 | (63 & a6) << 12 | (63 & o6) << 6 | 63 & s7) <= 65535 || l8 >= 1114112) && (l8 = null)), null === l8 ? (l8 = 65533, p5 = 1) : l8 > 65535 && (l8 -= 65536, n8 += String.fromCharCode(l8 >>> 10 & 1023 | 55296), l8 = 56320 | 1023 & l8), n8 += String.fromCharCode(l8), i6 += p5;
}
return n8;
}(this.buf, e6, t6);
}, readBytes: function() {
var t6 = this.readVarint() + this.pos, e6 = this.buf.subarray(this.pos, t6);
return this.pos = t6, e6;
}, readPackedVarint: function(t6, e6) {
if (this.type !== $s.Bytes) {
return t6.push(this.readVarint(e6));
}
var r7 = Qs(this);
for (t6 = t6 || []; this.pos < r7; ) {
t6.push(this.readVarint(e6));
}
return t6;
}, readPackedSVarint: function(t6) {
if (this.type !== $s.Bytes) {
return t6.push(this.readSVarint());
}
var e6 = Qs(this);
for (t6 = t6 || []; this.pos < e6; ) {
t6.push(this.readSVarint());
}
return t6;
}, readPackedBoolean: function(t6) {
if (this.type !== $s.Bytes) {
return t6.push(this.readBoolean());
}
var e6 = Qs(this);
for (t6 = t6 || []; this.pos < e6; ) {
t6.push(this.readBoolean());
}
return t6;
}, readPackedFloat: function(t6) {
if (this.type !== $s.Bytes) {
return t6.push(this.readFloat());
}
var e6 = Qs(this);
for (t6 = t6 || []; this.pos < e6; ) {
t6.push(this.readFloat());
}
return t6;
}, readPackedDouble: function(t6) {
if (this.type !== $s.Bytes) {
return t6.push(this.readDouble());
}
var e6 = Qs(this);
for (t6 = t6 || []; this.pos < e6; ) {
t6.push(this.readDouble());
}
return t6;
}, readPackedFixed32: function(t6) {
if (this.type !== $s.Bytes) {
return t6.push(this.readFixed32());
}
var e6 = Qs(this);
for (t6 = t6 || []; this.pos < e6; ) {
t6.push(this.readFixed32());
}
return t6;
}, readPackedSFixed32: function(t6) {
if (this.type !== $s.Bytes) {
return t6.push(this.readSFixed32());
}
var e6 = Qs(this);
for (t6 = t6 || []; this.pos < e6; ) {
t6.push(this.readSFixed32());
}
return t6;
}, readPackedFixed64: function(t6) {
if (this.type !== $s.Bytes) {
return t6.push(this.readFixed64());
}
var e6 = Qs(this);
for (t6 = t6 || []; this.pos < e6; ) {
t6.push(this.readFixed64());
}
return t6;
}, readPackedSFixed64: function(t6) {
if (this.type !== $s.Bytes) {
return t6.push(this.readSFixed64());
}
var e6 = Qs(this);
for (t6 = t6 || []; this.pos < e6; ) {
t6.push(this.readSFixed64());
}
return t6;
}, skip: function(t6) {
var e6 = 7 & t6;
if (e6 === $s.Varint) {
for (; this.buf[this.pos++] > 127; ) {
}
} else if (e6 === $s.Bytes) {
this.pos = this.readVarint() + this.pos;
} else if (e6 === $s.Fixed32) {
this.pos += 4;
} else {
if (e6 !== $s.Fixed64) {
throw new Error("Unimplemented type: " + e6);
}
this.pos += 8;
}
}, writeTag: function(t6, e6) {
this.writeVarint(t6 << 3 | e6);
}, realloc: function(t6) {
for (var e6 = this.length || 16; e6 < this.pos + t6; ) {
e6 *= 2;
}
if (e6 !== this.length) {
var r7 = new Uint8Array(e6);
r7.set(this.buf), this.buf = r7, this.length = e6;
}
}, finish: function() {
return this.length = this.pos, this.pos = 0, this.buf.subarray(0, this.length);
}, writeFixed32: function(t6) {
this.realloc(4), hu(this.buf, t6, this.pos), this.pos += 4;
}, writeSFixed32: function(t6) {
this.realloc(4), hu(this.buf, t6, this.pos), this.pos += 4;
}, writeFixed64: function(t6) {
this.realloc(8), hu(this.buf, -1 & t6, this.pos), hu(this.buf, Math.floor(t6 * (1 / 4294967296)), this.pos + 4), this.pos += 8;
}, writeSFixed64: function(t6) {
this.realloc(8), hu(this.buf, -1 & t6, this.pos), hu(this.buf, Math.floor(t6 * (1 / 4294967296)), this.pos + 4), this.pos += 8;
}, writeVarint: function(t6) {
(t6 = +t6 || 0) > 268435455 || t6 < 0 ? function(t7, e6) {
var r7, n8;
if (t7 >= 0 ? (r7 = t7 % 4294967296 | 0, n8 = t7 / 4294967296 | 0) : (n8 = ~(-t7 / 4294967296), 4294967295 ^ (r7 = ~(-t7 % 4294967296)) ? r7 = r7 + 1 | 0 : (r7 = 0, n8 = n8 + 1 | 0)), t7 >= 18446744073709552e3 || t7 < -18446744073709552e3) {
throw new Error("Given varint doesn't fit into 10 bytes");
}
e6.realloc(10), function(t8, e7, r8) {
r8.buf[r8.pos++] = 127 & t8 | 128, t8 >>>= 7, r8.buf[r8.pos++] = 127 & t8 | 128, t8 >>>= 7, r8.buf[r8.pos++] = 127 & t8 | 128, t8 >>>= 7, r8.buf[r8.pos++] = 127 & t8 | 128, r8.buf[r8.pos] = 127 & (t8 >>>= 7);
}(r7, 0, e6), function(t8, e7) {
var r8 = (7 & t8) << 4;
e7.buf[e7.pos++] |= r8 | ((t8 >>>= 3) ? 128 : 0), t8 && (e7.buf[e7.pos++] = 127 & t8 | ((t8 >>>= 7) ? 128 : 0), t8 && (e7.buf[e7.pos++] = 127 & t8 | ((t8 >>>= 7) ? 128 : 0), t8 && (e7.buf[e7.pos++] = 127 & t8 | ((t8 >>>= 7) ? 128 : 0), t8 && (e7.buf[e7.pos++] = 127 & t8 | ((t8 >>>= 7) ? 128 : 0), t8 && (e7.buf[e7.pos++] = 127 & t8)))));
}(n8, e6);
}(t6, this) : (this.realloc(4), this.buf[this.pos++] = 127 & t6 | (t6 > 127 ? 128 : 0), t6 <= 127 || (this.buf[this.pos++] = 127 & (t6 >>>= 7) | (t6 > 127 ? 128 : 0), t6 <= 127 || (this.buf[this.pos++] = 127 & (t6 >>>= 7) | (t6 > 127 ? 128 : 0), t6 <= 127 || (this.buf[this.pos++] = t6 >>> 7 & 127))));
}, writeSVarint: function(t6) {
this.writeVarint(t6 < 0 ? 2 * -t6 - 1 : 2 * t6);
}, writeBoolean: function(t6) {
this.writeVarint(Boolean(t6));
}, writeString: function(t6) {
t6 = String(t6), this.realloc(4 * t6.length), this.pos++;
var e6 = this.pos;
this.pos = function(t7, e7, r8) {
for (var n8, i6, a6 = 0; a6 < e7.length; a6++) {
if ((n8 = e7.charCodeAt(a6)) > 55295 && n8 < 57344) {
if (!i6) {
n8 > 56319 || a6 + 1 === e7.length ? (t7[r8++] = 239, t7[r8++] = 191, t7[r8++] = 189) : i6 = n8;
continue;
}
if (n8 < 56320) {
t7[r8++] = 239, t7[r8++] = 191, t7[r8++] = 189, i6 = n8;
continue;
}
n8 = i6 - 55296 << 10 | n8 - 56320 | 65536, i6 = null;
} else {
i6 && (t7[r8++] = 239, t7[r8++] = 191, t7[r8++] = 189, i6 = null);
}
n8 < 128 ? t7[r8++] = n8 : (n8 < 2048 ? t7[r8++] = n8 >> 6 | 192 : (n8 < 65536 ? t7[r8++] = n8 >> 12 | 224 : (t7[r8++] = n8 >> 18 | 240, t7[r8++] = n8 >> 12 & 63 | 128), t7[r8++] = n8 >> 6 & 63 | 128), t7[r8++] = 63 & n8 | 128);
}
return r8;
}(this.buf, t6, this.pos);
var r7 = this.pos - e6;
r7 >= 128 && eu(e6, r7, this), this.pos = e6 - 1, this.writeVarint(r7), this.pos += r7;
}, writeFloat: function(t6) {
this.realloc(4), Hs(this.buf, t6, this.pos, true, 23, 4), this.pos += 4;
}, writeDouble: function(t6) {
this.realloc(8), Hs(this.buf, t6, this.pos, true, 52, 8), this.pos += 8;
}, writeBytes: function(t6) {
var e6 = t6.length;
this.writeVarint(e6), this.realloc(e6);
for (var r7 = 0; r7 < e6; r7++) {
this.buf[this.pos++] = t6[r7];
}
}, writeRawMessage: function(t6, e6) {
this.pos++;
var r7 = this.pos;
t6(e6, this);
var n8 = this.pos - r7;
n8 >= 128 && eu(r7, n8, this), this.pos = r7 - 1, this.writeVarint(n8), this.pos += n8;
}, writeMessage: function(t6, e6, r7) {
this.writeTag(t6, $s.Bytes), this.writeRawMessage(e6, r7);
}, writePackedVarint: function(t6, e6) {
e6.length && this.writeMessage(t6, ru, e6);
}, writePackedSVarint: function(t6, e6) {
e6.length && this.writeMessage(t6, nu, e6);
}, writePackedBoolean: function(t6, e6) {
e6.length && this.writeMessage(t6, ou, e6);
}, writePackedFloat: function(t6, e6) {
e6.length && this.writeMessage(t6, iu, e6);
}, writePackedDouble: function(t6, e6) {
e6.length && this.writeMessage(t6, au, e6);
}, writePackedFixed32: function(t6, e6) {
e6.length && this.writeMessage(t6, su, e6);
}, writePackedSFixed32: function(t6, e6) {
e6.length && this.writeMessage(t6, uu, e6);
}, writePackedFixed64: function(t6, e6) {
e6.length && this.writeMessage(t6, lu, e6);
}, writePackedSFixed64: function(t6, e6) {
e6.length && this.writeMessage(t6, pu, e6);
}, writeBytesField: function(t6, e6) {
this.writeTag(t6, $s.Bytes), this.writeBytes(e6);
}, writeFixed32Field: function(t6, e6) {
this.writeTag(t6, $s.Fixed32), this.writeFixed32(e6);
}, writeSFixed32Field: function(t6, e6) {
this.writeTag(t6, $s.Fixed32), this.writeSFixed32(e6);
}, writeFixed64Field: function(t6, e6) {
this.writeTag(t6, $s.Fixed64), this.writeFixed64(e6);
}, writeSFixed64Field: function(t6, e6) {
this.writeTag(t6, $s.Fixed64), this.writeSFixed64(e6);
}, writeVarintField: function(t6, e6) {
this.writeTag(t6, $s.Varint), this.writeVarint(e6);
}, writeSVarintField: function(t6, e6) {
this.writeTag(t6, $s.Varint), this.writeSVarint(e6);
}, writeStringField: function(t6, e6) {
this.writeTag(t6, $s.Bytes), this.writeString(e6);
}, writeFloatField: function(t6, e6) {
this.writeTag(t6, $s.Fixed32), this.writeFloat(e6);
}, writeDoubleField: function(t6, e6) {
this.writeTag(t6, $s.Fixed64), this.writeDouble(e6);
}, writeBooleanField: function(t6, e6) {
this.writeVarintField(t6, Boolean(e6));
} };
var gu = function(t6, e6) {
var r7 = e6.pixelRatio, n8 = e6.version, i6 = e6.stretchX, a6 = e6.stretchY, o6 = e6.content;
this.paddedRect = t6, this.pixelRatio = r7, this.stretchX = i6, this.stretchY = a6, this.content = o6, this.version = n8;
}, xu = { tl: { configurable: true }, br: { configurable: true }, tlbr: { configurable: true }, displaySize: { configurable: true } };
xu.tl.get = function() {
return [this.paddedRect.x + 1, this.paddedRect.y + 1];
}, xu.br.get = function() {
return [this.paddedRect.x + this.paddedRect.w - 1, this.paddedRect.y + this.paddedRect.h - 1];
}, xu.tlbr.get = function() {
return this.tl.concat(this.br);
}, xu.displaySize.get = function() {
return [(this.paddedRect.w - 2) / this.pixelRatio, (this.paddedRect.h - 2) / this.pixelRatio];
}, Object.defineProperties(gu.prototype, xu);
var bu = function(t6, e6) {
var r7 = {}, n8 = {};
this.haveRenderCallbacks = [];
var i6 = [];
this.addImages(t6, r7, i6), this.addImages(e6, n8, i6);
var a6 = vu(i6), o6 = new xo({ width: a6.w || 1, height: a6.h || 1 });
for (var s7 in t6) {
var u5 = t6[s7], l8 = r7[s7].paddedRect;
xo.copy(u5.data, o6, { x: 0, y: 0 }, { x: l8.x + 1, y: l8.y + 1 }, u5.data);
}
for (var p5 in e6) {
var c5 = e6[p5], h7 = n8[p5].paddedRect, f5 = h7.x + 1, y5 = h7.y + 1, d5 = c5.data.width, m5 = c5.data.height;
xo.copy(c5.data, o6, { x: 0, y: 0 }, { x: f5, y: y5 }, c5.data), xo.copy(c5.data, o6, { x: 0, y: m5 - 1 }, { x: f5, y: y5 - 1 }, { width: d5, height: 1 }), xo.copy(c5.data, o6, { x: 0, y: 0 }, { x: f5, y: y5 + m5 }, { width: d5, height: 1 }), xo.copy(c5.data, o6, { x: d5 - 1, y: 0 }, { x: f5 - 1, y: y5 }, { width: 1, height: m5 }), xo.copy(c5.data, o6, { x: 0, y: 0 }, { x: f5 + d5, y: y5 }, { width: 1, height: m5 });
}
this.image = o6, this.iconPositions = r7, this.patternPositions = n8;
};
bu.prototype.addImages = function(t6, e6, r7) {
for (var n8 in t6) {
var i6 = t6[n8], a6 = { x: 0, y: 0, w: i6.data.width + 2, h: i6.data.height + 2 };
r7.push(a6), e6[n8] = new gu(a6, i6), i6.hasRenderCallback && this.haveRenderCallbacks.push(n8);
}
}, bu.prototype.patchUpdatedImages = function(t6, e6) {
for (var r7 in t6.dispatchRenderCallbacks(this.haveRenderCallbacks), t6.updatedImages) {
this.patchUpdatedImage(this.iconPositions[r7], t6.getImage(r7), e6), this.patchUpdatedImage(this.patternPositions[r7], t6.getImage(r7), e6);
}
}, bu.prototype.patchUpdatedImage = function(t6, e6, r7) {
if (t6 && e6 && t6.version !== e6.version) {
t6.version = e6.version;
var n8 = t6.tl;
r7.update(e6.data, void 0, { x: n8[0], y: n8[1] });
}
}, On2("ImagePosition", gu), On2("ImageAtlas", bu);
var wu = { horizontal: 1, vertical: 2, horizontalOnly: 3 }, _u = function() {
this.scale = 1, this.fontStack = "", this.imageName = null;
};
_u.forText = function(t6, e6) {
var r7 = new _u();
return r7.scale = t6 || 1, r7.fontStack = e6, r7;
}, _u.forImage = function(t6) {
var e6 = new _u();
return e6.imageName = t6, e6;
};
var Au = function() {
this.text = "", this.sectionIndex = [], this.sections = [], this.imageSectionID = null;
};
function Su(t6, e6, r7, n8, i6, a6, o6, s7, u5, l8, p5, c5, h7, f5, y5, d5) {
var m5, v5 = Au.fromFeature(t6, i6);
c5 === wu.vertical && v5.verticalizePunctuation();
var g5 = oi2.processBidirectionalText, x5 = oi2.processStyledBidirectionalText;
if (g5 && 1 === v5.sections.length) {
m5 = [];
for (var b5 = 0, w5 = g5(v5.toString(), Mu(v5, l8, a6, e6, n8, f5, y5)); b5 < w5.length; b5 += 1) {
var _4 = w5[b5], A5 = new Au();
A5.text = _4, A5.sections = v5.sections;
for (var S5 = 0; S5 < _4.length; S5++) {
A5.sectionIndex.push(0);
}
m5.push(A5);
}
} else if (x5) {
m5 = [];
for (var k5 = 0, I5 = x5(v5.text, v5.sectionIndex, Mu(v5, l8, a6, e6, n8, f5, y5)); k5 < I5.length; k5 += 1) {
var z5 = I5[k5], C5 = new Au();
C5.text = z5[0], C5.sectionIndex = z5[1], C5.sections = v5.sections, m5.push(C5);
}
} else {
m5 = function(t7, e7) {
for (var r8 = [], n9 = t7.text, i7 = 0, a7 = 0, o7 = e7; a7 < o7.length; a7 += 1) {
var s8 = o7[a7];
r8.push(t7.substring(i7, s8)), i7 = s8;
}
return i7 < n9.length && r8.push(t7.substring(i7, n9.length)), r8;
}(v5, Mu(v5, l8, a6, e6, n8, f5, y5));
}
var E4 = [], P5 = { positionedLines: E4, text: v5.toString(), top: p5[1], bottom: p5[1], left: p5[0], right: p5[0], writingMode: c5, iconsInText: false, verticalizable: false };
return function(t7, e7, r8, n9, i7, a7, o7, s8, u6, l9, p6, c6) {
for (var h8 = 0, f6 = -17, y6 = 0, d6 = 0, m6 = "right" === s8 ? 1 : "left" === s8 ? 0 : 0.5, v6 = 0, g6 = 0, x6 = i7; g6 < x6.length; g6 += 1) {
var b6 = x6[g6];
b6.trim();
var w6 = b6.getMaxScale(), _5 = 24 * (w6 - 1), A6 = { positionedGlyphs: [], lineOffset: 0 };
t7.positionedLines[v6] = A6;
var S6 = A6.positionedGlyphs, k6 = 0;
if (b6.length()) {
for (var I6 = 0; I6 < b6.length(); I6++) {
var z6 = b6.getSection(I6), C6 = b6.getSectionIndex(I6), E5 = b6.getCharCode(I6), P6 = 0, M5 = null, B4 = null, T5 = null, V4 = 24, F4 = !(u6 === wu.horizontal || !p6 && !Xn2(E5) || p6 && (ku[E5] || (K4 = E5, Gn2.Arabic(K4) || Gn2["Arabic Supplement"](K4) || Gn2["Arabic Extended-A"](K4) || Gn2["Arabic Presentation Forms-A"](K4) || Gn2["Arabic Presentation Forms-B"](K4))));
if (z6.imageName) {
var D5 = n9[z6.imageName];
if (!D5) {
continue;
}
T5 = z6.imageName, t7.iconsInText = t7.iconsInText || true, B4 = D5.paddedRect;
var L5 = D5.displaySize;
z6.scale = 24 * z6.scale / c6, P6 = _5 + (24 - L5[1] * z6.scale), V4 = (M5 = { width: L5[0], height: L5[1], left: 1, top: -3, advance: F4 ? L5[1] : L5[0] }).advance;
var O5 = F4 ? L5[0] * z6.scale - 24 * w6 : L5[1] * z6.scale - 24 * w6;
O5 > 0 && O5 > k6 && (k6 = O5);
} else {
var R4 = r8[z6.fontStack], U4 = R4 && R4[E5];
if (U4 && U4.rect) {
B4 = U4.rect, M5 = U4.metrics;
} else {
var j5 = e7[z6.fontStack], q5 = j5 && j5[E5];
if (!q5) {
continue;
}
M5 = q5.metrics;
}
P6 = 24 * (w6 - z6.scale);
}
F4 ? (t7.verticalizable = true, S6.push({ glyph: E5, imageName: T5, x: h8, y: f6 + P6, vertical: F4, scale: z6.scale, fontStack: z6.fontStack, sectionIndex: C6, metrics: M5, rect: B4 }), h8 += V4 * z6.scale + l9) : (S6.push({ glyph: E5, imageName: T5, x: h8, y: f6 + P6, vertical: F4, scale: z6.scale, fontStack: z6.fontStack, sectionIndex: C6, metrics: M5, rect: B4 }), h8 += M5.advance * z6.scale + l9);
}
0 !== S6.length && (y6 = Math.max(h8 - l9, y6), Tu(S6, 0, S6.length - 1, m6, k6)), h8 = 0;
var N5 = a7 * w6 + k6;
A6.lineOffset = Math.max(k6, _5), f6 += N5, d6 = Math.max(N5, d6), ++v6;
} else {
f6 += a7, ++v6;
}
}
var K4, G4 = f6 - -17, Z3 = Bu(o7), X4 = Z3.horizontalAlign, J4 = Z3.verticalAlign;
(function(t8, e8, r9, n10, i8, a8, o8, s9, u7) {
var l10, p7 = (e8 - r9) * i8;
l10 = a8 !== o8 ? -s9 * n10 - -17 : (-n10 * u7 + 0.5) * o8;
for (var c7 = 0, h9 = t8; c7 < h9.length; c7 += 1) {
for (var f7 = 0, y7 = h9[c7].positionedGlyphs; f7 < y7.length; f7 += 1) {
var d7 = y7[f7];
d7.x += p7, d7.y += l10;
}
}
})(t7.positionedLines, m6, X4, J4, y6, d6, a7, G4, i7.length), t7.top += -J4 * G4, t7.bottom = t7.top + G4, t7.left += -X4 * y6, t7.right = t7.left + y6;
}(P5, e6, r7, n8, m5, o6, s7, u5, c5, l8, h7, d5), !function(t7) {
for (var e7 = 0, r8 = t7; e7 < r8.length; e7 += 1) {
if (0 !== r8[e7].positionedGlyphs.length) {
return false;
}
}
return true;
}(E4) && P5;
}
Au.fromFeature = function(t6, e6) {
for (var r7 = new Au(), n8 = 0; n8 < t6.sections.length; n8++) {
var i6 = t6.sections[n8];
i6.image ? r7.addImageSection(i6) : r7.addTextSection(i6, e6);
}
return r7;
}, Au.prototype.length = function() {
return this.text.length;
}, Au.prototype.getSection = function(t6) {
return this.sections[this.sectionIndex[t6]];
}, Au.prototype.getSectionIndex = function(t6) {
return this.sectionIndex[t6];
}, Au.prototype.getCharCode = function(t6) {
return this.text.charCodeAt(t6);
}, Au.prototype.verticalizePunctuation = function() {
this.text = function(t6) {
for (var e6 = "", r7 = 0; r7 < t6.length; r7++) {
var n8 = t6.charCodeAt(r7 + 1) || null, i6 = t6.charCodeAt(r7 - 1) || null;
e6 += n8 && Jn2(n8) && !Xs[t6[r7 + 1]] || i6 && Jn2(i6) && !Xs[t6[r7 - 1]] || !Xs[t6[r7]] ? t6[r7] : Xs[t6[r7]];
}
return e6;
}(this.text);
}, Au.prototype.trim = function() {
for (var t6 = 0, e6 = 0; e6 < this.text.length && ku[this.text.charCodeAt(e6)]; e6++) {
t6++;
}
for (var r7 = this.text.length, n8 = this.text.length - 1; n8 >= 0 && n8 >= t6 && ku[this.text.charCodeAt(n8)]; n8--) {
r7--;
}
this.text = this.text.substring(t6, r7), this.sectionIndex = this.sectionIndex.slice(t6, r7);
}, Au.prototype.substring = function(t6, e6) {
var r7 = new Au();
return r7.text = this.text.substring(t6, e6), r7.sectionIndex = this.sectionIndex.slice(t6, e6), r7.sections = this.sections, r7;
}, Au.prototype.toString = function() {
return this.text;
}, Au.prototype.getMaxScale = function() {
var t6 = this;
return this.sectionIndex.reduce(function(e6, r7) {
return Math.max(e6, t6.sections[r7].scale);
}, 0);
}, Au.prototype.addTextSection = function(t6, e6) {
this.text += t6.text, this.sections.push(_u.forText(t6.scale, t6.fontStack || e6));
for (var r7 = this.sections.length - 1, n8 = 0; n8 < t6.text.length; ++n8) {
this.sectionIndex.push(r7);
}
}, Au.prototype.addImageSection = function(t6) {
var e6 = t6.image ? t6.image.name : "";
if (0 !== e6.length) {
var r7 = this.getNextImageSectionCharCode();
r7 ? (this.text += String.fromCharCode(r7), this.sections.push(_u.forImage(e6)), this.sectionIndex.push(this.sections.length - 1)) : A4("Reached maximum number of images 6401");
} else {
A4("Can't add FormattedSection with an empty image.");
}
}, Au.prototype.getNextImageSectionCharCode = function() {
return this.imageSectionID ? this.imageSectionID >= 63743 ? null : ++this.imageSectionID : (this.imageSectionID = 57344, this.imageSectionID);
};
var ku = { 9: true, 10: true, 11: true, 12: true, 13: true, 32: true }, Iu = {};
function zu(t6, e6, r7, n8, i6, a6) {
if (e6.imageName) {
var o6 = n8[e6.imageName];
return o6 ? o6.displaySize[0] * e6.scale * 24 / a6 + i6 : 0;
}
var s7 = r7[e6.fontStack], u5 = s7 && s7[t6];
return u5 ? u5.metrics.advance * e6.scale + i6 : 0;
}
function Cu(t6, e6, r7, n8) {
var i6 = Math.pow(t6 - e6, 2);
return n8 ? t6 < e6 ? i6 / 2 : 2 * i6 : i6 + Math.abs(r7) * r7;
}
function Eu(t6, e6, r7) {
var n8 = 0;
return 10 === t6 && (n8 -= 1e4), r7 && (n8 += 150), 40 !== t6 && 65288 !== t6 || (n8 += 50), 41 !== e6 && 65289 !== e6 || (n8 += 50), n8;
}
function Pu(t6, e6, r7, n8, i6, a6) {
for (var o6 = null, s7 = Cu(e6, r7, i6, a6), u5 = 0, l8 = n8; u5 < l8.length; u5 += 1) {
var p5 = l8[u5], c5 = Cu(e6 - p5.x, r7, i6, a6) + p5.badness;
c5 <= s7 && (o6 = p5, s7 = c5);
}
return { index: t6, x: e6, priorBreak: o6, badness: s7 };
}
function Mu(t6, e6, r7, n8, i6, a6, o6) {
if ("point" !== a6) {
return [];
}
if (!t6) {
return [];
}
for (var s7, u5 = [], l8 = function(t7, e7, r8, n9, i7, a7) {
for (var o7 = 0, s8 = 0; s8 < t7.length(); s8++) {
var u6 = t7.getSection(s8);
o7 += zu(t7.getCharCode(s8), u6, n9, i7, e7, a7);
}
return o7 / Math.max(1, Math.ceil(o7 / r8));
}(t6, e6, r7, n8, i6, o6), p5 = t6.text.indexOf("\u200B") >= 0, c5 = 0, h7 = 0; h7 < t6.length(); h7++) {
var f5 = t6.getSection(h7), y5 = t6.getCharCode(h7);
if (ku[y5] || (c5 += zu(y5, f5, n8, i6, e6, o6)), h7 < t6.length() - 1) {
var d5 = !((s7 = y5) < 11904 || !(Gn2["Bopomofo Extended"](s7) || Gn2.Bopomofo(s7) || Gn2["CJK Compatibility Forms"](s7) || Gn2["CJK Compatibility Ideographs"](s7) || Gn2["CJK Compatibility"](s7) || Gn2["CJK Radicals Supplement"](s7) || Gn2["CJK Strokes"](s7) || Gn2["CJK Symbols and Punctuation"](s7) || Gn2["CJK Unified Ideographs Extension A"](s7) || Gn2["CJK Unified Ideographs"](s7) || Gn2["Enclosed CJK Letters and Months"](s7) || Gn2["Halfwidth and Fullwidth Forms"](s7) || Gn2.Hiragana(s7) || Gn2["Ideographic Description Characters"](s7) || Gn2["Kangxi Radicals"](s7) || Gn2["Katakana Phonetic Extensions"](s7) || Gn2.Katakana(s7) || Gn2["Vertical Forms"](s7) || Gn2["Yi Radicals"](s7) || Gn2["Yi Syllables"](s7)));
(Iu[y5] || d5 || f5.imageName) && u5.push(Pu(h7 + 1, c5, l8, u5, Eu(y5, t6.getCharCode(h7 + 1), d5 && p5), false));
}
}
return function t7(e7) {
return e7 ? t7(e7.priorBreak).concat(e7.index) : [];
}(Pu(t6.length(), c5, l8, u5, 0, true));
}
function Bu(t6) {
var e6 = 0.5, r7 = 0.5;
switch (t6) {
case "right":
case "top-right":
case "bottom-right":
e6 = 1;
break;
case "left":
case "top-left":
case "bottom-left":
e6 = 0;
}
switch (t6) {
case "bottom":
case "bottom-right":
case "bottom-left":
r7 = 1;
break;
case "top":
case "top-right":
case "top-left":
r7 = 0;
}
return { horizontalAlign: e6, verticalAlign: r7 };
}
function Tu(t6, e6, r7, n8, i6) {
if (n8 || i6) {
for (var a6 = t6[r7], o6 = (t6[r7].x + a6.metrics.advance * a6.scale) * n8, s7 = e6; s7 <= r7; s7++) {
t6[s7].x -= o6, t6[s7].y += i6;
}
}
}
function Vu(t6, e6, r7, n8, i6, a6) {
var o6, s7 = t6.image;
if (s7.content) {
var u5 = s7.content, l8 = s7.pixelRatio || 1;
o6 = [u5[0] / l8, u5[1] / l8, s7.displaySize[0] - u5[2] / l8, s7.displaySize[1] - u5[3] / l8];
}
var p5, c5, h7, f5, y5 = e6.left * a6, d5 = e6.right * a6;
"width" === r7 || "both" === r7 ? (f5 = i6[0] + y5 - n8[3], c5 = i6[0] + d5 + n8[1]) : c5 = (f5 = i6[0] + (y5 + d5 - s7.displaySize[0]) / 2) + s7.displaySize[0];
var m5 = e6.top * a6, v5 = e6.bottom * a6;
return "height" === r7 || "both" === r7 ? (p5 = i6[1] + m5 - n8[0], h7 = i6[1] + v5 + n8[2]) : h7 = (p5 = i6[1] + (m5 + v5 - s7.displaySize[1]) / 2) + s7.displaySize[1], { image: s7, top: p5, right: c5, bottom: h7, left: f5, collisionPadding: o6 };
}
Iu[10] = true, Iu[32] = true, Iu[38] = true, Iu[40] = true, Iu[41] = true, Iu[43] = true, Iu[45] = true, Iu[47] = true, Iu[173] = true, Iu[183] = true, Iu[8203] = true, Iu[8208] = true, Iu[8211] = true, Iu[8231] = true;
var Fu = function(t6) {
function e6(e7, r7, n8, i6) {
t6.call(this, e7, r7), this.angle = n8, void 0 !== i6 && (this.segment = i6);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.clone = function() {
return new e6(this.x, this.y, this.angle, this.segment);
}, e6;
}(i5);
function Du(t6, e6) {
var r7 = e6.expression;
if ("constant" === r7.kind) {
return { kind: "constant", layoutSize: r7.evaluate(new si2(t6 + 1)) };
}
if ("source" === r7.kind) {
return { kind: "source" };
}
for (var n8 = r7.zoomStops, i6 = r7.interpolationType, a6 = 0; a6 < n8.length && n8[a6] <= t6; ) {
a6++;
}
for (var o6 = a6 = Math.max(0, a6 - 1); o6 < n8.length && n8[o6] < t6 + 1; ) {
o6++;
}
o6 = Math.min(n8.length - 1, o6);
var s7 = n8[a6], u5 = n8[o6];
return "composite" === r7.kind ? { kind: "composite", minZoom: s7, maxZoom: u5, interpolationType: i6 } : { kind: "camera", minZoom: s7, maxZoom: u5, minSize: r7.evaluate(new si2(s7)), maxSize: r7.evaluate(new si2(u5)), interpolationType: i6 };
}
function Lu(t6, e6, r7) {
var n8 = e6.uSize, i6 = r7.lowerSize;
return "source" === t6.kind ? i6 / 128 : "composite" === t6.kind ? Ke2(i6 / 128, r7.upperSize / 128, e6.uSizeT) : n8;
}
function Ou(t6, e6) {
var r7 = 0, n8 = 0;
if ("constant" === t6.kind) {
n8 = t6.layoutSize;
} else if ("source" !== t6.kind) {
var i6 = t6.interpolationType, a6 = i6 ? p4(ar.interpolationFactor(i6, e6, t6.minZoom, t6.maxZoom), 0, 1) : 0;
"camera" === t6.kind ? n8 = Ke2(t6.minSize, t6.maxSize, a6) : r7 = a6;
}
return { uSizeT: r7, uSize: n8 };
}
On2("Anchor", Fu);
var Ru = Object.freeze({ __proto__: null, getSizeData: Du, evaluateSizeForFeature: Lu, evaluateSizeForZoom: Ou, SIZE_PACK_FACTOR: 128 });
function Uu(t6, e6, r7, n8, i6) {
if (void 0 === e6.segment) {
return true;
}
for (var a6 = e6, o6 = e6.segment + 1, s7 = 0; s7 > -r7 / 2; ) {
if (--o6 < 0) {
return false;
}
s7 -= t6[o6].dist(a6), a6 = t6[o6];
}
s7 += t6[o6].dist(t6[o6 + 1]), o6++;
for (var u5 = [], l8 = 0; s7 < r7 / 2; ) {
var p5 = t6[o6], c5 = t6[o6 + 1];
if (!c5) {
return false;
}
var h7 = t6[o6 - 1].angleTo(p5) - p5.angleTo(c5);
for (h7 = Math.abs((h7 + 3 * Math.PI) % (2 * Math.PI) - Math.PI), u5.push({ distance: s7, angleDelta: h7 }), l8 += h7; s7 - u5[0].distance > n8; ) {
l8 -= u5.shift().angleDelta;
}
if (l8 > i6) {
return false;
}
o6++, s7 += p5.dist(c5);
}
return true;
}
function ju(t6) {
for (var e6 = 0, r7 = 0; r7 < t6.length - 1; r7++) {
e6 += t6[r7].dist(t6[r7 + 1]);
}
return e6;
}
function qu(t6, e6, r7) {
return t6 ? 0.6 * e6 * r7 : 0;
}
function Nu(t6, e6) {
return Math.max(t6 ? t6.right - t6.left : 0, e6 ? e6.right - e6.left : 0);
}
function Ku(t6, e6, r7, n8, i6, a6) {
for (var o6 = qu(r7, i6, a6), s7 = Nu(r7, n8) * a6, u5 = 0, l8 = ju(t6) / 2, p5 = 0; p5 < t6.length - 1; p5++) {
var c5 = t6[p5], h7 = t6[p5 + 1], f5 = c5.dist(h7);
if (u5 + f5 > l8) {
var y5 = (l8 - u5) / f5, d5 = Ke2(c5.x, h7.x, y5), m5 = Ke2(c5.y, h7.y, y5), v5 = new Fu(d5, m5, h7.angleTo(c5), p5);
return v5._round(), !o6 || Uu(t6, v5, s7, o6, e6) ? v5 : void 0;
}
u5 += f5;
}
}
function Gu(t6, e6, r7, n8, i6, a6, o6, s7, u5) {
var l8 = qu(n8, a6, o6), p5 = Nu(n8, i6), c5 = p5 * o6, h7 = 0 === t6[0].x || t6[0].x === u5 || 0 === t6[0].y || t6[0].y === u5;
return e6 - c5 < e6 / 4 && (e6 = c5 + e6 / 4), function t7(e7, r8, n9, i7, a7, o7, s8, u6, l9) {
for (var p6 = o7 / 2, c6 = ju(e7), h8 = 0, f5 = r8 - n9, y5 = [], d5 = 0; d5 < e7.length - 1; d5++) {
for (var m5 = e7[d5], v5 = e7[d5 + 1], g5 = m5.dist(v5), x5 = v5.angleTo(m5); f5 + n9 < h8 + g5; ) {
var b5 = ((f5 += n9) - h8) / g5, w5 = Ke2(m5.x, v5.x, b5), _4 = Ke2(m5.y, v5.y, b5);
if (w5 >= 0 && w5 < l9 && _4 >= 0 && _4 < l9 && f5 - p6 >= 0 && f5 + p6 <= c6) {
var A5 = new Fu(w5, _4, x5, d5);
A5._round(), i7 && !Uu(e7, A5, o7, i7, a7) || y5.push(A5);
}
}
h8 += g5;
}
return u6 || y5.length || s8 || (y5 = t7(e7, h8 / 2, n9, i7, a7, o7, s8, true, l9)), y5;
}(t6, h7 ? e6 / 2 * s7 % e6 : (p5 / 2 + 2 * a6) * o6 * s7 % e6, e6, l8, r7, c5, h7, false, u5);
}
function Zu(t6, e6, r7, n8, a6) {
for (var o6 = [], s7 = 0; s7 < t6.length; s7++) {
for (var u5 = t6[s7], l8 = void 0, p5 = 0; p5 < u5.length - 1; p5++) {
var c5 = u5[p5], h7 = u5[p5 + 1];
c5.x < e6 && h7.x < e6 || (c5.x < e6 ? c5 = new i5(e6, c5.y + (e6 - c5.x) / (h7.x - c5.x) * (h7.y - c5.y))._round() : h7.x < e6 && (h7 = new i5(e6, c5.y + (e6 - c5.x) / (h7.x - c5.x) * (h7.y - c5.y))._round()), c5.y < r7 && h7.y < r7 || (c5.y < r7 ? c5 = new i5(c5.x + (r7 - c5.y) / (h7.y - c5.y) * (h7.x - c5.x), r7)._round() : h7.y < r7 && (h7 = new i5(c5.x + (r7 - c5.y) / (h7.y - c5.y) * (h7.x - c5.x), r7)._round()), c5.x >= n8 && h7.x >= n8 || (c5.x >= n8 ? c5 = new i5(n8, c5.y + (n8 - c5.x) / (h7.x - c5.x) * (h7.y - c5.y))._round() : h7.x >= n8 && (h7 = new i5(n8, c5.y + (n8 - c5.x) / (h7.x - c5.x) * (h7.y - c5.y))._round()), c5.y >= a6 && h7.y >= a6 || (c5.y >= a6 ? c5 = new i5(c5.x + (a6 - c5.y) / (h7.y - c5.y) * (h7.x - c5.x), a6)._round() : h7.y >= a6 && (h7 = new i5(c5.x + (a6 - c5.y) / (h7.y - c5.y) * (h7.x - c5.x), a6)._round()), l8 && c5.equals(l8[l8.length - 1]) || o6.push(l8 = [c5]), l8.push(h7)))));
}
}
return o6;
}
function Xu(t6, e6, r7, n8) {
var a6 = [], o6 = t6.image, s7 = o6.pixelRatio, u5 = o6.paddedRect.w - 2, l8 = o6.paddedRect.h - 2, p5 = t6.right - t6.left, c5 = t6.bottom - t6.top, h7 = o6.stretchX || [[0, u5]], f5 = o6.stretchY || [[0, l8]], y5 = function(t7, e7) {
return t7 + e7[1] - e7[0];
}, d5 = h7.reduce(y5, 0), m5 = f5.reduce(y5, 0), v5 = u5 - d5, g5 = l8 - m5, x5 = 0, b5 = d5, w5 = 0, _4 = m5, A5 = 0, S5 = v5, k5 = 0, I5 = g5;
if (o6.content && n8) {
var z5 = o6.content;
x5 = Ju(h7, 0, z5[0]), w5 = Ju(f5, 0, z5[1]), b5 = Ju(h7, z5[0], z5[2]), _4 = Ju(f5, z5[1], z5[3]), A5 = z5[0] - x5, k5 = z5[1] - w5, S5 = z5[2] - z5[0] - b5, I5 = z5[3] - z5[1] - _4;
}
var C5 = function(n9, a7, u6, l9) {
var h8 = Yu(n9.stretch - x5, b5, p5, t6.left), f6 = $u(n9.fixed - A5, S5, n9.stretch, d5), y6 = Yu(a7.stretch - w5, _4, c5, t6.top), v6 = $u(a7.fixed - k5, I5, a7.stretch, m5), g6 = Yu(u6.stretch - x5, b5, p5, t6.left), z6 = $u(u6.fixed - A5, S5, u6.stretch, d5), C6 = Yu(l9.stretch - w5, _4, c5, t6.top), E5 = $u(l9.fixed - k5, I5, l9.stretch, m5), P6 = new i5(h8, y6), M6 = new i5(g6, y6), B5 = new i5(g6, C6), T6 = new i5(h8, C6), V5 = new i5(f6 / s7, v6 / s7), F4 = new i5(z6 / s7, E5 / s7), D5 = e6 * Math.PI / 180;
if (D5) {
var L5 = Math.sin(D5), O5 = Math.cos(D5), R4 = [O5, -L5, L5, O5];
P6._matMult(R4), M6._matMult(R4), T6._matMult(R4), B5._matMult(R4);
}
var U4 = n9.stretch + n9.fixed, j5 = a7.stretch + a7.fixed;
return { tl: P6, tr: M6, bl: T6, br: B5, tex: { x: o6.paddedRect.x + 1 + U4, y: o6.paddedRect.y + 1 + j5, w: u6.stretch + u6.fixed - U4, h: l9.stretch + l9.fixed - j5 }, writingMode: void 0, glyphOffset: [0, 0], sectionIndex: 0, pixelOffsetTL: V5, pixelOffsetBR: F4, minFontScaleX: S5 / s7 / p5, minFontScaleY: I5 / s7 / c5, isSDF: r7 };
};
if (n8 && (o6.stretchX || o6.stretchY)) {
for (var E4 = Hu(h7, v5, d5), P5 = Hu(f5, g5, m5), M5 = 0; M5 < E4.length - 1; M5++) {
for (var B4 = E4[M5], T5 = E4[M5 + 1], V4 = 0; V4 < P5.length - 1; V4++) {
a6.push(C5(B4, P5[V4], T5, P5[V4 + 1]));
}
}
} else {
a6.push(C5({ fixed: 0, stretch: -1 }, { fixed: 0, stretch: -1 }, { fixed: 0, stretch: u5 + 1 }, { fixed: 0, stretch: l8 + 1 }));
}
return a6;
}
function Ju(t6, e6, r7) {
for (var n8 = 0, i6 = 0, a6 = t6; i6 < a6.length; i6 += 1) {
var o6 = a6[i6];
n8 += Math.max(e6, Math.min(r7, o6[1])) - Math.max(e6, Math.min(r7, o6[0]));
}
return n8;
}
function Hu(t6, e6, r7) {
for (var n8 = [{ fixed: -1, stretch: 0 }], i6 = 0, a6 = t6; i6 < a6.length; i6 += 1) {
var o6 = a6[i6], s7 = o6[0], u5 = o6[1], l8 = n8[n8.length - 1];
n8.push({ fixed: s7 - l8.stretch, stretch: l8.stretch }), n8.push({ fixed: s7 - l8.stretch, stretch: l8.stretch + (u5 - s7) });
}
return n8.push({ fixed: e6 + 1, stretch: r7 }), n8;
}
function Yu(t6, e6, r7, n8) {
return t6 / e6 * r7 + n8;
}
function $u(t6, e6, r7, n8) {
return t6 - e6 * r7 / n8;
}
var Wu = function(t6, e6, r7, n8, a6, o6, s7, u5, l8, p5) {
if (this.boxStartIndex = t6.length, l8) {
var c5 = o6.top, h7 = o6.bottom, f5 = o6.collisionPadding;
f5 && (c5 -= f5[1], h7 += f5[3]);
var y5 = h7 - c5;
y5 > 0 && (y5 = Math.max(10, y5), this.circleDiameter = y5);
} else {
var d5 = o6.top * s7 - u5, m5 = o6.bottom * s7 + u5, v5 = o6.left * s7 - u5, g5 = o6.right * s7 + u5, x5 = o6.collisionPadding;
if (x5 && (v5 -= x5[0] * s7, d5 -= x5[1] * s7, g5 += x5[2] * s7, m5 += x5[3] * s7), p5) {
var b5 = new i5(v5, d5), w5 = new i5(g5, d5), _4 = new i5(v5, m5), A5 = new i5(g5, m5), S5 = p5 * Math.PI / 180;
b5._rotate(S5), w5._rotate(S5), _4._rotate(S5), A5._rotate(S5), v5 = Math.min(b5.x, w5.x, _4.x, A5.x), g5 = Math.max(b5.x, w5.x, _4.x, A5.x), d5 = Math.min(b5.y, w5.y, _4.y, A5.y), m5 = Math.max(b5.y, w5.y, _4.y, A5.y);
}
t6.emplaceBack(e6.x, e6.y, v5, d5, g5, m5, r7, n8, a6);
}
this.boxEndIndex = t6.length;
}, Qu = function(t6, e6) {
if (void 0 === t6 && (t6 = []), void 0 === e6 && (e6 = tl), this.data = t6, this.length = this.data.length, this.compare = e6, this.length > 0) {
for (var r7 = (this.length >> 1) - 1; r7 >= 0; r7--) {
this._down(r7);
}
}
};
function tl(t6, e6) {
return t6 < e6 ? -1 : t6 > e6 ? 1 : 0;
}
function el(t6, e6, r7) {
void 0 === e6 && (e6 = 1), void 0 === r7 && (r7 = false);
for (var n8 = 1 / 0, a6 = 1 / 0, o6 = -1 / 0, s7 = -1 / 0, u5 = t6[0], l8 = 0; l8 < u5.length; l8++) {
var p5 = u5[l8];
(!l8 || p5.x < n8) && (n8 = p5.x), (!l8 || p5.y < a6) && (a6 = p5.y), (!l8 || p5.x > o6) && (o6 = p5.x), (!l8 || p5.y > s7) && (s7 = p5.y);
}
var c5 = Math.min(o6 - n8, s7 - a6), h7 = c5 / 2, f5 = new Qu([], rl);
if (0 === c5) {
return new i5(n8, a6);
}
for (var y5 = n8; y5 < o6; y5 += c5) {
for (var d5 = a6; d5 < s7; d5 += c5) {
f5.push(new nl(y5 + h7, d5 + h7, h7, t6));
}
}
for (var m5 = function(t7) {
for (var e7 = 0, r8 = 0, n9 = 0, i6 = t7[0], a7 = 0, o7 = i6.length, s8 = o7 - 1; a7 < o7; s8 = a7++) {
var u6 = i6[a7], l9 = i6[s8], p6 = u6.x * l9.y - l9.x * u6.y;
r8 += (u6.x + l9.x) * p6, n9 += (u6.y + l9.y) * p6, e7 += 3 * p6;
}
return new nl(r8 / e7, n9 / e7, 0, t7);
}(t6), v5 = f5.length; f5.length; ) {
var g5 = f5.pop();
(g5.d > m5.d || !m5.d) && (m5 = g5, r7 && console.log("found best %d after %d probes", Math.round(1e4 * g5.d) / 1e4, v5)), g5.max - m5.d <= e6 || (f5.push(new nl(g5.p.x - (h7 = g5.h / 2), g5.p.y - h7, h7, t6)), f5.push(new nl(g5.p.x + h7, g5.p.y - h7, h7, t6)), f5.push(new nl(g5.p.x - h7, g5.p.y + h7, h7, t6)), f5.push(new nl(g5.p.x + h7, g5.p.y + h7, h7, t6)), v5 += 4);
}
return r7 && (console.log("num probes: " + v5), console.log("best distance: " + m5.d)), m5.p;
}
function rl(t6, e6) {
return e6.max - t6.max;
}
function nl(t6, e6, r7, n8) {
this.p = new i5(t6, e6), this.h = r7, this.d = function(t7, e7) {
for (var r8 = false, n9 = 1 / 0, i6 = 0; i6 < e7.length; i6++) {
for (var a6 = e7[i6], o6 = 0, s7 = a6.length, u5 = s7 - 1; o6 < s7; u5 = o6++) {
var l8 = a6[o6], p5 = a6[u5];
l8.y > t7.y != p5.y > t7.y && t7.x < (p5.x - l8.x) * (t7.y - l8.y) / (p5.y - l8.y) + l8.x && (r8 = !r8), n9 = Math.min(n9, Ya(t7, l8, p5));
}
}
return (r8 ? 1 : -1) * Math.sqrt(n9);
}(this.p, n8), this.max = this.d + this.h * Math.SQRT2;
}
Qu.prototype.push = function(t6) {
this.data.push(t6), this.length++, this._up(this.length - 1);
}, Qu.prototype.pop = function() {
if (0 !== this.length) {
var t6 = this.data[0], e6 = this.data.pop();
return this.length--, this.length > 0 && (this.data[0] = e6, this._down(0)), t6;
}
}, Qu.prototype.peek = function() {
return this.data[0];
}, Qu.prototype._up = function(t6) {
for (var e6 = this.data, r7 = this.compare, n8 = e6[t6]; t6 > 0; ) {
var i6 = t6 - 1 >> 1, a6 = e6[i6];
if (r7(n8, a6) >= 0) {
break;
}
e6[t6] = a6, t6 = i6;
}
e6[t6] = n8;
}, Qu.prototype._down = function(t6) {
for (var e6 = this.data, r7 = this.compare, n8 = this.length >> 1, i6 = e6[t6]; t6 < n8; ) {
var a6 = 1 + (t6 << 1), o6 = e6[a6], s7 = a6 + 1;
if (s7 < this.length && r7(e6[s7], o6) < 0 && (a6 = s7, o6 = e6[s7]), r7(o6, i6) >= 0) {
break;
}
e6[t6] = o6, t6 = a6;
}
e6[t6] = i6;
};
var il = Number.POSITIVE_INFINITY;
function al(t6, e6) {
return e6[1] !== il ? function(t7, e7, r7) {
var n8 = 0, i6 = 0;
switch (e7 = Math.abs(e7), r7 = Math.abs(r7), t7) {
case "top-right":
case "top-left":
case "top":
i6 = r7 - 7;
break;
case "bottom-right":
case "bottom-left":
case "bottom":
i6 = 7 - r7;
}
switch (t7) {
case "top-right":
case "bottom-right":
case "right":
n8 = -e7;
break;
case "top-left":
case "bottom-left":
case "left":
n8 = e7;
}
return [n8, i6];
}(t6, e6[0], e6[1]) : function(t7, e7) {
var r7 = 0, n8 = 0;
e7 < 0 && (e7 = 0);
var i6 = e7 / Math.sqrt(2);
switch (t7) {
case "top-right":
case "top-left":
n8 = i6 - 7;
break;
case "bottom-right":
case "bottom-left":
n8 = 7 - i6;
break;
case "bottom":
n8 = 7 - e7;
break;
case "top":
n8 = e7 - 7;
}
switch (t7) {
case "top-right":
case "bottom-right":
r7 = -i6;
break;
case "top-left":
case "bottom-left":
r7 = i6;
break;
case "left":
r7 = e7;
break;
case "right":
r7 = -e7;
}
return [r7, n8];
}(t6, e6[0]);
}
function ol(t6) {
switch (t6) {
case "right":
case "top-right":
case "bottom-right":
return "right";
case "left":
case "top-left":
case "bottom-left":
return "left";
}
return "center";
}
function sl(t6, e6, r7, n8, a6, o6, s7, u5, l8, p5, c5, h7, f5, y5, d5) {
var m5 = function(t7, e7, r8, n9, a7, o7, s8, u6) {
for (var l9 = n9.layout.get("text-rotate").evaluate(o7, {}) * Math.PI / 180, p6 = [], c6 = 0, h8 = e7.positionedLines; c6 < h8.length; c6 += 1) {
for (var f6 = h8[c6], y6 = 0, d6 = f6.positionedGlyphs; y6 < d6.length; y6 += 1) {
var m6 = d6[y6];
if (m6.rect) {
var v6 = m6.rect || {}, g6 = 4, x6 = true, b6 = 1, w5 = 0, _4 = (a7 || u6) && m6.vertical, A5 = m6.metrics.advance * m6.scale / 2;
if (u6 && e7.verticalizable && (w5 = f6.lineOffset / 2 - (m6.imageName ? -(24 - m6.metrics.width * m6.scale) / 2 : 24 * (m6.scale - 1))), m6.imageName) {
var S5 = s8[m6.imageName];
x6 = S5.sdf, g6 = 1 / (b6 = S5.pixelRatio);
}
var k5 = a7 ? [m6.x + A5, m6.y] : [0, 0], I5 = a7 ? [0, 0] : [m6.x + A5 + r8[0], m6.y + r8[1] - w5], z5 = [0, 0];
_4 && (z5 = I5, I5 = [0, 0]);
var C5 = (m6.metrics.left - g6) * m6.scale - A5 + I5[0], E4 = (-m6.metrics.top - g6) * m6.scale + I5[1], P5 = C5 + v6.w * m6.scale / b6, M5 = E4 + v6.h * m6.scale / b6, B4 = new i5(C5, E4), T5 = new i5(P5, E4), V4 = new i5(C5, M5), F4 = new i5(P5, M5);
if (_4) {
var D5 = new i5(-A5, A5 - -17), L5 = -Math.PI / 2, O5 = 12 - A5, R4 = new i5(22 - O5, -(m6.imageName ? O5 : 0)), U4 = new (Function.prototype.bind.apply(i5, [null].concat(z5)))();
B4._rotateAround(L5, D5)._add(R4)._add(U4), T5._rotateAround(L5, D5)._add(R4)._add(U4), V4._rotateAround(L5, D5)._add(R4)._add(U4), F4._rotateAround(L5, D5)._add(R4)._add(U4);
}
if (l9) {
var j5 = Math.sin(l9), q5 = Math.cos(l9), N5 = [q5, -j5, j5, q5];
B4._matMult(N5), T5._matMult(N5), V4._matMult(N5), F4._matMult(N5);
}
var K4 = new i5(0, 0), G4 = new i5(0, 0);
p6.push({ tl: B4, tr: T5, bl: V4, br: F4, tex: v6, writingMode: e7.writingMode, glyphOffset: k5, sectionIndex: m6.sectionIndex, isSDF: x6, pixelOffsetTL: K4, pixelOffsetBR: G4, minFontScaleX: 0, minFontScaleY: 0 });
}
}
}
return p6;
}(0, r7, u5, a6, o6, s7, n8, t6.allowVerticalPlacement), v5 = t6.textSizeData, g5 = null;
"source" === v5.kind ? (g5 = [128 * a6.layout.get("text-size").evaluate(s7, {})])[0] > 32640 && A4(t6.layerIds[0] + ': Value for "text-size" is >= 255. Reduce your "text-size".') : "composite" === v5.kind && ((g5 = [128 * y5.compositeTextSizes[0].evaluate(s7, {}, d5), 128 * y5.compositeTextSizes[1].evaluate(s7, {}, d5)])[0] > 32640 || g5[1] > 32640) && A4(t6.layerIds[0] + ': Value for "text-size" is >= 255. Reduce your "text-size".'), t6.addSymbols(t6.text, m5, g5, u5, o6, s7, p5, e6, l8.lineStartIndex, l8.lineLength, f5, d5);
for (var x5 = 0, b5 = c5; x5 < b5.length; x5 += 1) {
h7[b5[x5]] = t6.text.placedSymbolArray.length - 1;
}
return 4 * m5.length;
}
function ul(t6) {
for (var e6 in t6) {
return t6[e6];
}
return null;
}
function ll(t6, e6, r7, n8) {
var i6 = t6.compareText;
if (e6 in i6) {
for (var a6 = i6[e6], o6 = a6.length - 1; o6 >= 0; o6--) {
if (n8.dist(a6[o6]) < r7) {
return true;
}
}
} else {
i6[e6] = [];
}
return i6[e6].push(n8), false;
}
var pl = bs.VectorTileFeature.types, cl = [{ name: "a_fade_opacity", components: 1, type: "Uint8", offset: 0 }];
function hl(t6, e6, r7, n8, i6, a6, o6, s7, u5, l8, p5, c5, h7) {
var f5 = s7 ? Math.min(32640, Math.round(s7[0])) : 0, y5 = s7 ? Math.min(32640, Math.round(s7[1])) : 0;
t6.emplaceBack(e6, r7, Math.round(32 * n8), Math.round(32 * i6), a6, o6, (f5 << 1) + (u5 ? 1 : 0), y5, 16 * l8, 16 * p5, 256 * c5, 256 * h7);
}
function fl(t6, e6, r7) {
t6.emplaceBack(e6.x, e6.y, r7), t6.emplaceBack(e6.x, e6.y, r7), t6.emplaceBack(e6.x, e6.y, r7), t6.emplaceBack(e6.x, e6.y, r7);
}
function yl(t6) {
for (var e6 = 0, r7 = t6.sections; e6 < r7.length; e6 += 1) {
if ($n2(r7[e6].text)) {
return true;
}
}
return false;
}
var dl = function(t6) {
this.layoutVertexArray = new Vi2(), this.indexArray = new ji2(), this.programConfigurations = t6, this.segments = new sa(), this.dynamicLayoutVertexArray = new Fi2(), this.opacityVertexArray = new Di2(), this.placedSymbolArray = new Qi2();
};
dl.prototype.isEmpty = function() {
return 0 === this.layoutVertexArray.length && 0 === this.indexArray.length && 0 === this.dynamicLayoutVertexArray.length && 0 === this.opacityVertexArray.length;
}, dl.prototype.upload = function(t6, e6, r7, n8) {
this.isEmpty() || (r7 && (this.layoutVertexBuffer = t6.createVertexBuffer(this.layoutVertexArray, js.members), this.indexBuffer = t6.createIndexBuffer(this.indexArray, e6), this.dynamicLayoutVertexBuffer = t6.createVertexBuffer(this.dynamicLayoutVertexArray, qs.members, true), this.opacityVertexBuffer = t6.createVertexBuffer(this.opacityVertexArray, cl, true), this.opacityVertexBuffer.itemSize = 1), (r7 || n8) && this.programConfigurations.upload(t6));
}, dl.prototype.destroy = function() {
this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.programConfigurations.destroy(), this.segments.destroy(), this.dynamicLayoutVertexBuffer.destroy(), this.opacityVertexBuffer.destroy());
}, On2("SymbolBuffers", dl);
var ml = function(t6, e6, r7) {
this.layoutVertexArray = new t6(), this.layoutAttributes = e6, this.indexArray = new r7(), this.segments = new sa(), this.collisionVertexArray = new Ui2();
};
ml.prototype.upload = function(t6) {
this.layoutVertexBuffer = t6.createVertexBuffer(this.layoutVertexArray, this.layoutAttributes), this.indexBuffer = t6.createIndexBuffer(this.indexArray), this.collisionVertexBuffer = t6.createVertexBuffer(this.collisionVertexArray, Ns.members, true);
}, ml.prototype.destroy = function() {
this.layoutVertexBuffer && (this.layoutVertexBuffer.destroy(), this.indexBuffer.destroy(), this.segments.destroy(), this.collisionVertexBuffer.destroy());
}, On2("CollisionBuffers", ml);
var vl = function(t6) {
this.collisionBoxArray = t6.collisionBoxArray, this.zoom = t6.zoom, this.overscaling = t6.overscaling, this.layers = t6.layers, this.layerIds = this.layers.map(function(t7) {
return t7.id;
}), this.index = t6.index, this.pixelRatio = t6.pixelRatio, this.sourceLayerIndex = t6.sourceLayerIndex, this.hasPattern = false, this.hasRTLText = false, this.sortKeyRanges = [], this.collisionCircleArray = [], this.placementInvProjMatrix = oo([]), this.placementViewportMatrix = oo([]);
var e6 = this.layers[0]._unevaluatedLayout._values;
this.textSizeData = Du(this.zoom, e6["text-size"]), this.iconSizeData = Du(this.zoom, e6["icon-size"]);
var r7 = this.layers[0].layout, n8 = r7.get("symbol-sort-key"), i6 = r7.get("symbol-z-order");
this.canOverlap = r7.get("text-allow-overlap") || r7.get("icon-allow-overlap") || r7.get("text-ignore-placement") || r7.get("icon-ignore-placement"), this.sortFeaturesByKey = "viewport-y" !== i6 && void 0 !== n8.constantOr(1), this.sortFeaturesByY = ("viewport-y" === i6 || "auto" === i6 && !this.sortFeaturesByKey) && this.canOverlap, "point" === r7.get("symbol-placement") && (this.writingModes = r7.get("text-writing-mode").map(function(t7) {
return wu[t7];
})), this.stateDependentLayerIds = this.layers.filter(function(t7) {
return t7.isStateDependent();
}).map(function(t7) {
return t7.id;
}), this.sourceID = t6.sourceID;
};
vl.prototype.createArrays = function() {
this.text = new dl(new Va(this.layers, this.zoom, function(t6) {
return /^text/.test(t6);
})), this.icon = new dl(new Va(this.layers, this.zoom, function(t6) {
return /^icon/.test(t6);
})), this.glyphOffsetArray = new ra(), this.lineVertexArray = new na(), this.symbolInstances = new ea();
}, vl.prototype.calculateGlyphDependencies = function(t6, e6, r7, n8, i6) {
for (var a6 = 0; a6 < t6.length; a6++) {
if (e6[t6.charCodeAt(a6)] = true, (r7 || n8) && i6) {
var o6 = Xs[t6.charAt(a6)];
o6 && (e6[o6.charCodeAt(0)] = true);
}
}
}, vl.prototype.populate = function(t6, e6, r7) {
var n8 = this.layers[0], i6 = n8.layout, a6 = i6.get("text-font"), o6 = i6.get("text-field"), s7 = i6.get("icon-image"), u5 = ("constant" !== o6.value.kind || o6.value.value instanceof ne2 && !o6.value.value.isEmpty() || o6.value.value.toString().length > 0) && ("constant" !== a6.value.kind || a6.value.value.length > 0), l8 = "constant" !== s7.value.kind || !!s7.value.value || Object.keys(s7.parameters).length > 0, p5 = i6.get("symbol-sort-key");
if (this.features = [], u5 || l8) {
for (var c5 = e6.iconDependencies, h7 = e6.glyphDependencies, f5 = e6.availableImages, y5 = new si2(this.zoom), d5 = 0, m5 = t6; d5 < m5.length; d5 += 1) {
var v5 = m5[d5], g5 = v5.feature, x5 = v5.id, b5 = v5.index, w5 = v5.sourceLayerIndex, _4 = n8._featureFilter.needGeometry, A5 = Ua(g5, _4);
if (n8._featureFilter.filter(y5, A5, r7)) {
_4 || (A5.geometry = Ra(g5));
var S5 = void 0;
if (u5) {
var k5 = n8.getValueAndResolveTokens("text-field", A5, r7, f5), I5 = ne2.factory(k5);
yl(I5) && (this.hasRTLText = true), (!this.hasRTLText || "unavailable" === ii2() || this.hasRTLText && oi2.isParsed()) && (S5 = Zs(I5, n8, A5));
}
var z5 = void 0;
if (l8) {
var C5 = n8.getValueAndResolveTokens("icon-image", A5, r7, f5);
z5 = C5 instanceof ie4 ? C5 : ie4.fromString(C5);
}
if (S5 || z5) {
var E4 = this.sortFeaturesByKey ? p5.evaluate(A5, {}, r7) : void 0;
if (this.features.push({ id: x5, text: S5, icon: z5, index: b5, sourceLayerIndex: w5, geometry: A5.geometry, properties: g5.properties, type: pl[g5.type], sortKey: E4 }), z5 && (c5[z5.name] = true), S5) {
var P5 = a6.evaluate(A5, {}, r7).join(","), M5 = "map" === i6.get("text-rotation-alignment") && "point" !== i6.get("symbol-placement");
this.allowVerticalPlacement = this.writingModes && this.writingModes.indexOf(wu.vertical) >= 0;
for (var B4 = 0, T5 = S5.sections; B4 < T5.length; B4 += 1) {
var V4 = T5[B4];
if (V4.image) {
c5[V4.image.name] = true;
} else {
var F4 = Zn2(S5.toString()), D5 = V4.fontStack || P5, L5 = h7[D5] = h7[D5] || {};
this.calculateGlyphDependencies(V4.text, L5, M5, this.allowVerticalPlacement, F4);
}
}
}
}
}
}
"line" === i6.get("symbol-placement") && (this.features = function(t7) {
var e7 = {}, r8 = {}, n9 = [], i7 = 0;
function a7(e8) {
n9.push(t7[e8]), i7++;
}
function o7(t8, e8, i8) {
var a8 = r8[t8];
return delete r8[t8], r8[e8] = a8, n9[a8].geometry[0].pop(), n9[a8].geometry[0] = n9[a8].geometry[0].concat(i8[0]), a8;
}
function s8(t8, r9, i8) {
var a8 = e7[r9];
return delete e7[r9], e7[t8] = a8, n9[a8].geometry[0].shift(), n9[a8].geometry[0] = i8[0].concat(n9[a8].geometry[0]), a8;
}
function u6(t8, e8, r9) {
var n10 = r9 ? e8[0][e8[0].length - 1] : e8[0][0];
return t8 + ":" + n10.x + ":" + n10.y;
}
for (var l9 = 0; l9 < t7.length; l9++) {
var p6 = t7[l9], c6 = p6.geometry, h8 = p6.text ? p6.text.toString() : null;
if (h8) {
var f6 = u6(h8, c6), y6 = u6(h8, c6, true);
if (f6 in r8 && y6 in e7 && r8[f6] !== e7[y6]) {
var d6 = s8(f6, y6, c6), m6 = o7(f6, y6, n9[d6].geometry);
delete e7[f6], delete r8[y6], r8[u6(h8, n9[m6].geometry, true)] = m6, n9[d6].geometry = null;
} else {
f6 in r8 ? o7(f6, y6, c6) : y6 in e7 ? s8(f6, y6, c6) : (a7(l9), e7[f6] = i7 - 1, r8[y6] = i7 - 1);
}
} else {
a7(l9);
}
}
return n9.filter(function(t8) {
return t8.geometry;
});
}(this.features)), this.sortFeaturesByKey && this.features.sort(function(t7, e7) {
return t7.sortKey - e7.sortKey;
});
}
}, vl.prototype.update = function(t6, e6, r7) {
this.stateDependentLayers.length && (this.text.programConfigurations.updatePaintArrays(t6, e6, this.layers, r7), this.icon.programConfigurations.updatePaintArrays(t6, e6, this.layers, r7));
}, vl.prototype.isEmpty = function() {
return 0 === this.symbolInstances.length && !this.hasRTLText;
}, vl.prototype.uploadPending = function() {
return !this.uploaded || this.text.programConfigurations.needsUpload || this.icon.programConfigurations.needsUpload;
}, vl.prototype.upload = function(t6) {
!this.uploaded && this.hasDebugData() && (this.textCollisionBox.upload(t6), this.iconCollisionBox.upload(t6)), this.text.upload(t6, this.sortFeaturesByY, !this.uploaded, this.text.programConfigurations.needsUpload), this.icon.upload(t6, this.sortFeaturesByY, !this.uploaded, this.icon.programConfigurations.needsUpload), this.uploaded = true;
}, vl.prototype.destroyDebugData = function() {
this.textCollisionBox.destroy(), this.iconCollisionBox.destroy();
}, vl.prototype.destroy = function() {
this.text.destroy(), this.icon.destroy(), this.hasDebugData() && this.destroyDebugData();
}, vl.prototype.addToLineVertexArray = function(t6, e6) {
var r7 = this.lineVertexArray.length;
if (void 0 !== t6.segment) {
for (var n8 = t6.dist(e6[t6.segment + 1]), i6 = t6.dist(e6[t6.segment]), a6 = {}, o6 = t6.segment + 1; o6 < e6.length; o6++) {
a6[o6] = { x: e6[o6].x, y: e6[o6].y, tileUnitDistanceFromAnchor: n8 }, o6 < e6.length - 1 && (n8 += e6[o6 + 1].dist(e6[o6]));
}
for (var s7 = t6.segment || 0; s7 >= 0; s7--) {
a6[s7] = { x: e6[s7].x, y: e6[s7].y, tileUnitDistanceFromAnchor: i6 }, s7 > 0 && (i6 += e6[s7 - 1].dist(e6[s7]));
}
for (var u5 = 0; u5 < e6.length; u5++) {
var l8 = a6[u5];
this.lineVertexArray.emplaceBack(l8.x, l8.y, l8.tileUnitDistanceFromAnchor);
}
}
return { lineStartIndex: r7, lineLength: this.lineVertexArray.length - r7 };
}, vl.prototype.addSymbols = function(t6, e6, r7, n8, i6, a6, o6, s7, u5, l8, p5, c5) {
for (var h7 = t6.indexArray, f5 = t6.layoutVertexArray, y5 = t6.segments.prepareSegment(4 * e6.length, f5, h7, this.canOverlap ? a6.sortKey : void 0), d5 = this.glyphOffsetArray.length, m5 = y5.vertexLength, v5 = this.allowVerticalPlacement && o6 === wu.vertical ? Math.PI / 2 : 0, g5 = a6.text && a6.text.sections, x5 = 0; x5 < e6.length; x5++) {
var b5 = e6[x5], w5 = b5.tl, _4 = b5.tr, A5 = b5.bl, S5 = b5.br, k5 = b5.tex, I5 = b5.pixelOffsetTL, z5 = b5.pixelOffsetBR, C5 = b5.minFontScaleX, E4 = b5.minFontScaleY, P5 = b5.glyphOffset, M5 = b5.isSDF, B4 = b5.sectionIndex, T5 = y5.vertexLength, V4 = P5[1];
hl(f5, s7.x, s7.y, w5.x, V4 + w5.y, k5.x, k5.y, r7, M5, I5.x, I5.y, C5, E4), hl(f5, s7.x, s7.y, _4.x, V4 + _4.y, k5.x + k5.w, k5.y, r7, M5, z5.x, I5.y, C5, E4), hl(f5, s7.x, s7.y, A5.x, V4 + A5.y, k5.x, k5.y + k5.h, r7, M5, I5.x, z5.y, C5, E4), hl(f5, s7.x, s7.y, S5.x, V4 + S5.y, k5.x + k5.w, k5.y + k5.h, r7, M5, z5.x, z5.y, C5, E4), fl(t6.dynamicLayoutVertexArray, s7, v5), h7.emplaceBack(T5, T5 + 1, T5 + 2), h7.emplaceBack(T5 + 1, T5 + 2, T5 + 3), y5.vertexLength += 4, y5.primitiveLength += 2, this.glyphOffsetArray.emplaceBack(P5[0]), x5 !== e6.length - 1 && B4 === e6[x5 + 1].sectionIndex || t6.programConfigurations.populatePaintArrays(f5.length, a6, a6.index, {}, c5, g5 && g5[B4]);
}
t6.placedSymbolArray.emplaceBack(s7.x, s7.y, d5, this.glyphOffsetArray.length - d5, m5, u5, l8, s7.segment, r7 ? r7[0] : 0, r7 ? r7[1] : 0, n8[0], n8[1], o6, 0, false, 0, p5);
}, vl.prototype._addCollisionDebugVertex = function(t6, e6, r7, n8, i6, a6) {
return e6.emplaceBack(0, 0), t6.emplaceBack(r7.x, r7.y, n8, i6, Math.round(a6.x), Math.round(a6.y));
}, vl.prototype.addCollisionDebugVertices = function(t6, e6, r7, n8, a6, o6, s7) {
var u5 = a6.segments.prepareSegment(4, a6.layoutVertexArray, a6.indexArray), l8 = u5.vertexLength, p5 = a6.layoutVertexArray, c5 = a6.collisionVertexArray, h7 = s7.anchorX, f5 = s7.anchorY;
this._addCollisionDebugVertex(p5, c5, o6, h7, f5, new i5(t6, e6)), this._addCollisionDebugVertex(p5, c5, o6, h7, f5, new i5(r7, e6)), this._addCollisionDebugVertex(p5, c5, o6, h7, f5, new i5(r7, n8)), this._addCollisionDebugVertex(p5, c5, o6, h7, f5, new i5(t6, n8)), u5.vertexLength += 4;
var y5 = a6.indexArray;
y5.emplaceBack(l8, l8 + 1), y5.emplaceBack(l8 + 1, l8 + 2), y5.emplaceBack(l8 + 2, l8 + 3), y5.emplaceBack(l8 + 3, l8), u5.primitiveLength += 4;
}, vl.prototype.addDebugCollisionBoxes = function(t6, e6, r7, n8) {
for (var i6 = t6; i6 < e6; i6++) {
var a6 = this.collisionBoxArray.get(i6);
this.addCollisionDebugVertices(a6.x1, a6.y1, a6.x2, a6.y2, n8 ? this.textCollisionBox : this.iconCollisionBox, a6.anchorPoint, r7);
}
}, vl.prototype.generateCollisionDebugBuffers = function() {
this.hasDebugData() && this.destroyDebugData(), this.textCollisionBox = new ml(Oi2, Ks.members, Xi2), this.iconCollisionBox = new ml(Oi2, Ks.members, Xi2);
for (var t6 = 0; t6 < this.symbolInstances.length; t6++) {
var e6 = this.symbolInstances.get(t6);
this.addDebugCollisionBoxes(e6.textBoxStartIndex, e6.textBoxEndIndex, e6, true), this.addDebugCollisionBoxes(e6.verticalTextBoxStartIndex, e6.verticalTextBoxEndIndex, e6, true), this.addDebugCollisionBoxes(e6.iconBoxStartIndex, e6.iconBoxEndIndex, e6, false), this.addDebugCollisionBoxes(e6.verticalIconBoxStartIndex, e6.verticalIconBoxEndIndex, e6, false);
}
}, vl.prototype._deserializeCollisionBoxesForSymbol = function(t6, e6, r7, n8, i6, a6, o6, s7, u5) {
for (var l8 = {}, p5 = e6; p5 < r7; p5++) {
var c5 = t6.get(p5);
l8.textBox = { x1: c5.x1, y1: c5.y1, x2: c5.x2, y2: c5.y2, anchorPointX: c5.anchorPointX, anchorPointY: c5.anchorPointY }, l8.textFeatureIndex = c5.featureIndex;
break;
}
for (var h7 = n8; h7 < i6; h7++) {
var f5 = t6.get(h7);
l8.verticalTextBox = { x1: f5.x1, y1: f5.y1, x2: f5.x2, y2: f5.y2, anchorPointX: f5.anchorPointX, anchorPointY: f5.anchorPointY }, l8.verticalTextFeatureIndex = f5.featureIndex;
break;
}
for (var y5 = a6; y5 < o6; y5++) {
var d5 = t6.get(y5);
l8.iconBox = { x1: d5.x1, y1: d5.y1, x2: d5.x2, y2: d5.y2, anchorPointX: d5.anchorPointX, anchorPointY: d5.anchorPointY }, l8.iconFeatureIndex = d5.featureIndex;
break;
}
for (var m5 = s7; m5 < u5; m5++) {
var v5 = t6.get(m5);
l8.verticalIconBox = { x1: v5.x1, y1: v5.y1, x2: v5.x2, y2: v5.y2, anchorPointX: v5.anchorPointX, anchorPointY: v5.anchorPointY }, l8.verticalIconFeatureIndex = v5.featureIndex;
break;
}
return l8;
}, vl.prototype.deserializeCollisionBoxes = function(t6) {
this.collisionArrays = [];
for (var e6 = 0; e6 < this.symbolInstances.length; e6++) {
var r7 = this.symbolInstances.get(e6);
this.collisionArrays.push(this._deserializeCollisionBoxesForSymbol(t6, r7.textBoxStartIndex, r7.textBoxEndIndex, r7.verticalTextBoxStartIndex, r7.verticalTextBoxEndIndex, r7.iconBoxStartIndex, r7.iconBoxEndIndex, r7.verticalIconBoxStartIndex, r7.verticalIconBoxEndIndex));
}
}, vl.prototype.hasTextData = function() {
return this.text.segments.get().length > 0;
}, vl.prototype.hasIconData = function() {
return this.icon.segments.get().length > 0;
}, vl.prototype.hasDebugData = function() {
return this.textCollisionBox && this.iconCollisionBox;
}, vl.prototype.hasTextCollisionBoxData = function() {
return this.hasDebugData() && this.textCollisionBox.segments.get().length > 0;
}, vl.prototype.hasIconCollisionBoxData = function() {
return this.hasDebugData() && this.iconCollisionBox.segments.get().length > 0;
}, vl.prototype.addIndicesForPlacedSymbol = function(t6, e6) {
for (var r7 = t6.placedSymbolArray.get(e6), n8 = r7.vertexStartIndex + 4 * r7.numGlyphs, i6 = r7.vertexStartIndex; i6 < n8; i6 += 4) {
t6.indexArray.emplaceBack(i6, i6 + 1, i6 + 2), t6.indexArray.emplaceBack(i6 + 1, i6 + 2, i6 + 3);
}
}, vl.prototype.getSortedSymbolIndexes = function(t6) {
if (this.sortedAngle === t6 && void 0 !== this.symbolInstanceIndexes) {
return this.symbolInstanceIndexes;
}
for (var e6 = Math.sin(t6), r7 = Math.cos(t6), n8 = [], i6 = [], a6 = [], o6 = 0; o6 < this.symbolInstances.length; ++o6) {
a6.push(o6);
var s7 = this.symbolInstances.get(o6);
n8.push(0 | Math.round(e6 * s7.anchorX + r7 * s7.anchorY)), i6.push(s7.featureIndex);
}
return a6.sort(function(t7, e7) {
return n8[t7] - n8[e7] || i6[e7] - i6[t7];
}), a6;
}, vl.prototype.addToSortKeyRanges = function(t6, e6) {
var r7 = this.sortKeyRanges[this.sortKeyRanges.length - 1];
r7 && r7.sortKey === e6 ? r7.symbolInstanceEnd = t6 + 1 : this.sortKeyRanges.push({ sortKey: e6, symbolInstanceStart: t6, symbolInstanceEnd: t6 + 1 });
}, vl.prototype.sortFeatures = function(t6) {
var e6 = this;
if (this.sortFeaturesByY && this.sortedAngle !== t6 && !(this.text.segments.get().length > 1 || this.icon.segments.get().length > 1)) {
this.symbolInstanceIndexes = this.getSortedSymbolIndexes(t6), this.sortedAngle = t6, this.text.indexArray.clear(), this.icon.indexArray.clear(), this.featureSortOrder = [];
for (var r7 = 0, n8 = this.symbolInstanceIndexes; r7 < n8.length; r7 += 1) {
var i6 = this.symbolInstances.get(n8[r7]);
this.featureSortOrder.push(i6.featureIndex), [i6.rightJustifiedTextSymbolIndex, i6.centerJustifiedTextSymbolIndex, i6.leftJustifiedTextSymbolIndex].forEach(function(t7, r8, n9) {
t7 >= 0 && n9.indexOf(t7) === r8 && e6.addIndicesForPlacedSymbol(e6.text, t7);
}), i6.verticalPlacedTextSymbolIndex >= 0 && this.addIndicesForPlacedSymbol(this.text, i6.verticalPlacedTextSymbolIndex), i6.placedIconSymbolIndex >= 0 && this.addIndicesForPlacedSymbol(this.icon, i6.placedIconSymbolIndex), i6.verticalPlacedIconSymbolIndex >= 0 && this.addIndicesForPlacedSymbol(this.icon, i6.verticalPlacedIconSymbolIndex);
}
this.text.indexBuffer && this.text.indexBuffer.updateData(this.text.indexArray), this.icon.indexBuffer && this.icon.indexBuffer.updateData(this.icon.indexArray);
}
}, On2("SymbolBucket", vl, { omit: ["layers", "collisionBoxArray", "features", "compareText"] }), vl.MAX_GLYPHS = 65535, vl.addDynamicAttributes = fl;
var gl = new wi2({ "symbol-placement": new mi2(Et2.layout_symbol["symbol-placement"]), "symbol-spacing": new mi2(Et2.layout_symbol["symbol-spacing"]), "symbol-avoid-edges": new mi2(Et2.layout_symbol["symbol-avoid-edges"]), "symbol-sort-key": new vi2(Et2.layout_symbol["symbol-sort-key"]), "symbol-z-order": new mi2(Et2.layout_symbol["symbol-z-order"]), "icon-allow-overlap": new mi2(Et2.layout_symbol["icon-allow-overlap"]), "icon-ignore-placement": new mi2(Et2.layout_symbol["icon-ignore-placement"]), "icon-optional": new mi2(Et2.layout_symbol["icon-optional"]), "icon-rotation-alignment": new mi2(Et2.layout_symbol["icon-rotation-alignment"]), "icon-size": new vi2(Et2.layout_symbol["icon-size"]), "icon-text-fit": new mi2(Et2.layout_symbol["icon-text-fit"]), "icon-text-fit-padding": new mi2(Et2.layout_symbol["icon-text-fit-padding"]), "icon-image": new vi2(Et2.layout_symbol["icon-image"]), "icon-rotate": new vi2(Et2.layout_symbol["icon-rotate"]), "icon-padding": new mi2(Et2.layout_symbol["icon-padding"]), "icon-keep-upright": new mi2(Et2.layout_symbol["icon-keep-upright"]), "icon-offset": new vi2(Et2.layout_symbol["icon-offset"]), "icon-anchor": new vi2(Et2.layout_symbol["icon-anchor"]), "icon-pitch-alignment": new mi2(Et2.layout_symbol["icon-pitch-alignment"]), "text-pitch-alignment": new mi2(Et2.layout_symbol["text-pitch-alignment"]), "text-rotation-alignment": new mi2(Et2.layout_symbol["text-rotation-alignment"]), "text-field": new vi2(Et2.layout_symbol["text-field"]), "text-font": new vi2(Et2.layout_symbol["text-font"]), "text-size": new vi2(Et2.layout_symbol["text-size"]), "text-max-width": new vi2(Et2.layout_symbol["text-max-width"]), "text-line-height": new mi2(Et2.layout_symbol["text-line-height"]), "text-letter-spacing": new vi2(Et2.layout_symbol["text-letter-spacing"]), "text-justify": new vi2(Et2.layout_symbol["text-justify"]), "text-radial-offset": new vi2(Et2.layout_symbol["text-radial-offset"]), "text-variable-anchor": new mi2(Et2.layout_symbol["text-variable-anchor"]), "text-anchor": new vi2(Et2.layout_symbol["text-anchor"]), "text-max-angle": new mi2(Et2.layout_symbol["text-max-angle"]), "text-writing-mode": new mi2(Et2.layout_symbol["text-writing-mode"]), "text-rotate": new vi2(Et2.layout_symbol["text-rotate"]), "text-padding": new mi2(Et2.layout_symbol["text-padding"]), "text-keep-upright": new mi2(Et2.layout_symbol["text-keep-upright"]), "text-transform": new vi2(Et2.layout_symbol["text-transform"]), "text-offset": new vi2(Et2.layout_symbol["text-offset"]), "text-allow-overlap": new mi2(Et2.layout_symbol["text-allow-overlap"]), "text-ignore-placement": new mi2(Et2.layout_symbol["text-ignore-placement"]), "text-optional": new mi2(Et2.layout_symbol["text-optional"]) }), xl = { paint: new wi2({ "icon-opacity": new vi2(Et2.paint_symbol["icon-opacity"]), "icon-color": new vi2(Et2.paint_symbol["icon-color"]), "icon-halo-color": new vi2(Et2.paint_symbol["icon-halo-color"]), "icon-halo-width": new vi2(Et2.paint_symbol["icon-halo-width"]), "icon-halo-blur": new vi2(Et2.paint_symbol["icon-halo-blur"]), "icon-translate": new mi2(Et2.paint_symbol["icon-translate"]), "icon-translate-anchor": new mi2(Et2.paint_symbol["icon-translate-anchor"]), "text-opacity": new vi2(Et2.paint_symbol["text-opacity"]), "text-color": new vi2(Et2.paint_symbol["text-color"], { runtimeType: jt2, getOverride: function(t6) {
return t6.textColor;
}, hasOverride: function(t6) {
return !!t6.textColor;
} }), "text-halo-color": new vi2(Et2.paint_symbol["text-halo-color"]), "text-halo-width": new vi2(Et2.paint_symbol["text-halo-width"]), "text-halo-blur": new vi2(Et2.paint_symbol["text-halo-blur"]), "text-translate": new mi2(Et2.paint_symbol["text-translate"]), "text-translate-anchor": new mi2(Et2.paint_symbol["text-translate-anchor"]) }), layout: gl }, bl = function(t6) {
this.type = t6.property.overrides ? t6.property.overrides.runtimeType : Lt2, this.defaultValue = t6;
};
bl.prototype.evaluate = function(t6) {
if (t6.formattedSection) {
var e6 = this.defaultValue.property.overrides;
if (e6 && e6.hasOverride(t6.formattedSection)) {
return e6.getOverride(t6.formattedSection);
}
}
return t6.feature && t6.featureState ? this.defaultValue.evaluate(t6.feature, t6.featureState) : this.defaultValue.property.specification.default;
}, bl.prototype.eachChild = function(t6) {
this.defaultValue.isConstant() || t6(this.defaultValue.value._styleExpression.expression);
}, bl.prototype.outputDefined = function() {
return false;
}, bl.prototype.serialize = function() {
return null;
}, On2("FormatSectionOverride", bl, { omit: ["defaultValue"] });
var wl = function(t6) {
function e6(e7) {
t6.call(this, e7, xl);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.recalculate = function(e7, r7) {
if (t6.prototype.recalculate.call(this, e7, r7), "auto" === this.layout.get("icon-rotation-alignment") && (this.layout._values["icon-rotation-alignment"] = "point" !== this.layout.get("symbol-placement") ? "map" : "viewport"), "auto" === this.layout.get("text-rotation-alignment") && (this.layout._values["text-rotation-alignment"] = "point" !== this.layout.get("symbol-placement") ? "map" : "viewport"), "auto" === this.layout.get("text-pitch-alignment") && (this.layout._values["text-pitch-alignment"] = this.layout.get("text-rotation-alignment")), "auto" === this.layout.get("icon-pitch-alignment") && (this.layout._values["icon-pitch-alignment"] = this.layout.get("icon-rotation-alignment")), "point" === this.layout.get("symbol-placement")) {
var n8 = this.layout.get("text-writing-mode");
if (n8) {
for (var i6 = [], a6 = 0, o6 = n8; a6 < o6.length; a6 += 1) {
var s7 = o6[a6];
i6.indexOf(s7) < 0 && i6.push(s7);
}
this.layout._values["text-writing-mode"] = i6;
} else {
this.layout._values["text-writing-mode"] = ["horizontal"];
}
}
this._setPaintOverrides();
}, e6.prototype.getValueAndResolveTokens = function(t7, e7, r7, n8) {
var i6 = this.layout.get(t7).evaluate(e7, {}, r7, n8), a6 = this._unevaluatedLayout._values[t7];
return a6.isDataDriven() || Gr(a6.value) || !i6 ? i6 : function(t8, e8) {
return e8.replace(/{([^{}]+)}/g, function(e9, r8) {
return r8 in t8 ? String(t8[r8]) : "";
});
}(e7.properties, i6);
}, e6.prototype.createBucket = function(t7) {
return new vl(t7);
}, e6.prototype.queryRadius = function() {
return 0;
}, e6.prototype.queryIntersectsFeature = function() {
return false;
}, e6.prototype._setPaintOverrides = function() {
for (var t7 = 0, r7 = xl.paint.overridableProperties; t7 < r7.length; t7 += 1) {
var n8 = r7[t7];
if (e6.hasPaintOverride(this.layout, n8)) {
var i6, a6 = this.paint.get(n8), o6 = new bl(a6), s7 = new Kr(o6, a6.property.specification);
i6 = "constant" === a6.value.kind || "source" === a6.value.kind ? new Xr("source", s7) : new Jr("composite", s7, a6.value.zoomStops, a6.value._interpolationType), this.paint._values[n8] = new yi2(a6.property, i6, a6.parameters);
}
}
}, e6.prototype._handleOverridablePaintPropertyUpdate = function(t7, r7, n8) {
return !(!this.layout || r7.isDataDriven() || n8.isDataDriven()) && e6.hasPaintOverride(this.layout, t7);
}, e6.hasPaintOverride = function(t7, e7) {
var r7 = t7.get("text-field"), n8 = xl.paint.properties[e7], i6 = false, a6 = function(t8) {
for (var e8 = 0, r8 = t8; e8 < r8.length; e8 += 1) {
if (n8.overrides && n8.overrides.hasOverride(r8[e8])) {
return void (i6 = true);
}
}
};
if ("constant" === r7.value.kind && r7.value.value instanceof ne2) {
a6(r7.value.value.sections);
} else if ("source" === r7.value.kind) {
var o6 = function(t8) {
i6 || (t8 instanceof le2 && se2(t8.value) === Gt2 ? a6(t8.value.sections) : t8 instanceof fe2 ? a6(t8.sections) : t8.eachChild(o6));
}, s7 = r7.value;
s7._styleExpression && o6(s7._styleExpression.expression);
}
return i6;
}, e6;
}(_i2), _l = { paint: new wi2({ "background-color": new mi2(Et2.paint_background["background-color"]), "background-pattern": new xi2(Et2.paint_background["background-pattern"]), "background-opacity": new mi2(Et2.paint_background["background-opacity"]) }) }, Al = function(t6) {
function e6(e7) {
t6.call(this, e7, _l);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6;
}(_i2), Sl = { paint: new wi2({ "raster-opacity": new mi2(Et2.paint_raster["raster-opacity"]), "raster-hue-rotate": new mi2(Et2.paint_raster["raster-hue-rotate"]), "raster-brightness-min": new mi2(Et2.paint_raster["raster-brightness-min"]), "raster-brightness-max": new mi2(Et2.paint_raster["raster-brightness-max"]), "raster-saturation": new mi2(Et2.paint_raster["raster-saturation"]), "raster-contrast": new mi2(Et2.paint_raster["raster-contrast"]), "raster-resampling": new mi2(Et2.paint_raster["raster-resampling"]), "raster-fade-duration": new mi2(Et2.paint_raster["raster-fade-duration"]) }) }, kl = function(t6) {
function e6(e7) {
t6.call(this, e7, Sl);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6;
}(_i2), Il = function(t6) {
function e6(e7) {
t6.call(this, e7, {}), this.implementation = e7;
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.is3D = function() {
return "3d" === this.implementation.renderingMode;
}, e6.prototype.hasOffscreenPass = function() {
return void 0 !== this.implementation.prerender;
}, e6.prototype.recalculate = function() {
}, e6.prototype.updateTransitions = function() {
}, e6.prototype.hasTransition = function() {
}, e6.prototype.serialize = function() {
}, e6.prototype.onAdd = function(t7) {
this.implementation.onAdd && this.implementation.onAdd(t7, t7.painter.context.gl);
}, e6.prototype.onRemove = function(t7) {
this.implementation.onRemove && this.implementation.onRemove(t7, t7.painter.context.gl);
}, e6;
}(_i2), zl = { circle: co, heatmap: _o, hillshade: So, fill: ps, "fill-extrusion": zs, line: Rs, symbol: wl, background: Al, raster: kl }, Cl = o5.HTMLImageElement, El = o5.HTMLCanvasElement, Pl = o5.HTMLVideoElement, Ml = o5.ImageData, Bl = o5.ImageBitmap, Tl = function(t6, e6, r7, n8) {
this.context = t6, this.format = r7, this.texture = t6.gl.createTexture(), this.update(e6, n8);
};
Tl.prototype.update = function(t6, e6, r7) {
var n8 = t6.width, i6 = t6.height, a6 = !(this.size && this.size[0] === n8 && this.size[1] === i6 || r7), o6 = this.context, s7 = o6.gl;
if (this.useMipmap = Boolean(e6 && e6.useMipmap), s7.bindTexture(s7.TEXTURE_2D, this.texture), o6.pixelStoreUnpackFlipY.set(false), o6.pixelStoreUnpack.set(1), o6.pixelStoreUnpackPremultiplyAlpha.set(this.format === s7.RGBA && (!e6 || false !== e6.premultiply)), a6) {
this.size = [n8, i6], t6 instanceof Cl || t6 instanceof El || t6 instanceof Pl || t6 instanceof Ml || Bl && t6 instanceof Bl ? s7.texImage2D(s7.TEXTURE_2D, 0, this.format, this.format, s7.UNSIGNED_BYTE, t6) : s7.texImage2D(s7.TEXTURE_2D, 0, this.format, n8, i6, 0, this.format, s7.UNSIGNED_BYTE, t6.data);
} else {
var u5 = r7 || { x: 0, y: 0 }, l8 = u5.x, p5 = u5.y;
t6 instanceof Cl || t6 instanceof El || t6 instanceof Pl || t6 instanceof Ml || Bl && t6 instanceof Bl ? s7.texSubImage2D(s7.TEXTURE_2D, 0, l8, p5, s7.RGBA, s7.UNSIGNED_BYTE, t6) : s7.texSubImage2D(s7.TEXTURE_2D, 0, l8, p5, n8, i6, s7.RGBA, s7.UNSIGNED_BYTE, t6.data);
}
this.useMipmap && this.isSizePowerOfTwo() && s7.generateMipmap(s7.TEXTURE_2D);
}, Tl.prototype.bind = function(t6, e6, r7) {
var n8 = this.context.gl;
n8.bindTexture(n8.TEXTURE_2D, this.texture), r7 !== n8.LINEAR_MIPMAP_NEAREST || this.isSizePowerOfTwo() || (r7 = n8.LINEAR), t6 !== this.filter && (n8.texParameteri(n8.TEXTURE_2D, n8.TEXTURE_MAG_FILTER, t6), n8.texParameteri(n8.TEXTURE_2D, n8.TEXTURE_MIN_FILTER, r7 || t6), this.filter = t6), e6 !== this.wrap && (n8.texParameteri(n8.TEXTURE_2D, n8.TEXTURE_WRAP_S, e6), n8.texParameteri(n8.TEXTURE_2D, n8.TEXTURE_WRAP_T, e6), this.wrap = e6);
}, Tl.prototype.isSizePowerOfTwo = function() {
return this.size[0] === this.size[1] && Math.log(this.size[0]) / Math.LN2 % 1 == 0;
}, Tl.prototype.destroy = function() {
this.context.gl.deleteTexture(this.texture), this.texture = null;
};
var Vl = function(t6) {
var e6 = this;
this._callback = t6, this._triggered = false, "undefined" != typeof MessageChannel && (this._channel = new MessageChannel(), this._channel.port2.onmessage = function() {
e6._triggered = false, e6._callback();
});
};
Vl.prototype.trigger = function() {
var t6 = this;
this._triggered || (this._triggered = true, this._channel ? this._channel.port1.postMessage(true) : setTimeout(function() {
t6._triggered = false, t6._callback();
}, 0));
}, Vl.prototype.remove = function() {
delete this._channel, this._callback = function() {
};
};
var Fl = function(t6, e6, r7) {
this.target = t6, this.parent = e6, this.mapId = r7, this.callbacks = {}, this.tasks = {}, this.taskQueue = [], this.cancelCallbacks = {}, v4(["receive", "process"], this), this.invoker = new Vl(this.process), this.target.addEventListener("message", this.receive, false), this.globalScope = I4() ? t6 : o5;
};
function Dl(t6, e6, r7) {
var n8 = 2 * Math.PI * 6378137 / 256 / Math.pow(2, r7);
return [t6 * n8 - 2 * Math.PI * 6378137 / 2, e6 * n8 - 2 * Math.PI * 6378137 / 2];
}
Fl.prototype.send = function(t6, e6, r7, n8, i6) {
var a6 = this;
void 0 === i6 && (i6 = false);
var o6 = Math.round(1e18 * Math.random()).toString(36).substring(0, 10);
r7 && (this.callbacks[o6] = r7);
var s7 = E3(this.globalScope) ? void 0 : [];
return this.target.postMessage({ id: o6, type: t6, hasCallback: !!r7, targetMapId: n8, mustQueue: i6, sourceMapId: this.mapId, data: qn2(e6, s7) }, s7), { cancel: function() {
r7 && delete a6.callbacks[o6], a6.target.postMessage({ id: o6, type: "", targetMapId: n8, sourceMapId: a6.mapId });
} };
}, Fl.prototype.receive = function(t6) {
var e6 = t6.data, r7 = e6.id;
if (r7 && (!e6.targetMapId || this.mapId === e6.targetMapId)) {
if ("" === e6.type) {
delete this.tasks[r7];
var n8 = this.cancelCallbacks[r7];
delete this.cancelCallbacks[r7], n8 && n8();
} else {
I4() || e6.mustQueue ? (this.tasks[r7] = e6, this.taskQueue.push(r7), this.invoker.trigger()) : this.processTask(r7, e6);
}
}
}, Fl.prototype.process = function() {
if (this.taskQueue.length) {
var t6 = this.taskQueue.shift(), e6 = this.tasks[t6];
delete this.tasks[t6], this.taskQueue.length && this.invoker.trigger(), e6 && this.processTask(t6, e6);
}
}, Fl.prototype.processTask = function(t6, e6) {
var r7 = this;
if ("" === e6.type) {
var n8 = this.callbacks[t6];
delete this.callbacks[t6], n8 && (e6.error ? n8(Nn2(e6.error)) : n8(null, Nn2(e6.data)));
} else {
var i6 = false, a6 = E3(this.globalScope) ? void 0 : [], o6 = e6.hasCallback ? function(e7, n9) {
i6 = true, delete r7.cancelCallbacks[t6], r7.target.postMessage({ id: t6, type: "", sourceMapId: r7.mapId, error: e7 ? qn2(e7) : null, data: qn2(n9, a6) }, a6);
} : function(t7) {
i6 = true;
}, s7 = null, u5 = Nn2(e6.data);
if (this.parent[e6.type]) {
s7 = this.parent[e6.type](e6.sourceMapId, u5, o6);
} else if (this.parent.getWorkerSource) {
var l8 = e6.type.split(".");
s7 = this.parent.getWorkerSource(e6.sourceMapId, l8[0], u5.source)[l8[1]](u5, o6);
} else {
o6(new Error("Could not find function " + e6.type));
}
!i6 && s7 && s7.cancel && (this.cancelCallbacks[t6] = s7.cancel);
}
}, Fl.prototype.remove = function() {
this.invoker.remove(), this.target.removeEventListener("message", this.receive, false);
};
var Ll = function(t6, e6) {
t6 && (e6 ? this.setSouthWest(t6).setNorthEast(e6) : 4 === t6.length ? this.setSouthWest([t6[0], t6[1]]).setNorthEast([t6[2], t6[3]]) : this.setSouthWest(t6[0]).setNorthEast(t6[1]));
};
Ll.prototype.setNorthEast = function(t6) {
return this._ne = t6 instanceof Ol ? new Ol(t6.lng, t6.lat) : Ol.convert(t6), this;
}, Ll.prototype.setSouthWest = function(t6) {
return this._sw = t6 instanceof Ol ? new Ol(t6.lng, t6.lat) : Ol.convert(t6), this;
}, Ll.prototype.extend = function(t6) {
var e6, r7, n8 = this._sw, i6 = this._ne;
if (t6 instanceof Ol) {
e6 = t6, r7 = t6;
} else {
if (!(t6 instanceof Ll)) {
return Array.isArray(t6) ? 4 === t6.length || t6.every(Array.isArray) ? this.extend(Ll.convert(t6)) : this.extend(Ol.convert(t6)) : this;
}
if (r7 = t6._ne, !(e6 = t6._sw) || !r7) {
return this;
}
}
return n8 || i6 ? (n8.lng = Math.min(e6.lng, n8.lng), n8.lat = Math.min(e6.lat, n8.lat), i6.lng = Math.max(r7.lng, i6.lng), i6.lat = Math.max(r7.lat, i6.lat)) : (this._sw = new Ol(e6.lng, e6.lat), this._ne = new Ol(r7.lng, r7.lat)), this;
}, Ll.prototype.getCenter = function() {
return new Ol((this._sw.lng + this._ne.lng) / 2, (this._sw.lat + this._ne.lat) / 2);
}, Ll.prototype.getSouthWest = function() {
return this._sw;
}, Ll.prototype.getNorthEast = function() {
return this._ne;
}, Ll.prototype.getNorthWest = function() {
return new Ol(this.getWest(), this.getNorth());
}, Ll.prototype.getSouthEast = function() {
return new Ol(this.getEast(), this.getSouth());
}, Ll.prototype.getWest = function() {
return this._sw.lng;
}, Ll.prototype.getSouth = function() {
return this._sw.lat;
}, Ll.prototype.getEast = function() {
return this._ne.lng;
}, Ll.prototype.getNorth = function() {
return this._ne.lat;
}, Ll.prototype.toArray = function() {
return [this._sw.toArray(), this._ne.toArray()];
}, Ll.prototype.toString = function() {
return "LngLatBounds(" + this._sw.toString() + ", " + this._ne.toString() + ")";
}, Ll.prototype.isEmpty = function() {
return !(this._sw && this._ne);
}, Ll.prototype.contains = function(t6) {
var e6 = Ol.convert(t6), r7 = e6.lng, n8 = e6.lat, i6 = this._sw.lng <= r7 && r7 <= this._ne.lng;
return this._sw.lng > this._ne.lng && (i6 = this._sw.lng >= r7 && r7 >= this._ne.lng), this._sw.lat <= n8 && n8 <= this._ne.lat && i6;
}, Ll.convert = function(t6) {
return !t6 || t6 instanceof Ll ? t6 : new Ll(t6);
};
var Ol = function(t6, e6) {
if (isNaN(t6) || isNaN(e6)) {
throw new Error("Invalid LngLat object: (" + t6 + ", " + e6 + ")");
}
if (this.lng = +t6, this.lat = +e6, this.lat > 90 || this.lat < -90) {
throw new Error("Invalid LngLat latitude value: must be between -90 and 90");
}
};
Ol.prototype.wrap = function() {
return new Ol(c4(this.lng, -180, 180), this.lat);
}, Ol.prototype.toArray = function() {
return [this.lng, this.lat];
}, Ol.prototype.toString = function() {
return "LngLat(" + this.lng + ", " + this.lat + ")";
}, Ol.prototype.distanceTo = function(t6) {
var e6 = Math.PI / 180, r7 = this.lat * e6, n8 = t6.lat * e6, i6 = Math.sin(r7) * Math.sin(n8) + Math.cos(r7) * Math.cos(n8) * Math.cos((t6.lng - this.lng) * e6);
return 63710088e-1 * Math.acos(Math.min(i6, 1));
}, Ol.prototype.toBounds = function(t6) {
void 0 === t6 && (t6 = 0);
var e6 = 360 * t6 / 40075017, r7 = e6 / Math.cos(Math.PI / 180 * this.lat);
return new Ll(new Ol(this.lng - r7, this.lat - e6), new Ol(this.lng + r7, this.lat + e6));
}, Ol.convert = function(t6) {
if (t6 instanceof Ol) {
return t6;
}
if (Array.isArray(t6) && (2 === t6.length || 3 === t6.length)) {
return new Ol(Number(t6[0]), Number(t6[1]));
}
if (!Array.isArray(t6) && "object" == typeof t6 && null !== t6) {
return new Ol(Number("lng" in t6 ? t6.lng : t6.lon), Number(t6.lat));
}
throw new Error("`LngLatLike` argument must be specified as a LngLat instance, an object {lng: , lat: }, an object {lon: , lat: }, or an array of [, ]");
};
var Rl = 2 * Math.PI * 63710088e-1;
function Ul(t6) {
return Rl * Math.cos(t6 * Math.PI / 180);
}
function jl(t6) {
return (180 + t6) / 360;
}
function ql(t6) {
return (180 - 180 / Math.PI * Math.log(Math.tan(Math.PI / 4 + t6 * Math.PI / 360))) / 360;
}
function Nl2(t6, e6) {
return t6 / Ul(e6);
}
function Kl(t6) {
return 360 / Math.PI * Math.atan(Math.exp((180 - 360 * t6) * Math.PI / 180)) - 90;
}
var Gl = function(t6, e6, r7) {
void 0 === r7 && (r7 = 0), this.x = +t6, this.y = +e6, this.z = +r7;
};
Gl.fromLngLat = function(t6, e6) {
void 0 === e6 && (e6 = 0);
var r7 = Ol.convert(t6);
return new Gl(jl(r7.lng), ql(r7.lat), Nl2(e6, r7.lat));
}, Gl.prototype.toLngLat = function() {
return new Ol(360 * this.x - 180, Kl(this.y));
}, Gl.prototype.toAltitude = function() {
return this.z * Ul(Kl(this.y));
}, Gl.prototype.meterInMercatorCoordinateUnits = function() {
return 1 / Rl * (t6 = Kl(this.y), 1 / Math.cos(t6 * Math.PI / 180));
var t6;
};
var Zl = function(t6, e6, r7) {
this.z = t6, this.x = e6, this.y = r7, this.key = Hl(0, t6, t6, e6, r7);
};
Zl.prototype.equals = function(t6) {
return this.z === t6.z && this.x === t6.x && this.y === t6.y;
}, Zl.prototype.url = function(t6, e6) {
var r7, n8, i6, a6, o6, s7 = (n8 = this.y, i6 = this.z, a6 = Dl(256 * (r7 = this.x), 256 * (n8 = Math.pow(2, i6) - n8 - 1), i6), o6 = Dl(256 * (r7 + 1), 256 * (n8 + 1), i6), a6[0] + "," + a6[1] + "," + o6[0] + "," + o6[1]), u5 = function(t7, e7, r8) {
for (var n9, i7 = "", a7 = t7; a7 > 0; a7--) {
i7 += (e7 & (n9 = 1 << a7 - 1) ? 1 : 0) + (r8 & n9 ? 2 : 0);
}
return i7;
}(this.z, this.x, this.y);
return t6[(this.x + this.y) % t6.length].replace("{prefix}", (this.x % 16).toString(16) + (this.y % 16).toString(16)).replace("{z}", String(this.z)).replace("{x}", String(this.x)).replace("{y}", String("tms" === e6 ? Math.pow(2, this.z) - this.y - 1 : this.y)).replace("{quadkey}", u5).replace("{bbox-epsg-3857}", s7);
}, Zl.prototype.getTilePoint = function(t6) {
var e6 = Math.pow(2, this.z);
return new i5(8192 * (t6.x * e6 - this.x), 8192 * (t6.y * e6 - this.y));
}, Zl.prototype.toString = function() {
return this.z + "/" + this.x + "/" + this.y;
};
var Xl = function(t6, e6) {
this.wrap = t6, this.canonical = e6, this.key = Hl(t6, e6.z, e6.z, e6.x, e6.y);
}, Jl = function(t6, e6, r7, n8, i6) {
this.overscaledZ = t6, this.wrap = e6, this.canonical = new Zl(r7, +n8, +i6), this.key = Hl(e6, t6, r7, n8, i6);
};
function Hl(t6, e6, r7, n8, i6) {
(t6 *= 2) < 0 && (t6 = -1 * t6 - 1);
var a6 = 1 << r7;
return (a6 * a6 * t6 + a6 * i6 + n8).toString(36) + r7.toString(36) + e6.toString(36);
}
Jl.prototype.equals = function(t6) {
return this.overscaledZ === t6.overscaledZ && this.wrap === t6.wrap && this.canonical.equals(t6.canonical);
}, Jl.prototype.scaledTo = function(t6) {
var e6 = this.canonical.z - t6;
return t6 > this.canonical.z ? new Jl(t6, this.wrap, this.canonical.z, this.canonical.x, this.canonical.y) : new Jl(t6, this.wrap, t6, this.canonical.x >> e6, this.canonical.y >> e6);
}, Jl.prototype.calculateScaledKey = function(t6, e6) {
var r7 = this.canonical.z - t6;
return t6 > this.canonical.z ? Hl(this.wrap * +e6, t6, this.canonical.z, this.canonical.x, this.canonical.y) : Hl(this.wrap * +e6, t6, t6, this.canonical.x >> r7, this.canonical.y >> r7);
}, Jl.prototype.isChildOf = function(t6) {
if (t6.wrap !== this.wrap) {
return false;
}
var e6 = this.canonical.z - t6.canonical.z;
return 0 === t6.overscaledZ || t6.overscaledZ < this.overscaledZ && t6.canonical.x === this.canonical.x >> e6 && t6.canonical.y === this.canonical.y >> e6;
}, Jl.prototype.children = function(t6) {
if (this.overscaledZ >= t6) {
return [new Jl(this.overscaledZ + 1, this.wrap, this.canonical.z, this.canonical.x, this.canonical.y)];
}
var e6 = this.canonical.z + 1, r7 = 2 * this.canonical.x, n8 = 2 * this.canonical.y;
return [new Jl(e6, this.wrap, e6, r7, n8), new Jl(e6, this.wrap, e6, r7 + 1, n8), new Jl(e6, this.wrap, e6, r7, n8 + 1), new Jl(e6, this.wrap, e6, r7 + 1, n8 + 1)];
}, Jl.prototype.isLessThan = function(t6) {
return this.wrap < t6.wrap || !(this.wrap > t6.wrap) && (this.overscaledZ < t6.overscaledZ || !(this.overscaledZ > t6.overscaledZ) && (this.canonical.x < t6.canonical.x || !(this.canonical.x > t6.canonical.x) && this.canonical.y < t6.canonical.y));
}, Jl.prototype.wrapped = function() {
return new Jl(this.overscaledZ, 0, this.canonical.z, this.canonical.x, this.canonical.y);
}, Jl.prototype.unwrapTo = function(t6) {
return new Jl(this.overscaledZ, t6, this.canonical.z, this.canonical.x, this.canonical.y);
}, Jl.prototype.overscaleFactor = function() {
return Math.pow(2, this.overscaledZ - this.canonical.z);
}, Jl.prototype.toUnwrapped = function() {
return new Xl(this.wrap, this.canonical);
}, Jl.prototype.toString = function() {
return this.overscaledZ + "/" + this.canonical.x + "/" + this.canonical.y;
}, Jl.prototype.getTilePoint = function(t6) {
return this.canonical.getTilePoint(new Gl(t6.x - this.wrap, t6.y));
}, On2("CanonicalTileID", Zl), On2("OverscaledTileID", Jl, { omit: ["posMatrix"] });
var Yl = function(t6, e6, r7) {
if (this.uid = t6, e6.height !== e6.width) {
throw new RangeError("DEM tiles must be square");
}
if (r7 && "mapbox" !== r7 && "terrarium" !== r7) {
return A4('"' + r7 + '" is not a valid encoding type. Valid types include "mapbox" and "terrarium".');
}
this.stride = e6.height;
var n8 = this.dim = e6.height - 2;
this.data = new Uint32Array(e6.data.buffer), this.encoding = r7 || "mapbox";
for (var i6 = 0; i6 < n8; i6++) {
this.data[this._idx(-1, i6)] = this.data[this._idx(0, i6)], this.data[this._idx(n8, i6)] = this.data[this._idx(n8 - 1, i6)], this.data[this._idx(i6, -1)] = this.data[this._idx(i6, 0)], this.data[this._idx(i6, n8)] = this.data[this._idx(i6, n8 - 1)];
}
this.data[this._idx(-1, -1)] = this.data[this._idx(0, 0)], this.data[this._idx(n8, -1)] = this.data[this._idx(n8 - 1, 0)], this.data[this._idx(-1, n8)] = this.data[this._idx(0, n8 - 1)], this.data[this._idx(n8, n8)] = this.data[this._idx(n8 - 1, n8 - 1)];
};
Yl.prototype.get = function(t6, e6) {
var r7 = new Uint8Array(this.data.buffer), n8 = 4 * this._idx(t6, e6);
return ("terrarium" === this.encoding ? this._unpackTerrarium : this._unpackMapbox)(r7[n8], r7[n8 + 1], r7[n8 + 2]);
}, Yl.prototype.getUnpackVector = function() {
return "terrarium" === this.encoding ? [256, 1, 1 / 256, 32768] : [6553.6, 25.6, 0.1, 1e4];
}, Yl.prototype._idx = function(t6, e6) {
if (t6 < -1 || t6 >= this.dim + 1 || e6 < -1 || e6 >= this.dim + 1) {
throw new RangeError("out of range source coordinates for DEM data");
}
return (e6 + 1) * this.stride + (t6 + 1);
}, Yl.prototype._unpackMapbox = function(t6, e6, r7) {
return (256 * t6 * 256 + 256 * e6 + r7) / 10 - 1e4;
}, Yl.prototype._unpackTerrarium = function(t6, e6, r7) {
return 256 * t6 + e6 + r7 / 256 - 32768;
}, Yl.prototype.getPixels = function() {
return new xo({ width: this.stride, height: this.stride }, new Uint8Array(this.data.buffer));
}, Yl.prototype.backfillBorder = function(t6, e6, r7) {
if (this.dim !== t6.dim) {
throw new Error("dem dimension mismatch");
}
var n8 = e6 * this.dim, i6 = e6 * this.dim + this.dim, a6 = r7 * this.dim, o6 = r7 * this.dim + this.dim;
switch (e6) {
case -1:
n8 = i6 - 1;
break;
case 1:
i6 = n8 + 1;
}
switch (r7) {
case -1:
a6 = o6 - 1;
break;
case 1:
o6 = a6 + 1;
}
for (var s7 = -e6 * this.dim, u5 = -r7 * this.dim, l8 = a6; l8 < o6; l8++) {
for (var p5 = n8; p5 < i6; p5++) {
this.data[this._idx(p5, l8)] = t6.data[this._idx(p5 + s7, l8 + u5)];
}
}
}, On2("DEMData", Yl);
var $l = function(t6) {
this._stringToNumber = {}, this._numberToString = [];
for (var e6 = 0; e6 < t6.length; e6++) {
var r7 = t6[e6];
this._stringToNumber[r7] = e6, this._numberToString[e6] = r7;
}
};
$l.prototype.encode = function(t6) {
return this._stringToNumber[t6];
}, $l.prototype.decode = function(t6) {
return this._numberToString[t6];
};
var Wl = function(t6, e6, r7, n8, i6) {
this.type = "Feature", this._vectorTileFeature = t6, t6._z = e6, t6._x = r7, t6._y = n8, this.properties = t6.properties, this.id = i6;
}, Ql = { geometry: { configurable: true } };
Ql.geometry.get = function() {
return void 0 === this._geometry && (this._geometry = this._vectorTileFeature.toGeoJSON(this._vectorTileFeature._x, this._vectorTileFeature._y, this._vectorTileFeature._z).geometry), this._geometry;
}, Ql.geometry.set = function(t6) {
this._geometry = t6;
}, Wl.prototype.toJSON = function() {
var t6 = { geometry: this.geometry };
for (var e6 in this) {
"_geometry" !== e6 && "_vectorTileFeature" !== e6 && (t6[e6] = this[e6]);
}
return t6;
}, Object.defineProperties(Wl.prototype, Ql);
var tp = function() {
this.state = {}, this.stateChanges = {}, this.deletedStates = {};
};
tp.prototype.updateState = function(t6, e6, r7) {
var n8 = String(e6);
if (this.stateChanges[t6] = this.stateChanges[t6] || {}, this.stateChanges[t6][n8] = this.stateChanges[t6][n8] || {}, h6(this.stateChanges[t6][n8], r7), null === this.deletedStates[t6]) {
for (var i6 in this.deletedStates[t6] = {}, this.state[t6]) {
i6 !== n8 && (this.deletedStates[t6][i6] = null);
}
} else if (this.deletedStates[t6] && null === this.deletedStates[t6][n8]) {
for (var a6 in this.deletedStates[t6][n8] = {}, this.state[t6][n8]) {
r7[a6] || (this.deletedStates[t6][n8][a6] = null);
}
} else {
for (var o6 in r7) {
this.deletedStates[t6] && this.deletedStates[t6][n8] && null === this.deletedStates[t6][n8][o6] && delete this.deletedStates[t6][n8][o6];
}
}
}, tp.prototype.removeFeatureState = function(t6, e6, r7) {
if (null !== this.deletedStates[t6]) {
var n8 = String(e6);
if (this.deletedStates[t6] = this.deletedStates[t6] || {}, r7 && void 0 !== e6) {
null !== this.deletedStates[t6][n8] && (this.deletedStates[t6][n8] = this.deletedStates[t6][n8] || {}, this.deletedStates[t6][n8][r7] = null);
} else if (void 0 !== e6) {
if (this.stateChanges[t6] && this.stateChanges[t6][n8]) {
for (r7 in this.deletedStates[t6][n8] = {}, this.stateChanges[t6][n8]) {
this.deletedStates[t6][n8][r7] = null;
}
} else {
this.deletedStates[t6][n8] = null;
}
} else {
this.deletedStates[t6] = null;
}
}
}, tp.prototype.getState = function(t6, e6) {
var r7 = String(e6), n8 = h6({}, (this.state[t6] || {})[r7], (this.stateChanges[t6] || {})[r7]);
if (null === this.deletedStates[t6]) {
return {};
}
if (this.deletedStates[t6]) {
var i6 = this.deletedStates[t6][e6];
if (null === i6) {
return {};
}
for (var a6 in i6) {
delete n8[a6];
}
}
return n8;
}, tp.prototype.initializeTileState = function(t6, e6) {
t6.setFeatureState(this.state, e6);
}, tp.prototype.coalesceChanges = function(t6, e6) {
var r7 = {};
for (var n8 in this.stateChanges) {
this.state[n8] = this.state[n8] || {};
var i6 = {};
for (var a6 in this.stateChanges[n8]) {
this.state[n8][a6] || (this.state[n8][a6] = {}), h6(this.state[n8][a6], this.stateChanges[n8][a6]), i6[a6] = this.state[n8][a6];
}
r7[n8] = i6;
}
for (var o6 in this.deletedStates) {
this.state[o6] = this.state[o6] || {};
var s7 = {};
if (null === this.deletedStates[o6]) {
for (var u5 in this.state[o6]) {
s7[u5] = {}, this.state[o6][u5] = {};
}
} else {
for (var l8 in this.deletedStates[o6]) {
if (null === this.deletedStates[o6][l8]) {
this.state[o6][l8] = {};
} else {
for (var p5 = 0, c5 = Object.keys(this.deletedStates[o6][l8]); p5 < c5.length; p5 += 1) {
delete this.state[o6][l8][c5[p5]];
}
}
s7[l8] = this.state[o6][l8];
}
}
r7[o6] = r7[o6] || {}, h6(r7[o6], s7);
}
if (this.stateChanges = {}, this.deletedStates = {}, 0 !== Object.keys(r7).length) {
for (var f5 in t6) {
t6[f5].setFeatureState(r7, e6);
}
}
};
var ep = function(t6, e6) {
this.tileID = t6, this.x = t6.canonical.x, this.y = t6.canonical.y, this.z = t6.canonical.z, this.grid = new Tn2(8192, 16, 0), this.grid3D = new Tn2(8192, 16, 0), this.featureIndexArray = new aa(), this.promoteId = e6;
};
function rp(t6, e6, r7, n8, i6) {
return x4(t6, function(t7, a6) {
var o6 = e6 instanceof di2 ? e6.get(a6) : null;
return o6 && o6.evaluate ? o6.evaluate(r7, n8, i6) : o6;
});
}
function np(t6) {
for (var e6 = 1 / 0, r7 = 1 / 0, n8 = -1 / 0, i6 = -1 / 0, a6 = 0, o6 = t6; a6 < o6.length; a6 += 1) {
var s7 = o6[a6];
e6 = Math.min(e6, s7.x), r7 = Math.min(r7, s7.y), n8 = Math.max(n8, s7.x), i6 = Math.max(i6, s7.y);
}
return { minX: e6, minY: r7, maxX: n8, maxY: i6 };
}
function ip(t6, e6) {
return e6 - t6;
}
ep.prototype.insert = function(t6, e6, r7, n8, i6, a6) {
var o6 = this.featureIndexArray.length;
this.featureIndexArray.emplaceBack(r7, n8, i6);
for (var s7 = a6 ? this.grid3D : this.grid, u5 = 0; u5 < e6.length; u5++) {
for (var l8 = e6[u5], p5 = [1 / 0, 1 / 0, -1 / 0, -1 / 0], c5 = 0; c5 < l8.length; c5++) {
var h7 = l8[c5];
p5[0] = Math.min(p5[0], h7.x), p5[1] = Math.min(p5[1], h7.y), p5[2] = Math.max(p5[2], h7.x), p5[3] = Math.max(p5[3], h7.y);
}
p5[0] < 8192 && p5[1] < 8192 && p5[2] >= 0 && p5[3] >= 0 && s7.insert(o6, p5[0], p5[1], p5[2], p5[3]);
}
}, ep.prototype.loadVTLayers = function() {
return this.vtLayers || (this.vtLayers = new bs.VectorTile(new Ys(this.rawTileData)).layers, this.sourceLayerCoder = new $l(this.vtLayers ? Object.keys(this.vtLayers).sort() : ["_geojsonTileLayer"])), this.vtLayers;
}, ep.prototype.query = function(t6, e6, r7, n8) {
var a6 = this;
this.loadVTLayers();
for (var o6 = t6.params || {}, s7 = 8192 / t6.tileSize / t6.scale, u5 = on3(o6.filter), l8 = t6.queryGeometry, p5 = t6.queryPadding * s7, c5 = np(l8), h7 = this.grid.query(c5.minX - p5, c5.minY - p5, c5.maxX + p5, c5.maxY + p5), f5 = np(t6.cameraQueryGeometry), y5 = this.grid3D.query(f5.minX - p5, f5.minY - p5, f5.maxX + p5, f5.maxY + p5, function(e7, r8, n9, a7) {
return function(t7, e8, r9, n10, a8) {
for (var o7 = 0, s8 = t7; o7 < s8.length; o7 += 1) {
var u6 = s8[o7];
if (e8 <= u6.x && r9 <= u6.y && n10 >= u6.x && a8 >= u6.y) {
return true;
}
}
var l9 = [new i5(e8, r9), new i5(e8, a8), new i5(n10, a8), new i5(n10, r9)];
if (t7.length > 2) {
for (var p6 = 0, c6 = l9; p6 < c6.length; p6 += 1) {
if (Wa(t7, c6[p6])) {
return true;
}
}
}
for (var h8 = 0; h8 < t7.length - 1; h8++) {
if (Qa(t7[h8], t7[h8 + 1], l9)) {
return true;
}
}
return false;
}(t6.cameraQueryGeometry, e7 - p5, r8 - p5, n9 + p5, a7 + p5);
}), d5 = 0, m5 = y5; d5 < m5.length; d5 += 1) {
h7.push(m5[d5]);
}
h7.sort(ip);
for (var v5, g5 = {}, x5 = function(i6) {
var p6 = h7[i6];
if (p6 !== v5) {
v5 = p6;
var c6 = a6.featureIndexArray.get(p6), f6 = null;
a6.loadMatchingFeature(g5, c6.bucketIndex, c6.sourceLayerIndex, c6.featureIndex, u5, o6.layers, o6.availableImages, e6, r7, n8, function(e7, r8, n9) {
return f6 || (f6 = Ra(e7)), r8.queryIntersectsFeature(l8, e7, n9, f6, a6.z, t6.transform, s7, t6.pixelPosMatrix);
});
}
}, b5 = 0; b5 < h7.length; b5++) {
x5(b5);
}
return g5;
}, ep.prototype.loadMatchingFeature = function(t6, e6, r7, n8, i6, a6, o6, s7, u5, l8, p5) {
var c5 = this.bucketLayerIDs[e6];
if (!a6 || function(t7, e7) {
for (var r8 = 0; r8 < t7.length; r8++) {
if (e7.indexOf(t7[r8]) >= 0) {
return true;
}
}
return false;
}(a6, c5)) {
var f5 = this.sourceLayerCoder.decode(r7), y5 = this.vtLayers[f5].feature(n8);
if (i6.needGeometry) {
var d5 = Ua(y5, true);
if (!i6.filter(new si2(this.tileID.overscaledZ), d5, this.tileID.canonical)) {
return;
}
} else if (!i6.filter(new si2(this.tileID.overscaledZ), y5)) {
return;
}
for (var m5 = this.getId(y5, f5), v5 = 0; v5 < c5.length; v5++) {
var g5 = c5[v5];
if (!(a6 && a6.indexOf(g5) < 0)) {
var x5 = s7[g5];
if (x5) {
var b5 = {};
void 0 !== m5 && l8 && (b5 = l8.getState(x5.sourceLayer || "_geojsonTileLayer", m5));
var w5 = h6({}, u5[g5]);
w5.paint = rp(w5.paint, x5.paint, y5, b5, o6), w5.layout = rp(w5.layout, x5.layout, y5, b5, o6);
var _4 = !p5 || p5(y5, x5, b5);
if (_4) {
var A5 = new Wl(y5, this.z, this.x, this.y, m5);
A5.layer = w5;
var S5 = t6[g5];
void 0 === S5 && (S5 = t6[g5] = []), S5.push({ featureIndex: n8, feature: A5, intersectionZ: _4 });
}
}
}
}
}
}, ep.prototype.lookupSymbolFeatures = function(t6, e6, r7, n8, i6, a6, o6, s7) {
var u5 = {};
this.loadVTLayers();
for (var l8 = on3(i6), p5 = 0, c5 = t6; p5 < c5.length; p5 += 1) {
this.loadMatchingFeature(u5, r7, n8, c5[p5], l8, a6, o6, s7, e6);
}
return u5;
}, ep.prototype.hasLayer = function(t6) {
for (var e6 = 0, r7 = this.bucketLayerIDs; e6 < r7.length; e6 += 1) {
for (var n8 = 0, i6 = r7[e6]; n8 < i6.length; n8 += 1) {
if (t6 === i6[n8]) {
return true;
}
}
}
return false;
}, ep.prototype.getId = function(t6, e6) {
var r7 = t6.id;
return this.promoteId && "boolean" == typeof (r7 = t6.properties["string" == typeof this.promoteId ? this.promoteId : this.promoteId[e6]]) && (r7 = Number(r7)), r7;
}, On2("FeatureIndex", ep, { omit: ["rawTileData", "sourceLayerCoder"] });
var ap = function(t6, e6) {
this.tileID = t6, this.uid = y4(), this.uses = 0, this.tileSize = e6, this.buckets = {}, this.expirationTime = null, this.queryPadding = 0, this.hasSymbolBuckets = false, this.hasRTLText = false, this.dependencies = {}, this.expiredRequestCount = 0, this.state = "loading";
};
ap.prototype.registerFadeDuration = function(t6) {
var e6 = t6 + this.timeAdded;
e6 < O4.now() || this.fadeEndTime && e6 < this.fadeEndTime || (this.fadeEndTime = e6);
}, ap.prototype.wasRequested = function() {
return "errored" === this.state || "loaded" === this.state || "reloading" === this.state;
}, ap.prototype.loadVectorData = function(t6, e6, r7) {
if (this.hasData() && this.unloadVectorData(), this.state = "loaded", t6) {
for (var n8 in t6.featureIndex && (this.latestFeatureIndex = t6.featureIndex, t6.rawTileData ? (this.latestRawTileData = t6.rawTileData, this.latestFeatureIndex.rawTileData = t6.rawTileData) : this.latestRawTileData && (this.latestFeatureIndex.rawTileData = this.latestRawTileData)), this.collisionBoxArray = t6.collisionBoxArray, this.buckets = function(t7, e7) {
var r8 = {};
if (!e7) {
return r8;
}
for (var n9 = function() {
var t8 = a7[i7], n10 = t8.layerIds.map(function(t9) {
return e7.getLayer(t9);
}).filter(Boolean);
if (0 !== n10.length) {
t8.layers = n10, t8.stateDependentLayerIds && (t8.stateDependentLayers = t8.stateDependentLayerIds.map(function(t9) {
return n10.filter(function(e8) {
return e8.id === t9;
})[0];
}));
for (var o7 = 0, s8 = n10; o7 < s8.length; o7 += 1) {
r8[s8[o7].id] = t8;
}
}
}, i7 = 0, a7 = t7; i7 < a7.length; i7 += 1) {
n9();
}
return r8;
}(t6.buckets, e6.style), this.hasSymbolBuckets = false, this.buckets) {
var i6 = this.buckets[n8];
if (i6 instanceof vl) {
if (this.hasSymbolBuckets = true, !r7) {
break;
}
i6.justReloaded = true;
}
}
if (this.hasRTLText = false, this.hasSymbolBuckets) {
for (var a6 in this.buckets) {
var o6 = this.buckets[a6];
if (o6 instanceof vl && o6.hasRTLText) {
this.hasRTLText = true, oi2.isLoading() || oi2.isLoaded() || "deferred" !== ii2() || ai2();
break;
}
}
}
for (var s7 in this.queryPadding = 0, this.buckets) {
var u5 = this.buckets[s7];
this.queryPadding = Math.max(this.queryPadding, e6.style.getLayer(s7).queryRadius(u5));
}
t6.imageAtlas && (this.imageAtlas = t6.imageAtlas), t6.glyphAtlasImage && (this.glyphAtlasImage = t6.glyphAtlasImage);
} else {
this.collisionBoxArray = new $i2();
}
}, ap.prototype.unloadVectorData = function() {
for (var t6 in this.buckets) {
this.buckets[t6].destroy();
}
this.buckets = {}, this.imageAtlasTexture && this.imageAtlasTexture.destroy(), this.imageAtlas && (this.imageAtlas = null), this.glyphAtlasTexture && this.glyphAtlasTexture.destroy(), this.latestFeatureIndex = null, this.state = "unloaded";
}, ap.prototype.getBucket = function(t6) {
return this.buckets[t6.id];
}, ap.prototype.upload = function(t6) {
for (var e6 in this.buckets) {
var r7 = this.buckets[e6];
r7.uploadPending() && r7.upload(t6);
}
var n8 = t6.gl;
this.imageAtlas && !this.imageAtlas.uploaded && (this.imageAtlasTexture = new Tl(t6, this.imageAtlas.image, n8.RGBA), this.imageAtlas.uploaded = true), this.glyphAtlasImage && (this.glyphAtlasTexture = new Tl(t6, this.glyphAtlasImage, n8.ALPHA), this.glyphAtlasImage = null);
}, ap.prototype.prepare = function(t6) {
this.imageAtlas && this.imageAtlas.patchUpdatedImages(t6, this.imageAtlasTexture);
}, ap.prototype.queryRenderedFeatures = function(t6, e6, r7, n8, i6, a6, o6, s7, u5, l8) {
return this.latestFeatureIndex && this.latestFeatureIndex.rawTileData ? this.latestFeatureIndex.query({ queryGeometry: n8, cameraQueryGeometry: i6, scale: a6, tileSize: this.tileSize, pixelPosMatrix: l8, transform: s7, params: o6, queryPadding: this.queryPadding * u5 }, t6, e6, r7) : {};
}, ap.prototype.querySourceFeatures = function(t6, e6) {
var r7 = this.latestFeatureIndex;
if (r7 && r7.rawTileData) {
var n8 = r7.loadVTLayers(), i6 = e6 ? e6.sourceLayer : "", a6 = n8._geojsonTileLayer || n8[i6];
if (a6) {
for (var o6 = on3(e6 && e6.filter), s7 = this.tileID.canonical, u5 = s7.z, l8 = s7.x, p5 = s7.y, c5 = { z: u5, x: l8, y: p5 }, h7 = 0; h7 < a6.length; h7++) {
var f5 = a6.feature(h7);
if (o6.needGeometry) {
var y5 = Ua(f5, true);
if (!o6.filter(new si2(this.tileID.overscaledZ), y5, this.tileID.canonical)) {
continue;
}
} else if (!o6.filter(new si2(this.tileID.overscaledZ), f5)) {
continue;
}
var d5 = r7.getId(f5, i6), m5 = new Wl(f5, u5, l8, p5, d5);
m5.tile = c5, t6.push(m5);
}
}
}
}, ap.prototype.hasData = function() {
return "loaded" === this.state || "reloading" === this.state || "expired" === this.state;
}, ap.prototype.patternsLoaded = function() {
return this.imageAtlas && !!Object.keys(this.imageAtlas.patternPositions).length;
}, ap.prototype.setExpiryData = function(t6) {
var e6 = this.expirationTime;
if (t6.cacheControl) {
var r7 = z4(t6.cacheControl);
r7["max-age"] && (this.expirationTime = Date.now() + 1e3 * r7["max-age"]);
} else {
t6.expires && (this.expirationTime = new Date(t6.expires).getTime());
}
if (this.expirationTime) {
var n8 = Date.now(), i6 = false;
if (this.expirationTime > n8) {
i6 = false;
} else if (e6) {
if (this.expirationTime < e6) {
i6 = true;
} else {
var a6 = this.expirationTime - e6;
a6 ? this.expirationTime = n8 + Math.max(a6, 3e4) : i6 = true;
}
} else {
i6 = true;
}
i6 ? (this.expiredRequestCount++, this.state = "expired") : this.expiredRequestCount = 0;
}
}, ap.prototype.getExpiryTimeout = function() {
if (this.expirationTime) {
return this.expiredRequestCount ? 1e3 * (1 << Math.min(this.expiredRequestCount - 1, 31)) : Math.min(this.expirationTime - new Date().getTime(), Math.pow(2, 31) - 1);
}
}, ap.prototype.setFeatureState = function(t6, e6) {
if (this.latestFeatureIndex && this.latestFeatureIndex.rawTileData && 0 !== Object.keys(t6).length) {
var r7 = this.latestFeatureIndex.loadVTLayers();
for (var n8 in this.buckets) {
if (e6.style.hasLayer(n8)) {
var i6 = this.buckets[n8], a6 = i6.layers[0].sourceLayer || "_geojsonTileLayer", o6 = r7[a6], s7 = t6[a6];
if (o6 && s7 && 0 !== Object.keys(s7).length) {
i6.update(s7, o6, this.imageAtlas && this.imageAtlas.patternPositions || {});
var u5 = e6 && e6.style && e6.style.getLayer(n8);
u5 && (this.queryPadding = Math.max(this.queryPadding, u5.queryRadius(i6)));
}
}
}
}
}, ap.prototype.holdingForFade = function() {
return void 0 !== this.symbolFadeHoldUntil;
}, ap.prototype.symbolFadeFinished = function() {
return !this.symbolFadeHoldUntil || this.symbolFadeHoldUntil < O4.now();
}, ap.prototype.clearFadeHold = function() {
this.symbolFadeHoldUntil = void 0;
}, ap.prototype.setHoldDuration = function(t6) {
this.symbolFadeHoldUntil = O4.now() + t6;
}, ap.prototype.setDependencies = function(t6, e6) {
for (var r7 = {}, n8 = 0, i6 = e6; n8 < i6.length; n8 += 1) {
r7[i6[n8]] = true;
}
this.dependencies[t6] = r7;
}, ap.prototype.hasDependency = function(t6, e6) {
for (var r7 = 0, n8 = t6; r7 < n8.length; r7 += 1) {
var i6 = this.dependencies[n8[r7]];
if (i6) {
for (var a6 = 0, o6 = e6; a6 < o6.length; a6 += 1) {
if (i6[o6[a6]]) {
return true;
}
}
}
}
return false;
};
var op = o5.performance, sp = function(t6) {
this._marks = { start: [t6.url, "start"].join("#"), end: [t6.url, "end"].join("#"), measure: t6.url.toString() }, op.mark(this._marks.start);
};
sp.prototype.finish = function() {
op.mark(this._marks.end);
var t6 = op.getEntriesByName(this._marks.measure);
return 0 === t6.length && (op.measure(this._marks.measure, this._marks.start, this._marks.end), t6 = op.getEntriesByName(this._marks.measure), op.clearMarks(this._marks.start), op.clearMarks(this._marks.end), op.clearMeasures(this._marks.measure)), t6;
}, t5.Actor = Fl, t5.AlphaImage = go, t5.CanonicalTileID = Zl, t5.CollisionBoxArray = $i2, t5.Color = te2, t5.DEMData = Yl, t5.DataConstantProperty = mi2, t5.DictionaryCoder = $l, t5.EXTENT = 8192, t5.ErrorEvent = zt2, t5.EvaluationParameters = si2, t5.Event = It2, t5.Evented = Ct2, t5.FeatureIndex = ep, t5.FillBucket = ss, t5.FillExtrusionBucket = Ss, t5.ImageAtlas = bu, t5.ImagePosition = gu, t5.LineBucket = Fs, t5.LngLat = Ol, t5.LngLatBounds = Ll, t5.MercatorCoordinate = Gl, t5.ONE_EM = 24, t5.OverscaledTileID = Jl, t5.Point = i5, t5.Point$1 = i5, t5.Properties = wi2, t5.Protobuf = Ys, t5.RGBAImage = xo, t5.RequestManager = G3, t5.RequestPerformance = sp, t5.ResourceType = yt2, t5.SegmentVector = sa, t5.SourceFeatureState = tp, t5.StructArrayLayout1ui2 = Ji2, t5.StructArrayLayout2f1f2i16 = Ri2, t5.StructArrayLayout2i4 = Ci2, t5.StructArrayLayout3ui6 = ji2, t5.StructArrayLayout4i8 = Ei2, t5.SymbolBucket = vl, t5.Texture = Tl, t5.Tile = ap, t5.Transitionable = pi2, t5.Uniform1f = ba, t5.Uniform1i = xa, t5.Uniform2f = wa, t5.Uniform3f = _a, t5.Uniform4f = Aa, t5.UniformColor = Sa, t5.UniformMatrix4f = Ia, t5.UnwrappedTileID = Xl, t5.ValidationError = Pt2, t5.WritingMode = wu, t5.ZoomHistory = Kn2, t5.add = function(t6, e6, r7) {
return t6[0] = e6[0] + r7[0], t6[1] = e6[1] + r7[1], t6[2] = e6[2] + r7[2], t6;
}, t5.addDynamicAttributes = fl, t5.asyncAll = function(t6, e6, r7) {
if (!t6.length) {
return r7(null, []);
}
var n8 = t6.length, i6 = new Array(t6.length), a6 = null;
t6.forEach(function(t7, o6) {
e6(t7, function(t8, e7) {
t8 && (a6 = t8), i6[o6] = e7, 0 == --n8 && r7(a6, i6);
});
});
}, t5.bezier = u4, t5.bindAll = v4, t5.browser = O4, t5.cacheEntryPossiblyAdded = function(t6) {
++ht2 > ut2 && (t6.getActor().send("enforceCacheSizeLimit", st2), ht2 = 0);
}, t5.clamp = p4, t5.clearTileCache = function(t6) {
var e6 = o5.caches.delete("mapbox-tiles");
t6 && e6.catch(t6).then(function() {
return t6();
});
}, t5.clipLine = Zu, t5.clone = function(t6) {
var e6 = new ao(16);
return e6[0] = t6[0], e6[1] = t6[1], e6[2] = t6[2], e6[3] = t6[3], e6[4] = t6[4], e6[5] = t6[5], e6[6] = t6[6], e6[7] = t6[7], e6[8] = t6[8], e6[9] = t6[9], e6[10] = t6[10], e6[11] = t6[11], e6[12] = t6[12], e6[13] = t6[13], e6[14] = t6[14], e6[15] = t6[15], e6;
}, t5.clone$1 = w4, t5.clone$2 = function(t6) {
var e6 = new ao(3);
return e6[0] = t6[0], e6[1] = t6[1], e6[2] = t6[2], e6;
}, t5.collisionCircleLayout = Gs, t5.config = R3, t5.create = function() {
var t6 = new ao(16);
return ao != Float32Array && (t6[1] = 0, t6[2] = 0, t6[3] = 0, t6[4] = 0, t6[6] = 0, t6[7] = 0, t6[8] = 0, t6[9] = 0, t6[11] = 0, t6[12] = 0, t6[13] = 0, t6[14] = 0), t6[0] = 1, t6[5] = 1, t6[10] = 1, t6[15] = 1, t6;
}, t5.create$1 = function() {
var t6 = new ao(9);
return ao != Float32Array && (t6[1] = 0, t6[2] = 0, t6[3] = 0, t6[5] = 0, t6[6] = 0, t6[7] = 0), t6[0] = 1, t6[4] = 1, t6[8] = 1, t6;
}, t5.create$2 = function() {
var t6 = new ao(4);
return ao != Float32Array && (t6[1] = 0, t6[2] = 0), t6[0] = 1, t6[3] = 1, t6;
}, t5.createCommonjsModule = e5, t5.createExpression = Zr, t5.createLayout = Ii2, t5.createStyleLayer = function(t6) {
return "custom" === t6.type ? new Il(t6) : new zl[t6.type](t6);
}, t5.cross = function(t6, e6, r7) {
var n8 = e6[0], i6 = e6[1], a6 = e6[2], o6 = r7[0], s7 = r7[1], u5 = r7[2];
return t6[0] = i6 * u5 - a6 * s7, t6[1] = a6 * o6 - n8 * u5, t6[2] = n8 * s7 - i6 * o6, t6;
}, t5.deepEqual = function t6(e6, r7) {
if (Array.isArray(e6)) {
if (!Array.isArray(r7) || e6.length !== r7.length) {
return false;
}
for (var n8 = 0; n8 < e6.length; n8++) {
if (!t6(e6[n8], r7[n8])) {
return false;
}
}
return true;
}
if ("object" == typeof e6 && null !== e6 && null !== r7) {
if ("object" != typeof r7) {
return false;
}
if (Object.keys(e6).length !== Object.keys(r7).length) {
return false;
}
for (var i6 in e6) {
if (!t6(e6[i6], r7[i6])) {
return false;
}
}
return true;
}
return e6 === r7;
}, t5.dot = function(t6, e6) {
return t6[0] * e6[0] + t6[1] * e6[1] + t6[2] * e6[2];
}, t5.dot$1 = function(t6, e6) {
return t6[0] * e6[0] + t6[1] * e6[1] + t6[2] * e6[2] + t6[3] * e6[3];
}, t5.ease = l7, t5.emitValidationErrors = Bn2, t5.endsWith = g4, t5.enforceCacheSizeLimit = function(t6) {
lt2(), tt3 && tt3.then(function(e6) {
e6.keys().then(function(r7) {
for (var n8 = 0; n8 < r7.length - t6; n8++) {
e6.delete(r7[n8]);
}
});
});
}, t5.evaluateSizeForFeature = Lu, t5.evaluateSizeForZoom = Ou, t5.evaluateVariableOffset = al, t5.evented = ni2, t5.extend = h6, t5.featureFilter = on3, t5.filterObject = b4, t5.fromRotation = function(t6, e6) {
var r7 = Math.sin(e6), n8 = Math.cos(e6);
return t6[0] = n8, t6[1] = r7, t6[2] = 0, t6[3] = -r7, t6[4] = n8, t6[5] = 0, t6[6] = 0, t6[7] = 0, t6[8] = 1, t6;
}, t5.getAnchorAlignment = Bu, t5.getAnchorJustification = ol, t5.getArrayBuffer = bt2, t5.getImage = At2, t5.getJSON = function(t6, e6) {
return xt2(h6(t6, { type: "json" }), e6);
}, t5.getRTLTextPluginStatus = ii2, t5.getReferrer = mt2, t5.getVideo = function(t6, e6) {
var r7, n8, i6 = o5.document.createElement("video");
i6.muted = true, i6.onloadstart = function() {
e6(null, i6);
};
for (var a6 = 0; a6 < t6.length; a6++) {
var s7 = o5.document.createElement("source");
r7 = t6[a6], n8 = void 0, (n8 = o5.document.createElement("a")).href = r7, (n8.protocol !== o5.document.location.protocol || n8.host !== o5.document.location.host) && (i6.crossOrigin = "Anonymous"), s7.src = t6[a6], i6.appendChild(s7);
}
return { cancel: function() {
} };
}, t5.identity = oo, t5.invert = function(t6, e6) {
var r7 = e6[0], n8 = e6[1], i6 = e6[2], a6 = e6[3], o6 = e6[4], s7 = e6[5], u5 = e6[6], l8 = e6[7], p5 = e6[8], c5 = e6[9], h7 = e6[10], f5 = e6[11], y5 = e6[12], d5 = e6[13], m5 = e6[14], v5 = e6[15], g5 = r7 * s7 - n8 * o6, x5 = r7 * u5 - i6 * o6, b5 = r7 * l8 - a6 * o6, w5 = n8 * u5 - i6 * s7, _4 = n8 * l8 - a6 * s7, A5 = i6 * l8 - a6 * u5, S5 = p5 * d5 - c5 * y5, k5 = p5 * m5 - h7 * y5, I5 = p5 * v5 - f5 * y5, z5 = c5 * m5 - h7 * d5, C5 = c5 * v5 - f5 * d5, E4 = h7 * v5 - f5 * m5, P5 = g5 * E4 - x5 * C5 + b5 * z5 + w5 * I5 - _4 * k5 + A5 * S5;
return P5 ? (t6[0] = (s7 * E4 - u5 * C5 + l8 * z5) * (P5 = 1 / P5), t6[1] = (i6 * C5 - n8 * E4 - a6 * z5) * P5, t6[2] = (d5 * A5 - m5 * _4 + v5 * w5) * P5, t6[3] = (h7 * _4 - c5 * A5 - f5 * w5) * P5, t6[4] = (u5 * I5 - o6 * E4 - l8 * k5) * P5, t6[5] = (r7 * E4 - i6 * I5 + a6 * k5) * P5, t6[6] = (m5 * b5 - y5 * A5 - v5 * x5) * P5, t6[7] = (p5 * A5 - h7 * b5 + f5 * x5) * P5, t6[8] = (o6 * C5 - s7 * I5 + l8 * S5) * P5, t6[9] = (n8 * I5 - r7 * C5 - a6 * S5) * P5, t6[10] = (y5 * _4 - d5 * b5 + v5 * g5) * P5, t6[11] = (c5 * b5 - p5 * _4 - f5 * g5) * P5, t6[12] = (s7 * k5 - o6 * z5 - u5 * S5) * P5, t6[13] = (r7 * z5 - n8 * k5 + i6 * S5) * P5, t6[14] = (d5 * x5 - y5 * w5 - m5 * g5) * P5, t6[15] = (p5 * w5 - c5 * x5 + h7 * g5) * P5, t6) : null;
}, t5.isChar = Gn2, t5.isMapboxURL = Z2, t5.keysDifference = function(t6, e6) {
var r7 = [];
for (var n8 in t6) {
n8 in e6 || r7.push(n8);
}
return r7;
}, t5.makeRequest = xt2, t5.mapObject = x4, t5.mercatorXfromLng = jl, t5.mercatorYfromLat = ql, t5.mercatorZfromAltitude = Nl2, t5.mul = lo, t5.multiply = so, t5.mvt = bs, t5.nextPowerOfTwo = function(t6) {
return t6 <= 1 ? 1 : Math.pow(2, Math.ceil(Math.log(t6) / Math.LN2));
}, t5.normalize = function(t6, e6) {
var r7 = e6[0], n8 = e6[1], i6 = e6[2], a6 = r7 * r7 + n8 * n8 + i6 * i6;
return a6 > 0 && (a6 = 1 / Math.sqrt(a6)), t6[0] = e6[0] * a6, t6[1] = e6[1] * a6, t6[2] = e6[2] * a6, t6;
}, t5.number = Ke2, t5.offscreenCanvasSupported = ft2, t5.ortho = function(t6, e6, r7, n8, i6, a6, o6) {
var s7 = 1 / (e6 - r7), u5 = 1 / (n8 - i6), l8 = 1 / (a6 - o6);
return t6[0] = -2 * s7, t6[1] = 0, t6[2] = 0, t6[3] = 0, t6[4] = 0, t6[5] = -2 * u5, t6[6] = 0, t6[7] = 0, t6[8] = 0, t6[9] = 0, t6[10] = 2 * l8, t6[11] = 0, t6[12] = (e6 + r7) * s7, t6[13] = (i6 + n8) * u5, t6[14] = (o6 + a6) * l8, t6[15] = 1, t6;
}, t5.parseGlyphPBF = function(t6) {
return new Ys(t6).readFields(yu, []);
}, t5.pbf = Ys, t5.performSymbolLayout = function(t6, e6, r7, n8, i6, a6, o6) {
t6.createArrays(), t6.tilePixelRatio = 8192 / (512 * t6.overscaling), t6.compareText = {}, t6.iconsNeedLinear = false;
var s7 = t6.layers[0].layout, u5 = t6.layers[0]._unevaluatedLayout._values, l8 = {};
if ("composite" === t6.textSizeData.kind) {
var p5 = t6.textSizeData, c5 = p5.maxZoom;
l8.compositeTextSizes = [u5["text-size"].possiblyEvaluate(new si2(p5.minZoom), o6), u5["text-size"].possiblyEvaluate(new si2(c5), o6)];
}
if ("composite" === t6.iconSizeData.kind) {
var h7 = t6.iconSizeData, f5 = h7.maxZoom;
l8.compositeIconSizes = [u5["icon-size"].possiblyEvaluate(new si2(h7.minZoom), o6), u5["icon-size"].possiblyEvaluate(new si2(f5), o6)];
}
l8.layoutTextSize = u5["text-size"].possiblyEvaluate(new si2(t6.zoom + 1), o6), l8.layoutIconSize = u5["icon-size"].possiblyEvaluate(new si2(t6.zoom + 1), o6), l8.textMaxSize = u5["text-size"].possiblyEvaluate(new si2(18));
for (var y5 = 24 * s7.get("text-line-height"), d5 = "map" === s7.get("text-rotation-alignment") && "point" !== s7.get("symbol-placement"), m5 = s7.get("text-keep-upright"), v5 = s7.get("text-size"), g5 = function() {
var a7 = b5[x5], u6 = s7.get("text-font").evaluate(a7, {}, o6).join(","), p6 = v5.evaluate(a7, {}, o6), c6 = l8.layoutTextSize.evaluate(a7, {}, o6), h8 = l8.layoutIconSize.evaluate(a7, {}, o6), f6 = { horizontal: {}, vertical: void 0 }, g6 = a7.text, w5 = [0, 0];
if (g6) {
var _4 = g6.toString(), S5 = 24 * s7.get("text-letter-spacing").evaluate(a7, {}, o6), k5 = function(t7) {
for (var e7 = 0, r8 = t7; e7 < r8.length; e7 += 1) {
if (n9 = r8[e7].charCodeAt(0), Gn2.Arabic(n9) || Gn2["Arabic Supplement"](n9) || Gn2["Arabic Extended-A"](n9) || Gn2["Arabic Presentation Forms-A"](n9) || Gn2["Arabic Presentation Forms-B"](n9)) {
return false;
}
}
var n9;
return true;
}(_4) ? S5 : 0, I5 = s7.get("text-anchor").evaluate(a7, {}, o6), z5 = s7.get("text-variable-anchor");
if (!z5) {
var C5 = s7.get("text-radial-offset").evaluate(a7, {}, o6);
w5 = C5 ? al(I5, [24 * C5, il]) : s7.get("text-offset").evaluate(a7, {}, o6).map(function(t7) {
return 24 * t7;
});
}
var E4 = d5 ? "center" : s7.get("text-justify").evaluate(a7, {}, o6), P5 = s7.get("symbol-placement"), M5 = "point" === P5 ? 24 * s7.get("text-max-width").evaluate(a7, {}, o6) : 0, B4 = function() {
t6.allowVerticalPlacement && Zn2(_4) && (f6.vertical = Su(g6, e6, r7, i6, u6, M5, y5, I5, "left", k5, w5, wu.vertical, true, P5, c6, p6));
};
if (!d5 && z5) {
for (var T5 = "auto" === E4 ? z5.map(function(t7) {
return ol(t7);
}) : [E4], V4 = false, F4 = 0; F4 < T5.length; F4++) {
var D5 = T5[F4];
if (!f6.horizontal[D5]) {
if (V4) {
f6.horizontal[D5] = f6.horizontal[0];
} else {
var L5 = Su(g6, e6, r7, i6, u6, M5, y5, "center", D5, k5, w5, wu.horizontal, false, P5, c6, p6);
L5 && (f6.horizontal[D5] = L5, V4 = 1 === L5.positionedLines.length);
}
}
}
B4();
} else {
"auto" === E4 && (E4 = ol(I5));
var O5 = Su(g6, e6, r7, i6, u6, M5, y5, I5, E4, k5, w5, wu.horizontal, false, P5, c6, p6);
O5 && (f6.horizontal[E4] = O5), B4(), Zn2(_4) && d5 && m5 && (f6.vertical = Su(g6, e6, r7, i6, u6, M5, y5, I5, E4, k5, w5, wu.vertical, false, P5, c6, p6));
}
}
var R4 = void 0, U4 = false;
if (a7.icon && a7.icon.name) {
var j5 = n8[a7.icon.name];
j5 && (R4 = function(t7, e7, r8) {
var n9 = Bu(r8), i7 = e7[0] - t7.displaySize[0] * n9.horizontalAlign, a8 = e7[1] - t7.displaySize[1] * n9.verticalAlign;
return { image: t7, top: a8, bottom: a8 + t7.displaySize[1], left: i7, right: i7 + t7.displaySize[0] };
}(i6[a7.icon.name], s7.get("icon-offset").evaluate(a7, {}, o6), s7.get("icon-anchor").evaluate(a7, {}, o6)), U4 = j5.sdf, void 0 === t6.sdfIcons ? t6.sdfIcons = j5.sdf : t6.sdfIcons !== j5.sdf && A4("Style sheet warning: Cannot mix SDF and non-SDF icons in one buffer"), (j5.pixelRatio !== t6.pixelRatio || 0 !== s7.get("icon-rotate").constantOr(1)) && (t6.iconsNeedLinear = true));
}
var q5 = ul(f6.horizontal) || f6.vertical;
t6.iconsInText = !!q5 && q5.iconsInText, (q5 || R4) && function(t7, e7, r8, n9, i7, a8, o7, s8, u7, l9, p7) {
var c7 = a8.textMaxSize.evaluate(e7, {});
void 0 === c7 && (c7 = o7);
var h9, f7 = t7.layers[0].layout, y6 = f7.get("icon-offset").evaluate(e7, {}, p7), d6 = ul(r8.horizontal), m6 = o7 / 24, v6 = t7.tilePixelRatio * m6, g7 = t7.tilePixelRatio * c7 / 24, x6 = t7.tilePixelRatio * s8, b6 = t7.tilePixelRatio * f7.get("symbol-spacing"), w6 = f7.get("text-padding") * t7.tilePixelRatio, _5 = f7.get("icon-padding") * t7.tilePixelRatio, S6 = f7.get("text-max-angle") / 180 * Math.PI, k6 = "map" === f7.get("text-rotation-alignment") && "point" !== f7.get("symbol-placement"), I6 = "map" === f7.get("icon-rotation-alignment") && "point" !== f7.get("symbol-placement"), z6 = f7.get("symbol-placement"), C6 = b6 / 2, E5 = f7.get("icon-text-fit");
n9 && "none" !== E5 && (t7.allowVerticalPlacement && r8.vertical && (h9 = Vu(n9, r8.vertical, E5, f7.get("icon-text-fit-padding"), y6, m6)), d6 && (n9 = Vu(n9, d6, E5, f7.get("icon-text-fit-padding"), y6, m6)));
var P6 = function(s9, c8) {
c8.x < 0 || c8.x >= 8192 || c8.y < 0 || c8.y >= 8192 || function(t8, e8, r9, n10, i8, a9, o8, s10, u8, l10, p8, c9, h10, f8, y7, d7, m7, v7, g8, x7, b7, w7, _6, S7, k7) {
var I7, z7, C7, E6, P7, M7 = t8.addToLineVertexArray(e8, r9), B6 = 0, T7 = 0, V6 = 0, F6 = 0, D7 = -1, L7 = -1, O7 = {}, R6 = ha(""), U6 = 0, j7 = 0;
if (void 0 === s10._unevaluatedLayout.getValue("text-radial-offset") ? (U6 = (I7 = s10.layout.get("text-offset").evaluate(b7, {}, S7).map(function(t9) {
return 24 * t9;
}))[0], j7 = I7[1]) : (U6 = 24 * s10.layout.get("text-radial-offset").evaluate(b7, {}, S7), j7 = il), t8.allowVerticalPlacement && n10.vertical) {
var q7 = s10.layout.get("text-rotate").evaluate(b7, {}, S7) + 90;
E6 = new Wu(u8, e8, l10, p8, c9, n10.vertical, h10, f8, y7, q7), o8 && (P7 = new Wu(u8, e8, l10, p8, c9, o8, m7, v7, y7, q7));
}
if (i8) {
var N6 = s10.layout.get("icon-rotate").evaluate(b7, {}), K5 = "none" !== s10.layout.get("icon-text-fit"), G5 = Xu(i8, N6, _6, K5), Z4 = o8 ? Xu(o8, N6, _6, K5) : void 0;
C7 = new Wu(u8, e8, l10, p8, c9, i8, m7, v7, false, N6), B6 = 4 * G5.length;
var X5 = t8.iconSizeData, J5 = null;
"source" === X5.kind ? (J5 = [128 * s10.layout.get("icon-size").evaluate(b7, {})])[0] > 32640 && A4(t8.layerIds[0] + ': Value for "icon-size" is >= 255. Reduce your "icon-size".') : "composite" === X5.kind && ((J5 = [128 * w7.compositeIconSizes[0].evaluate(b7, {}, S7), 128 * w7.compositeIconSizes[1].evaluate(b7, {}, S7)])[0] > 32640 || J5[1] > 32640) && A4(t8.layerIds[0] + ': Value for "icon-size" is >= 255. Reduce your "icon-size".'), t8.addSymbols(t8.icon, G5, J5, x7, g8, b7, false, e8, M7.lineStartIndex, M7.lineLength, -1, S7), D7 = t8.icon.placedSymbolArray.length - 1, Z4 && (T7 = 4 * Z4.length, t8.addSymbols(t8.icon, Z4, J5, x7, g8, b7, wu.vertical, e8, M7.lineStartIndex, M7.lineLength, -1, S7), L7 = t8.icon.placedSymbolArray.length - 1);
}
for (var H6 in n10.horizontal) {
var Y4 = n10.horizontal[H6];
if (!z7) {
R6 = ha(Y4.text);
var $5 = s10.layout.get("text-rotate").evaluate(b7, {}, S7);
z7 = new Wu(u8, e8, l10, p8, c9, Y4, h10, f8, y7, $5);
}
var W5 = 1 === Y4.positionedLines.length;
if (V6 += sl(t8, e8, Y4, a9, s10, y7, b7, d7, M7, n10.vertical ? wu.horizontal : wu.horizontalOnly, W5 ? Object.keys(n10.horizontal) : [H6], O7, D7, w7, S7), W5) {
break;
}
}
n10.vertical && (F6 += sl(t8, e8, n10.vertical, a9, s10, y7, b7, d7, M7, wu.vertical, ["vertical"], O7, L7, w7, S7));
var Q3 = z7 ? z7.boxStartIndex : t8.collisionBoxArray.length, tt4 = z7 ? z7.boxEndIndex : t8.collisionBoxArray.length, et3 = E6 ? E6.boxStartIndex : t8.collisionBoxArray.length, rt3 = E6 ? E6.boxEndIndex : t8.collisionBoxArray.length, nt3 = C7 ? C7.boxStartIndex : t8.collisionBoxArray.length, it3 = C7 ? C7.boxEndIndex : t8.collisionBoxArray.length, at3 = P7 ? P7.boxStartIndex : t8.collisionBoxArray.length, ot3 = P7 ? P7.boxEndIndex : t8.collisionBoxArray.length, st3 = -1, ut3 = function(t9, e9) {
return t9 && t9.circleDiameter ? Math.max(t9.circleDiameter, e9) : e9;
};
st3 = ut3(z7, st3), st3 = ut3(E6, st3), st3 = ut3(C7, st3);
var lt3 = (st3 = ut3(P7, st3)) > -1 ? 1 : 0;
lt3 && (st3 *= k7 / 24), t8.glyphOffsetArray.length >= vl.MAX_GLYPHS && A4("Too many glyphs being rendered in a tile. See https://github.com/mapbox/mapbox-gl-js/issues/2907"), void 0 !== b7.sortKey && t8.addToSortKeyRanges(t8.symbolInstances.length, b7.sortKey), t8.symbolInstances.emplaceBack(e8.x, e8.y, O7.right >= 0 ? O7.right : -1, O7.center >= 0 ? O7.center : -1, O7.left >= 0 ? O7.left : -1, O7.vertical || -1, D7, L7, R6, Q3, tt4, et3, rt3, nt3, it3, at3, ot3, l10, V6, F6, B6, T7, lt3, 0, h10, U6, j7, st3);
}(t7, c8, s9, r8, n9, i7, h9, t7.layers[0], t7.collisionBoxArray, e7.index, e7.sourceLayerIndex, t7.index, v6, w6, k6, u7, x6, _5, I6, y6, e7, a8, l9, p7, o7);
};
if ("line" === z6) {
for (var M6 = 0, B5 = Zu(e7.geometry, 0, 0, 8192, 8192); M6 < B5.length; M6 += 1) {
for (var T6 = B5[M6], V5 = 0, F5 = Gu(T6, b6, S6, r8.vertical || d6, n9, 24, g7, t7.overscaling, 8192); V5 < F5.length; V5 += 1) {
var D6 = F5[V5];
d6 && ll(t7, d6.text, C6, D6) || P6(T6, D6);
}
}
} else if ("line-center" === z6) {
for (var L6 = 0, O6 = e7.geometry; L6 < O6.length; L6 += 1) {
var R5 = O6[L6];
if (R5.length > 1) {
var U5 = Ku(R5, S6, r8.vertical || d6, n9, 24, g7);
U5 && P6(R5, U5);
}
}
} else if ("Polygon" === e7.type) {
for (var j6 = 0, q6 = ns(e7.geometry, 0); j6 < q6.length; j6 += 1) {
var N5 = q6[j6], K4 = el(N5, 16);
P6(N5[0], new Fu(K4.x, K4.y, 0));
}
} else if ("LineString" === e7.type) {
for (var G4 = 0, Z3 = e7.geometry; G4 < Z3.length; G4 += 1) {
var X4 = Z3[G4];
P6(X4, new Fu(X4[0].x, X4[0].y, 0));
}
} else if ("Point" === e7.type) {
for (var J4 = 0, H5 = e7.geometry; J4 < H5.length; J4 += 1) {
for (var Y3 = 0, $4 = H5[J4]; Y3 < $4.length; Y3 += 1) {
var W4 = $4[Y3];
P6([W4], new Fu(W4.x, W4.y, 0));
}
}
}
}(t6, a7, f6, R4, n8, l8, c6, h8, w5, U4, o6);
}, x5 = 0, b5 = t6.features; x5 < b5.length; x5 += 1) {
g5();
}
a6 && t6.generateCollisionDebugBuffers();
}, t5.perspective = function(t6, e6, r7, n8, i6) {
var a6, o6 = 1 / Math.tan(e6 / 2);
return t6[0] = o6 / r7, t6[1] = 0, t6[2] = 0, t6[3] = 0, t6[4] = 0, t6[5] = o6, t6[6] = 0, t6[7] = 0, t6[8] = 0, t6[9] = 0, t6[11] = -1, t6[12] = 0, t6[13] = 0, t6[15] = 0, null != i6 && i6 !== 1 / 0 ? (t6[10] = (i6 + n8) * (a6 = 1 / (n8 - i6)), t6[14] = 2 * i6 * n8 * a6) : (t6[10] = -1, t6[14] = -2 * n8), t6;
}, t5.pick = function(t6, e6) {
for (var r7 = {}, n8 = 0; n8 < e6.length; n8++) {
var i6 = e6[n8];
i6 in t6 && (r7[i6] = t6[i6]);
}
return r7;
}, t5.plugin = oi2, t5.polygonIntersectsPolygon = Na, t5.postMapLoadEvent = ot2, t5.postTurnstileEvent = it2, t5.potpack = vu, t5.refProperties = ["type", "source", "source-layer", "minzoom", "maxzoom", "filter", "layout"], t5.register = On2, t5.registerForPluginStateChange = function(t6) {
return t6({ pluginStatus: Qn2, pluginURL: ti2 }), ni2.on("pluginStateChange", t6), t6;
}, t5.renderColorRamp = wo, t5.rotate = function(t6, e6, r7) {
var n8 = e6[0], i6 = e6[1], a6 = e6[2], o6 = e6[3], s7 = Math.sin(r7), u5 = Math.cos(r7);
return t6[0] = n8 * u5 + a6 * s7, t6[1] = i6 * u5 + o6 * s7, t6[2] = n8 * -s7 + a6 * u5, t6[3] = i6 * -s7 + o6 * u5, t6;
}, t5.rotateX = function(t6, e6, r7) {
var n8 = Math.sin(r7), i6 = Math.cos(r7), a6 = e6[4], o6 = e6[5], s7 = e6[6], u5 = e6[7], l8 = e6[8], p5 = e6[9], c5 = e6[10], h7 = e6[11];
return e6 !== t6 && (t6[0] = e6[0], t6[1] = e6[1], t6[2] = e6[2], t6[3] = e6[3], t6[12] = e6[12], t6[13] = e6[13], t6[14] = e6[14], t6[15] = e6[15]), t6[4] = a6 * i6 + l8 * n8, t6[5] = o6 * i6 + p5 * n8, t6[6] = s7 * i6 + c5 * n8, t6[7] = u5 * i6 + h7 * n8, t6[8] = l8 * i6 - a6 * n8, t6[9] = p5 * i6 - o6 * n8, t6[10] = c5 * i6 - s7 * n8, t6[11] = h7 * i6 - u5 * n8, t6;
}, t5.rotateZ = function(t6, e6, r7) {
var n8 = Math.sin(r7), i6 = Math.cos(r7), a6 = e6[0], o6 = e6[1], s7 = e6[2], u5 = e6[3], l8 = e6[4], p5 = e6[5], c5 = e6[6], h7 = e6[7];
return e6 !== t6 && (t6[8] = e6[8], t6[9] = e6[9], t6[10] = e6[10], t6[11] = e6[11], t6[12] = e6[12], t6[13] = e6[13], t6[14] = e6[14], t6[15] = e6[15]), t6[0] = a6 * i6 + l8 * n8, t6[1] = o6 * i6 + p5 * n8, t6[2] = s7 * i6 + c5 * n8, t6[3] = u5 * i6 + h7 * n8, t6[4] = l8 * i6 - a6 * n8, t6[5] = p5 * i6 - o6 * n8, t6[6] = c5 * i6 - s7 * n8, t6[7] = h7 * i6 - u5 * n8, t6;
}, t5.scale = function(t6, e6, r7) {
var n8 = r7[0], i6 = r7[1], a6 = r7[2];
return t6[0] = e6[0] * n8, t6[1] = e6[1] * n8, t6[2] = e6[2] * n8, t6[3] = e6[3] * n8, t6[4] = e6[4] * i6, t6[5] = e6[5] * i6, t6[6] = e6[6] * i6, t6[7] = e6[7] * i6, t6[8] = e6[8] * a6, t6[9] = e6[9] * a6, t6[10] = e6[10] * a6, t6[11] = e6[11] * a6, t6[12] = e6[12], t6[13] = e6[13], t6[14] = e6[14], t6[15] = e6[15], t6;
}, t5.scale$1 = function(t6, e6, r7) {
return t6[0] = e6[0] * r7, t6[1] = e6[1] * r7, t6[2] = e6[2] * r7, t6[3] = e6[3] * r7, t6;
}, t5.scale$2 = function(t6, e6, r7) {
return t6[0] = e6[0] * r7, t6[1] = e6[1] * r7, t6[2] = e6[2] * r7, t6;
}, t5.setCacheLimits = function(t6, e6) {
st2 = t6, ut2 = e6;
}, t5.setRTLTextPlugin = function(t6, e6, r7) {
if (void 0 === r7 && (r7 = false), "deferred" === Qn2 || "loading" === Qn2 || "loaded" === Qn2) {
throw new Error("setRTLTextPlugin cannot be called multiple times.");
}
ti2 = O4.resolveURL(t6), Qn2 = "deferred", Wn2 = e6, ri2(), r7 || ai2();
}, t5.sphericalToCartesian = function(t6) {
var e6 = t6[0], r7 = t6[1], n8 = t6[2];
return r7 += 90, r7 *= Math.PI / 180, n8 *= Math.PI / 180, { x: e6 * Math.cos(r7) * Math.sin(n8), y: e6 * Math.sin(r7) * Math.sin(n8), z: e6 * Math.cos(n8) };
}, t5.sqrLen = function(t6) {
var e6 = t6[0], r7 = t6[1];
return e6 * e6 + r7 * r7;
}, t5.styleSpec = Et2, t5.sub = function(t6, e6, r7) {
return t6[0] = e6[0] - r7[0], t6[1] = e6[1] - r7[1], t6[2] = e6[2] - r7[2], t6;
}, t5.symbolSize = Ru, t5.transformMat3 = function(t6, e6, r7) {
var n8 = e6[0], i6 = e6[1], a6 = e6[2];
return t6[0] = n8 * r7[0] + i6 * r7[3] + a6 * r7[6], t6[1] = n8 * r7[1] + i6 * r7[4] + a6 * r7[7], t6[2] = n8 * r7[2] + i6 * r7[5] + a6 * r7[8], t6;
}, t5.transformMat4 = po, t5.translate = function(t6, e6, r7) {
var n8, i6, a6, o6, s7, u5, l8, p5, c5, h7, f5, y5, d5 = r7[0], m5 = r7[1], v5 = r7[2];
return e6 === t6 ? (t6[12] = e6[0] * d5 + e6[4] * m5 + e6[8] * v5 + e6[12], t6[13] = e6[1] * d5 + e6[5] * m5 + e6[9] * v5 + e6[13], t6[14] = e6[2] * d5 + e6[6] * m5 + e6[10] * v5 + e6[14], t6[15] = e6[3] * d5 + e6[7] * m5 + e6[11] * v5 + e6[15]) : (i6 = e6[1], a6 = e6[2], o6 = e6[3], s7 = e6[4], u5 = e6[5], l8 = e6[6], p5 = e6[7], c5 = e6[8], h7 = e6[9], f5 = e6[10], y5 = e6[11], t6[0] = n8 = e6[0], t6[1] = i6, t6[2] = a6, t6[3] = o6, t6[4] = s7, t6[5] = u5, t6[6] = l8, t6[7] = p5, t6[8] = c5, t6[9] = h7, t6[10] = f5, t6[11] = y5, t6[12] = n8 * d5 + s7 * m5 + c5 * v5 + e6[12], t6[13] = i6 * d5 + u5 * m5 + h7 * v5 + e6[13], t6[14] = a6 * d5 + l8 * m5 + f5 * v5 + e6[14], t6[15] = o6 * d5 + p5 * m5 + y5 * v5 + e6[15]), t6;
}, t5.triggerPluginCompletionEvent = ei2, t5.uniqueId = y4, t5.validateCustomStyleLayer = function(t6) {
var e6 = [], r7 = t6.id;
return void 0 === r7 && e6.push({ message: "layers." + r7 + ': missing required property "id"' }), void 0 === t6.render && e6.push({ message: "layers." + r7 + ': missing required method "render"' }), t6.renderingMode && "2d" !== t6.renderingMode && "3d" !== t6.renderingMode && e6.push({ message: "layers." + r7 + ': property "renderingMode" must be either "2d" or "3d"' }), e6;
}, t5.validateLight = En2, t5.validateStyle = Cn2, t5.values = function(t6) {
var e6 = [];
for (var r7 in t6) {
e6.push(t6[r7]);
}
return e6;
}, t5.vectorTile = bs, t5.version = "1.13.3", t5.warnOnce = A4, t5.webpSupported = U3, t5.window = o5, t5.wrap = c4;
});
define2(["./shared"], function(e5) {
function t5(e6) {
var r7 = typeof e6;
if ("number" === r7 || "boolean" === r7 || "string" === r7 || null == e6) {
return JSON.stringify(e6);
}
if (Array.isArray(e6)) {
for (var i6 = "[", o6 = 0, n8 = e6; o6 < n8.length; o6 += 1) {
i6 += t5(n8[o6]) + ",";
}
return i6 + "]";
}
for (var a6 = Object.keys(e6).sort(), s7 = "{", l8 = 0; l8 < a6.length; l8++) {
s7 += JSON.stringify(a6[l8]) + ":" + t5(e6[a6[l8]]) + ",";
}
return s7 + "}";
}
function r6(r7) {
for (var i6 = "", o6 = 0, n8 = e5.refProperties; o6 < n8.length; o6 += 1) {
i6 += "/" + t5(r7[n8[o6]]);
}
return i6;
}
var i5 = function(e6) {
this.keyCache = {}, e6 && this.replace(e6);
};
i5.prototype.replace = function(e6) {
this._layerConfigs = {}, this._layers = {}, this.update(e6, []);
}, i5.prototype.update = function(t6, i6) {
for (var o6 = this, n8 = 0, a6 = t6; n8 < a6.length; n8 += 1) {
var s7 = a6[n8];
this._layerConfigs[s7.id] = s7;
var l8 = this._layers[s7.id] = e5.createStyleLayer(s7);
l8._featureFilter = e5.featureFilter(l8.filter), this.keyCache[s7.id] && delete this.keyCache[s7.id];
}
for (var u5 = 0, h7 = i6; u5 < h7.length; u5 += 1) {
var c5 = h7[u5];
delete this.keyCache[c5], delete this._layerConfigs[c5], delete this._layers[c5];
}
this.familiesBySource = {};
for (var p5 = 0, f5 = function(e6, t7) {
for (var i7 = {}, o7 = 0; o7 < e6.length; o7++) {
var n9 = t7 && t7[e6[o7].id] || r6(e6[o7]);
t7 && (t7[e6[o7].id] = n9);
var a7 = i7[n9];
a7 || (a7 = i7[n9] = []), a7.push(e6[o7]);
}
var s8 = [];
for (var l9 in i7) {
s8.push(i7[l9]);
}
return s8;
}(e5.values(this._layerConfigs), this.keyCache); p5 < f5.length; p5 += 1) {
var d5 = f5[p5].map(function(e6) {
return o6._layers[e6.id];
}), g5 = d5[0];
if ("none" !== g5.visibility) {
var v5 = g5.source || "", m5 = this.familiesBySource[v5];
m5 || (m5 = this.familiesBySource[v5] = {});
var y5 = g5.sourceLayer || "_geojsonTileLayer", x5 = m5[y5];
x5 || (x5 = m5[y5] = []), x5.push(d5);
}
}
};
var o5 = function(t6) {
var r7 = {}, i6 = [];
for (var o6 in t6) {
var n8 = t6[o6], a6 = r7[o6] = {};
for (var s7 in n8) {
var l8 = n8[+s7];
if (l8 && 0 !== l8.bitmap.width && 0 !== l8.bitmap.height) {
var u5 = { x: 0, y: 0, w: l8.bitmap.width + 2, h: l8.bitmap.height + 2 };
i6.push(u5), a6[s7] = { rect: u5, metrics: l8.metrics };
}
}
}
var h7 = e5.potpack(i6), c5 = new e5.AlphaImage({ width: h7.w || 1, height: h7.h || 1 });
for (var p5 in t6) {
var f5 = t6[p5];
for (var d5 in f5) {
var g5 = f5[+d5];
if (g5 && 0 !== g5.bitmap.width && 0 !== g5.bitmap.height) {
var v5 = r7[p5][d5].rect;
e5.AlphaImage.copy(g5.bitmap, c5, { x: 0, y: 0 }, { x: v5.x + 1, y: v5.y + 1 }, g5.bitmap);
}
}
}
this.image = c5, this.positions = r7;
};
e5.register("GlyphAtlas", o5);
var n7 = function(t6) {
this.tileID = new e5.OverscaledTileID(t6.tileID.overscaledZ, t6.tileID.wrap, t6.tileID.canonical.z, t6.tileID.canonical.x, t6.tileID.canonical.y), this.uid = t6.uid, this.zoom = t6.zoom, this.pixelRatio = t6.pixelRatio, this.tileSize = t6.tileSize, this.source = t6.source, this.overscaling = this.tileID.overscaleFactor(), this.showCollisionBoxes = t6.showCollisionBoxes, this.collectResourceTiming = !!t6.collectResourceTiming, this.returnDependencies = !!t6.returnDependencies, this.promoteId = t6.promoteId;
};
function a5(t6, r7, i6) {
for (var o6 = new e5.EvaluationParameters(r7), n8 = 0, a6 = t6; n8 < a6.length; n8 += 1) {
a6[n8].recalculate(o6, i6);
}
}
function s6(t6, r7) {
var i6 = e5.getArrayBuffer(t6.request, function(t7, i7, o6, n8) {
t7 ? r7(t7) : i7 && r7(null, { vectorTile: new e5.vectorTile.VectorTile(new e5.pbf(i7)), rawData: i7, cacheControl: o6, expires: n8 });
});
return function() {
i6.cancel(), r7();
};
}
n7.prototype.parse = function(t6, r7, i6, n8, s7) {
var l8 = this;
this.status = "parsing", this.data = t6, this.collisionBoxArray = new e5.CollisionBoxArray();
var u5 = new e5.DictionaryCoder(Object.keys(t6.layers).sort()), h7 = new e5.FeatureIndex(this.tileID, this.promoteId);
h7.bucketLayerIDs = [];
var c5, p5, f5, d5, g5 = {}, v5 = { featureIndex: h7, iconDependencies: {}, patternDependencies: {}, glyphDependencies: {}, availableImages: i6 }, m5 = r7.familiesBySource[this.source];
for (var y5 in m5) {
var x5 = t6.layers[y5];
if (x5) {
1 === x5.version && e5.warnOnce('Vector tile source "' + this.source + '" layer "' + y5 + '" does not use vector tile spec v2 and therefore may have some rendering errors.');
for (var w5 = u5.encode(y5), S5 = [], I5 = 0; I5 < x5.length; I5++) {
var M5 = x5.feature(I5), b5 = h7.getId(M5, y5);
S5.push({ feature: M5, id: b5, index: I5, sourceLayerIndex: w5 });
}
for (var _4 = 0, k5 = m5[y5]; _4 < k5.length; _4 += 1) {
var P5 = k5[_4], T5 = P5[0];
T5.minzoom && this.zoom < Math.floor(T5.minzoom) || T5.maxzoom && this.zoom >= T5.maxzoom || "none" !== T5.visibility && (a5(P5, this.zoom, i6), (g5[T5.id] = T5.createBucket({ index: h7.bucketLayerIDs.length, layers: P5, zoom: this.zoom, pixelRatio: this.pixelRatio, overscaling: this.overscaling, collisionBoxArray: this.collisionBoxArray, sourceLayerIndex: w5, sourceID: this.source })).populate(S5, v5, this.tileID.canonical), h7.bucketLayerIDs.push(P5.map(function(e6) {
return e6.id;
})));
}
}
}
var C5 = e5.mapObject(v5.glyphDependencies, function(e6) {
return Object.keys(e6).map(Number);
});
Object.keys(C5).length ? n8.send("getGlyphs", { uid: this.uid, stacks: C5 }, function(e6, t7) {
c5 || (c5 = e6, p5 = t7, z5.call(l8));
}) : p5 = {};
var D5 = Object.keys(v5.iconDependencies);
D5.length ? n8.send("getImages", { icons: D5, source: this.source, tileID: this.tileID, type: "icons" }, function(e6, t7) {
c5 || (c5 = e6, f5 = t7, z5.call(l8));
}) : f5 = {};
var L5 = Object.keys(v5.patternDependencies);
function z5() {
if (c5) {
return s7(c5);
}
if (p5 && f5 && d5) {
var t7 = new o5(p5), r8 = new e5.ImageAtlas(f5, d5);
for (var n9 in g5) {
var l9 = g5[n9];
l9 instanceof e5.SymbolBucket ? (a5(l9.layers, this.zoom, i6), e5.performSymbolLayout(l9, p5, t7.positions, f5, r8.iconPositions, this.showCollisionBoxes, this.tileID.canonical)) : l9.hasPattern && (l9 instanceof e5.LineBucket || l9 instanceof e5.FillBucket || l9 instanceof e5.FillExtrusionBucket) && (a5(l9.layers, this.zoom, i6), l9.addFeatures(v5, this.tileID.canonical, r8.patternPositions));
}
this.status = "done", s7(null, { buckets: e5.values(g5).filter(function(e6) {
return !e6.isEmpty();
}), featureIndex: h7, collisionBoxArray: this.collisionBoxArray, glyphAtlasImage: t7.image, imageAtlas: r8, glyphMap: this.returnDependencies ? p5 : null, iconMap: this.returnDependencies ? f5 : null, glyphPositions: this.returnDependencies ? t7.positions : null });
}
}
L5.length ? n8.send("getImages", { icons: L5, source: this.source, tileID: this.tileID, type: "patterns" }, function(e6, t7) {
c5 || (c5 = e6, d5 = t7, z5.call(l8));
}) : d5 = {}, z5.call(this);
};
var l7 = function(e6, t6, r7, i6) {
this.actor = e6, this.layerIndex = t6, this.availableImages = r7, this.loadVectorData = i6 || s6, this.loading = {}, this.loaded = {};
};
l7.prototype.loadTile = function(t6, r7) {
var i6 = this, o6 = t6.uid;
this.loading || (this.loading = {});
var a6 = !!(t6 && t6.request && t6.request.collectResourceTiming) && new e5.RequestPerformance(t6.request), s7 = this.loading[o6] = new n7(t6);
s7.abort = this.loadVectorData(t6, function(t7, n8) {
if (delete i6.loading[o6], t7 || !n8) {
return s7.status = "done", i6.loaded[o6] = s7, r7(t7);
}
var l8 = n8.rawData, u5 = {};
n8.expires && (u5.expires = n8.expires), n8.cacheControl && (u5.cacheControl = n8.cacheControl);
var h7 = {};
if (a6) {
var c5 = a6.finish();
c5 && (h7.resourceTiming = JSON.parse(JSON.stringify(c5)));
}
s7.vectorTile = n8.vectorTile, s7.parse(n8.vectorTile, i6.layerIndex, i6.availableImages, i6.actor, function(t8, i7) {
if (t8 || !i7) {
return r7(t8);
}
r7(null, e5.extend({ rawTileData: l8.slice(0) }, i7, u5, h7));
}), i6.loaded = i6.loaded || {}, i6.loaded[o6] = s7;
});
}, l7.prototype.reloadTile = function(e6, t6) {
var r7 = this, i6 = this.loaded, o6 = e6.uid, n8 = this;
if (i6 && i6[o6]) {
var a6 = i6[o6];
a6.showCollisionBoxes = e6.showCollisionBoxes;
var s7 = function(e7, i7) {
var o7 = a6.reloadCallback;
o7 && (delete a6.reloadCallback, a6.parse(a6.vectorTile, n8.layerIndex, r7.availableImages, n8.actor, o7)), t6(e7, i7);
};
"parsing" === a6.status ? a6.reloadCallback = s7 : "done" === a6.status && (a6.vectorTile ? a6.parse(a6.vectorTile, this.layerIndex, this.availableImages, this.actor, s7) : s7());
}
}, l7.prototype.abortTile = function(e6, t6) {
var r7 = this.loading, i6 = e6.uid;
r7 && r7[i6] && r7[i6].abort && (r7[i6].abort(), delete r7[i6]), t6();
}, l7.prototype.removeTile = function(e6, t6) {
var r7 = this.loaded, i6 = e6.uid;
r7 && r7[i6] && delete r7[i6], t6();
};
var u4 = e5.window.ImageBitmap, h6 = function() {
this.loaded = {};
};
function c4(e6, t6) {
if (0 !== e6.length) {
p4(e6[0], t6);
for (var r7 = 1; r7 < e6.length; r7++) {
p4(e6[r7], !t6);
}
}
}
function p4(e6, t6) {
for (var r7 = 0, i6 = 0, o6 = 0, n8 = e6.length, a6 = n8 - 1; o6 < n8; a6 = o6++) {
var s7 = (e6[o6][0] - e6[a6][0]) * (e6[a6][1] + e6[o6][1]), l8 = r7 + s7;
i6 += Math.abs(r7) >= Math.abs(s7) ? r7 - l8 + s7 : s7 - l8 + r7, r7 = l8;
}
r7 + i6 >= 0 != !!t6 && e6.reverse();
}
h6.prototype.loadTile = function(t6, r7) {
var i6 = t6.uid, o6 = t6.encoding, n8 = t6.rawImageData, a6 = u4 && n8 instanceof u4 ? this.getImageData(n8) : n8, s7 = new e5.DEMData(i6, a6, o6);
this.loaded = this.loaded || {}, this.loaded[i6] = s7, r7(null, s7);
}, h6.prototype.getImageData = function(t6) {
this.offscreenCanvas && this.offscreenCanvasContext || (this.offscreenCanvas = new OffscreenCanvas(t6.width, t6.height), this.offscreenCanvasContext = this.offscreenCanvas.getContext("2d")), this.offscreenCanvas.width = t6.width, this.offscreenCanvas.height = t6.height, this.offscreenCanvasContext.drawImage(t6, 0, 0, t6.width, t6.height);
var r7 = this.offscreenCanvasContext.getImageData(-1, -1, t6.width + 2, t6.height + 2);
return this.offscreenCanvasContext.clearRect(0, 0, this.offscreenCanvas.width, this.offscreenCanvas.height), new e5.RGBAImage({ width: r7.width, height: r7.height }, r7.data);
}, h6.prototype.removeTile = function(e6) {
var t6 = this.loaded, r7 = e6.uid;
t6 && t6[r7] && delete t6[r7];
};
var f4 = e5.vectorTile.VectorTileFeature.prototype.toGeoJSON, d4 = function(t6) {
this._feature = t6, this.extent = e5.EXTENT, this.type = t6.type, this.properties = t6.tags, "id" in t6 && !isNaN(t6.id) && (this.id = parseInt(t6.id, 10));
};
d4.prototype.loadGeometry = function() {
if (1 === this._feature.type) {
for (var t6 = [], r7 = 0, i6 = this._feature.geometry; r7 < i6.length; r7 += 1) {
var o6 = i6[r7];
t6.push([new e5.Point$1(o6[0], o6[1])]);
}
return t6;
}
for (var n8 = [], a6 = 0, s7 = this._feature.geometry; a6 < s7.length; a6 += 1) {
for (var l8 = [], u5 = 0, h7 = s7[a6]; u5 < h7.length; u5 += 1) {
var c5 = h7[u5];
l8.push(new e5.Point$1(c5[0], c5[1]));
}
n8.push(l8);
}
return n8;
}, d4.prototype.toGeoJSON = function(e6, t6, r7) {
return f4.call(this, e6, t6, r7);
};
var g4 = function(t6) {
this.layers = { _geojsonTileLayer: this }, this.name = "_geojsonTileLayer", this.extent = e5.EXTENT, this.length = t6.length, this._features = t6;
};
g4.prototype.feature = function(e6) {
return new d4(this._features[e6]);
};
var v4 = e5.vectorTile.VectorTileFeature, m4 = y4;
function y4(e6, t6) {
this.options = t6 || {}, this.features = e6, this.length = e6.length;
}
function x4(e6, t6) {
this.id = "number" == typeof e6.id ? e6.id : void 0, this.type = e6.type, this.rawGeometry = 1 === e6.type ? [e6.geometry] : e6.geometry, this.properties = e6.tags, this.extent = t6 || 4096;
}
y4.prototype.feature = function(e6) {
return new x4(this.features[e6], this.options.extent);
}, x4.prototype.loadGeometry = function() {
var t6 = this.rawGeometry;
this.geometry = [];
for (var r7 = 0; r7 < t6.length; r7++) {
for (var i6 = t6[r7], o6 = [], n8 = 0; n8 < i6.length; n8++) {
o6.push(new e5.Point$1(i6[n8][0], i6[n8][1]));
}
this.geometry.push(o6);
}
return this.geometry;
}, x4.prototype.bbox = function() {
this.geometry || this.loadGeometry();
for (var e6 = this.geometry, t6 = 1 / 0, r7 = -1 / 0, i6 = 1 / 0, o6 = -1 / 0, n8 = 0; n8 < e6.length; n8++) {
for (var a6 = e6[n8], s7 = 0; s7 < a6.length; s7++) {
var l8 = a6[s7];
t6 = Math.min(t6, l8.x), r7 = Math.max(r7, l8.x), i6 = Math.min(i6, l8.y), o6 = Math.max(o6, l8.y);
}
}
return [t6, i6, r7, o6];
}, x4.prototype.toGeoJSON = v4.prototype.toGeoJSON;
var w4 = I4, S4 = m4;
function I4(t6) {
var r7 = new e5.pbf();
return function(e6, t7) {
for (var r8 in e6.layers) {
t7.writeMessage(3, M4, e6.layers[r8]);
}
}(t6, r7), r7.finish();
}
function M4(e6, t6) {
var r7;
t6.writeVarintField(15, e6.version || 1), t6.writeStringField(1, e6.name || ""), t6.writeVarintField(5, e6.extent || 4096);
var i6 = { keys: [], values: [], keycache: {}, valuecache: {} };
for (r7 = 0; r7 < e6.length; r7++) {
i6.feature = e6.feature(r7), t6.writeMessage(2, b4, i6);
}
var o6 = i6.keys;
for (r7 = 0; r7 < o6.length; r7++) {
t6.writeStringField(3, o6[r7]);
}
var n8 = i6.values;
for (r7 = 0; r7 < n8.length; r7++) {
t6.writeMessage(4, C4, n8[r7]);
}
}
function b4(e6, t6) {
var r7 = e6.feature;
void 0 !== r7.id && t6.writeVarintField(1, r7.id), t6.writeMessage(2, _3, e6), t6.writeVarintField(3, r7.type), t6.writeMessage(4, T4, r7);
}
function _3(e6, t6) {
var r7 = e6.feature, i6 = e6.keys, o6 = e6.values, n8 = e6.keycache, a6 = e6.valuecache;
for (var s7 in r7.properties) {
var l8 = n8[s7];
void 0 === l8 && (i6.push(s7), n8[s7] = l8 = i6.length - 1), t6.writeVarint(l8);
var u5 = r7.properties[s7], h7 = typeof u5;
"string" !== h7 && "boolean" !== h7 && "number" !== h7 && (u5 = JSON.stringify(u5));
var c5 = h7 + ":" + u5, p5 = a6[c5];
void 0 === p5 && (o6.push(u5), a6[c5] = p5 = o6.length - 1), t6.writeVarint(p5);
}
}
function k4(e6, t6) {
return (t6 << 3) + (7 & e6);
}
function P4(e6) {
return e6 << 1 ^ e6 >> 31;
}
function T4(e6, t6) {
for (var r7 = e6.loadGeometry(), i6 = e6.type, o6 = 0, n8 = 0, a6 = r7.length, s7 = 0; s7 < a6; s7++) {
var l8 = r7[s7], u5 = 1;
1 === i6 && (u5 = l8.length), t6.writeVarint(k4(1, u5));
for (var h7 = 3 === i6 ? l8.length - 1 : l8.length, c5 = 0; c5 < h7; c5++) {
1 === c5 && 1 !== i6 && t6.writeVarint(k4(2, h7 - 1));
var p5 = l8[c5].x - o6, f5 = l8[c5].y - n8;
t6.writeVarint(P4(p5)), t6.writeVarint(P4(f5)), o6 += p5, n8 += f5;
}
3 === i6 && t6.writeVarint(k4(7, 1));
}
}
function C4(e6, t6) {
var r7 = typeof e6;
"string" === r7 ? t6.writeStringField(1, e6) : "boolean" === r7 ? t6.writeBooleanField(7, e6) : "number" === r7 && (e6 % 1 != 0 ? t6.writeDoubleField(3, e6) : e6 < 0 ? t6.writeSVarintField(6, e6) : t6.writeVarintField(5, e6));
}
function D4(e6, t6, r7, i6) {
L4(e6, r7, i6), L4(t6, 2 * r7, 2 * i6), L4(t6, 2 * r7 + 1, 2 * i6 + 1);
}
function L4(e6, t6, r7) {
var i6 = e6[t6];
e6[t6] = e6[r7], e6[r7] = i6;
}
function z4(e6, t6, r7, i6) {
var o6 = e6 - r7, n8 = t6 - i6;
return o6 * o6 + n8 * n8;
}
w4.fromVectorTileJs = I4, w4.fromGeojsonVt = function(e6, t6) {
t6 = t6 || {};
var r7 = {};
for (var i6 in e6) {
r7[i6] = new m4(e6[i6].features, t6), r7[i6].name = i6, r7[i6].version = t6.version, r7[i6].extent = t6.extent;
}
return I4({ layers: r7 });
}, w4.GeoJSONWrapper = S4;
var O4 = function(e6) {
return e6[0];
}, E3 = function(e6) {
return e6[1];
}, F3 = function(e6, t6, r7, i6, o6) {
void 0 === t6 && (t6 = O4), void 0 === r7 && (r7 = E3), void 0 === i6 && (i6 = 64), void 0 === o6 && (o6 = Float64Array), this.nodeSize = i6, this.points = e6;
for (var n8 = e6.length < 65536 ? Uint16Array : Uint32Array, a6 = this.ids = new n8(e6.length), s7 = this.coords = new o6(2 * e6.length), l8 = 0; l8 < e6.length; l8++) {
a6[l8] = l8, s7[2 * l8] = t6(e6[l8]), s7[2 * l8 + 1] = r7(e6[l8]);
}
!function e7(t7, r8, i7, o7, n9, a7) {
if (!(n9 - o7 <= i7)) {
var s8 = o7 + n9 >> 1;
!function e8(t8, r9, i8, o8, n10, a8) {
for (; n10 > o8; ) {
if (n10 - o8 > 600) {
var s9 = n10 - o8 + 1, l9 = i8 - o8 + 1, u5 = Math.log(s9), h7 = 0.5 * Math.exp(2 * u5 / 3), c5 = 0.5 * Math.sqrt(u5 * h7 * (s9 - h7) / s9) * (l9 - s9 / 2 < 0 ? -1 : 1);
e8(t8, r9, i8, Math.max(o8, Math.floor(i8 - l9 * h7 / s9 + c5)), Math.min(n10, Math.floor(i8 + (s9 - l9) * h7 / s9 + c5)), a8);
}
var p5 = r9[2 * i8 + a8], f5 = o8, d5 = n10;
for (D4(t8, r9, o8, i8), r9[2 * n10 + a8] > p5 && D4(t8, r9, o8, n10); f5 < d5; ) {
for (D4(t8, r9, f5, d5), f5++, d5--; r9[2 * f5 + a8] < p5; ) {
f5++;
}
for (; r9[2 * d5 + a8] > p5; ) {
d5--;
}
}
r9[2 * o8 + a8] === p5 ? D4(t8, r9, o8, d5) : D4(t8, r9, ++d5, n10), d5 <= i8 && (o8 = d5 + 1), i8 <= d5 && (n10 = d5 - 1);
}
}(t7, r8, s8, o7, n9, a7 % 2), e7(t7, r8, i7, o7, s8 - 1, a7 + 1), e7(t7, r8, i7, s8 + 1, n9, a7 + 1);
}
}(a6, s7, i6, 0, a6.length - 1, 0);
};
F3.prototype.range = function(e6, t6, r7, i6) {
return function(e7, t7, r8, i7, o6, n8, a6) {
for (var s7, l8, u5 = [0, e7.length - 1, 0], h7 = []; u5.length; ) {
var c5 = u5.pop(), p5 = u5.pop(), f5 = u5.pop();
if (p5 - f5 <= a6) {
for (var d5 = f5; d5 <= p5; d5++) {
l8 = t7[2 * d5 + 1], (s7 = t7[2 * d5]) >= r8 && s7 <= o6 && l8 >= i7 && l8 <= n8 && h7.push(e7[d5]);
}
} else {
var g5 = Math.floor((f5 + p5) / 2);
l8 = t7[2 * g5 + 1], (s7 = t7[2 * g5]) >= r8 && s7 <= o6 && l8 >= i7 && l8 <= n8 && h7.push(e7[g5]);
var v5 = (c5 + 1) % 2;
(0 === c5 ? r8 <= s7 : i7 <= l8) && (u5.push(f5), u5.push(g5 - 1), u5.push(v5)), (0 === c5 ? o6 >= s7 : n8 >= l8) && (u5.push(g5 + 1), u5.push(p5), u5.push(v5));
}
}
return h7;
}(this.ids, this.coords, e6, t6, r7, i6, this.nodeSize);
}, F3.prototype.within = function(e6, t6, r7) {
return function(e7, t7, r8, i6, o6, n8) {
for (var a6 = [0, e7.length - 1, 0], s7 = [], l8 = o6 * o6; a6.length; ) {
var u5 = a6.pop(), h7 = a6.pop(), c5 = a6.pop();
if (h7 - c5 <= n8) {
for (var p5 = c5; p5 <= h7; p5++) {
z4(t7[2 * p5], t7[2 * p5 + 1], r8, i6) <= l8 && s7.push(e7[p5]);
}
} else {
var f5 = Math.floor((c5 + h7) / 2), d5 = t7[2 * f5], g5 = t7[2 * f5 + 1];
z4(d5, g5, r8, i6) <= l8 && s7.push(e7[f5]);
var v5 = (u5 + 1) % 2;
(0 === u5 ? r8 - o6 <= d5 : i6 - o6 <= g5) && (a6.push(c5), a6.push(f5 - 1), a6.push(v5)), (0 === u5 ? r8 + o6 >= d5 : i6 + o6 >= g5) && (a6.push(f5 + 1), a6.push(h7), a6.push(v5));
}
}
return s7;
}(this.ids, this.coords, e6, t6, r7, this.nodeSize);
};
var N4 = { minZoom: 0, maxZoom: 16, minPoints: 2, radius: 40, extent: 512, nodeSize: 64, log: false, generateId: false, reduce: null, map: function(e6) {
return e6;
} }, J3 = function(e6) {
this.options = V3(Object.create(N4), e6), this.trees = new Array(this.options.maxZoom + 1);
};
function Z2(e6, t6, r7, i6, o6) {
return { x: e6, y: t6, zoom: 1 / 0, id: r7, parentId: -1, numPoints: i6, properties: o6 };
}
function A4(e6, t6) {
var r7 = e6.geometry.coordinates, i6 = r7[1];
return { x: Y2(r7[0]), y: j4(i6), zoom: 1 / 0, index: t6, parentId: -1 };
}
function B3(e6) {
return { type: "Feature", id: e6.id, properties: G3(e6), geometry: { type: "Point", coordinates: [(i6 = e6.x, 360 * (i6 - 0.5)), (t6 = e6.y, r7 = (180 - 360 * t6) * Math.PI / 180, 360 * Math.atan(Math.exp(r7)) / Math.PI - 90)] } };
var t6, r7, i6;
}
function G3(e6) {
var t6 = e6.numPoints, r7 = t6 >= 1e4 ? Math.round(t6 / 1e3) + "k" : t6 >= 1e3 ? Math.round(t6 / 100) / 10 + "k" : t6;
return V3(V3({}, e6.properties), { cluster: true, cluster_id: e6.id, point_count: t6, point_count_abbreviated: r7 });
}
function Y2(e6) {
return e6 / 360 + 0.5;
}
function j4(e6) {
var t6 = Math.sin(e6 * Math.PI / 180), r7 = 0.5 - 0.25 * Math.log((1 + t6) / (1 - t6)) / Math.PI;
return r7 < 0 ? 0 : r7 > 1 ? 1 : r7;
}
function V3(e6, t6) {
for (var r7 in t6) {
e6[r7] = t6[r7];
}
return e6;
}
function X3(e6) {
return e6.x;
}
function W3(e6) {
return e6.y;
}
function R3(e6, t6, r7, i6, o6, n8) {
var a6 = o6 - r7, s7 = n8 - i6;
if (0 !== a6 || 0 !== s7) {
var l8 = ((e6 - r7) * a6 + (t6 - i6) * s7) / (a6 * a6 + s7 * s7);
l8 > 1 ? (r7 = o6, i6 = n8) : l8 > 0 && (r7 += a6 * l8, i6 += s7 * l8);
}
return (a6 = e6 - r7) * a6 + (s7 = t6 - i6) * s7;
}
function q4(e6, t6, r7, i6) {
var o6 = { id: void 0 === e6 ? null : e6, type: t6, geometry: r7, tags: i6, minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0 };
return function(e7) {
var t7 = e7.geometry, r8 = e7.type;
if ("Point" === r8 || "MultiPoint" === r8 || "LineString" === r8) {
U3(e7, t7);
} else if ("Polygon" === r8 || "MultiLineString" === r8) {
for (var i7 = 0; i7 < t7.length; i7++) {
U3(e7, t7[i7]);
}
} else if ("MultiPolygon" === r8) {
for (i7 = 0; i7 < t7.length; i7++) {
for (var o7 = 0; o7 < t7[i7].length; o7++) {
U3(e7, t7[i7][o7]);
}
}
}
}(o6), o6;
}
function U3(e6, t6) {
for (var r7 = 0; r7 < t6.length; r7 += 3) {
e6.minX = Math.min(e6.minX, t6[r7]), e6.minY = Math.min(e6.minY, t6[r7 + 1]), e6.maxX = Math.max(e6.maxX, t6[r7]), e6.maxY = Math.max(e6.maxY, t6[r7 + 1]);
}
}
function $3(e6, t6, r7, i6) {
if (t6.geometry) {
var o6 = t6.geometry.coordinates, n8 = t6.geometry.type, a6 = Math.pow(r7.tolerance / ((1 << r7.maxZoom) * r7.extent), 2), s7 = [], l8 = t6.id;
if (r7.promoteId ? l8 = t6.properties[r7.promoteId] : r7.generateId && (l8 = i6 || 0), "Point" === n8) {
H4(o6, s7);
} else if ("MultiPoint" === n8) {
for (var u5 = 0; u5 < o6.length; u5++) {
H4(o6[u5], s7);
}
} else if ("LineString" === n8) {
K3(o6, s7, a6, false);
} else if ("MultiLineString" === n8) {
if (r7.lineMetrics) {
for (u5 = 0; u5 < o6.length; u5++) {
K3(o6[u5], s7 = [], a6, false), e6.push(q4(l8, "LineString", s7, t6.properties));
}
return;
}
Q2(o6, s7, a6, false);
} else if ("Polygon" === n8) {
Q2(o6, s7, a6, true);
} else {
if ("MultiPolygon" !== n8) {
if ("GeometryCollection" === n8) {
for (u5 = 0; u5 < t6.geometry.geometries.length; u5++) {
$3(e6, { id: l8, geometry: t6.geometry.geometries[u5], properties: t6.properties }, r7, i6);
}
return;
}
throw new Error("Input data is not a valid GeoJSON object.");
}
for (u5 = 0; u5 < o6.length; u5++) {
var h7 = [];
Q2(o6[u5], h7, a6, true), s7.push(h7);
}
}
e6.push(q4(l8, n8, s7, t6.properties));
}
}
function H4(e6, t6) {
t6.push(ee2(e6[0])), t6.push(te2(e6[1])), t6.push(0);
}
function K3(e6, t6, r7, i6) {
for (var o6, n8, a6 = 0, s7 = 0; s7 < e6.length; s7++) {
var l8 = ee2(e6[s7][0]), u5 = te2(e6[s7][1]);
t6.push(l8), t6.push(u5), t6.push(0), s7 > 0 && (a6 += i6 ? (o6 * u5 - l8 * n8) / 2 : Math.sqrt(Math.pow(l8 - o6, 2) + Math.pow(u5 - n8, 2))), o6 = l8, n8 = u5;
}
var h7 = t6.length - 3;
t6[2] = 1, function e7(t7, r8, i7, o7) {
for (var n9, a7 = o7, s8 = i7 - r8 >> 1, l9 = i7 - r8, u6 = t7[r8], h8 = t7[r8 + 1], c5 = t7[i7], p5 = t7[i7 + 1], f5 = r8 + 3; f5 < i7; f5 += 3) {
var d5 = R3(t7[f5], t7[f5 + 1], u6, h8, c5, p5);
if (d5 > a7) {
n9 = f5, a7 = d5;
} else if (d5 === a7) {
var g5 = Math.abs(f5 - s8);
g5 < l9 && (n9 = f5, l9 = g5);
}
}
a7 > o7 && (n9 - r8 > 3 && e7(t7, r8, n9, o7), t7[n9 + 2] = a7, i7 - n9 > 3 && e7(t7, n9, i7, o7));
}(t6, 0, h7, r7), t6[h7 + 2] = 1, t6.size = Math.abs(a6), t6.start = 0, t6.end = t6.size;
}
function Q2(e6, t6, r7, i6) {
for (var o6 = 0; o6 < e6.length; o6++) {
var n8 = [];
K3(e6[o6], n8, r7, i6), t6.push(n8);
}
}
function ee2(e6) {
return e6 / 360 + 0.5;
}
function te2(e6) {
var t6 = Math.sin(e6 * Math.PI / 180), r7 = 0.5 - 0.25 * Math.log((1 + t6) / (1 - t6)) / Math.PI;
return r7 < 0 ? 0 : r7 > 1 ? 1 : r7;
}
function re2(e6, t6, r7, i6, o6, n8, a6, s7) {
if (i6 /= t6, n8 >= (r7 /= t6) && a6 < i6) {
return e6;
}
if (a6 < r7 || n8 >= i6) {
return null;
}
for (var l8 = [], u5 = 0; u5 < e6.length; u5++) {
var h7 = e6[u5], c5 = h7.geometry, p5 = h7.type, f5 = 0 === o6 ? h7.minX : h7.minY, d5 = 0 === o6 ? h7.maxX : h7.maxY;
if (f5 >= r7 && d5 < i6) {
l8.push(h7);
} else if (!(d5 < r7 || f5 >= i6)) {
var g5 = [];
if ("Point" === p5 || "MultiPoint" === p5) {
ie4(c5, g5, r7, i6, o6);
} else if ("LineString" === p5) {
oe2(c5, g5, r7, i6, o6, false, s7.lineMetrics);
} else if ("MultiLineString" === p5) {
ae2(c5, g5, r7, i6, o6, false);
} else if ("Polygon" === p5) {
ae2(c5, g5, r7, i6, o6, true);
} else if ("MultiPolygon" === p5) {
for (var v5 = 0; v5 < c5.length; v5++) {
var m5 = [];
ae2(c5[v5], m5, r7, i6, o6, true), m5.length && g5.push(m5);
}
}
if (g5.length) {
if (s7.lineMetrics && "LineString" === p5) {
for (v5 = 0; v5 < g5.length; v5++) {
l8.push(q4(h7.id, p5, g5[v5], h7.tags));
}
continue;
}
"LineString" !== p5 && "MultiLineString" !== p5 || (1 === g5.length ? (p5 = "LineString", g5 = g5[0]) : p5 = "MultiLineString"), "Point" !== p5 && "MultiPoint" !== p5 || (p5 = 3 === g5.length ? "Point" : "MultiPoint"), l8.push(q4(h7.id, p5, g5, h7.tags));
}
}
}
return l8.length ? l8 : null;
}
function ie4(e6, t6, r7, i6, o6) {
for (var n8 = 0; n8 < e6.length; n8 += 3) {
var a6 = e6[n8 + o6];
a6 >= r7 && a6 <= i6 && (t6.push(e6[n8]), t6.push(e6[n8 + 1]), t6.push(e6[n8 + 2]));
}
}
function oe2(e6, t6, r7, i6, o6, n8, a6) {
for (var s7, l8, u5 = ne2(e6), h7 = 0 === o6 ? le2 : ue2, c5 = e6.start, p5 = 0; p5 < e6.length - 3; p5 += 3) {
var f5 = e6[p5], d5 = e6[p5 + 1], g5 = e6[p5 + 2], v5 = e6[p5 + 3], m5 = e6[p5 + 4], y5 = 0 === o6 ? f5 : d5, x5 = 0 === o6 ? v5 : m5, w5 = false;
a6 && (s7 = Math.sqrt(Math.pow(f5 - v5, 2) + Math.pow(d5 - m5, 2))), y5 < r7 ? x5 > r7 && (l8 = h7(u5, f5, d5, v5, m5, r7), a6 && (u5.start = c5 + s7 * l8)) : y5 > i6 ? x5 < i6 && (l8 = h7(u5, f5, d5, v5, m5, i6), a6 && (u5.start = c5 + s7 * l8)) : se2(u5, f5, d5, g5), x5 < r7 && y5 >= r7 && (l8 = h7(u5, f5, d5, v5, m5, r7), w5 = true), x5 > i6 && y5 <= i6 && (l8 = h7(u5, f5, d5, v5, m5, i6), w5 = true), !n8 && w5 && (a6 && (u5.end = c5 + s7 * l8), t6.push(u5), u5 = ne2(e6)), a6 && (c5 += s7);
}
var S5 = e6.length - 3;
f5 = e6[S5], d5 = e6[S5 + 1], g5 = e6[S5 + 2], (y5 = 0 === o6 ? f5 : d5) >= r7 && y5 <= i6 && se2(u5, f5, d5, g5), S5 = u5.length - 3, n8 && S5 >= 3 && (u5[S5] !== u5[0] || u5[S5 + 1] !== u5[1]) && se2(u5, u5[0], u5[1], u5[2]), u5.length && t6.push(u5);
}
function ne2(e6) {
var t6 = [];
return t6.size = e6.size, t6.start = e6.start, t6.end = e6.end, t6;
}
function ae2(e6, t6, r7, i6, o6, n8) {
for (var a6 = 0; a6 < e6.length; a6++) {
oe2(e6[a6], t6, r7, i6, o6, n8, false);
}
}
function se2(e6, t6, r7, i6) {
e6.push(t6), e6.push(r7), e6.push(i6);
}
function le2(e6, t6, r7, i6, o6, n8) {
var a6 = (n8 - t6) / (i6 - t6);
return e6.push(n8), e6.push(r7 + (o6 - r7) * a6), e6.push(1), a6;
}
function ue2(e6, t6, r7, i6, o6, n8) {
var a6 = (n8 - r7) / (o6 - r7);
return e6.push(t6 + (i6 - t6) * a6), e6.push(n8), e6.push(1), a6;
}
function he2(e6, t6) {
for (var r7 = [], i6 = 0; i6 < e6.length; i6++) {
var o6, n8 = e6[i6], a6 = n8.type;
if ("Point" === a6 || "MultiPoint" === a6 || "LineString" === a6) {
o6 = ce2(n8.geometry, t6);
} else if ("MultiLineString" === a6 || "Polygon" === a6) {
o6 = [];
for (var s7 = 0; s7 < n8.geometry.length; s7++) {
o6.push(ce2(n8.geometry[s7], t6));
}
} else if ("MultiPolygon" === a6) {
for (o6 = [], s7 = 0; s7 < n8.geometry.length; s7++) {
for (var l8 = [], u5 = 0; u5 < n8.geometry[s7].length; u5++) {
l8.push(ce2(n8.geometry[s7][u5], t6));
}
o6.push(l8);
}
}
r7.push(q4(n8.id, a6, o6, n8.tags));
}
return r7;
}
function ce2(e6, t6) {
var r7 = [];
r7.size = e6.size, void 0 !== e6.start && (r7.start = e6.start, r7.end = e6.end);
for (var i6 = 0; i6 < e6.length; i6 += 3) {
r7.push(e6[i6] + t6, e6[i6 + 1], e6[i6 + 2]);
}
return r7;
}
function pe2(e6, t6) {
if (e6.transformed) {
return e6;
}
var r7, i6, o6, n8 = 1 << e6.z, a6 = e6.x, s7 = e6.y;
for (r7 = 0; r7 < e6.features.length; r7++) {
var l8 = e6.features[r7], u5 = l8.geometry, h7 = l8.type;
if (l8.geometry = [], 1 === h7) {
for (i6 = 0; i6 < u5.length; i6 += 2) {
l8.geometry.push(fe2(u5[i6], u5[i6 + 1], t6, n8, a6, s7));
}
} else {
for (i6 = 0; i6 < u5.length; i6++) {
var c5 = [];
for (o6 = 0; o6 < u5[i6].length; o6 += 2) {
c5.push(fe2(u5[i6][o6], u5[i6][o6 + 1], t6, n8, a6, s7));
}
l8.geometry.push(c5);
}
}
}
return e6.transformed = true, e6;
}
function fe2(e6, t6, r7, i6, o6, n8) {
return [Math.round(r7 * (e6 * i6 - o6)), Math.round(r7 * (t6 * i6 - n8))];
}
function de2(e6, t6, r7, i6, o6) {
for (var n8 = t6 === o6.maxZoom ? 0 : o6.tolerance / ((1 << t6) * o6.extent), a6 = { features: [], numPoints: 0, numSimplified: 0, numFeatures: 0, source: null, x: r7, y: i6, z: t6, transformed: false, minX: 2, minY: 1, maxX: -1, maxY: 0 }, s7 = 0; s7 < e6.length; s7++) {
a6.numFeatures++, ge2(a6, e6[s7], n8, o6);
var l8 = e6[s7].minX, u5 = e6[s7].minY, h7 = e6[s7].maxX, c5 = e6[s7].maxY;
l8 < a6.minX && (a6.minX = l8), u5 < a6.minY && (a6.minY = u5), h7 > a6.maxX && (a6.maxX = h7), c5 > a6.maxY && (a6.maxY = c5);
}
return a6;
}
function ge2(e6, t6, r7, i6) {
var o6 = t6.geometry, n8 = t6.type, a6 = [];
if ("Point" === n8 || "MultiPoint" === n8) {
for (var s7 = 0; s7 < o6.length; s7 += 3) {
a6.push(o6[s7]), a6.push(o6[s7 + 1]), e6.numPoints++, e6.numSimplified++;
}
} else if ("LineString" === n8) {
ve2(a6, o6, e6, r7, false, false);
} else if ("MultiLineString" === n8 || "Polygon" === n8) {
for (s7 = 0; s7 < o6.length; s7++) {
ve2(a6, o6[s7], e6, r7, "Polygon" === n8, 0 === s7);
}
} else if ("MultiPolygon" === n8) {
for (var l8 = 0; l8 < o6.length; l8++) {
var u5 = o6[l8];
for (s7 = 0; s7 < u5.length; s7++) {
ve2(a6, u5[s7], e6, r7, true, 0 === s7);
}
}
}
if (a6.length) {
var h7 = t6.tags || null;
if ("LineString" === n8 && i6.lineMetrics) {
for (var c5 in h7 = {}, t6.tags) {
h7[c5] = t6.tags[c5];
}
h7.mapbox_clip_start = o6.start / o6.size, h7.mapbox_clip_end = o6.end / o6.size;
}
var p5 = { geometry: a6, type: "Polygon" === n8 || "MultiPolygon" === n8 ? 3 : "LineString" === n8 || "MultiLineString" === n8 ? 2 : 1, tags: h7 };
null !== t6.id && (p5.id = t6.id), e6.features.push(p5);
}
}
function ve2(e6, t6, r7, i6, o6, n8) {
var a6 = i6 * i6;
if (i6 > 0 && t6.size < (o6 ? a6 : i6)) {
r7.numPoints += t6.length / 3;
} else {
for (var s7 = [], l8 = 0; l8 < t6.length; l8 += 3) {
(0 === i6 || t6[l8 + 2] > a6) && (r7.numSimplified++, s7.push(t6[l8]), s7.push(t6[l8 + 1])), r7.numPoints++;
}
o6 && function(e7, t7) {
for (var r8 = 0, i7 = 0, o7 = e7.length, n9 = o7 - 2; i7 < o7; n9 = i7, i7 += 2) {
r8 += (e7[i7] - e7[n9]) * (e7[i7 + 1] + e7[n9 + 1]);
}
if (r8 > 0 === t7) {
for (i7 = 0, o7 = e7.length; i7 < o7 / 2; i7 += 2) {
var a7 = e7[i7], s8 = e7[i7 + 1];
e7[i7] = e7[o7 - 2 - i7], e7[i7 + 1] = e7[o7 - 1 - i7], e7[o7 - 2 - i7] = a7, e7[o7 - 1 - i7] = s8;
}
}
}(s7, n8), e6.push(s7);
}
}
function me2(e6, t6) {
var r7 = (t6 = this.options = function(e7, t7) {
for (var r8 in t7) {
e7[r8] = t7[r8];
}
return e7;
}(Object.create(this.options), t6)).debug;
if (r7 && console.time("preprocess data"), t6.maxZoom < 0 || t6.maxZoom > 24) {
throw new Error("maxZoom should be in the 0-24 range");
}
if (t6.promoteId && t6.generateId) {
throw new Error("promoteId and generateId cannot be used together.");
}
var i6 = function(e7, t7) {
var r8 = [];
if ("FeatureCollection" === e7.type) {
for (var i7 = 0; i7 < e7.features.length; i7++) {
$3(r8, e7.features[i7], t7, i7);
}
} else {
$3(r8, "Feature" === e7.type ? e7 : { geometry: e7 }, t7);
}
return r8;
}(e6, t6);
this.tiles = {}, this.tileCoords = [], r7 && (console.timeEnd("preprocess data"), console.log("index: maxZoom: %d, maxPoints: %d", t6.indexMaxZoom, t6.indexMaxPoints), console.time("generate tiles"), this.stats = {}, this.total = 0), (i6 = function(e7, t7) {
var r8 = t7.buffer / t7.extent, i7 = e7, o6 = re2(e7, 1, -1 - r8, r8, 0, -1, 2, t7), n8 = re2(e7, 1, 1 - r8, 2 + r8, 0, -1, 2, t7);
return (o6 || n8) && (i7 = re2(e7, 1, -r8, 1 + r8, 0, -1, 2, t7) || [], o6 && (i7 = he2(o6, 1).concat(i7)), n8 && (i7 = i7.concat(he2(n8, -1)))), i7;
}(i6, t6)).length && this.splitTile(i6, 0, 0, 0), r7 && (i6.length && console.log("features: %d, points: %d", this.tiles[0].numFeatures, this.tiles[0].numPoints), console.timeEnd("generate tiles"), console.log("tiles generated:", this.total, JSON.stringify(this.stats)));
}
function ye2(e6, t6, r7) {
return 32 * ((1 << e6) * r7 + t6) + e6;
}
function xe2(e6, t6) {
var r7 = e6.tileID.canonical;
if (!this._geoJSONIndex) {
return t6(null, null);
}
var i6 = this._geoJSONIndex.getTile(r7.z, r7.x, r7.y);
if (!i6) {
return t6(null, null);
}
var o6 = new g4(i6.features), n8 = w4(o6);
0 === n8.byteOffset && n8.byteLength === n8.buffer.byteLength || (n8 = new Uint8Array(n8)), t6(null, { vectorTile: o6, rawData: n8.buffer });
}
J3.prototype.load = function(e6) {
var t6 = this.options, r7 = t6.log, i6 = t6.minZoom, o6 = t6.maxZoom, n8 = t6.nodeSize;
r7 && console.time("total time");
var a6 = "prepare " + e6.length + " points";
r7 && console.time(a6), this.points = e6;
for (var s7 = [], l8 = 0; l8 < e6.length; l8++) {
e6[l8].geometry && s7.push(A4(e6[l8], l8));
}
this.trees[o6 + 1] = new F3(s7, X3, W3, n8, Float32Array), r7 && console.timeEnd(a6);
for (var u5 = o6; u5 >= i6; u5--) {
var h7 = +Date.now();
s7 = this._cluster(s7, u5), this.trees[u5] = new F3(s7, X3, W3, n8, Float32Array), r7 && console.log("z%d: %d clusters in %dms", u5, s7.length, +Date.now() - h7);
}
return r7 && console.timeEnd("total time"), this;
}, J3.prototype.getClusters = function(e6, t6) {
var r7 = ((e6[0] + 180) % 360 + 360) % 360 - 180, i6 = Math.max(-90, Math.min(90, e6[1])), o6 = 180 === e6[2] ? 180 : ((e6[2] + 180) % 360 + 360) % 360 - 180, n8 = Math.max(-90, Math.min(90, e6[3]));
if (e6[2] - e6[0] >= 360) {
r7 = -180, o6 = 180;
} else if (r7 > o6) {
var a6 = this.getClusters([r7, i6, 180, n8], t6), s7 = this.getClusters([-180, i6, o6, n8], t6);
return a6.concat(s7);
}
for (var l8 = this.trees[this._limitZoom(t6)], u5 = [], h7 = 0, c5 = l8.range(Y2(r7), j4(n8), Y2(o6), j4(i6)); h7 < c5.length; h7 += 1) {
var p5 = l8.points[c5[h7]];
u5.push(p5.numPoints ? B3(p5) : this.points[p5.index]);
}
return u5;
}, J3.prototype.getChildren = function(e6) {
var t6 = this._getOriginId(e6), r7 = this._getOriginZoom(e6), i6 = "No cluster with the specified id.", o6 = this.trees[r7];
if (!o6) {
throw new Error(i6);
}
var n8 = o6.points[t6];
if (!n8) {
throw new Error(i6);
}
for (var a6 = this.options.radius / (this.options.extent * Math.pow(2, r7 - 1)), s7 = [], l8 = 0, u5 = o6.within(n8.x, n8.y, a6); l8 < u5.length; l8 += 1) {
var h7 = o6.points[u5[l8]];
h7.parentId === e6 && s7.push(h7.numPoints ? B3(h7) : this.points[h7.index]);
}
if (0 === s7.length) {
throw new Error(i6);
}
return s7;
}, J3.prototype.getLeaves = function(e6, t6, r7) {
var i6 = [];
return this._appendLeaves(i6, e6, t6 = t6 || 10, r7 = r7 || 0, 0), i6;
}, J3.prototype.getTile = function(e6, t6, r7) {
var i6 = this.trees[this._limitZoom(e6)], o6 = Math.pow(2, e6), n8 = this.options, a6 = n8.radius / n8.extent, s7 = (r7 - a6) / o6, l8 = (r7 + 1 + a6) / o6, u5 = { features: [] };
return this._addTileFeatures(i6.range((t6 - a6) / o6, s7, (t6 + 1 + a6) / o6, l8), i6.points, t6, r7, o6, u5), 0 === t6 && this._addTileFeatures(i6.range(1 - a6 / o6, s7, 1, l8), i6.points, o6, r7, o6, u5), t6 === o6 - 1 && this._addTileFeatures(i6.range(0, s7, a6 / o6, l8), i6.points, -1, r7, o6, u5), u5.features.length ? u5 : null;
}, J3.prototype.getClusterExpansionZoom = function(e6) {
for (var t6 = this._getOriginZoom(e6) - 1; t6 <= this.options.maxZoom; ) {
var r7 = this.getChildren(e6);
if (t6++, 1 !== r7.length) {
break;
}
e6 = r7[0].properties.cluster_id;
}
return t6;
}, J3.prototype._appendLeaves = function(e6, t6, r7, i6, o6) {
for (var n8 = 0, a6 = this.getChildren(t6); n8 < a6.length; n8 += 1) {
var s7 = a6[n8], l8 = s7.properties;
if (l8 && l8.cluster ? o6 + l8.point_count <= i6 ? o6 += l8.point_count : o6 = this._appendLeaves(e6, l8.cluster_id, r7, i6, o6) : o6 < i6 ? o6++ : e6.push(s7), e6.length === r7) {
break;
}
}
return o6;
}, J3.prototype._addTileFeatures = function(e6, t6, r7, i6, o6, n8) {
for (var a6 = 0, s7 = e6; a6 < s7.length; a6 += 1) {
var l8 = t6[s7[a6]], u5 = l8.numPoints, h7 = { type: 1, geometry: [[Math.round(this.options.extent * (l8.x * o6 - r7)), Math.round(this.options.extent * (l8.y * o6 - i6))]], tags: u5 ? G3(l8) : this.points[l8.index].properties }, c5 = void 0;
u5 ? c5 = l8.id : this.options.generateId ? c5 = l8.index : this.points[l8.index].id && (c5 = this.points[l8.index].id), void 0 !== c5 && (h7.id = c5), n8.features.push(h7);
}
}, J3.prototype._limitZoom = function(e6) {
return Math.max(this.options.minZoom, Math.min(+e6, this.options.maxZoom + 1));
}, J3.prototype._cluster = function(e6, t6) {
for (var r7 = [], i6 = this.options, o6 = i6.reduce, n8 = i6.minPoints, a6 = i6.radius / (i6.extent * Math.pow(2, t6)), s7 = 0; s7 < e6.length; s7++) {
var l8 = e6[s7];
if (!(l8.zoom <= t6)) {
l8.zoom = t6;
for (var u5 = this.trees[t6 + 1], h7 = u5.within(l8.x, l8.y, a6), c5 = l8.numPoints || 1, p5 = c5, f5 = 0, d5 = h7; f5 < d5.length; f5 += 1) {
var g5 = u5.points[d5[f5]];
g5.zoom > t6 && (p5 += g5.numPoints || 1);
}
if (p5 >= n8) {
for (var v5 = l8.x * c5, m5 = l8.y * c5, y5 = o6 && c5 > 1 ? this._map(l8, true) : null, x5 = (s7 << 5) + (t6 + 1) + this.points.length, w5 = 0, S5 = h7; w5 < S5.length; w5 += 1) {
var I5 = u5.points[S5[w5]];
if (!(I5.zoom <= t6)) {
I5.zoom = t6;
var M5 = I5.numPoints || 1;
v5 += I5.x * M5, m5 += I5.y * M5, I5.parentId = x5, o6 && (y5 || (y5 = this._map(l8, true)), o6(y5, this._map(I5)));
}
}
l8.parentId = x5, r7.push(Z2(v5 / p5, m5 / p5, x5, p5, y5));
} else if (r7.push(l8), p5 > 1) {
for (var b5 = 0, _4 = h7; b5 < _4.length; b5 += 1) {
var k5 = u5.points[_4[b5]];
k5.zoom <= t6 || (k5.zoom = t6, r7.push(k5));
}
}
}
}
return r7;
}, J3.prototype._getOriginId = function(e6) {
return e6 - this.points.length >> 5;
}, J3.prototype._getOriginZoom = function(e6) {
return (e6 - this.points.length) % 32;
}, J3.prototype._map = function(e6, t6) {
if (e6.numPoints) {
return t6 ? V3({}, e6.properties) : e6.properties;
}
var r7 = this.points[e6.index].properties, i6 = this.options.map(r7);
return t6 && i6 === r7 ? V3({}, i6) : i6;
}, me2.prototype.options = { maxZoom: 14, indexMaxZoom: 5, indexMaxPoints: 1e5, tolerance: 3, extent: 4096, buffer: 64, lineMetrics: false, promoteId: null, generateId: false, debug: 0 }, me2.prototype.splitTile = function(e6, t6, r7, i6, o6, n8, a6) {
for (var s7 = [e6, t6, r7, i6], l8 = this.options, u5 = l8.debug; s7.length; ) {
i6 = s7.pop(), r7 = s7.pop(), t6 = s7.pop(), e6 = s7.pop();
var h7 = 1 << t6, c5 = ye2(t6, r7, i6), p5 = this.tiles[c5];
if (!p5 && (u5 > 1 && console.time("creation"), p5 = this.tiles[c5] = de2(e6, t6, r7, i6, l8), this.tileCoords.push({ z: t6, x: r7, y: i6 }), u5)) {
u5 > 1 && (console.log("tile z%d-%d-%d (features: %d, points: %d, simplified: %d)", t6, r7, i6, p5.numFeatures, p5.numPoints, p5.numSimplified), console.timeEnd("creation"));
var f5 = "z" + t6;
this.stats[f5] = (this.stats[f5] || 0) + 1, this.total++;
}
if (p5.source = e6, o6) {
if (t6 === l8.maxZoom || t6 === o6) {
continue;
}
var d5 = 1 << o6 - t6;
if (r7 !== Math.floor(n8 / d5) || i6 !== Math.floor(a6 / d5)) {
continue;
}
} else if (t6 === l8.indexMaxZoom || p5.numPoints <= l8.indexMaxPoints) {
continue;
}
if (p5.source = null, 0 !== e6.length) {
u5 > 1 && console.time("clipping");
var g5, v5, m5, y5, x5, w5, S5 = 0.5 * l8.buffer / l8.extent, I5 = 0.5 - S5, M5 = 0.5 + S5, b5 = 1 + S5;
g5 = v5 = m5 = y5 = null, x5 = re2(e6, h7, r7 - S5, r7 + M5, 0, p5.minX, p5.maxX, l8), w5 = re2(e6, h7, r7 + I5, r7 + b5, 0, p5.minX, p5.maxX, l8), e6 = null, x5 && (g5 = re2(x5, h7, i6 - S5, i6 + M5, 1, p5.minY, p5.maxY, l8), v5 = re2(x5, h7, i6 + I5, i6 + b5, 1, p5.minY, p5.maxY, l8), x5 = null), w5 && (m5 = re2(w5, h7, i6 - S5, i6 + M5, 1, p5.minY, p5.maxY, l8), y5 = re2(w5, h7, i6 + I5, i6 + b5, 1, p5.minY, p5.maxY, l8), w5 = null), u5 > 1 && console.timeEnd("clipping"), s7.push(g5 || [], t6 + 1, 2 * r7, 2 * i6), s7.push(v5 || [], t6 + 1, 2 * r7, 2 * i6 + 1), s7.push(m5 || [], t6 + 1, 2 * r7 + 1, 2 * i6), s7.push(y5 || [], t6 + 1, 2 * r7 + 1, 2 * i6 + 1);
}
}
}, me2.prototype.getTile = function(e6, t6, r7) {
var i6 = this.options, o6 = i6.extent, n8 = i6.debug;
if (e6 < 0 || e6 > 24) {
return null;
}
var a6 = 1 << e6, s7 = ye2(e6, t6 = (t6 % a6 + a6) % a6, r7);
if (this.tiles[s7]) {
return pe2(this.tiles[s7], o6);
}
n8 > 1 && console.log("drilling down to z%d-%d-%d", e6, t6, r7);
for (var l8, u5 = e6, h7 = t6, c5 = r7; !l8 && u5 > 0; ) {
u5--, h7 = Math.floor(h7 / 2), c5 = Math.floor(c5 / 2), l8 = this.tiles[ye2(u5, h7, c5)];
}
return l8 && l8.source ? (n8 > 1 && console.log("found parent tile z%d-%d-%d", u5, h7, c5), n8 > 1 && console.time("drilling down"), this.splitTile(l8.source, u5, h7, c5, e6, t6, r7), n8 > 1 && console.timeEnd("drilling down"), this.tiles[s7] ? pe2(this.tiles[s7], o6) : null) : null;
};
var we2 = function(t6) {
function r7(e6, r8, i6, o6) {
t6.call(this, e6, r8, i6, xe2), o6 && (this.loadGeoJSON = o6);
}
return t6 && (r7.__proto__ = t6), (r7.prototype = Object.create(t6 && t6.prototype)).constructor = r7, r7.prototype.loadData = function(e6, t7) {
this._pendingCallback && this._pendingCallback(null, { abandoned: true }), this._pendingCallback = t7, this._pendingLoadDataParams = e6, this._state && "Idle" !== this._state ? this._state = "NeedsLoadData" : (this._state = "Coalescing", this._loadData());
}, r7.prototype._loadData = function() {
var t7 = this;
if (this._pendingCallback && this._pendingLoadDataParams) {
var r8 = this._pendingCallback, i6 = this._pendingLoadDataParams;
delete this._pendingCallback, delete this._pendingLoadDataParams;
var o6 = !!(i6 && i6.request && i6.request.collectResourceTiming) && new e5.RequestPerformance(i6.request);
this.loadGeoJSON(i6, function(n8, a6) {
if (n8 || !a6) {
return r8(n8);
}
if ("object" != typeof a6) {
return r8(new Error("Input data given to '" + i6.source + "' is not a valid GeoJSON object."));
}
!function e6(t8, r9) {
var i7, o7 = t8 && t8.type;
if ("FeatureCollection" === o7) {
for (i7 = 0; i7 < t8.features.length; i7++) {
e6(t8.features[i7], r9);
}
} else if ("GeometryCollection" === o7) {
for (i7 = 0; i7 < t8.geometries.length; i7++) {
e6(t8.geometries[i7], r9);
}
} else if ("Feature" === o7) {
e6(t8.geometry, r9);
} else if ("Polygon" === o7) {
c4(t8.coordinates, r9);
} else if ("MultiPolygon" === o7) {
for (i7 = 0; i7 < t8.coordinates.length; i7++) {
c4(t8.coordinates[i7], r9);
}
}
return t8;
}(a6, true);
try {
if (i6.filter) {
var s7 = e5.createExpression(i6.filter, { type: "boolean", "property-type": "data-driven", overridable: false, transition: false });
if ("error" === s7.result) {
throw new Error(s7.value.map(function(e6) {
return e6.key + ": " + e6.message;
}).join(", "));
}
var l8 = a6.features.filter(function(e6) {
return s7.value.evaluate({ zoom: 0 }, e6);
});
a6 = { type: "FeatureCollection", features: l8 };
}
t7._geoJSONIndex = i6.cluster ? new J3(function(t8) {
var r9 = t8.superclusterOptions, i7 = t8.clusterProperties;
if (!i7 || !r9) {
return r9;
}
for (var o7 = {}, n9 = {}, a7 = { accumulated: null, zoom: 0 }, s8 = { properties: null }, l9 = Object.keys(i7), u6 = 0, h8 = l9; u6 < h8.length; u6 += 1) {
var c5 = h8[u6], p5 = i7[c5], f5 = p5[0], d5 = e5.createExpression(p5[1]), g5 = e5.createExpression("string" == typeof f5 ? [f5, ["accumulated"], ["get", c5]] : f5);
o7[c5] = d5.value, n9[c5] = g5.value;
}
return r9.map = function(e6) {
s8.properties = e6;
for (var t9 = {}, r10 = 0, i8 = l9; r10 < i8.length; r10 += 1) {
var n10 = i8[r10];
t9[n10] = o7[n10].evaluate(a7, s8);
}
return t9;
}, r9.reduce = function(e6, t9) {
s8.properties = t9;
for (var r10 = 0, i8 = l9; r10 < i8.length; r10 += 1) {
var o8 = i8[r10];
a7.accumulated = e6[o8], e6[o8] = n9[o8].evaluate(a7, s8);
}
}, r9;
}(i6)).load(a6.features) : function(e6, t8) {
return new me2(e6, t8);
}(a6, i6.geojsonVtOptions);
} catch (n$1) {
return r8(n$1);
}
t7.loaded = {};
var u5 = {};
if (o6) {
var h7 = o6.finish();
h7 && (u5.resourceTiming = {}, u5.resourceTiming[i6.source] = JSON.parse(JSON.stringify(h7)));
}
r8(null, u5);
});
}
}, r7.prototype.coalesce = function() {
"Coalescing" === this._state ? this._state = "Idle" : "NeedsLoadData" === this._state && (this._state = "Coalescing", this._loadData());
}, r7.prototype.reloadTile = function(e6, r8) {
var i6 = this.loaded;
return i6 && i6[e6.uid] ? t6.prototype.reloadTile.call(this, e6, r8) : this.loadTile(e6, r8);
}, r7.prototype.loadGeoJSON = function(t7, r8) {
if (t7.request) {
e5.getJSON(t7.request, r8);
} else {
if ("string" != typeof t7.data) {
return r8(new Error("Input data given to '" + t7.source + "' is not a valid GeoJSON object."));
}
try {
return r8(null, JSON.parse(t7.data));
} catch (e$1) {
return r8(new Error("Input data given to '" + t7.source + "' is not a valid GeoJSON object."));
}
}
}, r7.prototype.removeSource = function(e6, t7) {
this._pendingCallback && this._pendingCallback(null, { abandoned: true }), t7();
}, r7.prototype.getClusterExpansionZoom = function(e6, t7) {
try {
t7(null, this._geoJSONIndex.getClusterExpansionZoom(e6.clusterId));
} catch (e$1) {
t7(e$1);
}
}, r7.prototype.getClusterChildren = function(e6, t7) {
try {
t7(null, this._geoJSONIndex.getChildren(e6.clusterId));
} catch (e$1) {
t7(e$1);
}
}, r7.prototype.getClusterLeaves = function(e6, t7) {
try {
t7(null, this._geoJSONIndex.getLeaves(e6.clusterId, e6.limit, e6.offset));
} catch (e$1) {
t7(e$1);
}
}, r7;
}(l7), Se2 = function(t6) {
var r7 = this;
this.self = t6, this.actor = new e5.Actor(t6, this), this.layerIndexes = {}, this.availableImages = {}, this.workerSourceTypes = { vector: l7, geojson: we2 }, this.workerSources = {}, this.demWorkerSources = {}, this.self.registerWorkerSource = function(e6, t7) {
if (r7.workerSourceTypes[e6]) {
throw new Error('Worker source with name "' + e6 + '" already registered.');
}
r7.workerSourceTypes[e6] = t7;
}, this.self.registerRTLTextPlugin = function(t7) {
if (e5.plugin.isParsed()) {
throw new Error("RTL text plugin already registered.");
}
e5.plugin.applyArabicShaping = t7.applyArabicShaping, e5.plugin.processBidirectionalText = t7.processBidirectionalText, e5.plugin.processStyledBidirectionalText = t7.processStyledBidirectionalText;
};
};
return Se2.prototype.setReferrer = function(e6, t6) {
this.referrer = t6;
}, Se2.prototype.setImages = function(e6, t6, r7) {
for (var i6 in this.availableImages[e6] = t6, this.workerSources[e6]) {
var o6 = this.workerSources[e6][i6];
for (var n8 in o6) {
o6[n8].availableImages = t6;
}
}
r7();
}, Se2.prototype.setLayers = function(e6, t6, r7) {
this.getLayerIndex(e6).replace(t6), r7();
}, Se2.prototype.updateLayers = function(e6, t6, r7) {
this.getLayerIndex(e6).update(t6.layers, t6.removedIds), r7();
}, Se2.prototype.loadTile = function(e6, t6, r7) {
this.getWorkerSource(e6, t6.type, t6.source).loadTile(t6, r7);
}, Se2.prototype.loadDEMTile = function(e6, t6, r7) {
this.getDEMWorkerSource(e6, t6.source).loadTile(t6, r7);
}, Se2.prototype.reloadTile = function(e6, t6, r7) {
this.getWorkerSource(e6, t6.type, t6.source).reloadTile(t6, r7);
}, Se2.prototype.abortTile = function(e6, t6, r7) {
this.getWorkerSource(e6, t6.type, t6.source).abortTile(t6, r7);
}, Se2.prototype.removeTile = function(e6, t6, r7) {
this.getWorkerSource(e6, t6.type, t6.source).removeTile(t6, r7);
}, Se2.prototype.removeDEMTile = function(e6, t6) {
this.getDEMWorkerSource(e6, t6.source).removeTile(t6);
}, Se2.prototype.removeSource = function(e6, t6, r7) {
if (this.workerSources[e6] && this.workerSources[e6][t6.type] && this.workerSources[e6][t6.type][t6.source]) {
var i6 = this.workerSources[e6][t6.type][t6.source];
delete this.workerSources[e6][t6.type][t6.source], void 0 !== i6.removeSource ? i6.removeSource(t6, r7) : r7();
}
}, Se2.prototype.loadWorkerSource = function(e6, t6, r7) {
try {
this.self.importScripts(t6.url), r7();
} catch (e$1) {
r7(e$1.toString());
}
}, Se2.prototype.syncRTLPluginState = function(t6, r7, i6) {
try {
e5.plugin.setState(r7);
var o6 = e5.plugin.getPluginURL();
if (e5.plugin.isLoaded() && !e5.plugin.isParsed() && null != o6) {
this.self.importScripts(o6);
var n8 = e5.plugin.isParsed();
i6(n8 ? void 0 : new Error("RTL Text Plugin failed to import scripts from " + o6), n8);
}
} catch (e$1) {
i6(e$1.toString());
}
}, Se2.prototype.getAvailableImages = function(e6) {
var t6 = this.availableImages[e6];
return t6 || (t6 = []), t6;
}, Se2.prototype.getLayerIndex = function(e6) {
var t6 = this.layerIndexes[e6];
return t6 || (t6 = this.layerIndexes[e6] = new i5()), t6;
}, Se2.prototype.getWorkerSource = function(e6, t6, r7) {
var i6 = this;
return this.workerSources[e6] || (this.workerSources[e6] = {}), this.workerSources[e6][t6] || (this.workerSources[e6][t6] = {}), this.workerSources[e6][t6][r7] || (this.workerSources[e6][t6][r7] = new this.workerSourceTypes[t6]({ send: function(t7, r8, o6) {
i6.actor.send(t7, r8, o6, e6);
} }, this.getLayerIndex(e6), this.getAvailableImages(e6))), this.workerSources[e6][t6][r7];
}, Se2.prototype.getDEMWorkerSource = function(e6, t6) {
return this.demWorkerSources[e6] || (this.demWorkerSources[e6] = {}), this.demWorkerSources[e6][t6] || (this.demWorkerSources[e6][t6] = new h6()), this.demWorkerSources[e6][t6];
}, Se2.prototype.enforceCacheSizeLimit = function(t6, r7) {
e5.enforceCacheSizeLimit(r7);
}, "undefined" != typeof WorkerGlobalScope && "undefined" != typeof self && self instanceof WorkerGlobalScope && (self.worker = new Se2(self)), Se2;
});
define2(["./shared"], function(t5) {
var e5 = t5.createCommonjsModule(function(t6) {
function e6(t7) {
return !i6(t7);
}
function i6(t7) {
return "undefined" == typeof window || "undefined" == typeof document ? "not a browser" : Array.prototype && Array.prototype.every && Array.prototype.filter && Array.prototype.forEach && Array.prototype.indexOf && Array.prototype.lastIndexOf && Array.prototype.map && Array.prototype.some && Array.prototype.reduce && Array.prototype.reduceRight && Array.isArray ? Function.prototype && Function.prototype.bind ? Object.keys && Object.create && Object.getPrototypeOf && Object.getOwnPropertyNames && Object.isSealed && Object.isFrozen && Object.isExtensible && Object.getOwnPropertyDescriptor && Object.defineProperty && Object.defineProperties && Object.seal && Object.freeze && Object.preventExtensions ? "JSON" in window && "parse" in JSON && "stringify" in JSON ? function() {
if (!("Worker" in window && "Blob" in window && "URL" in window)) {
return false;
}
var t8, e7, i8 = new Blob([""], { type: "text/javascript" }), o7 = URL.createObjectURL(i8);
try {
e7 = new Worker(o7), t8 = true;
} catch (e$1) {
t8 = false;
}
return e7 && e7.terminate(), URL.revokeObjectURL(o7), t8;
}() ? "Uint8ClampedArray" in window ? ArrayBuffer.isView ? function() {
var t8 = document.createElement("canvas");
t8.width = t8.height = 1;
var e7 = t8.getContext("2d");
if (!e7) {
return false;
}
var i8 = e7.getImageData(0, 0, 1, 1);
return i8 && i8.width === t8.width;
}() ? (void 0 === o6[i7 = t7 && t7.failIfMajorPerformanceCaveat] && (o6[i7] = function(t8) {
var i8 = function(t9) {
var i9 = document.createElement("canvas"), o8 = Object.create(e6.webGLContextAttributes);
return o8.failIfMajorPerformanceCaveat = t9, i9.probablySupportsContext ? i9.probablySupportsContext("webgl", o8) || i9.probablySupportsContext("experimental-webgl", o8) : i9.supportsContext ? i9.supportsContext("webgl", o8) || i9.supportsContext("experimental-webgl", o8) : i9.getContext("webgl", o8) || i9.getContext("experimental-webgl", o8);
}(t8);
if (!i8) {
return false;
}
var o7 = i8.createShader(i8.VERTEX_SHADER);
return !(!o7 || i8.isContextLost()) && (i8.shaderSource(o7, "void main() {}"), i8.compileShader(o7), true === i8.getShaderParameter(o7, i8.COMPILE_STATUS));
}(i7)), o6[i7] ? void 0 : "insufficient WebGL support") : "insufficient Canvas/getImageData support" : "insufficient ArrayBuffer support" : "insufficient Uint8ClampedArray support" : "insufficient worker support" : "insufficient JSON support" : "insufficient Object support" : "insufficient Function support" : "insufficent Array support";
var i7;
}
t6.exports ? t6.exports = e6 : window && (window.mapboxgl = window.mapboxgl || {}, window.mapboxgl.supported = e6, window.mapboxgl.notSupportedReason = i6);
var o6 = {};
e6.webGLContextAttributes = { antialias: false, alpha: true, stencil: true, depth: true };
}), i5 = { create: function(e6, i6, o6) {
var r7 = t5.window.document.createElement(e6);
return void 0 !== i6 && (r7.className = i6), o6 && o6.appendChild(r7), r7;
}, createNS: function(e6, i6) {
return t5.window.document.createElementNS(e6, i6);
} }, o5 = t5.window.document && t5.window.document.documentElement.style;
function r6(t6) {
if (!o5) {
return t6[0];
}
for (var e6 = 0; e6 < t6.length; e6++) {
if (t6[e6] in o5) {
return t6[e6];
}
}
return t6[0];
}
var a5, n7 = r6(["userSelect", "MozUserSelect", "WebkitUserSelect", "msUserSelect"]);
i5.disableDrag = function() {
o5 && n7 && (a5 = o5[n7], o5[n7] = "none");
}, i5.enableDrag = function() {
o5 && n7 && (o5[n7] = a5);
};
var s6 = r6(["transform", "WebkitTransform"]);
i5.setTransform = function(t6, e6) {
t6.style[s6] = e6;
};
var l7 = false;
try {
var c4 = Object.defineProperty({}, "passive", { get: function() {
l7 = true;
} });
t5.window.addEventListener("test", c4, c4), t5.window.removeEventListener("test", c4, c4);
} catch (t$1) {
l7 = false;
}
i5.addEventListener = function(t6, e6, i6, o6) {
void 0 === o6 && (o6 = {}), t6.addEventListener(e6, i6, "passive" in o6 && l7 ? o6 : o6.capture);
}, i5.removeEventListener = function(t6, e6, i6, o6) {
void 0 === o6 && (o6 = {}), t6.removeEventListener(e6, i6, "passive" in o6 && l7 ? o6 : o6.capture);
};
var u4 = function(e6) {
e6.preventDefault(), e6.stopPropagation(), t5.window.removeEventListener("click", u4, true);
};
function h6(t6) {
var e6 = t6.userImage;
return !!(e6 && e6.render && e6.render()) && (t6.data.replace(new Uint8Array(e6.data.buffer)), true);
}
i5.suppressClick = function() {
t5.window.addEventListener("click", u4, true), t5.window.setTimeout(function() {
t5.window.removeEventListener("click", u4, true);
}, 0);
}, i5.mousePos = function(e6, i6) {
var o6 = e6.getBoundingClientRect();
return new t5.Point(i6.clientX - o6.left - e6.clientLeft, i6.clientY - o6.top - e6.clientTop);
}, i5.touchPos = function(e6, i6) {
for (var o6 = e6.getBoundingClientRect(), r7 = [], a6 = 0; a6 < i6.length; a6++) {
r7.push(new t5.Point(i6[a6].clientX - o6.left - e6.clientLeft, i6[a6].clientY - o6.top - e6.clientTop));
}
return r7;
}, i5.mouseButton = function(e6) {
return void 0 !== t5.window.InstallTrigger && 2 === e6.button && e6.ctrlKey && t5.window.navigator.platform.toUpperCase().indexOf("MAC") >= 0 ? 0 : e6.button;
}, i5.remove = function(t6) {
t6.parentNode && t6.parentNode.removeChild(t6);
};
var p4 = function(e6) {
function i6() {
e6.call(this), this.images = {}, this.updatedImages = {}, this.callbackDispatchedThisFrame = {}, this.loaded = false, this.requestors = [], this.patterns = {}, this.atlasImage = new t5.RGBAImage({ width: 1, height: 1 }), this.dirty = true;
}
return e6 && (i6.__proto__ = e6), (i6.prototype = Object.create(e6 && e6.prototype)).constructor = i6, i6.prototype.isLoaded = function() {
return this.loaded;
}, i6.prototype.setLoaded = function(t6) {
if (this.loaded !== t6 && (this.loaded = t6, t6)) {
for (var e7 = 0, i7 = this.requestors; e7 < i7.length; e7 += 1) {
var o6 = i7[e7];
this._notify(o6.ids, o6.callback);
}
this.requestors = [];
}
}, i6.prototype.getImage = function(t6) {
return this.images[t6];
}, i6.prototype.addImage = function(t6, e7) {
this._validate(t6, e7) && (this.images[t6] = e7);
}, i6.prototype._validate = function(e7, i7) {
var o6 = true;
return this._validateStretch(i7.stretchX, i7.data && i7.data.width) || (this.fire(new t5.ErrorEvent(new Error('Image "' + e7 + '" has invalid "stretchX" value'))), o6 = false), this._validateStretch(i7.stretchY, i7.data && i7.data.height) || (this.fire(new t5.ErrorEvent(new Error('Image "' + e7 + '" has invalid "stretchY" value'))), o6 = false), this._validateContent(i7.content, i7) || (this.fire(new t5.ErrorEvent(new Error('Image "' + e7 + '" has invalid "content" value'))), o6 = false), o6;
}, i6.prototype._validateStretch = function(t6, e7) {
if (!t6) {
return true;
}
for (var i7 = 0, o6 = 0, r7 = t6; o6 < r7.length; o6 += 1) {
var a6 = r7[o6];
if (a6[0] < i7 || a6[1] < a6[0] || e7 < a6[1]) {
return false;
}
i7 = a6[1];
}
return true;
}, i6.prototype._validateContent = function(t6, e7) {
return !(t6 && (4 !== t6.length || t6[0] < 0 || e7.data.width < t6[0] || t6[1] < 0 || e7.data.height < t6[1] || t6[2] < 0 || e7.data.width < t6[2] || t6[3] < 0 || e7.data.height < t6[3] || t6[2] < t6[0] || t6[3] < t6[1]));
}, i6.prototype.updateImage = function(t6, e7) {
e7.version = this.images[t6].version + 1, this.images[t6] = e7, this.updatedImages[t6] = true;
}, i6.prototype.removeImage = function(t6) {
var e7 = this.images[t6];
delete this.images[t6], delete this.patterns[t6], e7.userImage && e7.userImage.onRemove && e7.userImage.onRemove();
}, i6.prototype.listImages = function() {
return Object.keys(this.images);
}, i6.prototype.getImages = function(t6, e7) {
var i7 = true;
if (!this.isLoaded()) {
for (var o6 = 0, r7 = t6; o6 < r7.length; o6 += 1) {
this.images[r7[o6]] || (i7 = false);
}
}
this.isLoaded() || i7 ? this._notify(t6, e7) : this.requestors.push({ ids: t6, callback: e7 });
}, i6.prototype._notify = function(e7, i7) {
for (var o6 = {}, r7 = 0, a6 = e7; r7 < a6.length; r7 += 1) {
var n8 = a6[r7];
this.images[n8] || this.fire(new t5.Event("styleimagemissing", { id: n8 }));
var s7 = this.images[n8];
s7 ? o6[n8] = { data: s7.data.clone(), pixelRatio: s7.pixelRatio, sdf: s7.sdf, version: s7.version, stretchX: s7.stretchX, stretchY: s7.stretchY, content: s7.content, hasRenderCallback: Boolean(s7.userImage && s7.userImage.render) } : t5.warnOnce('Image "' + n8 + '" could not be loaded. Please make sure you have added the image with map.addImage() or a "sprite" property in your style. You can provide missing images by listening for the "styleimagemissing" map event.');
}
i7(null, o6);
}, i6.prototype.getPixelSize = function() {
var t6 = this.atlasImage;
return { width: t6.width, height: t6.height };
}, i6.prototype.getPattern = function(e7) {
var i7 = this.patterns[e7], o6 = this.getImage(e7);
if (!o6) {
return null;
}
if (i7 && i7.position.version === o6.version) {
return i7.position;
}
if (i7) {
i7.position.version = o6.version;
} else {
var r7 = { w: o6.data.width + 2, h: o6.data.height + 2, x: 0, y: 0 }, a6 = new t5.ImagePosition(r7, o6);
this.patterns[e7] = { bin: r7, position: a6 };
}
return this._updatePatternAtlas(), this.patterns[e7].position;
}, i6.prototype.bind = function(e7) {
var i7 = e7.gl;
this.atlasTexture ? this.dirty && (this.atlasTexture.update(this.atlasImage), this.dirty = false) : this.atlasTexture = new t5.Texture(e7, this.atlasImage, i7.RGBA), this.atlasTexture.bind(i7.LINEAR, i7.CLAMP_TO_EDGE);
}, i6.prototype._updatePatternAtlas = function() {
var e7 = [];
for (var i7 in this.patterns) {
e7.push(this.patterns[i7].bin);
}
var o6 = t5.potpack(e7), r7 = o6.w, a6 = o6.h, n8 = this.atlasImage;
for (var s7 in n8.resize({ width: r7 || 1, height: a6 || 1 }), this.patterns) {
var l8 = this.patterns[s7].bin, c5 = l8.x + 1, u5 = l8.y + 1, h7 = this.images[s7].data, p5 = h7.width, d5 = h7.height;
t5.RGBAImage.copy(h7, n8, { x: 0, y: 0 }, { x: c5, y: u5 }, { width: p5, height: d5 }), t5.RGBAImage.copy(h7, n8, { x: 0, y: d5 - 1 }, { x: c5, y: u5 - 1 }, { width: p5, height: 1 }), t5.RGBAImage.copy(h7, n8, { x: 0, y: 0 }, { x: c5, y: u5 + d5 }, { width: p5, height: 1 }), t5.RGBAImage.copy(h7, n8, { x: p5 - 1, y: 0 }, { x: c5 - 1, y: u5 }, { width: 1, height: d5 }), t5.RGBAImage.copy(h7, n8, { x: 0, y: 0 }, { x: c5 + p5, y: u5 }, { width: 1, height: d5 });
}
this.dirty = true;
}, i6.prototype.beginFrame = function() {
this.callbackDispatchedThisFrame = {};
}, i6.prototype.dispatchRenderCallbacks = function(t6) {
for (var e7 = 0, i7 = t6; e7 < i7.length; e7 += 1) {
var o6 = i7[e7];
if (!this.callbackDispatchedThisFrame[o6]) {
this.callbackDispatchedThisFrame[o6] = true;
var r7 = this.images[o6];
h6(r7) && this.updateImage(o6, r7);
}
}
}, i6;
}(t5.Evented), d4 = m4, _3 = m4, f4 = 1e20;
function m4(t6, e6, i6, o6, r7, a6) {
this.fontSize = t6 || 24, this.buffer = void 0 === e6 ? 3 : e6, this.cutoff = o6 || 0.25, this.fontFamily = r7 || "sans-serif", this.fontWeight = a6 || "normal", this.radius = i6 || 8;
var n8 = this.size = this.fontSize + 2 * this.buffer;
this.canvas = document.createElement("canvas"), this.canvas.width = this.canvas.height = n8, this.ctx = this.canvas.getContext("2d"), this.ctx.font = this.fontWeight + " " + this.fontSize + "px " + this.fontFamily, this.ctx.textBaseline = "middle", this.ctx.fillStyle = "black", this.gridOuter = new Float64Array(n8 * n8), this.gridInner = new Float64Array(n8 * n8), this.f = new Float64Array(n8), this.d = new Float64Array(n8), this.z = new Float64Array(n8 + 1), this.v = new Int16Array(n8), this.middle = Math.round(n8 / 2 * (navigator.userAgent.indexOf("Gecko/") >= 0 ? 1.2 : 1));
}
function g4(t6, e6, i6, o6, r7, a6, n8) {
for (var s7 = 0; s7 < e6; s7++) {
for (var l8 = 0; l8 < i6; l8++) {
o6[l8] = t6[l8 * e6 + s7];
}
for (v4(o6, r7, a6, n8, i6), l8 = 0; l8 < i6; l8++) {
t6[l8 * e6 + s7] = r7[l8];
}
}
for (l8 = 0; l8 < i6; l8++) {
for (s7 = 0; s7 < e6; s7++) {
o6[s7] = t6[l8 * e6 + s7];
}
for (v4(o6, r7, a6, n8, e6), s7 = 0; s7 < e6; s7++) {
t6[l8 * e6 + s7] = Math.sqrt(r7[s7]);
}
}
}
function v4(t6, e6, i6, o6, r7) {
i6[0] = 0, o6[0] = -f4, o6[1] = +f4;
for (var a6 = 1, n8 = 0; a6 < r7; a6++) {
for (var s7 = (t6[a6] + a6 * a6 - (t6[i6[n8]] + i6[n8] * i6[n8])) / (2 * a6 - 2 * i6[n8]); s7 <= o6[n8]; ) {
n8--, s7 = (t6[a6] + a6 * a6 - (t6[i6[n8]] + i6[n8] * i6[n8])) / (2 * a6 - 2 * i6[n8]);
}
i6[++n8] = a6, o6[n8] = s7, o6[n8 + 1] = +f4;
}
for (a6 = 0, n8 = 0; a6 < r7; a6++) {
for (; o6[n8 + 1] < a6; ) {
n8++;
}
e6[a6] = (a6 - i6[n8]) * (a6 - i6[n8]) + t6[i6[n8]];
}
}
m4.prototype.draw = function(t6) {
this.ctx.clearRect(0, 0, this.size, this.size), this.ctx.fillText(t6, this.buffer, this.middle);
for (var e6 = this.ctx.getImageData(0, 0, this.size, this.size), i6 = new Uint8ClampedArray(this.size * this.size), o6 = 0; o6 < this.size * this.size; o6++) {
var r7 = e6.data[4 * o6 + 3] / 255;
this.gridOuter[o6] = 1 === r7 ? 0 : 0 === r7 ? f4 : Math.pow(Math.max(0, 0.5 - r7), 2), this.gridInner[o6] = 1 === r7 ? f4 : 0 === r7 ? 0 : Math.pow(Math.max(0, r7 - 0.5), 2);
}
for (g4(this.gridOuter, this.size, this.size, this.f, this.d, this.v, this.z), g4(this.gridInner, this.size, this.size, this.f, this.d, this.v, this.z), o6 = 0; o6 < this.size * this.size; o6++) {
i6[o6] = Math.max(0, Math.min(255, Math.round(255 - 255 * ((this.gridOuter[o6] - this.gridInner[o6]) / this.radius + this.cutoff))));
}
return i6;
}, d4.default = _3;
var y4 = function(t6, e6) {
this.requestManager = t6, this.localIdeographFontFamily = e6, this.entries = {};
};
y4.prototype.setURL = function(t6) {
this.url = t6;
}, y4.prototype.getGlyphs = function(e6, i6) {
var o6 = this, r7 = [];
for (var a6 in e6) {
for (var n8 = 0, s7 = e6[a6]; n8 < s7.length; n8 += 1) {
r7.push({ stack: a6, id: s7[n8] });
}
}
t5.asyncAll(r7, function(t6, e7) {
var i7 = t6.stack, r8 = t6.id, a7 = o6.entries[i7];
a7 || (a7 = o6.entries[i7] = { glyphs: {}, requests: {}, ranges: {} });
var n9 = a7.glyphs[r8];
if (void 0 === n9) {
if (n9 = o6._tinySDF(a7, i7, r8)) {
return a7.glyphs[r8] = n9, void e7(null, { stack: i7, id: r8, glyph: n9 });
}
var s8 = Math.floor(r8 / 256);
if (256 * s8 > 65535) {
e7(new Error("glyphs > 65535 not supported"));
} else if (a7.ranges[s8]) {
e7(null, { stack: i7, id: r8, glyph: n9 });
} else {
var l8 = a7.requests[s8];
l8 || (l8 = a7.requests[s8] = [], y4.loadGlyphRange(i7, s8, o6.url, o6.requestManager, function(t7, e8) {
if (e8) {
for (var i8 in e8) {
o6._doesCharSupportLocalGlyph(+i8) || (a7.glyphs[+i8] = e8[+i8]);
}
a7.ranges[s8] = true;
}
for (var r9 = 0, n10 = l8; r9 < n10.length; r9 += 1) {
(0, n10[r9])(t7, e8);
}
delete a7.requests[s8];
})), l8.push(function(t7, o7) {
t7 ? e7(t7) : o7 && e7(null, { stack: i7, id: r8, glyph: o7[r8] || null });
});
}
} else {
e7(null, { stack: i7, id: r8, glyph: n9 });
}
}, function(t6, e7) {
if (t6) {
i6(t6);
} else if (e7) {
for (var o7 = {}, r8 = 0, a7 = e7; r8 < a7.length; r8 += 1) {
var n9 = a7[r8], s8 = n9.stack, l8 = n9.id, c5 = n9.glyph;
(o7[s8] || (o7[s8] = {}))[l8] = c5 && { id: c5.id, bitmap: c5.bitmap.clone(), metrics: c5.metrics };
}
i6(null, o7);
}
});
}, y4.prototype._doesCharSupportLocalGlyph = function(e6) {
return !!this.localIdeographFontFamily && (t5.isChar["CJK Unified Ideographs"](e6) || t5.isChar["Hangul Syllables"](e6) || t5.isChar.Hiragana(e6) || t5.isChar.Katakana(e6));
}, y4.prototype._tinySDF = function(e6, i6, o6) {
var r7 = this.localIdeographFontFamily;
if (r7 && this._doesCharSupportLocalGlyph(o6)) {
var a6 = e6.tinySDF;
if (!a6) {
var n8 = "400";
/bold/i.test(i6) ? n8 = "900" : /medium/i.test(i6) ? n8 = "500" : /light/i.test(i6) && (n8 = "200"), a6 = e6.tinySDF = new y4.TinySDF(24, 3, 8, 0.25, r7, n8);
}
return { id: o6, bitmap: new t5.AlphaImage({ width: 30, height: 30 }, a6.draw(String.fromCharCode(o6))), metrics: { width: 24, height: 24, left: 0, top: -8, advance: 24 } };
}
}, y4.loadGlyphRange = function(e6, i6, o6, r7, a6) {
var n8 = 256 * i6, s7 = n8 + 255, l8 = r7.transformRequest(r7.normalizeGlyphsURL(o6).replace("{fontstack}", e6).replace("{range}", n8 + "-" + s7), t5.ResourceType.Glyphs);
t5.getArrayBuffer(l8, function(e7, i7) {
if (e7) {
a6(e7);
} else if (i7) {
for (var o7 = {}, r8 = 0, n9 = t5.parseGlyphPBF(i7); r8 < n9.length; r8 += 1) {
var s8 = n9[r8];
o7[s8.id] = s8;
}
a6(null, o7);
}
});
}, y4.TinySDF = d4;
var x4 = function() {
this.specification = t5.styleSpec.light.position;
};
x4.prototype.possiblyEvaluate = function(e6, i6) {
return t5.sphericalToCartesian(e6.expression.evaluate(i6));
}, x4.prototype.interpolate = function(e6, i6, o6) {
return { x: t5.number(e6.x, i6.x, o6), y: t5.number(e6.y, i6.y, o6), z: t5.number(e6.z, i6.z, o6) };
};
var b4 = new t5.Properties({ anchor: new t5.DataConstantProperty(t5.styleSpec.light.anchor), position: new x4(), color: new t5.DataConstantProperty(t5.styleSpec.light.color), intensity: new t5.DataConstantProperty(t5.styleSpec.light.intensity) }), w4 = function(e6) {
function i6(i7) {
e6.call(this), this._transitionable = new t5.Transitionable(b4), this.setLight(i7), this._transitioning = this._transitionable.untransitioned();
}
return e6 && (i6.__proto__ = e6), (i6.prototype = Object.create(e6 && e6.prototype)).constructor = i6, i6.prototype.getLight = function() {
return this._transitionable.serialize();
}, i6.prototype.setLight = function(e7, i7) {
if (void 0 === i7 && (i7 = {}), !this._validate(t5.validateLight, e7, i7)) {
for (var o6 in e7) {
var r7 = e7[o6];
t5.endsWith(o6, "-transition") ? this._transitionable.setTransition(o6.slice(0, -"-transition".length), r7) : this._transitionable.setValue(o6, r7);
}
}
}, i6.prototype.updateTransitions = function(t6) {
this._transitioning = this._transitionable.transitioned(t6, this._transitioning);
}, i6.prototype.hasTransition = function() {
return this._transitioning.hasTransition();
}, i6.prototype.recalculate = function(t6) {
this.properties = this._transitioning.possiblyEvaluate(t6);
}, i6.prototype._validate = function(e7, i7, o6) {
return (!o6 || false !== o6.validate) && t5.emitValidationErrors(this, e7.call(t5.validateStyle, t5.extend({ value: i7, style: { glyphs: true, sprite: true }, styleSpec: t5.styleSpec })));
}, i6;
}(t5.Evented), T4 = function(t6, e6) {
this.width = t6, this.height = e6, this.nextRow = 0, this.data = new Uint8Array(this.width * this.height), this.dashEntry = {};
};
T4.prototype.getDash = function(t6, e6) {
var i6 = t6.join(",") + String(e6);
return this.dashEntry[i6] || (this.dashEntry[i6] = this.addDash(t6, e6)), this.dashEntry[i6];
}, T4.prototype.getDashRanges = function(t6, e6, i6) {
var o6 = [], r7 = t6.length % 2 == 1 ? -t6[t6.length - 1] * i6 : 0, a6 = t6[0] * i6, n8 = true;
o6.push({ left: r7, right: a6, isDash: n8, zeroLength: 0 === t6[0] });
for (var s7 = t6[0], l8 = 1; l8 < t6.length; l8++) {
var c5 = t6[l8];
o6.push({ left: r7 = s7 * i6, right: a6 = (s7 += c5) * i6, isDash: n8 = !n8, zeroLength: 0 === c5 });
}
return o6;
}, T4.prototype.addRoundDash = function(t6, e6, i6) {
for (var o6 = e6 / 2, r7 = -i6; r7 <= i6; r7++) {
for (var a6 = this.width * (this.nextRow + i6 + r7), n8 = 0, s7 = t6[n8], l8 = 0; l8 < this.width; l8++) {
l8 / s7.right > 1 && (s7 = t6[++n8]);
var c5 = Math.abs(l8 - s7.left), u5 = Math.abs(l8 - s7.right), h7 = Math.min(c5, u5), p5 = void 0, d5 = r7 / i6 * (o6 + 1);
if (s7.isDash) {
var _4 = o6 - Math.abs(d5);
p5 = Math.sqrt(h7 * h7 + _4 * _4);
} else {
p5 = o6 - Math.sqrt(h7 * h7 + d5 * d5);
}
this.data[a6 + l8] = Math.max(0, Math.min(255, p5 + 128));
}
}
}, T4.prototype.addRegularDash = function(t6) {
for (var e6 = t6.length - 1; e6 >= 0; --e6) {
var i6 = t6[e6], o6 = t6[e6 + 1];
i6.zeroLength ? t6.splice(e6, 1) : o6 && o6.isDash === i6.isDash && (o6.left = i6.left, t6.splice(e6, 1));
}
var r7 = t6[0], a6 = t6[t6.length - 1];
r7.isDash === a6.isDash && (r7.left = a6.left - this.width, a6.right = r7.right + this.width);
for (var n8 = this.width * this.nextRow, s7 = 0, l8 = t6[s7], c5 = 0; c5 < this.width; c5++) {
c5 / l8.right > 1 && (l8 = t6[++s7]);
var u5 = Math.abs(c5 - l8.left), h7 = Math.abs(c5 - l8.right), p5 = Math.min(u5, h7);
this.data[n8 + c5] = Math.max(0, Math.min(255, (l8.isDash ? p5 : -p5) + 128));
}
}, T4.prototype.addDash = function(e6, i6) {
var o6 = i6 ? 7 : 0, r7 = 2 * o6 + 1;
if (this.nextRow + r7 > this.height) {
return t5.warnOnce("LineAtlas out of space"), null;
}
for (var a6 = 0, n8 = 0; n8 < e6.length; n8++) {
a6 += e6[n8];
}
if (0 !== a6) {
var s7 = this.width / a6, l8 = this.getDashRanges(e6, this.width, s7);
i6 ? this.addRoundDash(l8, s7, o6) : this.addRegularDash(l8);
}
var c5 = { y: (this.nextRow + o6 + 0.5) / this.height, height: 2 * o6 / this.height, width: a6 };
return this.nextRow += r7, this.dirty = true, c5;
}, T4.prototype.bind = function(t6) {
var e6 = t6.gl;
this.texture ? (e6.bindTexture(e6.TEXTURE_2D, this.texture), this.dirty && (this.dirty = false, e6.texSubImage2D(e6.TEXTURE_2D, 0, 0, 0, this.width, this.height, e6.ALPHA, e6.UNSIGNED_BYTE, this.data))) : (this.texture = e6.createTexture(), e6.bindTexture(e6.TEXTURE_2D, this.texture), e6.texParameteri(e6.TEXTURE_2D, e6.TEXTURE_WRAP_S, e6.REPEAT), e6.texParameteri(e6.TEXTURE_2D, e6.TEXTURE_WRAP_T, e6.REPEAT), e6.texParameteri(e6.TEXTURE_2D, e6.TEXTURE_MIN_FILTER, e6.LINEAR), e6.texParameteri(e6.TEXTURE_2D, e6.TEXTURE_MAG_FILTER, e6.LINEAR), e6.texImage2D(e6.TEXTURE_2D, 0, e6.ALPHA, this.width, this.height, 0, e6.ALPHA, e6.UNSIGNED_BYTE, this.data));
};
var E3 = function e6(i6, o6) {
this.workerPool = i6, this.actors = [], this.currentActor = 0, this.id = t5.uniqueId();
for (var r7 = this.workerPool.acquire(this.id), a6 = 0; a6 < r7.length; a6++) {
var n8 = new e6.Actor(r7[a6], o6, this.id);
n8.name = "Worker " + a6, this.actors.push(n8);
}
};
function I4(e6, i6, o6) {
var r7 = function(r8, a6) {
if (r8) {
return o6(r8);
}
if (a6) {
var n8 = t5.pick(t5.extend(a6, e6), ["tiles", "minzoom", "maxzoom", "attribution", "mapbox_logo", "bounds", "scheme", "tileSize", "encoding"]);
a6.vector_layers && (n8.vectorLayers = a6.vector_layers, n8.vectorLayerIds = n8.vectorLayers.map(function(t6) {
return t6.id;
})), n8.tiles = i6.canonicalizeTileset(n8, e6.url), o6(null, n8);
}
};
return e6.url ? t5.getJSON(i6.transformRequest(i6.normalizeSourceURL(e6.url), t5.ResourceType.Source), r7) : t5.browser.frame(function() {
return r7(null, e6);
});
}
E3.prototype.broadcast = function(e6, i6, o6) {
t5.asyncAll(this.actors, function(t6, o7) {
t6.send(e6, i6, o7);
}, o6 = o6 || function() {
});
}, E3.prototype.getActor = function() {
return this.currentActor = (this.currentActor + 1) % this.actors.length, this.actors[this.currentActor];
}, E3.prototype.remove = function() {
this.actors.forEach(function(t6) {
t6.remove();
}), this.actors = [], this.workerPool.release(this.id);
}, E3.Actor = t5.Actor;
var P4 = function(e6, i6, o6) {
this.bounds = t5.LngLatBounds.convert(this.validateBounds(e6)), this.minzoom = i6 || 0, this.maxzoom = o6 || 24;
};
P4.prototype.validateBounds = function(t6) {
return Array.isArray(t6) && 4 === t6.length ? [Math.max(-180, t6[0]), Math.max(-90, t6[1]), Math.min(180, t6[2]), Math.min(90, t6[3])] : [-180, -90, 180, 90];
}, P4.prototype.contains = function(e6) {
var i6 = Math.pow(2, e6.z), o6 = Math.floor(t5.mercatorXfromLng(this.bounds.getWest()) * i6), r7 = Math.floor(t5.mercatorYfromLat(this.bounds.getNorth()) * i6), a6 = Math.ceil(t5.mercatorXfromLng(this.bounds.getEast()) * i6), n8 = Math.ceil(t5.mercatorYfromLat(this.bounds.getSouth()) * i6);
return e6.x >= o6 && e6.x < a6 && e6.y >= r7 && e6.y < n8;
};
var S4 = function(e6) {
function i6(i7, o6, r7, a6) {
if (e6.call(this), this.id = i7, this.dispatcher = r7, this.type = "vector", this.minzoom = 0, this.maxzoom = 22, this.scheme = "xyz", this.tileSize = 512, this.reparseOverscaled = true, this.isTileClipped = true, this._loaded = false, t5.extend(this, t5.pick(o6, ["url", "scheme", "tileSize", "promoteId"])), this._options = t5.extend({ type: "vector" }, o6), this._collectResourceTiming = o6.collectResourceTiming, 512 !== this.tileSize) {
throw new Error("vector tile sources must have a tileSize of 512");
}
this.setEventedParent(a6);
}
return e6 && (i6.__proto__ = e6), (i6.prototype = Object.create(e6 && e6.prototype)).constructor = i6, i6.prototype.load = function() {
var e7 = this;
this._loaded = false, this.fire(new t5.Event("dataloading", { dataType: "source" })), this._tileJSONRequest = I4(this._options, this.map._requestManager, function(i7, o6) {
e7._tileJSONRequest = null, e7._loaded = true, i7 ? e7.fire(new t5.ErrorEvent(i7)) : o6 && (t5.extend(e7, o6), o6.bounds && (e7.tileBounds = new P4(o6.bounds, e7.minzoom, e7.maxzoom)), t5.postTurnstileEvent(o6.tiles, e7.map._requestManager._customAccessToken), t5.postMapLoadEvent(o6.tiles, e7.map._getMapId(), e7.map._requestManager._skuToken, e7.map._requestManager._customAccessToken), e7.fire(new t5.Event("data", { dataType: "source", sourceDataType: "metadata" })), e7.fire(new t5.Event("data", { dataType: "source", sourceDataType: "content" })));
});
}, i6.prototype.loaded = function() {
return this._loaded;
}, i6.prototype.hasTile = function(t6) {
return !this.tileBounds || this.tileBounds.contains(t6.canonical);
}, i6.prototype.onAdd = function(t6) {
this.map = t6, this.load();
}, i6.prototype.setSourceProperty = function(t6) {
this._tileJSONRequest && this._tileJSONRequest.cancel(), t6(), this.map.style.sourceCaches[this.id].clearTiles(), this.load();
}, i6.prototype.setTiles = function(t6) {
var e7 = this;
return this.setSourceProperty(function() {
e7._options.tiles = t6;
}), this;
}, i6.prototype.setUrl = function(t6) {
var e7 = this;
return this.setSourceProperty(function() {
e7.url = t6, e7._options.url = t6;
}), this;
}, i6.prototype.onRemove = function() {
this._tileJSONRequest && (this._tileJSONRequest.cancel(), this._tileJSONRequest = null);
}, i6.prototype.serialize = function() {
return t5.extend({}, this._options);
}, i6.prototype.loadTile = function(e7, i7) {
var o6 = this.map._requestManager.normalizeTileURL(e7.tileID.canonical.url(this.tiles, this.scheme)), r7 = { request: this.map._requestManager.transformRequest(o6, t5.ResourceType.Tile), uid: e7.uid, tileID: e7.tileID, zoom: e7.tileID.overscaledZ, tileSize: this.tileSize * e7.tileID.overscaleFactor(), type: this.type, source: this.id, pixelRatio: t5.browser.devicePixelRatio, showCollisionBoxes: this.map.showCollisionBoxes, promoteId: this.promoteId };
function a6(o7, r8) {
return delete e7.request, e7.aborted ? i7(null) : o7 && 404 !== o7.status ? i7(o7) : (r8 && r8.resourceTiming && (e7.resourceTiming = r8.resourceTiming), this.map._refreshExpiredTiles && r8 && e7.setExpiryData(r8), e7.loadVectorData(r8, this.map.painter), t5.cacheEntryPossiblyAdded(this.dispatcher), i7(null), void (e7.reloadCallback && (this.loadTile(e7, e7.reloadCallback), e7.reloadCallback = null)));
}
r7.request.collectResourceTiming = this._collectResourceTiming, e7.actor && "expired" !== e7.state ? "loading" === e7.state ? e7.reloadCallback = i7 : e7.request = e7.actor.send("reloadTile", r7, a6.bind(this)) : (e7.actor = this.dispatcher.getActor(), e7.request = e7.actor.send("loadTile", r7, a6.bind(this)));
}, i6.prototype.abortTile = function(t6) {
t6.request && (t6.request.cancel(), delete t6.request), t6.actor && t6.actor.send("abortTile", { uid: t6.uid, type: this.type, source: this.id }, void 0);
}, i6.prototype.unloadTile = function(t6) {
t6.unloadVectorData(), t6.actor && t6.actor.send("removeTile", { uid: t6.uid, type: this.type, source: this.id }, void 0);
}, i6.prototype.hasTransition = function() {
return false;
}, i6;
}(t5.Evented), C4 = function(e6) {
function i6(i7, o6, r7, a6) {
e6.call(this), this.id = i7, this.dispatcher = r7, this.setEventedParent(a6), this.type = "raster", this.minzoom = 0, this.maxzoom = 22, this.roundZoom = true, this.scheme = "xyz", this.tileSize = 512, this._loaded = false, this._options = t5.extend({ type: "raster" }, o6), t5.extend(this, t5.pick(o6, ["url", "scheme", "tileSize"]));
}
return e6 && (i6.__proto__ = e6), (i6.prototype = Object.create(e6 && e6.prototype)).constructor = i6, i6.prototype.load = function() {
var e7 = this;
this._loaded = false, this.fire(new t5.Event("dataloading", { dataType: "source" })), this._tileJSONRequest = I4(this._options, this.map._requestManager, function(i7, o6) {
e7._tileJSONRequest = null, e7._loaded = true, i7 ? e7.fire(new t5.ErrorEvent(i7)) : o6 && (t5.extend(e7, o6), o6.bounds && (e7.tileBounds = new P4(o6.bounds, e7.minzoom, e7.maxzoom)), t5.postTurnstileEvent(o6.tiles), t5.postMapLoadEvent(o6.tiles, e7.map._getMapId(), e7.map._requestManager._skuToken), e7.fire(new t5.Event("data", { dataType: "source", sourceDataType: "metadata" })), e7.fire(new t5.Event("data", { dataType: "source", sourceDataType: "content" })));
});
}, i6.prototype.loaded = function() {
return this._loaded;
}, i6.prototype.onAdd = function(t6) {
this.map = t6, this.load();
}, i6.prototype.onRemove = function() {
this._tileJSONRequest && (this._tileJSONRequest.cancel(), this._tileJSONRequest = null);
}, i6.prototype.serialize = function() {
return t5.extend({}, this._options);
}, i6.prototype.hasTile = function(t6) {
return !this.tileBounds || this.tileBounds.contains(t6.canonical);
}, i6.prototype.loadTile = function(e7, i7) {
var o6 = this, r7 = this.map._requestManager.normalizeTileURL(e7.tileID.canonical.url(this.tiles, this.scheme), this.tileSize);
e7.request = t5.getImage(this.map._requestManager.transformRequest(r7, t5.ResourceType.Tile), function(r8, a6) {
if (delete e7.request, e7.aborted) {
e7.state = "unloaded", i7(null);
} else if (r8) {
e7.state = "errored", i7(r8);
} else if (a6) {
o6.map._refreshExpiredTiles && e7.setExpiryData(a6), delete a6.cacheControl, delete a6.expires;
var n8 = o6.map.painter.context, s7 = n8.gl;
e7.texture = o6.map.painter.getTileTexture(a6.width), e7.texture ? e7.texture.update(a6, { useMipmap: true }) : (e7.texture = new t5.Texture(n8, a6, s7.RGBA, { useMipmap: true }), e7.texture.bind(s7.LINEAR, s7.CLAMP_TO_EDGE, s7.LINEAR_MIPMAP_NEAREST), n8.extTextureFilterAnisotropic && s7.texParameterf(s7.TEXTURE_2D, n8.extTextureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT, n8.extTextureFilterAnisotropicMax)), e7.state = "loaded", t5.cacheEntryPossiblyAdded(o6.dispatcher), i7(null);
}
});
}, i6.prototype.abortTile = function(t6, e7) {
t6.request && (t6.request.cancel(), delete t6.request), e7();
}, i6.prototype.unloadTile = function(t6, e7) {
t6.texture && this.map.painter.saveTileTexture(t6.texture), e7();
}, i6.prototype.hasTransition = function() {
return false;
}, i6;
}(t5.Evented), z4 = function(e6) {
function i6(i7, o6, r7, a6) {
e6.call(this, i7, o6, r7, a6), this.type = "raster-dem", this.maxzoom = 22, this._options = t5.extend({ type: "raster-dem" }, o6), this.encoding = o6.encoding || "mapbox";
}
return e6 && (i6.__proto__ = e6), (i6.prototype = Object.create(e6 && e6.prototype)).constructor = i6, i6.prototype.serialize = function() {
return { type: "raster-dem", url: this.url, tileSize: this.tileSize, tiles: this.tiles, bounds: this.bounds, encoding: this.encoding };
}, i6.prototype.loadTile = function(e7, i7) {
var o6 = this.map._requestManager.normalizeTileURL(e7.tileID.canonical.url(this.tiles, this.scheme), this.tileSize);
function r7(t6, o7) {
t6 && (e7.state = "errored", i7(t6)), o7 && (e7.dem = o7, e7.needsHillshadePrepare = true, e7.state = "loaded", i7(null));
}
e7.request = t5.getImage(this.map._requestManager.transformRequest(o6, t5.ResourceType.Tile), function(o7, a6) {
if (delete e7.request, e7.aborted) {
e7.state = "unloaded", i7(null);
} else if (o7) {
e7.state = "errored", i7(o7);
} else if (a6) {
this.map._refreshExpiredTiles && e7.setExpiryData(a6), delete a6.cacheControl, delete a6.expires;
var n8 = t5.window.ImageBitmap && a6 instanceof t5.window.ImageBitmap && t5.offscreenCanvasSupported() ? a6 : t5.browser.getImageData(a6, 1), s7 = { uid: e7.uid, coord: e7.tileID, source: this.id, rawImageData: n8, encoding: this.encoding };
e7.actor && "expired" !== e7.state || (e7.actor = this.dispatcher.getActor(), e7.actor.send("loadDEMTile", s7, r7.bind(this)));
}
}.bind(this)), e7.neighboringTiles = this._getNeighboringTiles(e7.tileID);
}, i6.prototype._getNeighboringTiles = function(e7) {
var i7 = e7.canonical, o6 = Math.pow(2, i7.z), r7 = (i7.x - 1 + o6) % o6, a6 = 0 === i7.x ? e7.wrap - 1 : e7.wrap, n8 = (i7.x + 1 + o6) % o6, s7 = i7.x + 1 === o6 ? e7.wrap + 1 : e7.wrap, l8 = {};
return l8[new t5.OverscaledTileID(e7.overscaledZ, a6, i7.z, r7, i7.y).key] = { backfilled: false }, l8[new t5.OverscaledTileID(e7.overscaledZ, s7, i7.z, n8, i7.y).key] = { backfilled: false }, i7.y > 0 && (l8[new t5.OverscaledTileID(e7.overscaledZ, a6, i7.z, r7, i7.y - 1).key] = { backfilled: false }, l8[new t5.OverscaledTileID(e7.overscaledZ, e7.wrap, i7.z, i7.x, i7.y - 1).key] = { backfilled: false }, l8[new t5.OverscaledTileID(e7.overscaledZ, s7, i7.z, n8, i7.y - 1).key] = { backfilled: false }), i7.y + 1 < o6 && (l8[new t5.OverscaledTileID(e7.overscaledZ, a6, i7.z, r7, i7.y + 1).key] = { backfilled: false }, l8[new t5.OverscaledTileID(e7.overscaledZ, e7.wrap, i7.z, i7.x, i7.y + 1).key] = { backfilled: false }, l8[new t5.OverscaledTileID(e7.overscaledZ, s7, i7.z, n8, i7.y + 1).key] = { backfilled: false }), l8;
}, i6.prototype.unloadTile = function(t6) {
t6.demTexture && this.map.painter.saveTileTexture(t6.demTexture), t6.fbo && (t6.fbo.destroy(), delete t6.fbo), t6.dem && delete t6.dem, delete t6.neighboringTiles, t6.state = "unloaded", t6.actor && t6.actor.send("removeDEMTile", { uid: t6.uid, source: this.id });
}, i6;
}(C4), D4 = function(e6) {
function i6(i7, o6, r7, a6) {
e6.call(this), this.id = i7, this.type = "geojson", this.minzoom = 0, this.maxzoom = 18, this.tileSize = 512, this.isTileClipped = true, this.reparseOverscaled = true, this._removed = false, this._loaded = false, this.actor = r7.getActor(), this.setEventedParent(a6), this._data = o6.data, this._options = t5.extend({}, o6), this._collectResourceTiming = o6.collectResourceTiming, this._resourceTiming = [], void 0 !== o6.maxzoom && (this.maxzoom = o6.maxzoom), o6.type && (this.type = o6.type), o6.attribution && (this.attribution = o6.attribution), this.promoteId = o6.promoteId;
var n8 = t5.EXTENT / this.tileSize;
this.workerOptions = t5.extend({ source: this.id, cluster: o6.cluster || false, geojsonVtOptions: { buffer: (void 0 !== o6.buffer ? o6.buffer : 128) * n8, tolerance: (void 0 !== o6.tolerance ? o6.tolerance : 0.375) * n8, extent: t5.EXTENT, maxZoom: this.maxzoom, lineMetrics: o6.lineMetrics || false, generateId: o6.generateId || false }, superclusterOptions: { maxZoom: void 0 !== o6.clusterMaxZoom ? Math.min(o6.clusterMaxZoom, this.maxzoom - 1) : this.maxzoom - 1, minPoints: Math.max(2, o6.clusterMinPoints || 2), extent: t5.EXTENT, radius: (o6.clusterRadius || 50) * n8, log: false, generateId: o6.generateId || false }, clusterProperties: o6.clusterProperties, filter: o6.filter }, o6.workerOptions);
}
return e6 && (i6.__proto__ = e6), (i6.prototype = Object.create(e6 && e6.prototype)).constructor = i6, i6.prototype.load = function() {
var e7 = this;
this.fire(new t5.Event("dataloading", { dataType: "source" })), this._updateWorkerData(function(i7) {
if (i7) {
e7.fire(new t5.ErrorEvent(i7));
} else {
var o6 = { dataType: "source", sourceDataType: "metadata" };
e7._collectResourceTiming && e7._resourceTiming && e7._resourceTiming.length > 0 && (o6.resourceTiming = e7._resourceTiming, e7._resourceTiming = []), e7.fire(new t5.Event("data", o6));
}
});
}, i6.prototype.onAdd = function(t6) {
this.map = t6, this.load();
}, i6.prototype.setData = function(e7) {
var i7 = this;
return this._data = e7, this.fire(new t5.Event("dataloading", { dataType: "source" })), this._updateWorkerData(function(e8) {
if (e8) {
i7.fire(new t5.ErrorEvent(e8));
} else {
var o6 = { dataType: "source", sourceDataType: "content" };
i7._collectResourceTiming && i7._resourceTiming && i7._resourceTiming.length > 0 && (o6.resourceTiming = i7._resourceTiming, i7._resourceTiming = []), i7.fire(new t5.Event("data", o6));
}
}), this;
}, i6.prototype.getClusterExpansionZoom = function(t6, e7) {
return this.actor.send("geojson.getClusterExpansionZoom", { clusterId: t6, source: this.id }, e7), this;
}, i6.prototype.getClusterChildren = function(t6, e7) {
return this.actor.send("geojson.getClusterChildren", { clusterId: t6, source: this.id }, e7), this;
}, i6.prototype.getClusterLeaves = function(t6, e7, i7, o6) {
return this.actor.send("geojson.getClusterLeaves", { source: this.id, clusterId: t6, limit: e7, offset: i7 }, o6), this;
}, i6.prototype._updateWorkerData = function(e7) {
var i7 = this;
this._loaded = false;
var o6 = t5.extend({}, this.workerOptions), r7 = this._data;
"string" == typeof r7 ? (o6.request = this.map._requestManager.transformRequest(t5.browser.resolveURL(r7), t5.ResourceType.Source), o6.request.collectResourceTiming = this._collectResourceTiming) : o6.data = JSON.stringify(r7), this.actor.send(this.type + ".loadData", o6, function(t6, r8) {
i7._removed || r8 && r8.abandoned || (i7._loaded = true, r8 && r8.resourceTiming && r8.resourceTiming[i7.id] && (i7._resourceTiming = r8.resourceTiming[i7.id].slice(0)), i7.actor.send(i7.type + ".coalesce", { source: o6.source }, null), e7(t6));
});
}, i6.prototype.loaded = function() {
return this._loaded;
}, i6.prototype.loadTile = function(e7, i7) {
var o6 = this, r7 = e7.actor ? "reloadTile" : "loadTile";
e7.actor = this.actor, e7.request = this.actor.send(r7, { type: this.type, uid: e7.uid, tileID: e7.tileID, zoom: e7.tileID.overscaledZ, maxZoom: this.maxzoom, tileSize: this.tileSize, source: this.id, pixelRatio: t5.browser.devicePixelRatio, showCollisionBoxes: this.map.showCollisionBoxes, promoteId: this.promoteId }, function(t6, a6) {
return delete e7.request, e7.unloadVectorData(), e7.aborted ? i7(null) : t6 ? i7(t6) : (e7.loadVectorData(a6, o6.map.painter, "reloadTile" === r7), i7(null));
});
}, i6.prototype.abortTile = function(t6) {
t6.request && (t6.request.cancel(), delete t6.request), t6.aborted = true;
}, i6.prototype.unloadTile = function(t6) {
t6.unloadVectorData(), this.actor.send("removeTile", { uid: t6.uid, type: this.type, source: this.id });
}, i6.prototype.onRemove = function() {
this._removed = true, this.actor.send("removeSource", { type: this.type, source: this.id });
}, i6.prototype.serialize = function() {
return t5.extend({}, this._options, { type: this.type, data: this._data });
}, i6.prototype.hasTransition = function() {
return false;
}, i6;
}(t5.Evented), A4 = t5.createLayout([{ name: "a_pos", type: "Int16", components: 2 }, { name: "a_texture_pos", type: "Int16", components: 2 }]), M4 = function(e6) {
function i6(t6, i7, o6, r7) {
e6.call(this), this.id = t6, this.dispatcher = o6, this.coordinates = i7.coordinates, this.type = "image", this.minzoom = 0, this.maxzoom = 22, this.tileSize = 512, this.tiles = {}, this._loaded = false, this.setEventedParent(r7), this.options = i7;
}
return e6 && (i6.__proto__ = e6), (i6.prototype = Object.create(e6 && e6.prototype)).constructor = i6, i6.prototype.load = function(e7, i7) {
var o6 = this;
this._loaded = false, this.fire(new t5.Event("dataloading", { dataType: "source" })), this.url = this.options.url, t5.getImage(this.map._requestManager.transformRequest(this.url, t5.ResourceType.Image), function(r7, a6) {
o6._loaded = true, r7 ? o6.fire(new t5.ErrorEvent(r7)) : a6 && (o6.image = a6, e7 && (o6.coordinates = e7), i7 && i7(), o6._finishLoading());
});
}, i6.prototype.loaded = function() {
return this._loaded;
}, i6.prototype.updateImage = function(t6) {
var e7 = this;
return this.image && t6.url ? (this.options.url = t6.url, this.load(t6.coordinates, function() {
e7.texture = null;
}), this) : this;
}, i6.prototype._finishLoading = function() {
this.map && (this.setCoordinates(this.coordinates), this.fire(new t5.Event("data", { dataType: "source", sourceDataType: "metadata" })));
}, i6.prototype.onAdd = function(t6) {
this.map = t6, this.load();
}, i6.prototype.setCoordinates = function(e7) {
var i7 = this;
this.coordinates = e7;
var o6 = e7.map(t5.MercatorCoordinate.fromLngLat);
this.tileID = function(e8) {
for (var i8 = 1 / 0, o7 = 1 / 0, r8 = -1 / 0, a6 = -1 / 0, n8 = 0, s7 = e8; n8 < s7.length; n8 += 1) {
var l8 = s7[n8];
i8 = Math.min(i8, l8.x), o7 = Math.min(o7, l8.y), r8 = Math.max(r8, l8.x), a6 = Math.max(a6, l8.y);
}
var c5 = Math.max(r8 - i8, a6 - o7), u5 = Math.max(0, Math.floor(-Math.log(c5) / Math.LN2)), h7 = Math.pow(2, u5);
return new t5.CanonicalTileID(u5, Math.floor((i8 + r8) / 2 * h7), Math.floor((o7 + a6) / 2 * h7));
}(o6), this.minzoom = this.maxzoom = this.tileID.z;
var r7 = o6.map(function(t6) {
return i7.tileID.getTilePoint(t6)._round();
});
return this._boundsArray = new t5.StructArrayLayout4i8(), this._boundsArray.emplaceBack(r7[0].x, r7[0].y, 0, 0), this._boundsArray.emplaceBack(r7[1].x, r7[1].y, t5.EXTENT, 0), this._boundsArray.emplaceBack(r7[3].x, r7[3].y, 0, t5.EXTENT), this._boundsArray.emplaceBack(r7[2].x, r7[2].y, t5.EXTENT, t5.EXTENT), this.boundsBuffer && (this.boundsBuffer.destroy(), delete this.boundsBuffer), this.fire(new t5.Event("data", { dataType: "source", sourceDataType: "content" })), this;
}, i6.prototype.prepare = function() {
if (0 !== Object.keys(this.tiles).length && this.image) {
var e7 = this.map.painter.context, i7 = e7.gl;
for (var o6 in this.boundsBuffer || (this.boundsBuffer = e7.createVertexBuffer(this._boundsArray, A4.members)), this.boundsSegments || (this.boundsSegments = t5.SegmentVector.simpleSegment(0, 0, 4, 2)), this.texture || (this.texture = new t5.Texture(e7, this.image, i7.RGBA), this.texture.bind(i7.LINEAR, i7.CLAMP_TO_EDGE)), this.tiles) {
var r7 = this.tiles[o6];
"loaded" !== r7.state && (r7.state = "loaded", r7.texture = this.texture);
}
}
}, i6.prototype.loadTile = function(t6, e7) {
this.tileID && this.tileID.equals(t6.tileID.canonical) ? (this.tiles[String(t6.tileID.wrap)] = t6, t6.buckets = {}, e7(null)) : (t6.state = "errored", e7(null));
}, i6.prototype.serialize = function() {
return { type: "image", url: this.options.url, coordinates: this.coordinates };
}, i6.prototype.hasTransition = function() {
return false;
}, i6;
}(t5.Evented), L4 = function(e6) {
function i6(t6, i7, o6, r7) {
e6.call(this, t6, i7, o6, r7), this.roundZoom = true, this.type = "video", this.options = i7;
}
return e6 && (i6.__proto__ = e6), (i6.prototype = Object.create(e6 && e6.prototype)).constructor = i6, i6.prototype.load = function() {
var e7 = this;
this._loaded = false;
var i7 = this.options;
this.urls = [];
for (var o6 = 0, r7 = i7.urls; o6 < r7.length; o6 += 1) {
this.urls.push(this.map._requestManager.transformRequest(r7[o6], t5.ResourceType.Source).url);
}
t5.getVideo(this.urls, function(i8, o7) {
e7._loaded = true, i8 ? e7.fire(new t5.ErrorEvent(i8)) : o7 && (e7.video = o7, e7.video.loop = true, e7.video.setAttribute("playsinline", ""), e7.video.addEventListener("playing", function() {
e7.map.triggerRepaint();
}), e7.map && e7.video.play(), e7._finishLoading());
});
}, i6.prototype.pause = function() {
this.video && this.video.pause();
}, i6.prototype.play = function() {
this.video && this.video.play();
}, i6.prototype.seek = function(e7) {
if (this.video) {
var i7 = this.video.seekable;
e7 < i7.start(0) || e7 > i7.end(0) ? this.fire(new t5.ErrorEvent(new t5.ValidationError("sources." + this.id, null, "Playback for this video can be set only between the " + i7.start(0) + " and " + i7.end(0) + "-second mark."))) : this.video.currentTime = e7;
}
}, i6.prototype.getVideo = function() {
return this.video;
}, i6.prototype.onAdd = function(t6) {
this.map || (this.map = t6, this.load(), this.video && (this.video.play(), this.setCoordinates(this.coordinates)));
}, i6.prototype.prepare = function() {
if (!(0 === Object.keys(this.tiles).length || this.video.readyState < 2)) {
var e7 = this.map.painter.context, i7 = e7.gl;
for (var o6 in this.boundsBuffer || (this.boundsBuffer = e7.createVertexBuffer(this._boundsArray, A4.members)), this.boundsSegments || (this.boundsSegments = t5.SegmentVector.simpleSegment(0, 0, 4, 2)), this.texture ? this.video.paused || (this.texture.bind(i7.LINEAR, i7.CLAMP_TO_EDGE), i7.texSubImage2D(i7.TEXTURE_2D, 0, 0, 0, i7.RGBA, i7.UNSIGNED_BYTE, this.video)) : (this.texture = new t5.Texture(e7, this.video, i7.RGBA), this.texture.bind(i7.LINEAR, i7.CLAMP_TO_EDGE)), this.tiles) {
var r7 = this.tiles[o6];
"loaded" !== r7.state && (r7.state = "loaded", r7.texture = this.texture);
}
}
}, i6.prototype.serialize = function() {
return { type: "video", urls: this.urls, coordinates: this.coordinates };
}, i6.prototype.hasTransition = function() {
return this.video && !this.video.paused;
}, i6;
}(M4), R3 = function(e6) {
function i6(i7, o6, r7, a6) {
e6.call(this, i7, o6, r7, a6), o6.coordinates ? Array.isArray(o6.coordinates) && 4 === o6.coordinates.length && !o6.coordinates.some(function(t6) {
return !Array.isArray(t6) || 2 !== t6.length || t6.some(function(t7) {
return "number" != typeof t7;
});
}) || this.fire(new t5.ErrorEvent(new t5.ValidationError("sources." + i7, null, '"coordinates" property must be an array of 4 longitude/latitude array pairs'))) : this.fire(new t5.ErrorEvent(new t5.ValidationError("sources." + i7, null, 'missing required property "coordinates"'))), o6.animate && "boolean" != typeof o6.animate && this.fire(new t5.ErrorEvent(new t5.ValidationError("sources." + i7, null, 'optional "animate" property must be a boolean value'))), o6.canvas ? "string" == typeof o6.canvas || o6.canvas instanceof t5.window.HTMLCanvasElement || this.fire(new t5.ErrorEvent(new t5.ValidationError("sources." + i7, null, '"canvas" must be either a string representing the ID of the canvas element from which to read, or an HTMLCanvasElement instance'))) : this.fire(new t5.ErrorEvent(new t5.ValidationError("sources." + i7, null, 'missing required property "canvas"'))), this.options = o6, this.animate = void 0 === o6.animate || o6.animate;
}
return e6 && (i6.__proto__ = e6), (i6.prototype = Object.create(e6 && e6.prototype)).constructor = i6, i6.prototype.load = function() {
this._loaded = true, this.canvas || (this.canvas = this.options.canvas instanceof t5.window.HTMLCanvasElement ? this.options.canvas : t5.window.document.getElementById(this.options.canvas)), this.width = this.canvas.width, this.height = this.canvas.height, this._hasInvalidDimensions() ? this.fire(new t5.ErrorEvent(new Error("Canvas dimensions cannot be less than or equal to zero."))) : (this.play = function() {
this._playing = true, this.map.triggerRepaint();
}, this.pause = function() {
this._playing && (this.prepare(), this._playing = false);
}, this._finishLoading());
}, i6.prototype.getCanvas = function() {
return this.canvas;
}, i6.prototype.onAdd = function(t6) {
this.map = t6, this.load(), this.canvas && this.animate && this.play();
}, i6.prototype.onRemove = function() {
this.pause();
}, i6.prototype.prepare = function() {
var e7 = false;
if (this.canvas.width !== this.width && (this.width = this.canvas.width, e7 = true), this.canvas.height !== this.height && (this.height = this.canvas.height, e7 = true), !this._hasInvalidDimensions() && 0 !== Object.keys(this.tiles).length) {
var i7 = this.map.painter.context, o6 = i7.gl;
for (var r7 in this.boundsBuffer || (this.boundsBuffer = i7.createVertexBuffer(this._boundsArray, A4.members)), this.boundsSegments || (this.boundsSegments = t5.SegmentVector.simpleSegment(0, 0, 4, 2)), this.texture ? (e7 || this._playing) && this.texture.update(this.canvas, { premultiply: true }) : this.texture = new t5.Texture(i7, this.canvas, o6.RGBA, { premultiply: true }), this.tiles) {
var a6 = this.tiles[r7];
"loaded" !== a6.state && (a6.state = "loaded", a6.texture = this.texture);
}
}
}, i6.prototype.serialize = function() {
return { type: "canvas", coordinates: this.coordinates };
}, i6.prototype.hasTransition = function() {
return this._playing;
}, i6.prototype._hasInvalidDimensions = function() {
for (var t6 = 0, e7 = [this.canvas.width, this.canvas.height]; t6 < e7.length; t6 += 1) {
var i7 = e7[t6];
if (isNaN(i7) || i7 <= 0) {
return true;
}
}
return false;
}, i6;
}(M4), k4 = { vector: S4, raster: C4, "raster-dem": z4, geojson: D4, video: L4, image: M4, canvas: R3 };
function B3(e6, i6) {
var o6 = t5.identity([]);
return t5.translate(o6, o6, [1, 1, 0]), t5.scale(o6, o6, [0.5 * e6.width, 0.5 * e6.height, 1]), t5.multiply(o6, o6, e6.calculatePosMatrix(i6.toUnwrapped()));
}
function O4(t6, e6, i6, o6, r7, a6) {
var n8 = function(t7, e7, i7) {
if (t7) {
for (var o7 = 0, r8 = t7; o7 < r8.length; o7 += 1) {
var a7 = e7[r8[o7]];
if (a7 && a7.source === i7 && "fill-extrusion" === a7.type) {
return true;
}
}
} else {
for (var n9 in e7) {
var s8 = e7[n9];
if (s8.source === i7 && "fill-extrusion" === s8.type) {
return true;
}
}
}
return false;
}(r7 && r7.layers, e6, t6.id), s7 = a6.maxPitchScaleFactor(), l8 = t6.tilesIn(o6, s7, n8);
l8.sort(F3);
for (var c5 = [], u5 = 0, h7 = l8; u5 < h7.length; u5 += 1) {
var p5 = h7[u5];
c5.push({ wrappedTileID: p5.tileID.wrapped().key, queryResults: p5.tile.queryRenderedFeatures(e6, i6, t6._state, p5.queryGeometry, p5.cameraQueryGeometry, p5.scale, r7, a6, s7, B3(t6.transform, p5.tileID)) });
}
var d5 = function(t7) {
for (var e7 = {}, i7 = {}, o7 = 0, r8 = t7; o7 < r8.length; o7 += 1) {
var a7 = r8[o7], n9 = a7.queryResults, s8 = a7.wrappedTileID, l9 = i7[s8] = i7[s8] || {};
for (var c6 in n9) {
for (var u6 = n9[c6], h8 = l9[c6] = l9[c6] || {}, p6 = e7[c6] = e7[c6] || [], d6 = 0, _5 = u6; d6 < _5.length; d6 += 1) {
var f5 = _5[d6];
h8[f5.featureIndex] || (h8[f5.featureIndex] = true, p6.push(f5));
}
}
}
return e7;
}(c5);
for (var _4 in d5) {
d5[_4].forEach(function(e7) {
var i7 = e7.feature, o7 = t6.getFeatureState(i7.layer["source-layer"], i7.id);
i7.source = i7.layer.source, i7.layer["source-layer"] && (i7.sourceLayer = i7.layer["source-layer"]), i7.state = o7;
});
}
return d5;
}
function F3(t6, e6) {
var i6 = t6.tileID, o6 = e6.tileID;
return i6.overscaledZ - o6.overscaledZ || i6.canonical.y - o6.canonical.y || i6.wrap - o6.wrap || i6.canonical.x - o6.canonical.x;
}
var U3 = function(t6, e6) {
this.max = t6, this.onRemove = e6, this.reset();
};
U3.prototype.reset = function() {
for (var t6 in this.data) {
for (var e6 = 0, i6 = this.data[t6]; e6 < i6.length; e6 += 1) {
var o6 = i6[e6];
o6.timeout && clearTimeout(o6.timeout), this.onRemove(o6.value);
}
}
return this.data = {}, this.order = [], this;
}, U3.prototype.add = function(t6, e6, i6) {
var o6 = this, r7 = t6.wrapped().key;
void 0 === this.data[r7] && (this.data[r7] = []);
var a6 = { value: e6, timeout: void 0 };
if (void 0 !== i6 && (a6.timeout = setTimeout(function() {
o6.remove(t6, a6);
}, i6)), this.data[r7].push(a6), this.order.push(r7), this.order.length > this.max) {
var n8 = this._getAndRemoveByKey(this.order[0]);
n8 && this.onRemove(n8);
}
return this;
}, U3.prototype.has = function(t6) {
return t6.wrapped().key in this.data;
}, U3.prototype.getAndRemove = function(t6) {
return this.has(t6) ? this._getAndRemoveByKey(t6.wrapped().key) : null;
}, U3.prototype._getAndRemoveByKey = function(t6) {
var e6 = this.data[t6].shift();
return e6.timeout && clearTimeout(e6.timeout), 0 === this.data[t6].length && delete this.data[t6], this.order.splice(this.order.indexOf(t6), 1), e6.value;
}, U3.prototype.getByKey = function(t6) {
var e6 = this.data[t6];
return e6 ? e6[0].value : null;
}, U3.prototype.get = function(t6) {
return this.has(t6) ? this.data[t6.wrapped().key][0].value : null;
}, U3.prototype.remove = function(t6, e6) {
if (!this.has(t6)) {
return this;
}
var i6 = t6.wrapped().key, o6 = void 0 === e6 ? 0 : this.data[i6].indexOf(e6), r7 = this.data[i6][o6];
return this.data[i6].splice(o6, 1), r7.timeout && clearTimeout(r7.timeout), 0 === this.data[i6].length && delete this.data[i6], this.onRemove(r7.value), this.order.splice(this.order.indexOf(i6), 1), this;
}, U3.prototype.setMaxSize = function(t6) {
for (this.max = t6; this.order.length > this.max; ) {
var e6 = this._getAndRemoveByKey(this.order[0]);
e6 && this.onRemove(e6);
}
return this;
}, U3.prototype.filter = function(t6) {
var e6 = [];
for (var i6 in this.data) {
for (var o6 = 0, r7 = this.data[i6]; o6 < r7.length; o6 += 1) {
var a6 = r7[o6];
t6(a6.value) || e6.push(a6);
}
}
for (var n8 = 0, s7 = e6; n8 < s7.length; n8 += 1) {
var l8 = s7[n8];
this.remove(l8.value.tileID, l8);
}
};
var N4 = function(t6, e6, i6) {
this.context = t6;
var o6 = t6.gl;
this.buffer = o6.createBuffer(), this.dynamicDraw = Boolean(i6), this.context.unbindVAO(), t6.bindElementBuffer.set(this.buffer), o6.bufferData(o6.ELEMENT_ARRAY_BUFFER, e6.arrayBuffer, this.dynamicDraw ? o6.DYNAMIC_DRAW : o6.STATIC_DRAW), this.dynamicDraw || delete e6.arrayBuffer;
};
N4.prototype.bind = function() {
this.context.bindElementBuffer.set(this.buffer);
}, N4.prototype.updateData = function(t6) {
var e6 = this.context.gl;
this.context.unbindVAO(), this.bind(), e6.bufferSubData(e6.ELEMENT_ARRAY_BUFFER, 0, t6.arrayBuffer);
}, N4.prototype.destroy = function() {
this.buffer && (this.context.gl.deleteBuffer(this.buffer), delete this.buffer);
};
var Z2 = { Int8: "BYTE", Uint8: "UNSIGNED_BYTE", Int16: "SHORT", Uint16: "UNSIGNED_SHORT", Int32: "INT", Uint32: "UNSIGNED_INT", Float32: "FLOAT" }, q4 = function(t6, e6, i6, o6) {
this.length = e6.length, this.attributes = i6, this.itemSize = e6.bytesPerElement, this.dynamicDraw = o6, this.context = t6;
var r7 = t6.gl;
this.buffer = r7.createBuffer(), t6.bindVertexBuffer.set(this.buffer), r7.bufferData(r7.ARRAY_BUFFER, e6.arrayBuffer, this.dynamicDraw ? r7.DYNAMIC_DRAW : r7.STATIC_DRAW), this.dynamicDraw || delete e6.arrayBuffer;
};
q4.prototype.bind = function() {
this.context.bindVertexBuffer.set(this.buffer);
}, q4.prototype.updateData = function(t6) {
var e6 = this.context.gl;
this.bind(), e6.bufferSubData(e6.ARRAY_BUFFER, 0, t6.arrayBuffer);
}, q4.prototype.enableAttributes = function(t6, e6) {
for (var i6 = 0; i6 < this.attributes.length; i6++) {
var o6 = e6.attributes[this.attributes[i6].name];
void 0 !== o6 && t6.enableVertexAttribArray(o6);
}
}, q4.prototype.setVertexAttribPointers = function(t6, e6, i6) {
for (var o6 = 0; o6 < this.attributes.length; o6++) {
var r7 = this.attributes[o6], a6 = e6.attributes[r7.name];
void 0 !== a6 && t6.vertexAttribPointer(a6, r7.components, t6[Z2[r7.type]], false, this.itemSize, r7.offset + this.itemSize * (i6 || 0));
}
}, q4.prototype.destroy = function() {
this.buffer && (this.context.gl.deleteBuffer(this.buffer), delete this.buffer);
};
var j4 = function(t6) {
this.gl = t6.gl, this.default = this.getDefault(), this.current = this.default, this.dirty = false;
};
j4.prototype.get = function() {
return this.current;
}, j4.prototype.set = function(t6) {
}, j4.prototype.getDefault = function() {
return this.default;
}, j4.prototype.setDefault = function() {
this.set(this.default);
};
var V3 = function(e6) {
function i6() {
e6.apply(this, arguments);
}
return e6 && (i6.__proto__ = e6), (i6.prototype = Object.create(e6 && e6.prototype)).constructor = i6, i6.prototype.getDefault = function() {
return t5.Color.transparent;
}, i6.prototype.set = function(t6) {
var e7 = this.current;
(t6.r !== e7.r || t6.g !== e7.g || t6.b !== e7.b || t6.a !== e7.a || this.dirty) && (this.gl.clearColor(t6.r, t6.g, t6.b, t6.a), this.current = t6, this.dirty = false);
}, i6;
}(j4), G3 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return 1;
}, e6.prototype.set = function(t7) {
(t7 !== this.current || this.dirty) && (this.gl.clearDepth(t7), this.current = t7, this.dirty = false);
}, e6;
}(j4), W3 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return 0;
}, e6.prototype.set = function(t7) {
(t7 !== this.current || this.dirty) && (this.gl.clearStencil(t7), this.current = t7, this.dirty = false);
}, e6;
}(j4), X3 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return [true, true, true, true];
}, e6.prototype.set = function(t7) {
var e7 = this.current;
(t7[0] !== e7[0] || t7[1] !== e7[1] || t7[2] !== e7[2] || t7[3] !== e7[3] || this.dirty) && (this.gl.colorMask(t7[0], t7[1], t7[2], t7[3]), this.current = t7, this.dirty = false);
}, e6;
}(j4), H4 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return true;
}, e6.prototype.set = function(t7) {
(t7 !== this.current || this.dirty) && (this.gl.depthMask(t7), this.current = t7, this.dirty = false);
}, e6;
}(j4), K3 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return 255;
}, e6.prototype.set = function(t7) {
(t7 !== this.current || this.dirty) && (this.gl.stencilMask(t7), this.current = t7, this.dirty = false);
}, e6;
}(j4), Y2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return { func: this.gl.ALWAYS, ref: 0, mask: 255 };
}, e6.prototype.set = function(t7) {
var e7 = this.current;
(t7.func !== e7.func || t7.ref !== e7.ref || t7.mask !== e7.mask || this.dirty) && (this.gl.stencilFunc(t7.func, t7.ref, t7.mask), this.current = t7, this.dirty = false);
}, e6;
}(j4), J3 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
var t7 = this.gl;
return [t7.KEEP, t7.KEEP, t7.KEEP];
}, e6.prototype.set = function(t7) {
var e7 = this.current;
(t7[0] !== e7[0] || t7[1] !== e7[1] || t7[2] !== e7[2] || this.dirty) && (this.gl.stencilOp(t7[0], t7[1], t7[2]), this.current = t7, this.dirty = false);
}, e6;
}(j4), Q2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return false;
}, e6.prototype.set = function(t7) {
if (t7 !== this.current || this.dirty) {
var e7 = this.gl;
t7 ? e7.enable(e7.STENCIL_TEST) : e7.disable(e7.STENCIL_TEST), this.current = t7, this.dirty = false;
}
}, e6;
}(j4), $3 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return [0, 1];
}, e6.prototype.set = function(t7) {
var e7 = this.current;
(t7[0] !== e7[0] || t7[1] !== e7[1] || this.dirty) && (this.gl.depthRange(t7[0], t7[1]), this.current = t7, this.dirty = false);
}, e6;
}(j4), tt3 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return false;
}, e6.prototype.set = function(t7) {
if (t7 !== this.current || this.dirty) {
var e7 = this.gl;
t7 ? e7.enable(e7.DEPTH_TEST) : e7.disable(e7.DEPTH_TEST), this.current = t7, this.dirty = false;
}
}, e6;
}(j4), et2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return this.gl.LESS;
}, e6.prototype.set = function(t7) {
(t7 !== this.current || this.dirty) && (this.gl.depthFunc(t7), this.current = t7, this.dirty = false);
}, e6;
}(j4), it2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return false;
}, e6.prototype.set = function(t7) {
if (t7 !== this.current || this.dirty) {
var e7 = this.gl;
t7 ? e7.enable(e7.BLEND) : e7.disable(e7.BLEND), this.current = t7, this.dirty = false;
}
}, e6;
}(j4), ot2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
var t7 = this.gl;
return [t7.ONE, t7.ZERO];
}, e6.prototype.set = function(t7) {
var e7 = this.current;
(t7[0] !== e7[0] || t7[1] !== e7[1] || this.dirty) && (this.gl.blendFunc(t7[0], t7[1]), this.current = t7, this.dirty = false);
}, e6;
}(j4), rt2 = function(e6) {
function i6() {
e6.apply(this, arguments);
}
return e6 && (i6.__proto__ = e6), (i6.prototype = Object.create(e6 && e6.prototype)).constructor = i6, i6.prototype.getDefault = function() {
return t5.Color.transparent;
}, i6.prototype.set = function(t6) {
var e7 = this.current;
(t6.r !== e7.r || t6.g !== e7.g || t6.b !== e7.b || t6.a !== e7.a || this.dirty) && (this.gl.blendColor(t6.r, t6.g, t6.b, t6.a), this.current = t6, this.dirty = false);
}, i6;
}(j4), at2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return this.gl.FUNC_ADD;
}, e6.prototype.set = function(t7) {
(t7 !== this.current || this.dirty) && (this.gl.blendEquation(t7), this.current = t7, this.dirty = false);
}, e6;
}(j4), nt2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return false;
}, e6.prototype.set = function(t7) {
if (t7 !== this.current || this.dirty) {
var e7 = this.gl;
t7 ? e7.enable(e7.CULL_FACE) : e7.disable(e7.CULL_FACE), this.current = t7, this.dirty = false;
}
}, e6;
}(j4), st2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return this.gl.BACK;
}, e6.prototype.set = function(t7) {
(t7 !== this.current || this.dirty) && (this.gl.cullFace(t7), this.current = t7, this.dirty = false);
}, e6;
}(j4), lt2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return this.gl.CCW;
}, e6.prototype.set = function(t7) {
(t7 !== this.current || this.dirty) && (this.gl.frontFace(t7), this.current = t7, this.dirty = false);
}, e6;
}(j4), ct2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return null;
}, e6.prototype.set = function(t7) {
(t7 !== this.current || this.dirty) && (this.gl.useProgram(t7), this.current = t7, this.dirty = false);
}, e6;
}(j4), ut2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return this.gl.TEXTURE0;
}, e6.prototype.set = function(t7) {
(t7 !== this.current || this.dirty) && (this.gl.activeTexture(t7), this.current = t7, this.dirty = false);
}, e6;
}(j4), ht2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
var t7 = this.gl;
return [0, 0, t7.drawingBufferWidth, t7.drawingBufferHeight];
}, e6.prototype.set = function(t7) {
var e7 = this.current;
(t7[0] !== e7[0] || t7[1] !== e7[1] || t7[2] !== e7[2] || t7[3] !== e7[3] || this.dirty) && (this.gl.viewport(t7[0], t7[1], t7[2], t7[3]), this.current = t7, this.dirty = false);
}, e6;
}(j4), pt2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return null;
}, e6.prototype.set = function(t7) {
if (t7 !== this.current || this.dirty) {
var e7 = this.gl;
e7.bindFramebuffer(e7.FRAMEBUFFER, t7), this.current = t7, this.dirty = false;
}
}, e6;
}(j4), dt2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return null;
}, e6.prototype.set = function(t7) {
if (t7 !== this.current || this.dirty) {
var e7 = this.gl;
e7.bindRenderbuffer(e7.RENDERBUFFER, t7), this.current = t7, this.dirty = false;
}
}, e6;
}(j4), _t2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return null;
}, e6.prototype.set = function(t7) {
if (t7 !== this.current || this.dirty) {
var e7 = this.gl;
e7.bindTexture(e7.TEXTURE_2D, t7), this.current = t7, this.dirty = false;
}
}, e6;
}(j4), ft2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return null;
}, e6.prototype.set = function(t7) {
if (t7 !== this.current || this.dirty) {
var e7 = this.gl;
e7.bindBuffer(e7.ARRAY_BUFFER, t7), this.current = t7, this.dirty = false;
}
}, e6;
}(j4), mt2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return null;
}, e6.prototype.set = function(t7) {
var e7 = this.gl;
e7.bindBuffer(e7.ELEMENT_ARRAY_BUFFER, t7), this.current = t7, this.dirty = false;
}, e6;
}(j4), gt2 = function(t6) {
function e6(e7) {
t6.call(this, e7), this.vao = e7.extVertexArrayObject;
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return null;
}, e6.prototype.set = function(t7) {
this.vao && (t7 !== this.current || this.dirty) && (this.vao.bindVertexArrayOES(t7), this.current = t7, this.dirty = false);
}, e6;
}(j4), vt2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return 4;
}, e6.prototype.set = function(t7) {
if (t7 !== this.current || this.dirty) {
var e7 = this.gl;
e7.pixelStorei(e7.UNPACK_ALIGNMENT, t7), this.current = t7, this.dirty = false;
}
}, e6;
}(j4), yt2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return false;
}, e6.prototype.set = function(t7) {
if (t7 !== this.current || this.dirty) {
var e7 = this.gl;
e7.pixelStorei(e7.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t7), this.current = t7, this.dirty = false;
}
}, e6;
}(j4), xt2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return false;
}, e6.prototype.set = function(t7) {
if (t7 !== this.current || this.dirty) {
var e7 = this.gl;
e7.pixelStorei(e7.UNPACK_FLIP_Y_WEBGL, t7), this.current = t7, this.dirty = false;
}
}, e6;
}(j4), bt2 = function(t6) {
function e6(e7, i6) {
t6.call(this, e7), this.context = e7, this.parent = i6;
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.getDefault = function() {
return null;
}, e6;
}(j4), wt2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.setDirty = function() {
this.dirty = true;
}, e6.prototype.set = function(t7) {
if (t7 !== this.current || this.dirty) {
this.context.bindFramebuffer.set(this.parent);
var e7 = this.gl;
e7.framebufferTexture2D(e7.FRAMEBUFFER, e7.COLOR_ATTACHMENT0, e7.TEXTURE_2D, t7, 0), this.current = t7, this.dirty = false;
}
}, e6;
}(bt2), Tt2 = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.set = function(t7) {
if (t7 !== this.current || this.dirty) {
this.context.bindFramebuffer.set(this.parent);
var e7 = this.gl;
e7.framebufferRenderbuffer(e7.FRAMEBUFFER, e7.DEPTH_ATTACHMENT, e7.RENDERBUFFER, t7), this.current = t7, this.dirty = false;
}
}, e6;
}(bt2), Et2 = function(t6, e6, i6, o6) {
this.context = t6, this.width = e6, this.height = i6;
var r7 = this.framebuffer = t6.gl.createFramebuffer();
this.colorAttachment = new wt2(t6, r7), o6 && (this.depthAttachment = new Tt2(t6, r7));
};
Et2.prototype.destroy = function() {
var t6 = this.context.gl, e6 = this.colorAttachment.get();
if (e6 && t6.deleteTexture(e6), this.depthAttachment) {
var i6 = this.depthAttachment.get();
i6 && t6.deleteRenderbuffer(i6);
}
t6.deleteFramebuffer(this.framebuffer);
};
var It2 = function(t6, e6, i6) {
this.func = t6, this.mask = e6, this.range = i6;
};
It2.ReadOnly = false, It2.ReadWrite = true, It2.disabled = new It2(519, It2.ReadOnly, [0, 1]);
var Pt2 = function(t6, e6, i6, o6, r7, a6) {
this.test = t6, this.ref = e6, this.mask = i6, this.fail = o6, this.depthFail = r7, this.pass = a6;
};
Pt2.disabled = new Pt2({ func: 519, mask: 0 }, 0, 0, 7680, 7680, 7680);
var St2 = function(t6, e6, i6) {
this.blendFunction = t6, this.blendColor = e6, this.mask = i6;
};
St2.disabled = new St2(St2.Replace = [1, 0], t5.Color.transparent, [false, false, false, false]), St2.unblended = new St2(St2.Replace, t5.Color.transparent, [true, true, true, true]), St2.alphaBlended = new St2([1, 771], t5.Color.transparent, [true, true, true, true]);
var Ct2 = function(t6, e6, i6) {
this.enable = t6, this.mode = e6, this.frontFace = i6;
};
Ct2.disabled = new Ct2(false, 1029, 2305), Ct2.backCCW = new Ct2(true, 1029, 2305);
var zt2 = function(t6) {
this.gl = t6, this.extVertexArrayObject = this.gl.getExtension("OES_vertex_array_object"), this.clearColor = new V3(this), this.clearDepth = new G3(this), this.clearStencil = new W3(this), this.colorMask = new X3(this), this.depthMask = new H4(this), this.stencilMask = new K3(this), this.stencilFunc = new Y2(this), this.stencilOp = new J3(this), this.stencilTest = new Q2(this), this.depthRange = new $3(this), this.depthTest = new tt3(this), this.depthFunc = new et2(this), this.blend = new it2(this), this.blendFunc = new ot2(this), this.blendColor = new rt2(this), this.blendEquation = new at2(this), this.cullFace = new nt2(this), this.cullFaceSide = new st2(this), this.frontFace = new lt2(this), this.program = new ct2(this), this.activeTexture = new ut2(this), this.viewport = new ht2(this), this.bindFramebuffer = new pt2(this), this.bindRenderbuffer = new dt2(this), this.bindTexture = new _t2(this), this.bindVertexBuffer = new ft2(this), this.bindElementBuffer = new mt2(this), this.bindVertexArrayOES = this.extVertexArrayObject && new gt2(this), this.pixelStoreUnpack = new vt2(this), this.pixelStoreUnpackPremultiplyAlpha = new yt2(this), this.pixelStoreUnpackFlipY = new xt2(this), this.extTextureFilterAnisotropic = t6.getExtension("EXT_texture_filter_anisotropic") || t6.getExtension("MOZ_EXT_texture_filter_anisotropic") || t6.getExtension("WEBKIT_EXT_texture_filter_anisotropic"), this.extTextureFilterAnisotropic && (this.extTextureFilterAnisotropicMax = t6.getParameter(this.extTextureFilterAnisotropic.MAX_TEXTURE_MAX_ANISOTROPY_EXT)), this.extTextureHalfFloat = t6.getExtension("OES_texture_half_float"), this.extTextureHalfFloat && (t6.getExtension("OES_texture_half_float_linear"), this.extRenderToTextureHalfFloat = t6.getExtension("EXT_color_buffer_half_float")), this.extTimerQuery = t6.getExtension("EXT_disjoint_timer_query"), this.maxTextureSize = t6.getParameter(t6.MAX_TEXTURE_SIZE);
};
zt2.prototype.setDefault = function() {
this.unbindVAO(), this.clearColor.setDefault(), this.clearDepth.setDefault(), this.clearStencil.setDefault(), this.colorMask.setDefault(), this.depthMask.setDefault(), this.stencilMask.setDefault(), this.stencilFunc.setDefault(), this.stencilOp.setDefault(), this.stencilTest.setDefault(), this.depthRange.setDefault(), this.depthTest.setDefault(), this.depthFunc.setDefault(), this.blend.setDefault(), this.blendFunc.setDefault(), this.blendColor.setDefault(), this.blendEquation.setDefault(), this.cullFace.setDefault(), this.cullFaceSide.setDefault(), this.frontFace.setDefault(), this.program.setDefault(), this.activeTexture.setDefault(), this.bindFramebuffer.setDefault(), this.pixelStoreUnpack.setDefault(), this.pixelStoreUnpackPremultiplyAlpha.setDefault(), this.pixelStoreUnpackFlipY.setDefault();
}, zt2.prototype.setDirty = function() {
this.clearColor.dirty = true, this.clearDepth.dirty = true, this.clearStencil.dirty = true, this.colorMask.dirty = true, this.depthMask.dirty = true, this.stencilMask.dirty = true, this.stencilFunc.dirty = true, this.stencilOp.dirty = true, this.stencilTest.dirty = true, this.depthRange.dirty = true, this.depthTest.dirty = true, this.depthFunc.dirty = true, this.blend.dirty = true, this.blendFunc.dirty = true, this.blendColor.dirty = true, this.blendEquation.dirty = true, this.cullFace.dirty = true, this.cullFaceSide.dirty = true, this.frontFace.dirty = true, this.program.dirty = true, this.activeTexture.dirty = true, this.viewport.dirty = true, this.bindFramebuffer.dirty = true, this.bindRenderbuffer.dirty = true, this.bindTexture.dirty = true, this.bindVertexBuffer.dirty = true, this.bindElementBuffer.dirty = true, this.extVertexArrayObject && (this.bindVertexArrayOES.dirty = true), this.pixelStoreUnpack.dirty = true, this.pixelStoreUnpackPremultiplyAlpha.dirty = true, this.pixelStoreUnpackFlipY.dirty = true;
}, zt2.prototype.createIndexBuffer = function(t6, e6) {
return new N4(this, t6, e6);
}, zt2.prototype.createVertexBuffer = function(t6, e6, i6) {
return new q4(this, t6, e6, i6);
}, zt2.prototype.createRenderbuffer = function(t6, e6, i6) {
var o6 = this.gl, r7 = o6.createRenderbuffer();
return this.bindRenderbuffer.set(r7), o6.renderbufferStorage(o6.RENDERBUFFER, t6, e6, i6), this.bindRenderbuffer.set(null), r7;
}, zt2.prototype.createFramebuffer = function(t6, e6, i6) {
return new Et2(this, t6, e6, i6);
}, zt2.prototype.clear = function(t6) {
var e6 = t6.color, i6 = t6.depth, o6 = this.gl, r7 = 0;
e6 && (r7 |= o6.COLOR_BUFFER_BIT, this.clearColor.set(e6), this.colorMask.set([true, true, true, true])), void 0 !== i6 && (r7 |= o6.DEPTH_BUFFER_BIT, this.depthRange.set([0, 1]), this.clearDepth.set(i6), this.depthMask.set(true)), o6.clear(r7);
}, zt2.prototype.setCullFace = function(t6) {
false === t6.enable ? this.cullFace.set(false) : (this.cullFace.set(true), this.cullFaceSide.set(t6.mode), this.frontFace.set(t6.frontFace));
}, zt2.prototype.setDepthMode = function(t6) {
t6.func !== this.gl.ALWAYS || t6.mask ? (this.depthTest.set(true), this.depthFunc.set(t6.func), this.depthMask.set(t6.mask), this.depthRange.set(t6.range)) : this.depthTest.set(false);
}, zt2.prototype.setStencilMode = function(t6) {
t6.test.func !== this.gl.ALWAYS || t6.mask ? (this.stencilTest.set(true), this.stencilMask.set(t6.mask), this.stencilOp.set([t6.fail, t6.depthFail, t6.pass]), this.stencilFunc.set({ func: t6.test.func, ref: t6.ref, mask: t6.test.mask })) : this.stencilTest.set(false);
}, zt2.prototype.setColorMode = function(e6) {
t5.deepEqual(e6.blendFunction, St2.Replace) ? this.blend.set(false) : (this.blend.set(true), this.blendFunc.set(e6.blendFunction), this.blendColor.set(e6.blendColor)), this.colorMask.set(e6.mask);
}, zt2.prototype.unbindVAO = function() {
this.extVertexArrayObject && this.bindVertexArrayOES.set(null);
};
var Dt2 = function(e6) {
function i6(i7, o6, r7) {
var a6 = this;
e6.call(this), this.id = i7, this.dispatcher = r7, this.on("data", function(t6) {
"source" === t6.dataType && "metadata" === t6.sourceDataType && (a6._sourceLoaded = true), a6._sourceLoaded && !a6._paused && "source" === t6.dataType && "content" === t6.sourceDataType && (a6.reload(), a6.transform && a6.update(a6.transform));
}), this.on("error", function() {
a6._sourceErrored = true;
}), this._source = function(e7, i8, o7, r8) {
var a7 = new k4[i8.type](e7, i8, o7, r8);
if (a7.id !== e7) {
throw new Error("Expected Source id to be " + e7 + " instead of " + a7.id);
}
return t5.bindAll(["load", "abort", "unload", "serialize", "prepare"], a7), a7;
}(i7, o6, r7, this), this._tiles = {}, this._cache = new U3(0, this._unloadTile.bind(this)), this._timers = {}, this._cacheTimers = {}, this._maxTileCacheSize = null, this._loadedParentTiles = {}, this._coveredTiles = {}, this._state = new t5.SourceFeatureState();
}
return e6 && (i6.__proto__ = e6), (i6.prototype = Object.create(e6 && e6.prototype)).constructor = i6, i6.prototype.onAdd = function(t6) {
this.map = t6, this._maxTileCacheSize = t6 ? t6._maxTileCacheSize : null, this._source && this._source.onAdd && this._source.onAdd(t6);
}, i6.prototype.onRemove = function(t6) {
this._source && this._source.onRemove && this._source.onRemove(t6);
}, i6.prototype.loaded = function() {
if (this._sourceErrored) {
return true;
}
if (!this._sourceLoaded) {
return false;
}
if (!this._source.loaded()) {
return false;
}
for (var t6 in this._tiles) {
var e7 = this._tiles[t6];
if ("loaded" !== e7.state && "errored" !== e7.state) {
return false;
}
}
return true;
}, i6.prototype.getSource = function() {
return this._source;
}, i6.prototype.pause = function() {
this._paused = true;
}, i6.prototype.resume = function() {
if (this._paused) {
var t6 = this._shouldReloadOnResume;
this._paused = false, this._shouldReloadOnResume = false, t6 && this.reload(), this.transform && this.update(this.transform);
}
}, i6.prototype._loadTile = function(t6, e7) {
return this._source.loadTile(t6, e7);
}, i6.prototype._unloadTile = function(t6) {
if (this._source.unloadTile) {
return this._source.unloadTile(t6, function() {
});
}
}, i6.prototype._abortTile = function(t6) {
if (this._source.abortTile) {
return this._source.abortTile(t6, function() {
});
}
}, i6.prototype.serialize = function() {
return this._source.serialize();
}, i6.prototype.prepare = function(t6) {
for (var e7 in this._source.prepare && this._source.prepare(), this._state.coalesceChanges(this._tiles, this.map ? this.map.painter : null), this._tiles) {
var i7 = this._tiles[e7];
i7.upload(t6), i7.prepare(this.map.style.imageManager);
}
}, i6.prototype.getIds = function() {
return t5.values(this._tiles).map(function(t6) {
return t6.tileID;
}).sort(At2).map(function(t6) {
return t6.key;
});
}, i6.prototype.getRenderableIds = function(e7) {
var i7 = this, o6 = [];
for (var r7 in this._tiles) {
this._isIdRenderable(r7, e7) && o6.push(this._tiles[r7]);
}
return e7 ? o6.sort(function(e8, o7) {
var r8 = e8.tileID, a6 = o7.tileID, n8 = new t5.Point(r8.canonical.x, r8.canonical.y)._rotate(i7.transform.angle), s7 = new t5.Point(a6.canonical.x, a6.canonical.y)._rotate(i7.transform.angle);
return r8.overscaledZ - a6.overscaledZ || s7.y - n8.y || s7.x - n8.x;
}).map(function(t6) {
return t6.tileID.key;
}) : o6.map(function(t6) {
return t6.tileID;
}).sort(At2).map(function(t6) {
return t6.key;
});
}, i6.prototype.hasRenderableParent = function(t6) {
var e7 = this.findLoadedParent(t6, 0);
return !!e7 && this._isIdRenderable(e7.tileID.key);
}, i6.prototype._isIdRenderable = function(t6, e7) {
return this._tiles[t6] && this._tiles[t6].hasData() && !this._coveredTiles[t6] && (e7 || !this._tiles[t6].holdingForFade());
}, i6.prototype.reload = function() {
if (this._paused) {
this._shouldReloadOnResume = true;
} else {
for (var t6 in this._cache.reset(), this._tiles) {
"errored" !== this._tiles[t6].state && this._reloadTile(t6, "reloading");
}
}
}, i6.prototype._reloadTile = function(t6, e7) {
var i7 = this._tiles[t6];
i7 && ("loading" !== i7.state && (i7.state = e7), this._loadTile(i7, this._tileLoaded.bind(this, i7, t6, e7)));
}, i6.prototype._tileLoaded = function(e7, i7, o6, r7) {
if (r7) {
return e7.state = "errored", void (404 !== r7.status ? this._source.fire(new t5.ErrorEvent(r7, { tile: e7 })) : this.update(this.transform));
}
e7.timeAdded = t5.browser.now(), "expired" === o6 && (e7.refreshedUponExpiration = true), this._setTileReloadTimer(i7, e7), "raster-dem" === this.getSource().type && e7.dem && this._backfillDEM(e7), this._state.initializeTileState(e7, this.map ? this.map.painter : null), this._source.fire(new t5.Event("data", { dataType: "source", tile: e7, coord: e7.tileID }));
}, i6.prototype._backfillDEM = function(t6) {
for (var e7 = this.getRenderableIds(), i7 = 0; i7 < e7.length; i7++) {
var o6 = e7[i7];
if (t6.neighboringTiles && t6.neighboringTiles[o6]) {
var r7 = this.getTileByID(o6);
a6(t6, r7), a6(r7, t6);
}
}
function a6(t7, e8) {
t7.needsHillshadePrepare = true;
var i8 = e8.tileID.canonical.x - t7.tileID.canonical.x, o7 = e8.tileID.canonical.y - t7.tileID.canonical.y, r8 = Math.pow(2, t7.tileID.canonical.z), a7 = e8.tileID.key;
0 === i8 && 0 === o7 || Math.abs(o7) > 1 || (Math.abs(i8) > 1 && (1 === Math.abs(i8 + r8) ? i8 += r8 : 1 === Math.abs(i8 - r8) && (i8 -= r8)), e8.dem && t7.dem && (t7.dem.backfillBorder(e8.dem, i8, o7), t7.neighboringTiles && t7.neighboringTiles[a7] && (t7.neighboringTiles[a7].backfilled = true)));
}
}, i6.prototype.getTile = function(t6) {
return this.getTileByID(t6.key);
}, i6.prototype.getTileByID = function(t6) {
return this._tiles[t6];
}, i6.prototype._retainLoadedChildren = function(t6, e7, i7, o6) {
for (var r7 in this._tiles) {
var a6 = this._tiles[r7];
if (!(o6[r7] || !a6.hasData() || a6.tileID.overscaledZ <= e7 || a6.tileID.overscaledZ > i7)) {
for (var n8 = a6.tileID; a6 && a6.tileID.overscaledZ > e7 + 1; ) {
var s7 = a6.tileID.scaledTo(a6.tileID.overscaledZ - 1);
(a6 = this._tiles[s7.key]) && a6.hasData() && (n8 = s7);
}
for (var l8 = n8; l8.overscaledZ > e7; ) {
if (t6[(l8 = l8.scaledTo(l8.overscaledZ - 1)).key]) {
o6[n8.key] = n8;
break;
}
}
}
}
}, i6.prototype.findLoadedParent = function(t6, e7) {
if (t6.key in this._loadedParentTiles) {
var i7 = this._loadedParentTiles[t6.key];
return i7 && i7.tileID.overscaledZ >= e7 ? i7 : null;
}
for (var o6 = t6.overscaledZ - 1; o6 >= e7; o6--) {
var r7 = t6.scaledTo(o6), a6 = this._getLoadedTile(r7);
if (a6) {
return a6;
}
}
}, i6.prototype._getLoadedTile = function(t6) {
var e7 = this._tiles[t6.key];
return e7 && e7.hasData() ? e7 : this._cache.getByKey(t6.wrapped().key);
}, i6.prototype.updateCacheSize = function(t6) {
var e7 = Math.ceil(t6.width / this._source.tileSize) + 1, i7 = Math.ceil(t6.height / this._source.tileSize) + 1, o6 = Math.floor(e7 * i7 * 5), r7 = "number" == typeof this._maxTileCacheSize ? Math.min(this._maxTileCacheSize, o6) : o6;
this._cache.setMaxSize(r7);
}, i6.prototype.handleWrapJump = function(t6) {
var e7 = Math.round((t6 - (void 0 === this._prevLng ? t6 : this._prevLng)) / 360);
if (this._prevLng = t6, e7) {
var i7 = {};
for (var o6 in this._tiles) {
var r7 = this._tiles[o6];
r7.tileID = r7.tileID.unwrapTo(r7.tileID.wrap + e7), i7[r7.tileID.key] = r7;
}
for (var a6 in this._tiles = i7, this._timers) {
clearTimeout(this._timers[a6]), delete this._timers[a6];
}
for (var n8 in this._tiles) {
this._setTileReloadTimer(n8, this._tiles[n8]);
}
}
}, i6.prototype.update = function(e7) {
var o6 = this;
if (this.transform = e7, this._sourceLoaded && !this._paused) {
var r7;
this.updateCacheSize(e7), this.handleWrapJump(this.transform.center.lng), this._coveredTiles = {}, this.used ? this._source.tileID ? r7 = e7.getVisibleUnwrappedCoordinates(this._source.tileID).map(function(e8) {
return new t5.OverscaledTileID(e8.canonical.z, e8.wrap, e8.canonical.z, e8.canonical.x, e8.canonical.y);
}) : (r7 = e7.coveringTiles({ tileSize: this._source.tileSize, minzoom: this._source.minzoom, maxzoom: this._source.maxzoom, roundZoom: this._source.roundZoom, reparseOverscaled: this._source.reparseOverscaled }), this._source.hasTile && (r7 = r7.filter(function(t6) {
return o6._source.hasTile(t6);
}))) : r7 = [];
var a6 = e7.coveringZoomLevel(this._source), n8 = Math.max(a6 - i6.maxOverzooming, this._source.minzoom), s7 = Math.max(a6 + i6.maxUnderzooming, this._source.minzoom), l8 = this._updateRetainedTiles(r7, a6);
if (Mt2(this._source.type)) {
for (var c5 = {}, u5 = {}, h7 = 0, p5 = Object.keys(l8); h7 < p5.length; h7 += 1) {
var d5 = p5[h7], _4 = l8[d5], f5 = this._tiles[d5];
if (f5 && !(f5.fadeEndTime && f5.fadeEndTime <= t5.browser.now())) {
var m5 = this.findLoadedParent(_4, n8);
m5 && (this._addTile(m5.tileID), c5[m5.tileID.key] = m5.tileID), u5[d5] = _4;
}
}
for (var g5 in this._retainLoadedChildren(u5, a6, s7, l8), c5) {
l8[g5] || (this._coveredTiles[g5] = true, l8[g5] = c5[g5]);
}
}
for (var v5 in l8) {
this._tiles[v5].clearFadeHold();
}
for (var y5 = 0, x5 = t5.keysDifference(this._tiles, l8); y5 < x5.length; y5 += 1) {
var b5 = x5[y5], w5 = this._tiles[b5];
w5.hasSymbolBuckets && !w5.holdingForFade() ? w5.setHoldDuration(this.map._fadeDuration) : w5.hasSymbolBuckets && !w5.symbolFadeFinished() || this._removeTile(b5);
}
this._updateLoadedParentTileCache();
}
}, i6.prototype.releaseSymbolFadeTiles = function() {
for (var t6 in this._tiles) {
this._tiles[t6].holdingForFade() && this._removeTile(t6);
}
}, i6.prototype._updateRetainedTiles = function(t6, e7) {
for (var o6 = {}, r7 = {}, a6 = Math.max(e7 - i6.maxOverzooming, this._source.minzoom), n8 = Math.max(e7 + i6.maxUnderzooming, this._source.minzoom), s7 = {}, l8 = 0, c5 = t6; l8 < c5.length; l8 += 1) {
var u5 = c5[l8], h7 = this._addTile(u5);
o6[u5.key] = u5, h7.hasData() || e7 < this._source.maxzoom && (s7[u5.key] = u5);
}
this._retainLoadedChildren(s7, e7, n8, o6);
for (var p5 = 0, d5 = t6; p5 < d5.length; p5 += 1) {
var _4 = d5[p5], f5 = this._tiles[_4.key];
if (!f5.hasData()) {
if (e7 + 1 > this._source.maxzoom) {
var m5 = _4.children(this._source.maxzoom)[0], g5 = this.getTile(m5);
if (g5 && g5.hasData()) {
o6[m5.key] = m5;
continue;
}
} else {
var v5 = _4.children(this._source.maxzoom);
if (o6[v5[0].key] && o6[v5[1].key] && o6[v5[2].key] && o6[v5[3].key]) {
continue;
}
}
for (var y5 = f5.wasRequested(), x5 = _4.overscaledZ - 1; x5 >= a6; --x5) {
var b5 = _4.scaledTo(x5);
if (r7[b5.key]) {
break;
}
if (r7[b5.key] = true, !(f5 = this.getTile(b5)) && y5 && (f5 = this._addTile(b5)), f5 && (o6[b5.key] = b5, y5 = f5.wasRequested(), f5.hasData())) {
break;
}
}
}
}
return o6;
}, i6.prototype._updateLoadedParentTileCache = function() {
for (var t6 in this._loadedParentTiles = {}, this._tiles) {
for (var e7 = [], i7 = void 0, o6 = this._tiles[t6].tileID; o6.overscaledZ > 0; ) {
if (o6.key in this._loadedParentTiles) {
i7 = this._loadedParentTiles[o6.key];
break;
}
e7.push(o6.key);
var r7 = o6.scaledTo(o6.overscaledZ - 1);
if (i7 = this._getLoadedTile(r7)) {
break;
}
o6 = r7;
}
for (var a6 = 0, n8 = e7; a6 < n8.length; a6 += 1) {
this._loadedParentTiles[n8[a6]] = i7;
}
}
}, i6.prototype._addTile = function(e7) {
var i7 = this._tiles[e7.key];
if (i7) {
return i7;
}
(i7 = this._cache.getAndRemove(e7)) && (this._setTileReloadTimer(e7.key, i7), i7.tileID = e7, this._state.initializeTileState(i7, this.map ? this.map.painter : null), this._cacheTimers[e7.key] && (clearTimeout(this._cacheTimers[e7.key]), delete this._cacheTimers[e7.key], this._setTileReloadTimer(e7.key, i7)));
var o6 = Boolean(i7);
return o6 || (i7 = new t5.Tile(e7, this._source.tileSize * e7.overscaleFactor()), this._loadTile(i7, this._tileLoaded.bind(this, i7, e7.key, i7.state))), i7 ? (i7.uses++, this._tiles[e7.key] = i7, o6 || this._source.fire(new t5.Event("dataloading", { tile: i7, coord: i7.tileID, dataType: "source" })), i7) : null;
}, i6.prototype._setTileReloadTimer = function(t6, e7) {
var i7 = this;
t6 in this._timers && (clearTimeout(this._timers[t6]), delete this._timers[t6]);
var o6 = e7.getExpiryTimeout();
o6 && (this._timers[t6] = setTimeout(function() {
i7._reloadTile(t6, "expired"), delete i7._timers[t6];
}, o6));
}, i6.prototype._removeTile = function(t6) {
var e7 = this._tiles[t6];
e7 && (e7.uses--, delete this._tiles[t6], this._timers[t6] && (clearTimeout(this._timers[t6]), delete this._timers[t6]), e7.uses > 0 || (e7.hasData() && "reloading" !== e7.state ? this._cache.add(e7.tileID, e7, e7.getExpiryTimeout()) : (e7.aborted = true, this._abortTile(e7), this._unloadTile(e7))));
}, i6.prototype.clearTiles = function() {
for (var t6 in this._shouldReloadOnResume = false, this._paused = false, this._tiles) {
this._removeTile(t6);
}
this._cache.reset();
}, i6.prototype.tilesIn = function(e7, i7, o6) {
var r7 = this, a6 = [], n8 = this.transform;
if (!n8) {
return a6;
}
for (var s7 = o6 ? n8.getCameraQueryGeometry(e7) : e7, l8 = e7.map(function(t6) {
return n8.pointCoordinate(t6);
}), c5 = s7.map(function(t6) {
return n8.pointCoordinate(t6);
}), u5 = this.getIds(), h7 = 1 / 0, p5 = 1 / 0, d5 = -1 / 0, _4 = -1 / 0, f5 = 0, m5 = c5; f5 < m5.length; f5 += 1) {
var g5 = m5[f5];
h7 = Math.min(h7, g5.x), p5 = Math.min(p5, g5.y), d5 = Math.max(d5, g5.x), _4 = Math.max(_4, g5.y);
}
for (var v5 = function(e8) {
var o7 = r7._tiles[u5[e8]];
if (!o7.holdingForFade()) {
var s8 = o7.tileID, f6 = Math.pow(2, n8.zoom - o7.tileID.overscaledZ), m6 = i7 * o7.queryPadding * t5.EXTENT / o7.tileSize / f6, g6 = [s8.getTilePoint(new t5.MercatorCoordinate(h7, p5)), s8.getTilePoint(new t5.MercatorCoordinate(d5, _4))];
if (g6[0].x - m6 < t5.EXTENT && g6[0].y - m6 < t5.EXTENT && g6[1].x + m6 >= 0 && g6[1].y + m6 >= 0) {
var v6 = l8.map(function(t6) {
return s8.getTilePoint(t6);
}), y6 = c5.map(function(t6) {
return s8.getTilePoint(t6);
});
a6.push({ tile: o7, tileID: s8, queryGeometry: v6, cameraQueryGeometry: y6, scale: f6 });
}
}
}, y5 = 0; y5 < u5.length; y5++) {
v5(y5);
}
return a6;
}, i6.prototype.getVisibleCoordinates = function(t6) {
for (var e7 = this, i7 = this.getRenderableIds(t6).map(function(t7) {
return e7._tiles[t7].tileID;
}), o6 = 0, r7 = i7; o6 < r7.length; o6 += 1) {
var a6 = r7[o6];
a6.posMatrix = this.transform.calculatePosMatrix(a6.toUnwrapped());
}
return i7;
}, i6.prototype.hasTransition = function() {
if (this._source.hasTransition()) {
return true;
}
if (Mt2(this._source.type)) {
for (var e7 in this._tiles) {
var i7 = this._tiles[e7];
if (void 0 !== i7.fadeEndTime && i7.fadeEndTime >= t5.browser.now()) {
return true;
}
}
}
return false;
}, i6.prototype.setFeatureState = function(t6, e7, i7) {
this._state.updateState(t6 = t6 || "_geojsonTileLayer", e7, i7);
}, i6.prototype.removeFeatureState = function(t6, e7, i7) {
this._state.removeFeatureState(t6 = t6 || "_geojsonTileLayer", e7, i7);
}, i6.prototype.getFeatureState = function(t6, e7) {
return this._state.getState(t6 = t6 || "_geojsonTileLayer", e7);
}, i6.prototype.setDependencies = function(t6, e7, i7) {
var o6 = this._tiles[t6];
o6 && o6.setDependencies(e7, i7);
}, i6.prototype.reloadTilesForDependencies = function(t6, e7) {
for (var i7 in this._tiles) {
this._tiles[i7].hasDependency(t6, e7) && this._reloadTile(i7, "reloading");
}
this._cache.filter(function(i8) {
return !i8.hasDependency(t6, e7);
});
}, i6;
}(t5.Evented);
function At2(t6, e6) {
var i6 = Math.abs(2 * t6.wrap) - +(t6.wrap < 0), o6 = Math.abs(2 * e6.wrap) - +(e6.wrap < 0);
return t6.overscaledZ - e6.overscaledZ || o6 - i6 || e6.canonical.y - t6.canonical.y || e6.canonical.x - t6.canonical.x;
}
function Mt2(t6) {
return "raster" === t6 || "image" === t6 || "video" === t6;
}
function Lt2() {
return new t5.window.Worker(Kr.workerUrl);
}
Dt2.maxOverzooming = 10, Dt2.maxUnderzooming = 3;
var Rt2 = "mapboxgl_preloaded_worker_pool", kt2 = function() {
this.active = {};
};
kt2.prototype.acquire = function(t6) {
if (!this.workers) {
for (this.workers = []; this.workers.length < kt2.workerCount; ) {
this.workers.push(new Lt2());
}
}
return this.active[t6] = true, this.workers.slice();
}, kt2.prototype.release = function(t6) {
delete this.active[t6], 0 === this.numActive() && (this.workers.forEach(function(t7) {
t7.terminate();
}), this.workers = null);
}, kt2.prototype.isPreloaded = function() {
return !!this.active[Rt2];
}, kt2.prototype.numActive = function() {
return Object.keys(this.active).length;
};
var Bt2, Ot2 = Math.floor(t5.browser.hardwareConcurrency / 2);
function Ft2() {
return Bt2 || (Bt2 = new kt2()), Bt2;
}
function Ut2(e6, i6) {
var o6 = {};
for (var r7 in e6) {
"ref" !== r7 && (o6[r7] = e6[r7]);
}
return t5.refProperties.forEach(function(t6) {
t6 in i6 && (o6[t6] = i6[t6]);
}), o6;
}
function Nt2(t6) {
t6 = t6.slice();
for (var e6 = /* @__PURE__ */ Object.create(null), i6 = 0; i6 < t6.length; i6++) {
e6[t6[i6].id] = t6[i6];
}
for (var o6 = 0; o6 < t6.length; o6++) {
"ref" in t6[o6] && (t6[o6] = Ut2(t6[o6], e6[t6[o6].ref]));
}
return t6;
}
kt2.workerCount = Math.max(Math.min(Ot2, 6), 1);
var Zt2 = { setStyle: "setStyle", addLayer: "addLayer", removeLayer: "removeLayer", setPaintProperty: "setPaintProperty", setLayoutProperty: "setLayoutProperty", setFilter: "setFilter", addSource: "addSource", removeSource: "removeSource", setGeoJSONSourceData: "setGeoJSONSourceData", setLayerZoomRange: "setLayerZoomRange", setLayerProperty: "setLayerProperty", setCenter: "setCenter", setZoom: "setZoom", setBearing: "setBearing", setPitch: "setPitch", setSprite: "setSprite", setGlyphs: "setGlyphs", setTransition: "setTransition", setLight: "setLight" };
function qt2(t6, e6, i6) {
i6.push({ command: Zt2.addSource, args: [t6, e6[t6]] });
}
function jt2(t6, e6, i6) {
e6.push({ command: Zt2.removeSource, args: [t6] }), i6[t6] = true;
}
function Vt2(t6, e6, i6, o6) {
jt2(t6, i6, o6), qt2(t6, e6, i6);
}
function Gt2(e6, i6, o6) {
var r7;
for (r7 in e6[o6]) {
if (e6[o6].hasOwnProperty(r7) && "data" !== r7 && !t5.deepEqual(e6[o6][r7], i6[o6][r7])) {
return false;
}
}
for (r7 in i6[o6]) {
if (i6[o6].hasOwnProperty(r7) && "data" !== r7 && !t5.deepEqual(e6[o6][r7], i6[o6][r7])) {
return false;
}
}
return true;
}
function Wt2(e6, i6, o6, r7, a6, n8) {
var s7;
for (s7 in i6 = i6 || {}, e6 = e6 || {}) {
e6.hasOwnProperty(s7) && (t5.deepEqual(e6[s7], i6[s7]) || o6.push({ command: n8, args: [r7, s7, i6[s7], a6] }));
}
for (s7 in i6) {
i6.hasOwnProperty(s7) && !e6.hasOwnProperty(s7) && (t5.deepEqual(e6[s7], i6[s7]) || o6.push({ command: n8, args: [r7, s7, i6[s7], a6] }));
}
}
function Xt2(t6) {
return t6.id;
}
function Ht2(t6, e6) {
return t6[e6.id] = e6, t6;
}
var Kt2 = function(t6, e6) {
this.reset(t6, e6);
};
Kt2.prototype.reset = function(t6, e6) {
this.points = t6 || [], this._distances = [0];
for (var i6 = 1; i6 < this.points.length; i6++) {
this._distances[i6] = this._distances[i6 - 1] + this.points[i6].dist(this.points[i6 - 1]);
}
this.length = this._distances[this._distances.length - 1], this.padding = Math.min(e6 || 0, 0.5 * this.length), this.paddedLength = this.length - 2 * this.padding;
}, Kt2.prototype.lerp = function(e6) {
if (1 === this.points.length) {
return this.points[0];
}
e6 = t5.clamp(e6, 0, 1);
for (var i6 = 1, o6 = this._distances[i6], r7 = e6 * this.paddedLength + this.padding; o6 < r7 && i6 < this._distances.length; ) {
o6 = this._distances[++i6];
}
var a6 = i6 - 1, n8 = this._distances[a6], s7 = o6 - n8, l8 = s7 > 0 ? (r7 - n8) / s7 : 0;
return this.points[a6].mult(1 - l8).add(this.points[i6].mult(l8));
};
var Yt2 = function(t6, e6, i6) {
var o6 = this.boxCells = [], r7 = this.circleCells = [];
this.xCellCount = Math.ceil(t6 / i6), this.yCellCount = Math.ceil(e6 / i6);
for (var a6 = 0; a6 < this.xCellCount * this.yCellCount; a6++) {
o6.push([]), r7.push([]);
}
this.circleKeys = [], this.boxKeys = [], this.bboxes = [], this.circles = [], this.width = t6, this.height = e6, this.xScale = this.xCellCount / t6, this.yScale = this.yCellCount / e6, this.boxUid = 0, this.circleUid = 0;
};
function Jt2(e6, i6, o6, r7, a6) {
var n8 = t5.create();
return i6 ? (t5.scale(n8, n8, [1 / a6, 1 / a6, 1]), o6 || t5.rotateZ(n8, n8, r7.angle)) : t5.multiply(n8, r7.labelPlaneMatrix, e6), n8;
}
function Qt2(e6, i6, o6, r7, a6) {
if (i6) {
var n8 = t5.clone(e6);
return t5.scale(n8, n8, [a6, a6, 1]), o6 || t5.rotateZ(n8, n8, -r7.angle), n8;
}
return r7.glCoordMatrix;
}
function $t2(e6, i6) {
var o6 = [e6.x, e6.y, 0, 1];
ue2(o6, o6, i6);
var r7 = o6[3];
return { point: new t5.Point(o6[0] / r7, o6[1] / r7), signedDistanceFromCamera: r7 };
}
function te2(t6, e6) {
return 0.5 + t6 / e6 * 0.5;
}
function ee2(t6, e6) {
var i6 = t6[0] / t6[3], o6 = t6[1] / t6[3];
return i6 >= -e6[0] && i6 <= e6[0] && o6 >= -e6[1] && o6 <= e6[1];
}
function ie4(e6, i6, o6, r7, a6, n8, s7, l8) {
var c5 = r7 ? e6.textSizeData : e6.iconSizeData, u5 = t5.evaluateSizeForZoom(c5, o6.transform.zoom), h7 = [256 / o6.width * 2 + 1, 256 / o6.height * 2 + 1], p5 = r7 ? e6.text.dynamicLayoutVertexArray : e6.icon.dynamicLayoutVertexArray;
p5.clear();
for (var d5 = e6.lineVertexArray, _4 = r7 ? e6.text.placedSymbolArray : e6.icon.placedSymbolArray, f5 = o6.transform.width / o6.transform.height, m5 = false, g5 = 0; g5 < _4.length; g5++) {
var v5 = _4.get(g5);
if (v5.hidden || v5.writingMode === t5.WritingMode.vertical && !m5) {
ce2(v5.numGlyphs, p5);
} else {
m5 = false;
var y5 = [v5.anchorX, v5.anchorY, 0, 1];
if (t5.transformMat4(y5, y5, i6), ee2(y5, h7)) {
var x5 = te2(o6.transform.cameraToCenterDistance, y5[3]), b5 = t5.evaluateSizeForFeature(c5, u5, v5), w5 = s7 ? b5 / x5 : b5 * x5, T5 = new t5.Point(v5.anchorX, v5.anchorY), E4 = $t2(T5, a6).point, I5 = {}, P5 = ae2(v5, w5, false, l8, i6, a6, n8, e6.glyphOffsetArray, d5, p5, E4, T5, I5, f5);
m5 = P5.useVertical, (P5.notEnoughRoom || m5 || P5.needsFlipping && ae2(v5, w5, true, l8, i6, a6, n8, e6.glyphOffsetArray, d5, p5, E4, T5, I5, f5).notEnoughRoom) && ce2(v5.numGlyphs, p5);
} else {
ce2(v5.numGlyphs, p5);
}
}
}
r7 ? e6.text.dynamicLayoutVertexBuffer.updateData(p5) : e6.icon.dynamicLayoutVertexBuffer.updateData(p5);
}
function oe2(t6, e6, i6, o6, r7, a6, n8, s7, l8, c5, u5) {
var h7 = s7.glyphStartIndex + s7.numGlyphs, p5 = s7.lineStartIndex, d5 = s7.lineStartIndex + s7.lineLength, _4 = e6.getoffsetX(s7.glyphStartIndex), f5 = e6.getoffsetX(h7 - 1), m5 = se2(t6 * _4, i6, o6, r7, a6, n8, s7.segment, p5, d5, l8, c5, u5);
if (!m5) {
return null;
}
var g5 = se2(t6 * f5, i6, o6, r7, a6, n8, s7.segment, p5, d5, l8, c5, u5);
return g5 ? { first: m5, last: g5 } : null;
}
function re2(e6, i6, o6, r7) {
return e6 === t5.WritingMode.horizontal && Math.abs(o6.y - i6.y) > Math.abs(o6.x - i6.x) * r7 ? { useVertical: true } : (e6 === t5.WritingMode.vertical ? i6.y < o6.y : i6.x > o6.x) ? { needsFlipping: true } : null;
}
function ae2(e6, i6, o6, r7, a6, n8, s7, l8, c5, u5, h7, p5, d5, _4) {
var f5, m5 = i6 / 24, g5 = e6.lineOffsetX * m5, v5 = e6.lineOffsetY * m5;
if (e6.numGlyphs > 1) {
var y5 = e6.glyphStartIndex + e6.numGlyphs, x5 = e6.lineStartIndex, b5 = e6.lineStartIndex + e6.lineLength, w5 = oe2(m5, l8, g5, v5, o6, h7, p5, e6, c5, n8, d5);
if (!w5) {
return { notEnoughRoom: true };
}
var T5 = $t2(w5.first.point, s7).point, E4 = $t2(w5.last.point, s7).point;
if (r7 && !o6) {
var I5 = re2(e6.writingMode, T5, E4, _4);
if (I5) {
return I5;
}
}
f5 = [w5.first];
for (var P5 = e6.glyphStartIndex + 1; P5 < y5 - 1; P5++) {
f5.push(se2(m5 * l8.getoffsetX(P5), g5, v5, o6, h7, p5, e6.segment, x5, b5, c5, n8, d5));
}
f5.push(w5.last);
} else {
if (r7 && !o6) {
var S5 = $t2(p5, a6).point, C5 = e6.lineStartIndex + e6.segment + 1, z5 = new t5.Point(c5.getx(C5), c5.gety(C5)), D5 = $t2(z5, a6), A5 = D5.signedDistanceFromCamera > 0 ? D5.point : ne2(p5, z5, S5, 1, a6), M5 = re2(e6.writingMode, S5, A5, _4);
if (M5) {
return M5;
}
}
var L5 = se2(m5 * l8.getoffsetX(e6.glyphStartIndex), g5, v5, o6, h7, p5, e6.segment, e6.lineStartIndex, e6.lineStartIndex + e6.lineLength, c5, n8, d5);
if (!L5) {
return { notEnoughRoom: true };
}
f5 = [L5];
}
for (var R4 = 0, k5 = f5; R4 < k5.length; R4 += 1) {
var B4 = k5[R4];
t5.addDynamicAttributes(u5, B4.point, B4.angle);
}
return {};
}
function ne2(t6, e6, i6, o6, r7) {
var a6 = $t2(t6.add(t6.sub(e6)._unit()), r7).point, n8 = i6.sub(a6);
return i6.add(n8._mult(o6 / n8.mag()));
}
function se2(e6, i6, o6, r7, a6, n8, s7, l8, c5, u5, h7, p5) {
var d5 = r7 ? e6 - i6 : e6 + i6, _4 = d5 > 0 ? 1 : -1, f5 = 0;
r7 && (_4 *= -1, f5 = Math.PI), _4 < 0 && (f5 += Math.PI);
for (var m5 = _4 > 0 ? l8 + s7 : l8 + s7 + 1, g5 = a6, v5 = a6, y5 = 0, x5 = 0, b5 = Math.abs(d5), w5 = []; y5 + x5 <= b5; ) {
if ((m5 += _4) < l8 || m5 >= c5) {
return null;
}
if (v5 = g5, w5.push(g5), void 0 === (g5 = p5[m5])) {
var T5 = new t5.Point(u5.getx(m5), u5.gety(m5)), E4 = $t2(T5, h7);
if (E4.signedDistanceFromCamera > 0) {
g5 = p5[m5] = E4.point;
} else {
var I5 = m5 - _4;
g5 = ne2(0 === y5 ? n8 : new t5.Point(u5.getx(I5), u5.gety(I5)), T5, v5, b5 - y5 + 1, h7);
}
}
y5 += x5, x5 = v5.dist(g5);
}
var P5 = (b5 - y5) / x5, S5 = g5.sub(v5), C5 = S5.mult(P5)._add(v5);
C5._add(S5._unit()._perp()._mult(o6 * _4));
var z5 = f5 + Math.atan2(g5.y - v5.y, g5.x - v5.x);
return w5.push(C5), { point: C5, angle: z5, path: w5 };
}
Yt2.prototype.keysLength = function() {
return this.boxKeys.length + this.circleKeys.length;
}, Yt2.prototype.insert = function(t6, e6, i6, o6, r7) {
this._forEachCell(e6, i6, o6, r7, this._insertBoxCell, this.boxUid++), this.boxKeys.push(t6), this.bboxes.push(e6), this.bboxes.push(i6), this.bboxes.push(o6), this.bboxes.push(r7);
}, Yt2.prototype.insertCircle = function(t6, e6, i6, o6) {
this._forEachCell(e6 - o6, i6 - o6, e6 + o6, i6 + o6, this._insertCircleCell, this.circleUid++), this.circleKeys.push(t6), this.circles.push(e6), this.circles.push(i6), this.circles.push(o6);
}, Yt2.prototype._insertBoxCell = function(t6, e6, i6, o6, r7, a6) {
this.boxCells[r7].push(a6);
}, Yt2.prototype._insertCircleCell = function(t6, e6, i6, o6, r7, a6) {
this.circleCells[r7].push(a6);
}, Yt2.prototype._query = function(t6, e6, i6, o6, r7, a6) {
if (i6 < 0 || t6 > this.width || o6 < 0 || e6 > this.height) {
return !r7 && [];
}
var n8 = [];
if (t6 <= 0 && e6 <= 0 && this.width <= i6 && this.height <= o6) {
if (r7) {
return true;
}
for (var s7 = 0; s7 < this.boxKeys.length; s7++) {
n8.push({ key: this.boxKeys[s7], x1: this.bboxes[4 * s7], y1: this.bboxes[4 * s7 + 1], x2: this.bboxes[4 * s7 + 2], y2: this.bboxes[4 * s7 + 3] });
}
for (var l8 = 0; l8 < this.circleKeys.length; l8++) {
var c5 = this.circles[3 * l8], u5 = this.circles[3 * l8 + 1], h7 = this.circles[3 * l8 + 2];
n8.push({ key: this.circleKeys[l8], x1: c5 - h7, y1: u5 - h7, x2: c5 + h7, y2: u5 + h7 });
}
return a6 ? n8.filter(a6) : n8;
}
return this._forEachCell(t6, e6, i6, o6, this._queryCell, n8, { hitTest: r7, seenUids: { box: {}, circle: {} } }, a6), r7 ? n8.length > 0 : n8;
}, Yt2.prototype._queryCircle = function(t6, e6, i6, o6, r7) {
var a6 = t6 - i6, n8 = t6 + i6, s7 = e6 - i6, l8 = e6 + i6;
if (n8 < 0 || a6 > this.width || l8 < 0 || s7 > this.height) {
return !o6 && [];
}
var c5 = [];
return this._forEachCell(a6, s7, n8, l8, this._queryCellCircle, c5, { hitTest: o6, circle: { x: t6, y: e6, radius: i6 }, seenUids: { box: {}, circle: {} } }, r7), o6 ? c5.length > 0 : c5;
}, Yt2.prototype.query = function(t6, e6, i6, o6, r7) {
return this._query(t6, e6, i6, o6, false, r7);
}, Yt2.prototype.hitTest = function(t6, e6, i6, o6, r7) {
return this._query(t6, e6, i6, o6, true, r7);
}, Yt2.prototype.hitTestCircle = function(t6, e6, i6, o6) {
return this._queryCircle(t6, e6, i6, true, o6);
}, Yt2.prototype._queryCell = function(t6, e6, i6, o6, r7, a6, n8, s7) {
var l8 = n8.seenUids, c5 = this.boxCells[r7];
if (null !== c5) {
for (var u5 = this.bboxes, h7 = 0, p5 = c5; h7 < p5.length; h7 += 1) {
var d5 = p5[h7];
if (!l8.box[d5]) {
l8.box[d5] = true;
var _4 = 4 * d5;
if (t6 <= u5[_4 + 2] && e6 <= u5[_4 + 3] && i6 >= u5[_4 + 0] && o6 >= u5[_4 + 1] && (!s7 || s7(this.boxKeys[d5]))) {
if (n8.hitTest) {
return a6.push(true), true;
}
a6.push({ key: this.boxKeys[d5], x1: u5[_4], y1: u5[_4 + 1], x2: u5[_4 + 2], y2: u5[_4 + 3] });
}
}
}
}
var f5 = this.circleCells[r7];
if (null !== f5) {
for (var m5 = this.circles, g5 = 0, v5 = f5; g5 < v5.length; g5 += 1) {
var y5 = v5[g5];
if (!l8.circle[y5]) {
l8.circle[y5] = true;
var x5 = 3 * y5;
if (this._circleAndRectCollide(m5[x5], m5[x5 + 1], m5[x5 + 2], t6, e6, i6, o6) && (!s7 || s7(this.circleKeys[y5]))) {
if (n8.hitTest) {
return a6.push(true), true;
}
var b5 = m5[x5], w5 = m5[x5 + 1], T5 = m5[x5 + 2];
a6.push({ key: this.circleKeys[y5], x1: b5 - T5, y1: w5 - T5, x2: b5 + T5, y2: w5 + T5 });
}
}
}
}
}, Yt2.prototype._queryCellCircle = function(t6, e6, i6, o6, r7, a6, n8, s7) {
var l8 = n8.circle, c5 = n8.seenUids, u5 = this.boxCells[r7];
if (null !== u5) {
for (var h7 = this.bboxes, p5 = 0, d5 = u5; p5 < d5.length; p5 += 1) {
var _4 = d5[p5];
if (!c5.box[_4]) {
c5.box[_4] = true;
var f5 = 4 * _4;
if (this._circleAndRectCollide(l8.x, l8.y, l8.radius, h7[f5 + 0], h7[f5 + 1], h7[f5 + 2], h7[f5 + 3]) && (!s7 || s7(this.boxKeys[_4]))) {
return a6.push(true), true;
}
}
}
}
var m5 = this.circleCells[r7];
if (null !== m5) {
for (var g5 = this.circles, v5 = 0, y5 = m5; v5 < y5.length; v5 += 1) {
var x5 = y5[v5];
if (!c5.circle[x5]) {
c5.circle[x5] = true;
var b5 = 3 * x5;
if (this._circlesCollide(g5[b5], g5[b5 + 1], g5[b5 + 2], l8.x, l8.y, l8.radius) && (!s7 || s7(this.circleKeys[x5]))) {
return a6.push(true), true;
}
}
}
}
}, Yt2.prototype._forEachCell = function(t6, e6, i6, o6, r7, a6, n8, s7) {
for (var l8 = this._convertToXCellCoord(t6), c5 = this._convertToYCellCoord(e6), u5 = this._convertToXCellCoord(i6), h7 = this._convertToYCellCoord(o6), p5 = l8; p5 <= u5; p5++) {
for (var d5 = c5; d5 <= h7; d5++) {
if (r7.call(this, t6, e6, i6, o6, this.xCellCount * d5 + p5, a6, n8, s7)) {
return;
}
}
}
}, Yt2.prototype._convertToXCellCoord = function(t6) {
return Math.max(0, Math.min(this.xCellCount - 1, Math.floor(t6 * this.xScale)));
}, Yt2.prototype._convertToYCellCoord = function(t6) {
return Math.max(0, Math.min(this.yCellCount - 1, Math.floor(t6 * this.yScale)));
}, Yt2.prototype._circlesCollide = function(t6, e6, i6, o6, r7, a6) {
var n8 = o6 - t6, s7 = r7 - e6, l8 = i6 + a6;
return l8 * l8 > n8 * n8 + s7 * s7;
}, Yt2.prototype._circleAndRectCollide = function(t6, e6, i6, o6, r7, a6, n8) {
var s7 = (a6 - o6) / 2, l8 = Math.abs(t6 - (o6 + s7));
if (l8 > s7 + i6) {
return false;
}
var c5 = (n8 - r7) / 2, u5 = Math.abs(e6 - (r7 + c5));
if (u5 > c5 + i6) {
return false;
}
if (l8 <= s7 || u5 <= c5) {
return true;
}
var h7 = l8 - s7, p5 = u5 - c5;
return h7 * h7 + p5 * p5 <= i6 * i6;
};
var le2 = new Float32Array([-1 / 0, -1 / 0, 0, -1 / 0, -1 / 0, 0, -1 / 0, -1 / 0, 0, -1 / 0, -1 / 0, 0]);
function ce2(t6, e6) {
for (var i6 = 0; i6 < t6; i6++) {
var o6 = e6.length;
e6.resize(o6 + 4), e6.float32.set(le2, 3 * o6);
}
}
function ue2(t6, e6, i6) {
var o6 = e6[0], r7 = e6[1];
return t6[0] = i6[0] * o6 + i6[4] * r7 + i6[12], t6[1] = i6[1] * o6 + i6[5] * r7 + i6[13], t6[3] = i6[3] * o6 + i6[7] * r7 + i6[15], t6;
}
var he2 = function(t6, e6, i6) {
void 0 === e6 && (e6 = new Yt2(t6.width + 200, t6.height + 200, 25)), void 0 === i6 && (i6 = new Yt2(t6.width + 200, t6.height + 200, 25)), this.transform = t6, this.grid = e6, this.ignoredGrid = i6, this.pitchfactor = Math.cos(t6._pitch) * t6.cameraToCenterDistance, this.screenRightBoundary = t6.width + 100, this.screenBottomBoundary = t6.height + 100, this.gridRightBoundary = t6.width + 200, this.gridBottomBoundary = t6.height + 200;
};
function pe2(e6, i6, o6) {
return i6 * (t5.EXTENT / (e6.tileSize * Math.pow(2, o6 - e6.tileID.overscaledZ)));
}
he2.prototype.placeCollisionBox = function(t6, e6, i6, o6, r7) {
var a6 = this.projectAndGetPerspectiveRatio(o6, t6.anchorPointX, t6.anchorPointY), n8 = i6 * a6.perspectiveRatio, s7 = t6.x1 * n8 + a6.point.x, l8 = t6.y1 * n8 + a6.point.y, c5 = t6.x2 * n8 + a6.point.x, u5 = t6.y2 * n8 + a6.point.y;
return !this.isInsideGrid(s7, l8, c5, u5) || !e6 && this.grid.hitTest(s7, l8, c5, u5, r7) ? { box: [], offscreen: false } : { box: [s7, l8, c5, u5], offscreen: this.isOffscreen(s7, l8, c5, u5) };
}, he2.prototype.placeCollisionCircles = function(e6, i6, o6, r7, a6, n8, s7, l8, c5, u5, h7, p5, d5) {
var _4 = [], f5 = new t5.Point(i6.anchorX, i6.anchorY), m5 = $t2(f5, n8), g5 = te2(this.transform.cameraToCenterDistance, m5.signedDistanceFromCamera), v5 = (u5 ? a6 / g5 : a6 * g5) / t5.ONE_EM, y5 = $t2(f5, s7).point, x5 = oe2(v5, r7, i6.lineOffsetX * v5, i6.lineOffsetY * v5, false, y5, f5, i6, o6, s7, {}), b5 = false, w5 = false, T5 = true;
if (x5) {
for (var E4 = 0.5 * p5 * g5 + d5, I5 = new t5.Point(-100, -100), P5 = new t5.Point(this.screenRightBoundary, this.screenBottomBoundary), S5 = new Kt2(), C5 = x5.first, z5 = x5.last, D5 = [], A5 = C5.path.length - 1; A5 >= 1; A5--) {
D5.push(C5.path[A5]);
}
for (var M5 = 1; M5 < z5.path.length; M5++) {
D5.push(z5.path[M5]);
}
var L5 = 2.5 * E4;
if (l8) {
var R4 = D5.map(function(t6) {
return $t2(t6, l8);
});
D5 = R4.some(function(t6) {
return t6.signedDistanceFromCamera <= 0;
}) ? [] : R4.map(function(t6) {
return t6.point;
});
}
var k5 = [];
if (D5.length > 0) {
for (var B4 = D5[0].clone(), O5 = D5[0].clone(), F4 = 1; F4 < D5.length; F4++) {
B4.x = Math.min(B4.x, D5[F4].x), B4.y = Math.min(B4.y, D5[F4].y), O5.x = Math.max(O5.x, D5[F4].x), O5.y = Math.max(O5.y, D5[F4].y);
}
k5 = B4.x >= I5.x && O5.x <= P5.x && B4.y >= I5.y && O5.y <= P5.y ? [D5] : O5.x < I5.x || B4.x > P5.x || O5.y < I5.y || B4.y > P5.y ? [] : t5.clipLine([D5], I5.x, I5.y, P5.x, P5.y);
}
for (var U4 = 0, N5 = k5; U4 < N5.length; U4 += 1) {
var Z3;
S5.reset(N5[U4], 0.25 * E4), Z3 = S5.length <= 0.5 * E4 ? 1 : Math.ceil(S5.paddedLength / L5) + 1;
for (var q5 = 0; q5 < Z3; q5++) {
var j5 = q5 / Math.max(Z3 - 1, 1), V4 = S5.lerp(j5), G4 = V4.x + 100, W4 = V4.y + 100;
_4.push(G4, W4, E4, 0);
var X4 = G4 - E4, H5 = W4 - E4, K4 = G4 + E4, Y3 = W4 + E4;
if (T5 = T5 && this.isOffscreen(X4, H5, K4, Y3), w5 = w5 || this.isInsideGrid(X4, H5, K4, Y3), !e6 && this.grid.hitTestCircle(G4, W4, E4, h7) && (b5 = true, !c5)) {
return { circles: [], offscreen: false, collisionDetected: b5 };
}
}
}
}
return { circles: !c5 && b5 || !w5 ? [] : _4, offscreen: T5, collisionDetected: b5 };
}, he2.prototype.queryRenderedSymbols = function(e6) {
if (0 === e6.length || 0 === this.grid.keysLength() && 0 === this.ignoredGrid.keysLength()) {
return {};
}
for (var i6 = [], o6 = 1 / 0, r7 = 1 / 0, a6 = -1 / 0, n8 = -1 / 0, s7 = 0, l8 = e6; s7 < l8.length; s7 += 1) {
var c5 = l8[s7], u5 = new t5.Point(c5.x + 100, c5.y + 100);
o6 = Math.min(o6, u5.x), r7 = Math.min(r7, u5.y), a6 = Math.max(a6, u5.x), n8 = Math.max(n8, u5.y), i6.push(u5);
}
for (var h7 = {}, p5 = {}, d5 = 0, _4 = this.grid.query(o6, r7, a6, n8).concat(this.ignoredGrid.query(o6, r7, a6, n8)); d5 < _4.length; d5 += 1) {
var f5 = _4[d5], m5 = f5.key;
if (void 0 === h7[m5.bucketInstanceId] && (h7[m5.bucketInstanceId] = {}), !h7[m5.bucketInstanceId][m5.featureIndex]) {
var g5 = [new t5.Point(f5.x1, f5.y1), new t5.Point(f5.x2, f5.y1), new t5.Point(f5.x2, f5.y2), new t5.Point(f5.x1, f5.y2)];
t5.polygonIntersectsPolygon(i6, g5) && (h7[m5.bucketInstanceId][m5.featureIndex] = true, void 0 === p5[m5.bucketInstanceId] && (p5[m5.bucketInstanceId] = []), p5[m5.bucketInstanceId].push(m5.featureIndex));
}
}
return p5;
}, he2.prototype.insertCollisionBox = function(t6, e6, i6, o6, r7) {
(e6 ? this.ignoredGrid : this.grid).insert({ bucketInstanceId: i6, featureIndex: o6, collisionGroupID: r7 }, t6[0], t6[1], t6[2], t6[3]);
}, he2.prototype.insertCollisionCircles = function(t6, e6, i6, o6, r7) {
for (var a6 = e6 ? this.ignoredGrid : this.grid, n8 = { bucketInstanceId: i6, featureIndex: o6, collisionGroupID: r7 }, s7 = 0; s7 < t6.length; s7 += 4) {
a6.insertCircle(n8, t6[s7], t6[s7 + 1], t6[s7 + 2]);
}
}, he2.prototype.projectAndGetPerspectiveRatio = function(e6, i6, o6) {
var r7 = [i6, o6, 0, 1];
return ue2(r7, r7, e6), { point: new t5.Point((r7[0] / r7[3] + 1) / 2 * this.transform.width + 100, (-r7[1] / r7[3] + 1) / 2 * this.transform.height + 100), perspectiveRatio: 0.5 + this.transform.cameraToCenterDistance / r7[3] * 0.5 };
}, he2.prototype.isOffscreen = function(t6, e6, i6, o6) {
return i6 < 100 || t6 >= this.screenRightBoundary || o6 < 100 || e6 > this.screenBottomBoundary;
}, he2.prototype.isInsideGrid = function(t6, e6, i6, o6) {
return i6 >= 0 && t6 < this.gridRightBoundary && o6 >= 0 && e6 < this.gridBottomBoundary;
}, he2.prototype.getViewportMatrix = function() {
var e6 = t5.identity([]);
return t5.translate(e6, e6, [-100, -100, 0]), e6;
};
var de2 = function(t6, e6, i6, o6) {
this.opacity = t6 ? Math.max(0, Math.min(1, t6.opacity + (t6.placed ? e6 : -e6))) : o6 && i6 ? 1 : 0, this.placed = i6;
};
de2.prototype.isHidden = function() {
return 0 === this.opacity && !this.placed;
};
var _e2 = function(t6, e6, i6, o6, r7) {
this.text = new de2(t6 ? t6.text : null, e6, i6, r7), this.icon = new de2(t6 ? t6.icon : null, e6, o6, r7);
};
_e2.prototype.isHidden = function() {
return this.text.isHidden() && this.icon.isHidden();
};
var fe2 = function(t6, e6, i6) {
this.text = t6, this.icon = e6, this.skipFade = i6;
}, me2 = function() {
this.invProjMatrix = t5.create(), this.viewportMatrix = t5.create(), this.circles = [];
}, ge2 = function(t6, e6, i6, o6, r7) {
this.bucketInstanceId = t6, this.featureIndex = e6, this.sourceLayerIndex = i6, this.bucketIndex = o6, this.tileID = r7;
}, ve2 = function(t6) {
this.crossSourceCollisions = t6, this.maxGroupID = 0, this.collisionGroups = {};
};
function ye2(e6, i6, o6, r7, a6) {
var n8 = t5.getAnchorAlignment(e6), s7 = -(n8.horizontalAlign - 0.5) * i6, l8 = -(n8.verticalAlign - 0.5) * o6, c5 = t5.evaluateVariableOffset(e6, r7);
return new t5.Point(s7 + c5[0] * a6, l8 + c5[1] * a6);
}
function xe2(e6, i6, o6, r7, a6, n8) {
var s7 = e6.x1, l8 = e6.x2, c5 = e6.y1, u5 = e6.y2, h7 = e6.anchorPointX, p5 = e6.anchorPointY, d5 = new t5.Point(i6, o6);
return r7 && d5._rotate(a6 ? n8 : -n8), { x1: s7 + d5.x, y1: c5 + d5.y, x2: l8 + d5.x, y2: u5 + d5.y, anchorPointX: h7, anchorPointY: p5 };
}
ve2.prototype.get = function(t6) {
if (this.crossSourceCollisions) {
return { ID: 0, predicate: null };
}
if (!this.collisionGroups[t6]) {
var e6 = ++this.maxGroupID;
this.collisionGroups[t6] = { ID: e6, predicate: function(t7) {
return t7.collisionGroupID === e6;
} };
}
return this.collisionGroups[t6];
};
var be2 = function(t6, e6, i6, o6) {
this.transform = t6.clone(), this.collisionIndex = new he2(this.transform), this.placements = {}, this.opacities = {}, this.variableOffsets = {}, this.stale = false, this.commitTime = 0, this.fadeDuration = e6, this.retainedQueryData = {}, this.collisionGroups = new ve2(i6), this.collisionCircleArrays = {}, this.prevPlacement = o6, o6 && (o6.prevPlacement = void 0), this.placedOrientations = {};
};
function we2(t6, e6, i6, o6, r7) {
t6.emplaceBack(e6 ? 1 : 0, i6 ? 1 : 0, o6 || 0, r7 || 0), t6.emplaceBack(e6 ? 1 : 0, i6 ? 1 : 0, o6 || 0, r7 || 0), t6.emplaceBack(e6 ? 1 : 0, i6 ? 1 : 0, o6 || 0, r7 || 0), t6.emplaceBack(e6 ? 1 : 0, i6 ? 1 : 0, o6 || 0, r7 || 0);
}
be2.prototype.getBucketParts = function(e6, i6, o6, r7) {
var a6 = o6.getBucket(i6), n8 = o6.latestFeatureIndex;
if (a6 && n8 && i6.id === a6.layerIds[0]) {
var s7 = o6.collisionBoxArray, l8 = a6.layers[0].layout, c5 = Math.pow(2, this.transform.zoom - o6.tileID.overscaledZ), u5 = o6.tileSize / t5.EXTENT, h7 = this.transform.calculatePosMatrix(o6.tileID.toUnwrapped()), p5 = "map" === l8.get("text-pitch-alignment"), d5 = "map" === l8.get("text-rotation-alignment"), _4 = pe2(o6, 1, this.transform.zoom), f5 = Jt2(h7, p5, d5, this.transform, _4), m5 = null;
if (p5) {
var g5 = Qt2(h7, p5, d5, this.transform, _4);
m5 = t5.multiply([], this.transform.labelPlaneMatrix, g5);
}
this.retainedQueryData[a6.bucketInstanceId] = new ge2(a6.bucketInstanceId, n8, a6.sourceLayerIndex, a6.index, o6.tileID);
var v5 = { bucket: a6, layout: l8, posMatrix: h7, textLabelPlaneMatrix: f5, labelToScreenMatrix: m5, scale: c5, textPixelRatio: u5, holdingForFade: o6.holdingForFade(), collisionBoxArray: s7, partiallyEvaluatedTextSize: t5.evaluateSizeForZoom(a6.textSizeData, this.transform.zoom), collisionGroup: this.collisionGroups.get(a6.sourceID) };
if (r7) {
for (var y5 = 0, x5 = a6.sortKeyRanges; y5 < x5.length; y5 += 1) {
var b5 = x5[y5];
e6.push({ sortKey: b5.sortKey, symbolInstanceStart: b5.symbolInstanceStart, symbolInstanceEnd: b5.symbolInstanceEnd, parameters: v5 });
}
} else {
e6.push({ symbolInstanceStart: 0, symbolInstanceEnd: a6.symbolInstances.length, parameters: v5 });
}
}
}, be2.prototype.attemptAnchorPlacement = function(t6, e6, i6, o6, r7, a6, n8, s7, l8, c5, u5, h7, p5, d5, _4) {
var f5, m5 = [h7.textOffset0, h7.textOffset1], g5 = ye2(t6, i6, o6, m5, r7), v5 = this.collisionIndex.placeCollisionBox(xe2(e6, g5.x, g5.y, a6, n8, this.transform.angle), u5, s7, l8, c5.predicate);
if (!_4 || 0 !== this.collisionIndex.placeCollisionBox(xe2(_4, g5.x, g5.y, a6, n8, this.transform.angle), u5, s7, l8, c5.predicate).box.length) {
return v5.box.length > 0 ? (this.prevPlacement && this.prevPlacement.variableOffsets[h7.crossTileID] && this.prevPlacement.placements[h7.crossTileID] && this.prevPlacement.placements[h7.crossTileID].text && (f5 = this.prevPlacement.variableOffsets[h7.crossTileID].anchor), this.variableOffsets[h7.crossTileID] = { textOffset: m5, width: i6, height: o6, anchor: t6, textBoxScale: r7, prevAnchor: f5 }, this.markUsedJustification(p5, t6, h7, d5), p5.allowVerticalPlacement && (this.markUsedOrientation(p5, d5, h7), this.placedOrientations[h7.crossTileID] = d5), { shift: g5, placedGlyphBoxes: v5 }) : void 0;
}
}, be2.prototype.placeLayerBucketPart = function(e6, i6, o6) {
var r7 = this, a6 = e6.parameters, n8 = a6.bucket, s7 = a6.layout, l8 = a6.posMatrix, c5 = a6.textLabelPlaneMatrix, u5 = a6.labelToScreenMatrix, h7 = a6.textPixelRatio, p5 = a6.holdingForFade, d5 = a6.collisionBoxArray, _4 = a6.partiallyEvaluatedTextSize, f5 = a6.collisionGroup, m5 = s7.get("text-optional"), g5 = s7.get("icon-optional"), v5 = s7.get("text-allow-overlap"), y5 = s7.get("icon-allow-overlap"), x5 = "map" === s7.get("text-rotation-alignment"), b5 = "map" === s7.get("text-pitch-alignment"), w5 = "none" !== s7.get("icon-text-fit"), T5 = "viewport-y" === s7.get("symbol-z-order"), E4 = v5 && (y5 || !n8.hasIconData() || g5), I5 = y5 && (v5 || !n8.hasTextData() || m5);
!n8.collisionArrays && d5 && n8.deserializeCollisionBoxes(d5);
var P5 = function(e7, a7) {
if (!i6[e7.crossTileID]) {
if (p5) {
r7.placements[e7.crossTileID] = new fe2(false, false, false);
} else {
var d6, T6 = false, P6 = false, S6 = true, C6 = null, z6 = { box: null, offscreen: null }, D6 = { box: null, offscreen: null }, A6 = null, M5 = null, L5 = 0, R4 = 0, k5 = 0;
a7.textFeatureIndex ? L5 = a7.textFeatureIndex : e7.useRuntimeCollisionCircles && (L5 = e7.featureIndex), a7.verticalTextFeatureIndex && (R4 = a7.verticalTextFeatureIndex);
var B4 = a7.textBox;
if (B4) {
var O5 = function(i7) {
var o7 = t5.WritingMode.horizontal;
if (n8.allowVerticalPlacement && !i7 && r7.prevPlacement) {
var a8 = r7.prevPlacement.placedOrientations[e7.crossTileID];
a8 && (r7.placedOrientations[e7.crossTileID] = a8, r7.markUsedOrientation(n8, o7 = a8, e7));
}
return o7;
}, F4 = function(i7, o7) {
if (n8.allowVerticalPlacement && e7.numVerticalGlyphVertices > 0 && a7.verticalTextBox) {
for (var r8 = 0, s8 = n8.writingModes; r8 < s8.length && (s8[r8] === t5.WritingMode.vertical ? (z6 = o7(), D6 = z6) : z6 = i7(), !(z6 && z6.box && z6.box.length)); r8 += 1) {
}
} else {
z6 = i7();
}
};
if (s7.get("text-variable-anchor")) {
var U4 = s7.get("text-variable-anchor");
if (r7.prevPlacement && r7.prevPlacement.variableOffsets[e7.crossTileID]) {
var N5 = r7.prevPlacement.variableOffsets[e7.crossTileID];
U4.indexOf(N5.anchor) > 0 && (U4 = U4.filter(function(t6) {
return t6 !== N5.anchor;
})).unshift(N5.anchor);
}
var Z3 = function(t6, i7, o7) {
for (var a8 = t6.x2 - t6.x1, s8 = t6.y2 - t6.y1, c6 = e7.textBoxScale, u6 = w5 && !y5 ? i7 : null, p6 = { box: [], offscreen: false }, d7 = v5 ? 2 * U4.length : U4.length, _5 = 0; _5 < d7; ++_5) {
var m6 = r7.attemptAnchorPlacement(U4[_5 % U4.length], t6, a8, s8, c6, x5, b5, h7, l8, f5, _5 >= U4.length, e7, n8, o7, u6);
if (m6 && (p6 = m6.placedGlyphBoxes) && p6.box && p6.box.length) {
T6 = true, C6 = m6.shift;
break;
}
}
return p6;
};
F4(function() {
return Z3(B4, a7.iconBox, t5.WritingMode.horizontal);
}, function() {
var i7 = a7.verticalTextBox;
return n8.allowVerticalPlacement && !(z6 && z6.box && z6.box.length) && e7.numVerticalGlyphVertices > 0 && i7 ? Z3(i7, a7.verticalIconBox, t5.WritingMode.vertical) : { box: null, offscreen: null };
}), z6 && (T6 = z6.box, S6 = z6.offscreen);
var q5 = O5(z6 && z6.box);
if (!T6 && r7.prevPlacement) {
var j5 = r7.prevPlacement.variableOffsets[e7.crossTileID];
j5 && (r7.variableOffsets[e7.crossTileID] = j5, r7.markUsedJustification(n8, j5.anchor, e7, q5));
}
} else {
var V4 = function(t6, i7) {
var o7 = r7.collisionIndex.placeCollisionBox(t6, v5, h7, l8, f5.predicate);
return o7 && o7.box && o7.box.length && (r7.markUsedOrientation(n8, i7, e7), r7.placedOrientations[e7.crossTileID] = i7), o7;
};
F4(function() {
return V4(B4, t5.WritingMode.horizontal);
}, function() {
var i7 = a7.verticalTextBox;
return n8.allowVerticalPlacement && e7.numVerticalGlyphVertices > 0 && i7 ? V4(i7, t5.WritingMode.vertical) : { box: null, offscreen: null };
}), O5(z6 && z6.box && z6.box.length);
}
}
if (T6 = (d6 = z6) && d6.box && d6.box.length > 0, S6 = d6 && d6.offscreen, e7.useRuntimeCollisionCircles) {
var G4 = n8.text.placedSymbolArray.get(e7.centerJustifiedTextSymbolIndex), W4 = t5.evaluateSizeForFeature(n8.textSizeData, _4, G4), X4 = s7.get("text-padding");
A6 = r7.collisionIndex.placeCollisionCircles(v5, G4, n8.lineVertexArray, n8.glyphOffsetArray, W4, l8, c5, u5, o6, b5, f5.predicate, e7.collisionCircleDiameter, X4), T6 = v5 || A6.circles.length > 0 && !A6.collisionDetected, S6 = S6 && A6.offscreen;
}
if (a7.iconFeatureIndex && (k5 = a7.iconFeatureIndex), a7.iconBox) {
var H5 = function(t6) {
var e8 = w5 && C6 ? xe2(t6, C6.x, C6.y, x5, b5, r7.transform.angle) : t6;
return r7.collisionIndex.placeCollisionBox(e8, y5, h7, l8, f5.predicate);
};
P6 = D6 && D6.box && D6.box.length && a7.verticalIconBox ? (M5 = H5(a7.verticalIconBox)).box.length > 0 : (M5 = H5(a7.iconBox)).box.length > 0, S6 = S6 && M5.offscreen;
}
var K4 = m5 || 0 === e7.numHorizontalGlyphVertices && 0 === e7.numVerticalGlyphVertices, Y3 = g5 || 0 === e7.numIconVertices;
if (K4 || Y3 ? Y3 ? K4 || (P6 = P6 && T6) : T6 = P6 && T6 : P6 = T6 = P6 && T6, T6 && d6 && d6.box && r7.collisionIndex.insertCollisionBox(d6.box, s7.get("text-ignore-placement"), n8.bucketInstanceId, D6 && D6.box && R4 ? R4 : L5, f5.ID), P6 && M5 && r7.collisionIndex.insertCollisionBox(M5.box, s7.get("icon-ignore-placement"), n8.bucketInstanceId, k5, f5.ID), A6 && (T6 && r7.collisionIndex.insertCollisionCircles(A6.circles, s7.get("text-ignore-placement"), n8.bucketInstanceId, L5, f5.ID), o6)) {
var J4 = n8.bucketInstanceId, Q3 = r7.collisionCircleArrays[J4];
void 0 === Q3 && (Q3 = r7.collisionCircleArrays[J4] = new me2());
for (var $4 = 0; $4 < A6.circles.length; $4 += 4) {
Q3.circles.push(A6.circles[$4 + 0]), Q3.circles.push(A6.circles[$4 + 1]), Q3.circles.push(A6.circles[$4 + 2]), Q3.circles.push(A6.collisionDetected ? 1 : 0);
}
}
r7.placements[e7.crossTileID] = new fe2(T6 || E4, P6 || I5, S6 || n8.justReloaded), i6[e7.crossTileID] = true;
}
}
};
if (T5) {
for (var S5 = n8.getSortedSymbolIndexes(this.transform.angle), C5 = S5.length - 1; C5 >= 0; --C5) {
var z5 = S5[C5];
P5(n8.symbolInstances.get(z5), n8.collisionArrays[z5]);
}
} else {
for (var D5 = e6.symbolInstanceStart; D5 < e6.symbolInstanceEnd; D5++) {
P5(n8.symbolInstances.get(D5), n8.collisionArrays[D5]);
}
}
if (o6 && n8.bucketInstanceId in this.collisionCircleArrays) {
var A5 = this.collisionCircleArrays[n8.bucketInstanceId];
t5.invert(A5.invProjMatrix, l8), A5.viewportMatrix = this.collisionIndex.getViewportMatrix();
}
n8.justReloaded = false;
}, be2.prototype.markUsedJustification = function(e6, i6, o6, r7) {
var a6;
a6 = r7 === t5.WritingMode.vertical ? o6.verticalPlacedTextSymbolIndex : { left: o6.leftJustifiedTextSymbolIndex, center: o6.centerJustifiedTextSymbolIndex, right: o6.rightJustifiedTextSymbolIndex }[t5.getAnchorJustification(i6)];
for (var n8 = 0, s7 = [o6.leftJustifiedTextSymbolIndex, o6.centerJustifiedTextSymbolIndex, o6.rightJustifiedTextSymbolIndex, o6.verticalPlacedTextSymbolIndex]; n8 < s7.length; n8 += 1) {
var l8 = s7[n8];
l8 >= 0 && (e6.text.placedSymbolArray.get(l8).crossTileID = a6 >= 0 && l8 !== a6 ? 0 : o6.crossTileID);
}
}, be2.prototype.markUsedOrientation = function(e6, i6, o6) {
for (var r7 = i6 === t5.WritingMode.horizontal || i6 === t5.WritingMode.horizontalOnly ? i6 : 0, a6 = i6 === t5.WritingMode.vertical ? i6 : 0, n8 = 0, s7 = [o6.leftJustifiedTextSymbolIndex, o6.centerJustifiedTextSymbolIndex, o6.rightJustifiedTextSymbolIndex]; n8 < s7.length; n8 += 1) {
e6.text.placedSymbolArray.get(s7[n8]).placedOrientation = r7;
}
o6.verticalPlacedTextSymbolIndex && (e6.text.placedSymbolArray.get(o6.verticalPlacedTextSymbolIndex).placedOrientation = a6);
}, be2.prototype.commit = function(t6) {
this.commitTime = t6, this.zoomAtLastRecencyCheck = this.transform.zoom;
var e6 = this.prevPlacement, i6 = false;
this.prevZoomAdjustment = e6 ? e6.zoomAdjustment(this.transform.zoom) : 0;
var o6 = e6 ? e6.symbolFadeChange(t6) : 1, r7 = e6 ? e6.opacities : {}, a6 = e6 ? e6.variableOffsets : {}, n8 = e6 ? e6.placedOrientations : {};
for (var s7 in this.placements) {
var l8 = this.placements[s7], c5 = r7[s7];
c5 ? (this.opacities[s7] = new _e2(c5, o6, l8.text, l8.icon), i6 = i6 || l8.text !== c5.text.placed || l8.icon !== c5.icon.placed) : (this.opacities[s7] = new _e2(null, o6, l8.text, l8.icon, l8.skipFade), i6 = i6 || l8.text || l8.icon);
}
for (var u5 in r7) {
var h7 = r7[u5];
if (!this.opacities[u5]) {
var p5 = new _e2(h7, o6, false, false);
p5.isHidden() || (this.opacities[u5] = p5, i6 = i6 || h7.text.placed || h7.icon.placed);
}
}
for (var d5 in a6) {
this.variableOffsets[d5] || !this.opacities[d5] || this.opacities[d5].isHidden() || (this.variableOffsets[d5] = a6[d5]);
}
for (var _4 in n8) {
this.placedOrientations[_4] || !this.opacities[_4] || this.opacities[_4].isHidden() || (this.placedOrientations[_4] = n8[_4]);
}
i6 ? this.lastPlacementChangeTime = t6 : "number" != typeof this.lastPlacementChangeTime && (this.lastPlacementChangeTime = e6 ? e6.lastPlacementChangeTime : t6);
}, be2.prototype.updateLayerOpacities = function(t6, e6) {
for (var i6 = {}, o6 = 0, r7 = e6; o6 < r7.length; o6 += 1) {
var a6 = r7[o6], n8 = a6.getBucket(t6);
n8 && a6.latestFeatureIndex && t6.id === n8.layerIds[0] && this.updateBucketOpacities(n8, i6, a6.collisionBoxArray);
}
}, be2.prototype.updateBucketOpacities = function(e6, i6, o6) {
var r7 = this;
e6.hasTextData() && e6.text.opacityVertexArray.clear(), e6.hasIconData() && e6.icon.opacityVertexArray.clear(), e6.hasIconCollisionBoxData() && e6.iconCollisionBox.collisionVertexArray.clear(), e6.hasTextCollisionBoxData() && e6.textCollisionBox.collisionVertexArray.clear();
var a6 = e6.layers[0].layout, n8 = new _e2(null, 0, false, false, true), s7 = a6.get("text-allow-overlap"), l8 = a6.get("icon-allow-overlap"), c5 = a6.get("text-variable-anchor"), u5 = "map" === a6.get("text-rotation-alignment"), h7 = "map" === a6.get("text-pitch-alignment"), p5 = "none" !== a6.get("icon-text-fit"), d5 = new _e2(null, 0, s7 && (l8 || !e6.hasIconData() || a6.get("icon-optional")), l8 && (s7 || !e6.hasTextData() || a6.get("text-optional")), true);
!e6.collisionArrays && o6 && (e6.hasIconCollisionBoxData() || e6.hasTextCollisionBoxData()) && e6.deserializeCollisionBoxes(o6);
for (var _4 = function(t6, e7, i7) {
for (var o7 = 0; o7 < e7 / 4; o7++) {
t6.opacityVertexArray.emplaceBack(i7);
}
}, f5 = function(o7) {
var a7 = e6.symbolInstances.get(o7), s8 = a7.numHorizontalGlyphVertices, l9 = a7.numVerticalGlyphVertices, f6 = a7.crossTileID, m6 = r7.opacities[f6];
i6[f6] ? m6 = n8 : m6 || (r7.opacities[f6] = m6 = d5), i6[f6] = true;
var g6 = a7.numIconVertices > 0, v5 = r7.placedOrientations[a7.crossTileID], y5 = v5 === t5.WritingMode.vertical, x5 = v5 === t5.WritingMode.horizontal || v5 === t5.WritingMode.horizontalOnly;
if (s8 > 0 || l9 > 0) {
var b5 = De2(m6.text);
_4(e6.text, s8, y5 ? Ae2 : b5), _4(e6.text, l9, x5 ? Ae2 : b5);
var w5 = m6.text.isHidden();
[a7.rightJustifiedTextSymbolIndex, a7.centerJustifiedTextSymbolIndex, a7.leftJustifiedTextSymbolIndex].forEach(function(t6) {
t6 >= 0 && (e6.text.placedSymbolArray.get(t6).hidden = w5 || y5 ? 1 : 0);
}), a7.verticalPlacedTextSymbolIndex >= 0 && (e6.text.placedSymbolArray.get(a7.verticalPlacedTextSymbolIndex).hidden = w5 || x5 ? 1 : 0);
var T5 = r7.variableOffsets[a7.crossTileID];
T5 && r7.markUsedJustification(e6, T5.anchor, a7, v5);
var E4 = r7.placedOrientations[a7.crossTileID];
E4 && (r7.markUsedJustification(e6, "left", a7, E4), r7.markUsedOrientation(e6, E4, a7));
}
if (g6) {
var I5 = De2(m6.icon), P5 = !(p5 && a7.verticalPlacedIconSymbolIndex && y5);
a7.placedIconSymbolIndex >= 0 && (_4(e6.icon, a7.numIconVertices, P5 ? I5 : Ae2), e6.icon.placedSymbolArray.get(a7.placedIconSymbolIndex).hidden = m6.icon.isHidden()), a7.verticalPlacedIconSymbolIndex >= 0 && (_4(e6.icon, a7.numVerticalIconVertices, P5 ? Ae2 : I5), e6.icon.placedSymbolArray.get(a7.verticalPlacedIconSymbolIndex).hidden = m6.icon.isHidden());
}
if (e6.hasIconCollisionBoxData() || e6.hasTextCollisionBoxData()) {
var S5 = e6.collisionArrays[o7];
if (S5) {
var C5 = new t5.Point(0, 0);
if (S5.textBox || S5.verticalTextBox) {
var z5 = true;
if (c5) {
var D5 = r7.variableOffsets[f6];
D5 ? (C5 = ye2(D5.anchor, D5.width, D5.height, D5.textOffset, D5.textBoxScale), u5 && C5._rotate(h7 ? r7.transform.angle : -r7.transform.angle)) : z5 = false;
}
S5.textBox && we2(e6.textCollisionBox.collisionVertexArray, m6.text.placed, !z5 || y5, C5.x, C5.y), S5.verticalTextBox && we2(e6.textCollisionBox.collisionVertexArray, m6.text.placed, !z5 || x5, C5.x, C5.y);
}
var A5 = Boolean(!x5 && S5.verticalIconBox);
S5.iconBox && we2(e6.iconCollisionBox.collisionVertexArray, m6.icon.placed, A5, p5 ? C5.x : 0, p5 ? C5.y : 0), S5.verticalIconBox && we2(e6.iconCollisionBox.collisionVertexArray, m6.icon.placed, !A5, p5 ? C5.x : 0, p5 ? C5.y : 0);
}
}
}, m5 = 0; m5 < e6.symbolInstances.length; m5++) {
f5(m5);
}
if (e6.sortFeatures(this.transform.angle), this.retainedQueryData[e6.bucketInstanceId] && (this.retainedQueryData[e6.bucketInstanceId].featureSortOrder = e6.featureSortOrder), e6.hasTextData() && e6.text.opacityVertexBuffer && e6.text.opacityVertexBuffer.updateData(e6.text.opacityVertexArray), e6.hasIconData() && e6.icon.opacityVertexBuffer && e6.icon.opacityVertexBuffer.updateData(e6.icon.opacityVertexArray), e6.hasIconCollisionBoxData() && e6.iconCollisionBox.collisionVertexBuffer && e6.iconCollisionBox.collisionVertexBuffer.updateData(e6.iconCollisionBox.collisionVertexArray), e6.hasTextCollisionBoxData() && e6.textCollisionBox.collisionVertexBuffer && e6.textCollisionBox.collisionVertexBuffer.updateData(e6.textCollisionBox.collisionVertexArray), e6.bucketInstanceId in this.collisionCircleArrays) {
var g5 = this.collisionCircleArrays[e6.bucketInstanceId];
e6.placementInvProjMatrix = g5.invProjMatrix, e6.placementViewportMatrix = g5.viewportMatrix, e6.collisionCircleArray = g5.circles, delete this.collisionCircleArrays[e6.bucketInstanceId];
}
}, be2.prototype.symbolFadeChange = function(t6) {
return 0 === this.fadeDuration ? 1 : (t6 - this.commitTime) / this.fadeDuration + this.prevZoomAdjustment;
}, be2.prototype.zoomAdjustment = function(t6) {
return Math.max(0, (this.transform.zoom - t6) / 1.5);
}, be2.prototype.hasTransitions = function(t6) {
return this.stale || t6 - this.lastPlacementChangeTime < this.fadeDuration;
}, be2.prototype.stillRecent = function(t6, e6) {
var i6 = this.zoomAtLastRecencyCheck === e6 ? 1 - this.zoomAdjustment(e6) : 1;
return this.zoomAtLastRecencyCheck = e6, this.commitTime + this.fadeDuration * i6 > t6;
}, be2.prototype.setStale = function() {
this.stale = true;
};
var Te2 = Math.pow(2, 25), Ee2 = Math.pow(2, 24), Ie2 = Math.pow(2, 17), Pe2 = Math.pow(2, 16), Se2 = Math.pow(2, 9), Ce2 = Math.pow(2, 8), ze2 = Math.pow(2, 1);
function De2(t6) {
if (0 === t6.opacity && !t6.placed) {
return 0;
}
if (1 === t6.opacity && t6.placed) {
return 4294967295;
}
var e6 = t6.placed ? 1 : 0, i6 = Math.floor(127 * t6.opacity);
return i6 * Te2 + e6 * Ee2 + i6 * Ie2 + e6 * Pe2 + i6 * Se2 + e6 * Ce2 + i6 * ze2 + e6;
}
var Ae2 = 0, Me2 = function(t6) {
this._sortAcrossTiles = "viewport-y" !== t6.layout.get("symbol-z-order") && void 0 !== t6.layout.get("symbol-sort-key").constantOr(1), this._currentTileIndex = 0, this._currentPartIndex = 0, this._seenCrossTileIDs = {}, this._bucketParts = [];
};
Me2.prototype.continuePlacement = function(t6, e6, i6, o6, r7) {
for (var a6 = this._bucketParts; this._currentTileIndex < t6.length; ) {
if (e6.getBucketParts(a6, o6, t6[this._currentTileIndex], this._sortAcrossTiles), this._currentTileIndex++, r7()) {
return true;
}
}
for (this._sortAcrossTiles && (this._sortAcrossTiles = false, a6.sort(function(t7, e7) {
return t7.sortKey - e7.sortKey;
})); this._currentPartIndex < a6.length; ) {
if (e6.placeLayerBucketPart(a6[this._currentPartIndex], this._seenCrossTileIDs, i6), this._currentPartIndex++, r7()) {
return true;
}
}
return false;
};
var Le2 = function(t6, e6, i6, o6, r7, a6, n8) {
this.placement = new be2(t6, r7, a6, n8), this._currentPlacementIndex = e6.length - 1, this._forceFullPlacement = i6, this._showCollisionBoxes = o6, this._done = false;
};
Le2.prototype.isDone = function() {
return this._done;
}, Le2.prototype.continuePlacement = function(e6, i6, o6) {
for (var r7 = this, a6 = t5.browser.now(), n8 = function() {
var e7 = t5.browser.now() - a6;
return !r7._forceFullPlacement && e7 > 2;
}; this._currentPlacementIndex >= 0; ) {
var s7 = i6[e6[this._currentPlacementIndex]], l8 = this.placement.collisionIndex.transform.zoom;
if ("symbol" === s7.type && (!s7.minzoom || s7.minzoom <= l8) && (!s7.maxzoom || s7.maxzoom > l8)) {
if (this._inProgressLayer || (this._inProgressLayer = new Me2(s7)), this._inProgressLayer.continuePlacement(o6[s7.source], this.placement, this._showCollisionBoxes, s7, n8)) {
return;
}
delete this._inProgressLayer;
}
this._currentPlacementIndex--;
}
this._done = true;
}, Le2.prototype.commit = function(t6) {
return this.placement.commit(t6), this.placement;
};
var Re2 = 512 / t5.EXTENT / 2, ke2 = function(t6, e6, i6) {
this.tileID = t6, this.indexedSymbolInstances = {}, this.bucketInstanceId = i6;
for (var o6 = 0; o6 < e6.length; o6++) {
var r7 = e6.get(o6), a6 = r7.key;
this.indexedSymbolInstances[a6] || (this.indexedSymbolInstances[a6] = []), this.indexedSymbolInstances[a6].push({ crossTileID: r7.crossTileID, coord: this.getScaledCoordinates(r7, t6) });
}
};
ke2.prototype.getScaledCoordinates = function(e6, i6) {
var o6 = Re2 / Math.pow(2, i6.canonical.z - this.tileID.canonical.z);
return { x: Math.floor((i6.canonical.x * t5.EXTENT + e6.anchorX) * o6), y: Math.floor((i6.canonical.y * t5.EXTENT + e6.anchorY) * o6) };
}, ke2.prototype.findMatches = function(t6, e6, i6) {
for (var o6 = this.tileID.canonical.z < e6.canonical.z ? 1 : Math.pow(2, this.tileID.canonical.z - e6.canonical.z), r7 = 0; r7 < t6.length; r7++) {
var a6 = t6.get(r7);
if (!a6.crossTileID) {
var n8 = this.indexedSymbolInstances[a6.key];
if (n8) {
for (var s7 = this.getScaledCoordinates(a6, e6), l8 = 0, c5 = n8; l8 < c5.length; l8 += 1) {
var u5 = c5[l8];
if (Math.abs(u5.coord.x - s7.x) <= o6 && Math.abs(u5.coord.y - s7.y) <= o6 && !i6[u5.crossTileID]) {
i6[u5.crossTileID] = true, a6.crossTileID = u5.crossTileID;
break;
}
}
}
}
}
};
var Be2 = function() {
this.maxCrossTileID = 0;
};
Be2.prototype.generate = function() {
return ++this.maxCrossTileID;
};
var Oe2 = function() {
this.indexes = {}, this.usedCrossTileIDs = {}, this.lng = 0;
};
Oe2.prototype.handleWrapJump = function(t6) {
var e6 = Math.round((t6 - this.lng) / 360);
if (0 !== e6) {
for (var i6 in this.indexes) {
var o6 = this.indexes[i6], r7 = {};
for (var a6 in o6) {
var n8 = o6[a6];
n8.tileID = n8.tileID.unwrapTo(n8.tileID.wrap + e6), r7[n8.tileID.key] = n8;
}
this.indexes[i6] = r7;
}
}
this.lng = t6;
}, Oe2.prototype.addBucket = function(t6, e6, i6) {
if (this.indexes[t6.overscaledZ] && this.indexes[t6.overscaledZ][t6.key]) {
if (this.indexes[t6.overscaledZ][t6.key].bucketInstanceId === e6.bucketInstanceId) {
return false;
}
this.removeBucketCrossTileIDs(t6.overscaledZ, this.indexes[t6.overscaledZ][t6.key]);
}
for (var o6 = 0; o6 < e6.symbolInstances.length; o6++) {
e6.symbolInstances.get(o6).crossTileID = 0;
}
this.usedCrossTileIDs[t6.overscaledZ] || (this.usedCrossTileIDs[t6.overscaledZ] = {});
var r7 = this.usedCrossTileIDs[t6.overscaledZ];
for (var a6 in this.indexes) {
var n8 = this.indexes[a6];
if (Number(a6) > t6.overscaledZ) {
for (var s7 in n8) {
var l8 = n8[s7];
l8.tileID.isChildOf(t6) && l8.findMatches(e6.symbolInstances, t6, r7);
}
} else {
var c5 = n8[t6.scaledTo(Number(a6)).key];
c5 && c5.findMatches(e6.symbolInstances, t6, r7);
}
}
for (var u5 = 0; u5 < e6.symbolInstances.length; u5++) {
var h7 = e6.symbolInstances.get(u5);
h7.crossTileID || (h7.crossTileID = i6.generate(), r7[h7.crossTileID] = true);
}
return void 0 === this.indexes[t6.overscaledZ] && (this.indexes[t6.overscaledZ] = {}), this.indexes[t6.overscaledZ][t6.key] = new ke2(t6, e6.symbolInstances, e6.bucketInstanceId), true;
}, Oe2.prototype.removeBucketCrossTileIDs = function(t6, e6) {
for (var i6 in e6.indexedSymbolInstances) {
for (var o6 = 0, r7 = e6.indexedSymbolInstances[i6]; o6 < r7.length; o6 += 1) {
delete this.usedCrossTileIDs[t6][r7[o6].crossTileID];
}
}
}, Oe2.prototype.removeStaleBuckets = function(t6) {
var e6 = false;
for (var i6 in this.indexes) {
var o6 = this.indexes[i6];
for (var r7 in o6) {
t6[o6[r7].bucketInstanceId] || (this.removeBucketCrossTileIDs(i6, o6[r7]), delete o6[r7], e6 = true);
}
}
return e6;
};
var Fe2 = function() {
this.layerIndexes = {}, this.crossTileIDs = new Be2(), this.maxBucketInstanceId = 0, this.bucketsInCurrentPlacement = {};
};
Fe2.prototype.addLayer = function(t6, e6, i6) {
var o6 = this.layerIndexes[t6.id];
void 0 === o6 && (o6 = this.layerIndexes[t6.id] = new Oe2());
var r7 = false, a6 = {};
o6.handleWrapJump(i6);
for (var n8 = 0, s7 = e6; n8 < s7.length; n8 += 1) {
var l8 = s7[n8], c5 = l8.getBucket(t6);
c5 && t6.id === c5.layerIds[0] && (c5.bucketInstanceId || (c5.bucketInstanceId = ++this.maxBucketInstanceId), o6.addBucket(l8.tileID, c5, this.crossTileIDs) && (r7 = true), a6[c5.bucketInstanceId] = true);
}
return o6.removeStaleBuckets(a6) && (r7 = true), r7;
}, Fe2.prototype.pruneUnusedLayers = function(t6) {
var e6 = {};
for (var i6 in t6.forEach(function(t7) {
e6[t7] = true;
}), this.layerIndexes) {
e6[i6] || delete this.layerIndexes[i6];
}
};
var Ue2 = function(e6, i6) {
return t5.emitValidationErrors(e6, i6 && i6.filter(function(t6) {
return "source.canvas" !== t6.identifier;
}));
}, Ne2 = t5.pick(Zt2, ["addLayer", "removeLayer", "setPaintProperty", "setLayoutProperty", "setFilter", "addSource", "removeSource", "setLayerZoomRange", "setLight", "setTransition", "setGeoJSONSourceData"]), Ze2 = t5.pick(Zt2, ["setCenter", "setZoom", "setBearing", "setPitch"]), qe2 = function() {
var e6 = {}, i6 = t5.styleSpec.$version;
for (var o6 in t5.styleSpec.$root) {
var r7, a6 = t5.styleSpec.$root[o6];
if (a6.required) {
null != (r7 = "version" === o6 ? i6 : "array" === a6.type ? [] : {}) && (e6[o6] = r7);
}
}
return e6;
}(), je2 = function(e6) {
function i6(o6, r7) {
var a6 = this;
void 0 === r7 && (r7 = {}), e6.call(this), this.map = o6, this.dispatcher = new E3(Ft2(), this), this.imageManager = new p4(), this.imageManager.setEventedParent(this), this.glyphManager = new y4(o6._requestManager, r7.localIdeographFontFamily), this.lineAtlas = new T4(256, 512), this.crossTileSymbolIndex = new Fe2(), this._layers = {}, this._serializedLayers = {}, this._order = [], this.sourceCaches = {}, this.zoomHistory = new t5.ZoomHistory(), this._loaded = false, this._availableImages = [], this._resetUpdates(), this.dispatcher.broadcast("setReferrer", t5.getReferrer());
var n8 = this;
this._rtlTextPluginCallback = i6.registerForPluginStateChange(function(e7) {
n8.dispatcher.broadcast("syncRTLPluginState", { pluginStatus: e7.pluginStatus, pluginURL: e7.pluginURL }, function(e8, i7) {
if (t5.triggerPluginCompletionEvent(e8), i7 && i7.every(function(t6) {
return t6;
})) {
for (var o7 in n8.sourceCaches) {
n8.sourceCaches[o7].reload();
}
}
});
}), this.on("data", function(t6) {
if ("source" === t6.dataType && "metadata" === t6.sourceDataType) {
var e7 = a6.sourceCaches[t6.sourceId];
if (e7) {
var i7 = e7.getSource();
if (i7 && i7.vectorLayerIds) {
for (var o7 in a6._layers) {
var r8 = a6._layers[o7];
r8.source === i7.id && a6._validateLayer(r8);
}
}
}
}
});
}
return e6 && (i6.__proto__ = e6), (i6.prototype = Object.create(e6 && e6.prototype)).constructor = i6, i6.prototype.loadURL = function(e7, i7) {
var o6 = this;
void 0 === i7 && (i7 = {}), this.fire(new t5.Event("dataloading", { dataType: "style" }));
var r7 = "boolean" == typeof i7.validate ? i7.validate : !t5.isMapboxURL(e7);
e7 = this.map._requestManager.normalizeStyleURL(e7, i7.accessToken);
var a6 = this.map._requestManager.transformRequest(e7, t5.ResourceType.Style);
this._request = t5.getJSON(a6, function(e8, i8) {
o6._request = null, e8 ? o6.fire(new t5.ErrorEvent(e8)) : i8 && o6._load(i8, r7);
});
}, i6.prototype.loadJSON = function(e7, i7) {
var o6 = this;
void 0 === i7 && (i7 = {}), this.fire(new t5.Event("dataloading", { dataType: "style" })), this._request = t5.browser.frame(function() {
o6._request = null, o6._load(e7, false !== i7.validate);
});
}, i6.prototype.loadEmpty = function() {
this.fire(new t5.Event("dataloading", { dataType: "style" })), this._load(qe2, false);
}, i6.prototype._load = function(e7, i7) {
if (!i7 || !Ue2(this, t5.validateStyle(e7))) {
for (var o6 in this._loaded = true, this.stylesheet = e7, e7.sources) {
this.addSource(o6, e7.sources[o6], { validate: false });
}
e7.sprite ? this._loadSprite(e7.sprite) : this.imageManager.setLoaded(true), this.glyphManager.setURL(e7.glyphs);
var r7 = Nt2(this.stylesheet.layers);
this._order = r7.map(function(t6) {
return t6.id;
}), this._layers = {}, this._serializedLayers = {};
for (var a6 = 0, n8 = r7; a6 < n8.length; a6 += 1) {
var s7 = n8[a6];
(s7 = t5.createStyleLayer(s7)).setEventedParent(this, { layer: { id: s7.id } }), this._layers[s7.id] = s7, this._serializedLayers[s7.id] = s7.serialize();
}
this.dispatcher.broadcast("setLayers", this._serializeLayers(this._order)), this.light = new w4(this.stylesheet.light), this.fire(new t5.Event("data", { dataType: "style" })), this.fire(new t5.Event("style.load"));
}
}, i6.prototype._loadSprite = function(e7) {
var i7 = this;
this._spriteRequest = function(e8, i8, o6) {
var r7, a6, n8, s7 = t5.browser.devicePixelRatio > 1 ? "@2x" : "", l8 = t5.getJSON(i8.transformRequest(i8.normalizeSpriteURL(e8, s7, ".json"), t5.ResourceType.SpriteJSON), function(t6, e9) {
l8 = null, n8 || (n8 = t6, r7 = e9, u5());
}), c5 = t5.getImage(i8.transformRequest(i8.normalizeSpriteURL(e8, s7, ".png"), t5.ResourceType.SpriteImage), function(t6, e9) {
c5 = null, n8 || (n8 = t6, a6 = e9, u5());
});
function u5() {
if (n8) {
o6(n8);
} else if (r7 && a6) {
var e9 = t5.browser.getImageData(a6), i9 = {};
for (var s8 in r7) {
var l9 = r7[s8], c6 = l9.width, u6 = l9.height, h7 = l9.x, p5 = l9.y, d5 = l9.sdf, _4 = l9.pixelRatio, f5 = l9.stretchX, m5 = l9.stretchY, g5 = l9.content, v5 = new t5.RGBAImage({ width: c6, height: u6 });
t5.RGBAImage.copy(e9, v5, { x: h7, y: p5 }, { x: 0, y: 0 }, { width: c6, height: u6 }), i9[s8] = { data: v5, pixelRatio: _4, sdf: d5, stretchX: f5, stretchY: m5, content: g5 };
}
o6(null, i9);
}
}
return { cancel: function() {
l8 && (l8.cancel(), l8 = null), c5 && (c5.cancel(), c5 = null);
} };
}(e7, this.map._requestManager, function(e8, o6) {
if (i7._spriteRequest = null, e8) {
i7.fire(new t5.ErrorEvent(e8));
} else if (o6) {
for (var r7 in o6) {
i7.imageManager.addImage(r7, o6[r7]);
}
}
i7.imageManager.setLoaded(true), i7._availableImages = i7.imageManager.listImages(), i7.dispatcher.broadcast("setImages", i7._availableImages), i7.fire(new t5.Event("data", { dataType: "style" }));
});
}, i6.prototype._validateLayer = function(e7) {
var i7 = this.sourceCaches[e7.source];
if (i7) {
var o6 = e7.sourceLayer;
if (o6) {
var r7 = i7.getSource();
("geojson" === r7.type || r7.vectorLayerIds && -1 === r7.vectorLayerIds.indexOf(o6)) && this.fire(new t5.ErrorEvent(new Error('Source layer "' + o6 + '" does not exist on source "' + r7.id + '" as specified by style layer "' + e7.id + '"')));
}
}
}, i6.prototype.loaded = function() {
if (!this._loaded) {
return false;
}
if (Object.keys(this._updatedSources).length) {
return false;
}
for (var t6 in this.sourceCaches) {
if (!this.sourceCaches[t6].loaded()) {
return false;
}
}
return !!this.imageManager.isLoaded();
}, i6.prototype._serializeLayers = function(t6) {
for (var e7 = [], i7 = 0, o6 = t6; i7 < o6.length; i7 += 1) {
var r7 = this._layers[o6[i7]];
"custom" !== r7.type && e7.push(r7.serialize());
}
return e7;
}, i6.prototype.hasTransitions = function() {
if (this.light && this.light.hasTransition()) {
return true;
}
for (var t6 in this.sourceCaches) {
if (this.sourceCaches[t6].hasTransition()) {
return true;
}
}
for (var e7 in this._layers) {
if (this._layers[e7].hasTransition()) {
return true;
}
}
return false;
}, i6.prototype._checkLoaded = function() {
if (!this._loaded) {
throw new Error("Style is not done loading");
}
}, i6.prototype.update = function(e7) {
if (this._loaded) {
var i7 = this._changed;
if (this._changed) {
var o6 = Object.keys(this._updatedLayers), r7 = Object.keys(this._removedLayers);
for (var a6 in (o6.length || r7.length) && this._updateWorkerLayers(o6, r7), this._updatedSources) {
var n8 = this._updatedSources[a6];
"reload" === n8 ? this._reloadSource(a6) : "clear" === n8 && this._clearSource(a6);
}
for (var s7 in this._updateTilesForChangedImages(), this._updatedPaintProps) {
this._layers[s7].updateTransitions(e7);
}
this.light.updateTransitions(e7), this._resetUpdates();
}
var l8 = {};
for (var c5 in this.sourceCaches) {
var u5 = this.sourceCaches[c5];
l8[c5] = u5.used, u5.used = false;
}
for (var h7 = 0, p5 = this._order; h7 < p5.length; h7 += 1) {
var d5 = this._layers[p5[h7]];
d5.recalculate(e7, this._availableImages), !d5.isHidden(e7.zoom) && d5.source && (this.sourceCaches[d5.source].used = true);
}
for (var _4 in l8) {
var f5 = this.sourceCaches[_4];
l8[_4] !== f5.used && f5.fire(new t5.Event("data", { sourceDataType: "visibility", dataType: "source", sourceId: _4 }));
}
this.light.recalculate(e7), this.z = e7.zoom, i7 && this.fire(new t5.Event("data", { dataType: "style" }));
}
}, i6.prototype._updateTilesForChangedImages = function() {
var t6 = Object.keys(this._changedImages);
if (t6.length) {
for (var e7 in this.sourceCaches) {
this.sourceCaches[e7].reloadTilesForDependencies(["icons", "patterns"], t6);
}
this._changedImages = {};
}
}, i6.prototype._updateWorkerLayers = function(t6, e7) {
this.dispatcher.broadcast("updateLayers", { layers: this._serializeLayers(t6), removedIds: e7 });
}, i6.prototype._resetUpdates = function() {
this._changed = false, this._updatedLayers = {}, this._removedLayers = {}, this._updatedSources = {}, this._updatedPaintProps = {}, this._changedImages = {};
}, i6.prototype.setState = function(e7) {
var i7 = this;
if (this._checkLoaded(), Ue2(this, t5.validateStyle(e7))) {
return false;
}
(e7 = t5.clone$1(e7)).layers = Nt2(e7.layers);
var o6 = function(e8, i8) {
if (!e8) {
return [{ command: Zt2.setStyle, args: [i8] }];
}
var o7 = [];
try {
if (!t5.deepEqual(e8.version, i8.version)) {
return [{ command: Zt2.setStyle, args: [i8] }];
}
t5.deepEqual(e8.center, i8.center) || o7.push({ command: Zt2.setCenter, args: [i8.center] }), t5.deepEqual(e8.zoom, i8.zoom) || o7.push({ command: Zt2.setZoom, args: [i8.zoom] }), t5.deepEqual(e8.bearing, i8.bearing) || o7.push({ command: Zt2.setBearing, args: [i8.bearing] }), t5.deepEqual(e8.pitch, i8.pitch) || o7.push({ command: Zt2.setPitch, args: [i8.pitch] }), t5.deepEqual(e8.sprite, i8.sprite) || o7.push({ command: Zt2.setSprite, args: [i8.sprite] }), t5.deepEqual(e8.glyphs, i8.glyphs) || o7.push({ command: Zt2.setGlyphs, args: [i8.glyphs] }), t5.deepEqual(e8.transition, i8.transition) || o7.push({ command: Zt2.setTransition, args: [i8.transition] }), t5.deepEqual(e8.light, i8.light) || o7.push({ command: Zt2.setLight, args: [i8.light] });
var r8 = {}, a6 = [];
!function(e9, i9, o8, r9) {
var a7;
for (a7 in i9 = i9 || {}, e9 = e9 || {}) {
e9.hasOwnProperty(a7) && (i9.hasOwnProperty(a7) || jt2(a7, o8, r9));
}
for (a7 in i9) {
i9.hasOwnProperty(a7) && (e9.hasOwnProperty(a7) ? t5.deepEqual(e9[a7], i9[a7]) || ("geojson" === e9[a7].type && "geojson" === i9[a7].type && Gt2(e9, i9, a7) ? o8.push({ command: Zt2.setGeoJSONSourceData, args: [a7, i9[a7].data] }) : Vt2(a7, i9, o8, r9)) : qt2(a7, i9, o8));
}
}(e8.sources, i8.sources, a6, r8);
var n8 = [];
e8.layers && e8.layers.forEach(function(t6) {
r8[t6.source] ? o7.push({ command: Zt2.removeLayer, args: [t6.id] }) : n8.push(t6);
}), o7 = o7.concat(a6), function(e9, i9, o8) {
i9 = i9 || [];
var r9, a7, n9, s7, l8, c5, u5, h7 = (e9 = e9 || []).map(Xt2), p5 = i9.map(Xt2), d5 = e9.reduce(Ht2, {}), _4 = i9.reduce(Ht2, {}), f5 = h7.slice(), m5 = /* @__PURE__ */ Object.create(null);
for (r9 = 0, a7 = 0; r9 < h7.length; r9++) {
_4.hasOwnProperty(n9 = h7[r9]) ? a7++ : (o8.push({ command: Zt2.removeLayer, args: [n9] }), f5.splice(f5.indexOf(n9, a7), 1));
}
for (r9 = 0, a7 = 0; r9 < p5.length; r9++) {
f5[f5.length - 1 - r9] !== (n9 = p5[p5.length - 1 - r9]) && (d5.hasOwnProperty(n9) ? (o8.push({ command: Zt2.removeLayer, args: [n9] }), f5.splice(f5.lastIndexOf(n9, f5.length - a7), 1)) : a7++, o8.push({ command: Zt2.addLayer, args: [_4[n9], c5 = f5[f5.length - r9]] }), f5.splice(f5.length - r9, 0, n9), m5[n9] = true);
}
for (r9 = 0; r9 < p5.length; r9++) {
if (s7 = d5[n9 = p5[r9]], l8 = _4[n9], !m5[n9] && !t5.deepEqual(s7, l8)) {
if (t5.deepEqual(s7.source, l8.source) && t5.deepEqual(s7["source-layer"], l8["source-layer"]) && t5.deepEqual(s7.type, l8.type)) {
for (u5 in Wt2(s7.layout, l8.layout, o8, n9, null, Zt2.setLayoutProperty), Wt2(s7.paint, l8.paint, o8, n9, null, Zt2.setPaintProperty), t5.deepEqual(s7.filter, l8.filter) || o8.push({ command: Zt2.setFilter, args: [n9, l8.filter] }), t5.deepEqual(s7.minzoom, l8.minzoom) && t5.deepEqual(s7.maxzoom, l8.maxzoom) || o8.push({ command: Zt2.setLayerZoomRange, args: [n9, l8.minzoom, l8.maxzoom] }), s7) {
s7.hasOwnProperty(u5) && "layout" !== u5 && "paint" !== u5 && "filter" !== u5 && "metadata" !== u5 && "minzoom" !== u5 && "maxzoom" !== u5 && (0 === u5.indexOf("paint.") ? Wt2(s7[u5], l8[u5], o8, n9, u5.slice(6), Zt2.setPaintProperty) : t5.deepEqual(s7[u5], l8[u5]) || o8.push({ command: Zt2.setLayerProperty, args: [n9, u5, l8[u5]] }));
}
for (u5 in l8) {
l8.hasOwnProperty(u5) && !s7.hasOwnProperty(u5) && "layout" !== u5 && "paint" !== u5 && "filter" !== u5 && "metadata" !== u5 && "minzoom" !== u5 && "maxzoom" !== u5 && (0 === u5.indexOf("paint.") ? Wt2(s7[u5], l8[u5], o8, n9, u5.slice(6), Zt2.setPaintProperty) : t5.deepEqual(s7[u5], l8[u5]) || o8.push({ command: Zt2.setLayerProperty, args: [n9, u5, l8[u5]] }));
}
} else {
o8.push({ command: Zt2.removeLayer, args: [n9] }), c5 = f5[f5.lastIndexOf(n9) + 1], o8.push({ command: Zt2.addLayer, args: [l8, c5] });
}
}
}
}(n8, i8.layers, o7);
} catch (t$1) {
console.warn("Unable to compute style diff:", t$1), o7 = [{ command: Zt2.setStyle, args: [i8] }];
}
return o7;
}(this.serialize(), e7).filter(function(t6) {
return !(t6.command in Ze2);
});
if (0 === o6.length) {
return false;
}
var r7 = o6.filter(function(t6) {
return !(t6.command in Ne2);
});
if (r7.length > 0) {
throw new Error("Unimplemented: " + r7.map(function(t6) {
return t6.command;
}).join(", ") + ".");
}
return o6.forEach(function(t6) {
"setTransition" !== t6.command && i7[t6.command].apply(i7, t6.args);
}), this.stylesheet = e7, true;
}, i6.prototype.addImage = function(e7, i7) {
if (this.getImage(e7)) {
return this.fire(new t5.ErrorEvent(new Error("An image with this name already exists.")));
}
this.imageManager.addImage(e7, i7), this._afterImageUpdated(e7);
}, i6.prototype.updateImage = function(t6, e7) {
this.imageManager.updateImage(t6, e7);
}, i6.prototype.getImage = function(t6) {
return this.imageManager.getImage(t6);
}, i6.prototype.removeImage = function(e7) {
if (!this.getImage(e7)) {
return this.fire(new t5.ErrorEvent(new Error("No image with this name exists.")));
}
this.imageManager.removeImage(e7), this._afterImageUpdated(e7);
}, i6.prototype._afterImageUpdated = function(e7) {
this._availableImages = this.imageManager.listImages(), this._changedImages[e7] = true, this._changed = true, this.dispatcher.broadcast("setImages", this._availableImages), this.fire(new t5.Event("data", { dataType: "style" }));
}, i6.prototype.listImages = function() {
return this._checkLoaded(), this.imageManager.listImages();
}, i6.prototype.addSource = function(e7, i7, o6) {
var r7 = this;
if (void 0 === o6 && (o6 = {}), this._checkLoaded(), void 0 !== this.sourceCaches[e7]) {
throw new Error("There is already a source with this ID");
}
if (!i7.type) {
throw new Error("The type property must be defined, but only the following properties were given: " + Object.keys(i7).join(", ") + ".");
}
if (!(["vector", "raster", "geojson", "video", "image"].indexOf(i7.type) >= 0 && this._validate(t5.validateStyle.source, "sources." + e7, i7, null, o6))) {
this.map && this.map._collectResourceTiming && (i7.collectResourceTiming = true);
var a6 = this.sourceCaches[e7] = new Dt2(e7, i7, this.dispatcher);
a6.style = this, a6.setEventedParent(this, function() {
return { isSourceLoaded: r7.loaded(), source: a6.serialize(), sourceId: e7 };
}), a6.onAdd(this.map), this._changed = true;
}
}, i6.prototype.removeSource = function(e7) {
if (this._checkLoaded(), void 0 === this.sourceCaches[e7]) {
throw new Error("There is no source with this ID");
}
for (var i7 in this._layers) {
if (this._layers[i7].source === e7) {
return this.fire(new t5.ErrorEvent(new Error('Source "' + e7 + '" cannot be removed while layer "' + i7 + '" is using it.')));
}
}
var o6 = this.sourceCaches[e7];
delete this.sourceCaches[e7], delete this._updatedSources[e7], o6.fire(new t5.Event("data", { sourceDataType: "metadata", dataType: "source", sourceId: e7 })), o6.setEventedParent(null), o6.clearTiles(), o6.onRemove && o6.onRemove(this.map), this._changed = true;
}, i6.prototype.setGeoJSONSourceData = function(t6, e7) {
this._checkLoaded(), this.sourceCaches[t6].getSource().setData(e7), this._changed = true;
}, i6.prototype.getSource = function(t6) {
return this.sourceCaches[t6] && this.sourceCaches[t6].getSource();
}, i6.prototype.addLayer = function(e7, i7, o6) {
void 0 === o6 && (o6 = {}), this._checkLoaded();
var r7 = e7.id;
if (this.getLayer(r7)) {
this.fire(new t5.ErrorEvent(new Error('Layer with id "' + r7 + '" already exists on this map')));
} else {
var a6;
if ("custom" === e7.type) {
if (Ue2(this, t5.validateCustomStyleLayer(e7))) {
return;
}
a6 = t5.createStyleLayer(e7);
} else {
if ("object" == typeof e7.source && (this.addSource(r7, e7.source), e7 = t5.clone$1(e7), e7 = t5.extend(e7, { source: r7 })), this._validate(t5.validateStyle.layer, "layers." + r7, e7, { arrayIndex: -1 }, o6)) {
return;
}
a6 = t5.createStyleLayer(e7), this._validateLayer(a6), a6.setEventedParent(this, { layer: { id: r7 } }), this._serializedLayers[a6.id] = a6.serialize();
}
var n8 = i7 ? this._order.indexOf(i7) : this._order.length;
if (i7 && -1 === n8) {
this.fire(new t5.ErrorEvent(new Error('Layer with id "' + i7 + '" does not exist on this map.')));
} else {
if (this._order.splice(n8, 0, r7), this._layerOrderChanged = true, this._layers[r7] = a6, this._removedLayers[r7] && a6.source && "custom" !== a6.type) {
var s7 = this._removedLayers[r7];
delete this._removedLayers[r7], s7.type !== a6.type ? this._updatedSources[a6.source] = "clear" : (this._updatedSources[a6.source] = "reload", this.sourceCaches[a6.source].pause());
}
this._updateLayer(a6), a6.onAdd && a6.onAdd(this.map);
}
}
}, i6.prototype.moveLayer = function(e7, i7) {
if (this._checkLoaded(), this._changed = true, this._layers[e7]) {
if (e7 !== i7) {
var o6 = this._order.indexOf(e7);
this._order.splice(o6, 1);
var r7 = i7 ? this._order.indexOf(i7) : this._order.length;
i7 && -1 === r7 ? this.fire(new t5.ErrorEvent(new Error('Layer with id "' + i7 + '" does not exist on this map.'))) : (this._order.splice(r7, 0, e7), this._layerOrderChanged = true);
}
} else {
this.fire(new t5.ErrorEvent(new Error("The layer '" + e7 + "' does not exist in the map's style and cannot be moved.")));
}
}, i6.prototype.removeLayer = function(e7) {
this._checkLoaded();
var i7 = this._layers[e7];
if (i7) {
i7.setEventedParent(null);
var o6 = this._order.indexOf(e7);
this._order.splice(o6, 1), this._layerOrderChanged = true, this._changed = true, this._removedLayers[e7] = i7, delete this._layers[e7], delete this._serializedLayers[e7], delete this._updatedLayers[e7], delete this._updatedPaintProps[e7], i7.onRemove && i7.onRemove(this.map);
} else {
this.fire(new t5.ErrorEvent(new Error("The layer '" + e7 + "' does not exist in the map's style and cannot be removed.")));
}
}, i6.prototype.getLayer = function(t6) {
return this._layers[t6];
}, i6.prototype.hasLayer = function(t6) {
return t6 in this._layers;
}, i6.prototype.setLayerZoomRange = function(e7, i7, o6) {
this._checkLoaded();
var r7 = this.getLayer(e7);
r7 ? r7.minzoom === i7 && r7.maxzoom === o6 || (null != i7 && (r7.minzoom = i7), null != o6 && (r7.maxzoom = o6), this._updateLayer(r7)) : this.fire(new t5.ErrorEvent(new Error("The layer '" + e7 + "' does not exist in the map's style and cannot have zoom extent.")));
}, i6.prototype.setFilter = function(e7, i7, o6) {
void 0 === o6 && (o6 = {}), this._checkLoaded();
var r7 = this.getLayer(e7);
if (r7) {
if (!t5.deepEqual(r7.filter, i7)) {
return null == i7 ? (r7.filter = void 0, void this._updateLayer(r7)) : void (this._validate(t5.validateStyle.filter, "layers." + r7.id + ".filter", i7, null, o6) || (r7.filter = t5.clone$1(i7), this._updateLayer(r7)));
}
} else {
this.fire(new t5.ErrorEvent(new Error("The layer '" + e7 + "' does not exist in the map's style and cannot be filtered.")));
}
}, i6.prototype.getFilter = function(e7) {
return t5.clone$1(this.getLayer(e7).filter);
}, i6.prototype.setLayoutProperty = function(e7, i7, o6, r7) {
void 0 === r7 && (r7 = {}), this._checkLoaded();
var a6 = this.getLayer(e7);
a6 ? t5.deepEqual(a6.getLayoutProperty(i7), o6) || (a6.setLayoutProperty(i7, o6, r7), this._updateLayer(a6)) : this.fire(new t5.ErrorEvent(new Error("The layer '" + e7 + "' does not exist in the map's style and cannot be styled.")));
}, i6.prototype.getLayoutProperty = function(e7, i7) {
var o6 = this.getLayer(e7);
if (o6) {
return o6.getLayoutProperty(i7);
}
this.fire(new t5.ErrorEvent(new Error("The layer '" + e7 + "' does not exist in the map's style.")));
}, i6.prototype.setPaintProperty = function(e7, i7, o6, r7) {
void 0 === r7 && (r7 = {}), this._checkLoaded();
var a6 = this.getLayer(e7);
a6 ? t5.deepEqual(a6.getPaintProperty(i7), o6) || (a6.setPaintProperty(i7, o6, r7) && this._updateLayer(a6), this._changed = true, this._updatedPaintProps[e7] = true) : this.fire(new t5.ErrorEvent(new Error("The layer '" + e7 + "' does not exist in the map's style and cannot be styled.")));
}, i6.prototype.getPaintProperty = function(t6, e7) {
return this.getLayer(t6).getPaintProperty(e7);
}, i6.prototype.setFeatureState = function(e7, i7) {
this._checkLoaded();
var o6 = e7.source, r7 = e7.sourceLayer, a6 = this.sourceCaches[o6];
if (void 0 !== a6) {
var n8 = a6.getSource().type;
"geojson" === n8 && r7 ? this.fire(new t5.ErrorEvent(new Error("GeoJSON sources cannot have a sourceLayer parameter."))) : "vector" !== n8 || r7 ? (void 0 === e7.id && this.fire(new t5.ErrorEvent(new Error("The feature id parameter must be provided."))), a6.setFeatureState(r7, e7.id, i7)) : this.fire(new t5.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));
} else {
this.fire(new t5.ErrorEvent(new Error("The source '" + o6 + "' does not exist in the map's style.")));
}
}, i6.prototype.removeFeatureState = function(e7, i7) {
this._checkLoaded();
var o6 = e7.source, r7 = this.sourceCaches[o6];
if (void 0 !== r7) {
var a6 = r7.getSource().type, n8 = "vector" === a6 ? e7.sourceLayer : void 0;
"vector" !== a6 || n8 ? i7 && "string" != typeof e7.id && "number" != typeof e7.id ? this.fire(new t5.ErrorEvent(new Error("A feature id is required to remove its specific state property."))) : r7.removeFeatureState(n8, e7.id, i7) : this.fire(new t5.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));
} else {
this.fire(new t5.ErrorEvent(new Error("The source '" + o6 + "' does not exist in the map's style.")));
}
}, i6.prototype.getFeatureState = function(e7) {
this._checkLoaded();
var i7 = e7.source, o6 = e7.sourceLayer, r7 = this.sourceCaches[i7];
if (void 0 !== r7) {
if ("vector" !== r7.getSource().type || o6) {
return void 0 === e7.id && this.fire(new t5.ErrorEvent(new Error("The feature id parameter must be provided."))), r7.getFeatureState(o6, e7.id);
}
this.fire(new t5.ErrorEvent(new Error("The sourceLayer parameter must be provided for vector source types.")));
} else {
this.fire(new t5.ErrorEvent(new Error("The source '" + i7 + "' does not exist in the map's style.")));
}
}, i6.prototype.getTransition = function() {
return t5.extend({ duration: 300, delay: 0 }, this.stylesheet && this.stylesheet.transition);
}, i6.prototype.serialize = function() {
return t5.filterObject({ version: this.stylesheet.version, name: this.stylesheet.name, metadata: this.stylesheet.metadata, light: this.stylesheet.light, center: this.stylesheet.center, zoom: this.stylesheet.zoom, bearing: this.stylesheet.bearing, pitch: this.stylesheet.pitch, sprite: this.stylesheet.sprite, glyphs: this.stylesheet.glyphs, transition: this.stylesheet.transition, sources: t5.mapObject(this.sourceCaches, function(t6) {
return t6.serialize();
}), layers: this._serializeLayers(this._order) }, function(t6) {
return void 0 !== t6;
});
}, i6.prototype._updateLayer = function(t6) {
this._updatedLayers[t6.id] = true, t6.source && !this._updatedSources[t6.source] && "raster" !== this.sourceCaches[t6.source].getSource().type && (this._updatedSources[t6.source] = "reload", this.sourceCaches[t6.source].pause()), this._changed = true;
}, i6.prototype._flattenAndSortRenderedFeatures = function(t6) {
for (var e7 = this, i7 = function(t7) {
return "fill-extrusion" === e7._layers[t7].type;
}, o6 = {}, r7 = [], a6 = this._order.length - 1; a6 >= 0; a6--) {
var n8 = this._order[a6];
if (i7(n8)) {
o6[n8] = a6;
for (var s7 = 0, l8 = t6; s7 < l8.length; s7 += 1) {
var c5 = l8[s7][n8];
if (c5) {
for (var u5 = 0, h7 = c5; u5 < h7.length; u5 += 1) {
r7.push(h7[u5]);
}
}
}
}
}
r7.sort(function(t7, e8) {
return e8.intersectionZ - t7.intersectionZ;
});
for (var p5 = [], d5 = this._order.length - 1; d5 >= 0; d5--) {
var _4 = this._order[d5];
if (i7(_4)) {
for (var f5 = r7.length - 1; f5 >= 0; f5--) {
var m5 = r7[f5].feature;
if (o6[m5.layer.id] < d5) {
break;
}
p5.push(m5), r7.pop();
}
} else {
for (var g5 = 0, v5 = t6; g5 < v5.length; g5 += 1) {
var y5 = v5[g5][_4];
if (y5) {
for (var x5 = 0, b5 = y5; x5 < b5.length; x5 += 1) {
p5.push(b5[x5].feature);
}
}
}
}
}
return p5;
}, i6.prototype.queryRenderedFeatures = function(e7, i7, o6) {
i7 && i7.filter && this._validate(t5.validateStyle.filter, "queryRenderedFeatures.filter", i7.filter, null, i7);
var r7 = {};
if (i7 && i7.layers) {
if (!Array.isArray(i7.layers)) {
return this.fire(new t5.ErrorEvent(new Error("parameters.layers must be an Array."))), [];
}
for (var a6 = 0, n8 = i7.layers; a6 < n8.length; a6 += 1) {
var s7 = n8[a6], l8 = this._layers[s7];
if (!l8) {
return this.fire(new t5.ErrorEvent(new Error("The layer '" + s7 + "' does not exist in the map's style and cannot be queried for features."))), [];
}
r7[l8.source] = true;
}
}
var c5 = [];
for (var u5 in i7.availableImages = this._availableImages, this.sourceCaches) {
i7.layers && !r7[u5] || c5.push(O4(this.sourceCaches[u5], this._layers, this._serializedLayers, e7, i7, o6));
}
return this.placement && c5.push(function(t6, e8, i8, o7, r8, a7, n9) {
for (var s8 = {}, l9 = a7.queryRenderedSymbols(o7), c6 = [], u6 = 0, h7 = Object.keys(l9).map(Number); u6 < h7.length; u6 += 1) {
c6.push(n9[h7[u6]]);
}
c6.sort(F3);
for (var p5 = function() {
var i9 = _4[d5], o8 = i9.featureIndex.lookupSymbolFeatures(l9[i9.bucketInstanceId], e8, i9.bucketIndex, i9.sourceLayerIndex, r8.filter, r8.layers, r8.availableImages, t6);
for (var a8 in o8) {
var n10 = s8[a8] = s8[a8] || [], c7 = o8[a8];
c7.sort(function(t7, e9) {
var o9 = i9.featureSortOrder;
if (o9) {
var r9 = o9.indexOf(t7.featureIndex);
return o9.indexOf(e9.featureIndex) - r9;
}
return e9.featureIndex - t7.featureIndex;
});
for (var u7 = 0, h8 = c7; u7 < h8.length; u7 += 1) {
n10.push(h8[u7]);
}
}
}, d5 = 0, _4 = c6; d5 < _4.length; d5 += 1) {
p5();
}
var f5 = function(e9) {
s8[e9].forEach(function(o8) {
var r9 = o8.feature, a8 = i8[t6[e9].source].getFeatureState(r9.layer["source-layer"], r9.id);
r9.source = r9.layer.source, r9.layer["source-layer"] && (r9.sourceLayer = r9.layer["source-layer"]), r9.state = a8;
});
};
for (var m5 in s8) {
f5(m5);
}
return s8;
}(this._layers, this._serializedLayers, this.sourceCaches, e7, i7, this.placement.collisionIndex, this.placement.retainedQueryData)), this._flattenAndSortRenderedFeatures(c5);
}, i6.prototype.querySourceFeatures = function(e7, i7) {
i7 && i7.filter && this._validate(t5.validateStyle.filter, "querySourceFeatures.filter", i7.filter, null, i7);
var o6 = this.sourceCaches[e7];
return o6 ? function(t6, e8) {
for (var i8 = t6.getRenderableIds().map(function(e9) {
return t6.getTileByID(e9);
}), o7 = [], r7 = {}, a6 = 0; a6 < i8.length; a6++) {
var n8 = i8[a6], s7 = n8.tileID.canonical.key;
r7[s7] || (r7[s7] = true, n8.querySourceFeatures(o7, e8));
}
return o7;
}(o6, i7) : [];
}, i6.prototype.addSourceType = function(t6, e7, o6) {
return i6.getSourceType(t6) ? o6(new Error('A source type called "' + t6 + '" already exists.')) : (i6.setSourceType(t6, e7), e7.workerSourceURL ? void this.dispatcher.broadcast("loadWorkerSource", { name: t6, url: e7.workerSourceURL }, o6) : o6(null, null));
}, i6.prototype.getLight = function() {
return this.light.getLight();
}, i6.prototype.setLight = function(e7, i7) {
void 0 === i7 && (i7 = {}), this._checkLoaded();
var o6 = this.light.getLight(), r7 = false;
for (var a6 in e7) {
if (!t5.deepEqual(e7[a6], o6[a6])) {
r7 = true;
break;
}
}
if (r7) {
var n8 = { now: t5.browser.now(), transition: t5.extend({ duration: 300, delay: 0 }, this.stylesheet.transition) };
this.light.setLight(e7, i7), this.light.updateTransitions(n8);
}
}, i6.prototype._validate = function(e7, i7, o6, r7, a6) {
return void 0 === a6 && (a6 = {}), (!a6 || false !== a6.validate) && Ue2(this, e7.call(t5.validateStyle, t5.extend({ key: i7, style: this.serialize(), value: o6, styleSpec: t5.styleSpec }, r7)));
}, i6.prototype._remove = function() {
for (var e7 in this._request && (this._request.cancel(), this._request = null), this._spriteRequest && (this._spriteRequest.cancel(), this._spriteRequest = null), t5.evented.off("pluginStateChange", this._rtlTextPluginCallback), this._layers) {
this._layers[e7].setEventedParent(null);
}
for (var i7 in this.sourceCaches) {
this.sourceCaches[i7].clearTiles(), this.sourceCaches[i7].setEventedParent(null);
}
this.imageManager.setEventedParent(null), this.setEventedParent(null), this.dispatcher.remove();
}, i6.prototype._clearSource = function(t6) {
this.sourceCaches[t6].clearTiles();
}, i6.prototype._reloadSource = function(t6) {
this.sourceCaches[t6].resume(), this.sourceCaches[t6].reload();
}, i6.prototype._updateSources = function(t6) {
for (var e7 in this.sourceCaches) {
this.sourceCaches[e7].update(t6);
}
}, i6.prototype._generateCollisionBoxes = function() {
for (var t6 in this.sourceCaches) {
this._reloadSource(t6);
}
}, i6.prototype._updatePlacement = function(e7, i7, o6, r7, a6) {
void 0 === a6 && (a6 = false);
for (var n8 = false, s7 = false, l8 = {}, c5 = 0, u5 = this._order; c5 < u5.length; c5 += 1) {
var h7 = this._layers[u5[c5]];
if ("symbol" === h7.type) {
if (!l8[h7.source]) {
var p5 = this.sourceCaches[h7.source];
l8[h7.source] = p5.getRenderableIds(true).map(function(t6) {
return p5.getTileByID(t6);
}).sort(function(t6, e8) {
return e8.tileID.overscaledZ - t6.tileID.overscaledZ || (t6.tileID.isLessThan(e8.tileID) ? -1 : 1);
});
}
var d5 = this.crossTileSymbolIndex.addLayer(h7, l8[h7.source], e7.center.lng);
n8 = n8 || d5;
}
}
if (this.crossTileSymbolIndex.pruneUnusedLayers(this._order), ((a6 = a6 || this._layerOrderChanged || 0 === o6) || !this.pauseablePlacement || this.pauseablePlacement.isDone() && !this.placement.stillRecent(t5.browser.now(), e7.zoom)) && (this.pauseablePlacement = new Le2(e7, this._order, a6, i7, o6, r7, this.placement), this._layerOrderChanged = false), this.pauseablePlacement.isDone() ? this.placement.setStale() : (this.pauseablePlacement.continuePlacement(this._order, this._layers, l8), this.pauseablePlacement.isDone() && (this.placement = this.pauseablePlacement.commit(t5.browser.now()), s7 = true), n8 && this.pauseablePlacement.placement.setStale()), s7 || n8) {
for (var _4 = 0, f5 = this._order; _4 < f5.length; _4 += 1) {
var m5 = this._layers[f5[_4]];
"symbol" === m5.type && this.placement.updateLayerOpacities(m5, l8[m5.source]);
}
}
return !this.pauseablePlacement.isDone() || this.placement.hasTransitions(t5.browser.now());
}, i6.prototype._releaseSymbolFadeTiles = function() {
for (var t6 in this.sourceCaches) {
this.sourceCaches[t6].releaseSymbolFadeTiles();
}
}, i6.prototype.getImages = function(t6, e7, i7) {
this.imageManager.getImages(e7.icons, i7), this._updateTilesForChangedImages();
var o6 = this.sourceCaches[e7.source];
o6 && o6.setDependencies(e7.tileID.key, e7.type, e7.icons);
}, i6.prototype.getGlyphs = function(t6, e7, i7) {
this.glyphManager.getGlyphs(e7.stacks, i7);
}, i6.prototype.getResource = function(e7, i7, o6) {
return t5.makeRequest(i7, o6);
}, i6;
}(t5.Evented);
je2.getSourceType = function(t6) {
return k4[t6];
}, je2.setSourceType = function(t6, e6) {
k4[t6] = e6;
}, je2.registerForPluginStateChange = t5.registerForPluginStateChange;
var Ve2 = t5.createLayout([{ name: "a_pos", type: "Int16", components: 2 }]), Ge2 = gi2("#ifdef GL_ES\nprecision mediump float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif", "#ifdef GL_ES\nprecision highp float;\n#else\n#if !defined(lowp)\n#define lowp\n#endif\n#if !defined(mediump)\n#define mediump\n#endif\n#if !defined(highp)\n#define highp\n#endif\n#endif\nvec2 unpack_float(const float packedValue) {int packedIntValue=int(packedValue);int v0=packedIntValue/256;return vec2(v0,packedIntValue-v0*256);}vec2 unpack_opacity(const float packedOpacity) {int intOpacity=int(packedOpacity)/2;return vec2(float(intOpacity)/127.0,mod(packedOpacity,2.0));}vec4 decode_color(const vec2 encodedColor) {return vec4(unpack_float(encodedColor[0])/255.0,unpack_float(encodedColor[1])/255.0\n);}float unpack_mix_vec2(const vec2 packedValue,const float t) {return mix(packedValue[0],packedValue[1],t);}vec4 unpack_mix_color(const vec4 packedColors,const float t) {vec4 minColor=decode_color(vec2(packedColors[0],packedColors[1]));vec4 maxColor=decode_color(vec2(packedColors[2],packedColors[3]));return mix(minColor,maxColor,t);}vec2 get_pattern_pos(const vec2 pixel_coord_upper,const vec2 pixel_coord_lower,const vec2 pattern_size,const float tile_units_to_pixels,const vec2 pos) {vec2 offset=mod(mod(mod(pixel_coord_upper,pattern_size)*256.0,pattern_size)*256.0+pixel_coord_lower,pattern_size);return (tile_units_to_pixels*pos+offset)/pattern_size;}"), We2 = gi2("uniform vec4 u_color;uniform float u_opacity;void main() {gl_FragColor=u_color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"), Xe2 = gi2("uniform vec2 u_pattern_tl_a;uniform vec2 u_pattern_br_a;uniform vec2 u_pattern_tl_b;uniform vec2 u_pattern_br_b;uniform vec2 u_texsize;uniform float u_mix;uniform float u_opacity;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(u_pattern_tl_a/u_texsize,u_pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(u_pattern_tl_b/u_texsize,u_pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_mix)*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;uniform vec2 u_pattern_size_a;uniform vec2 u_pattern_size_b;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_scale_a;uniform float u_scale_b;uniform float u_tile_units_to_pixels;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_a*u_pattern_size_a,u_tile_units_to_pixels,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,u_scale_b*u_pattern_size_b,u_tile_units_to_pixels,a_pos);}"), He2 = gi2("varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=v_data.xy;float extrude_length=length(extrude);lowp float antialiasblur=v_data.z;float antialiased_blur=-max(blur,antialiasblur);float opacity_t=smoothstep(0.0,antialiased_blur,extrude_length-1.0);float color_t=stroke_width < 0.01 ? 0.0 : smoothstep(antialiased_blur,0.0,extrude_length-radius/(radius+stroke_width));gl_FragColor=opacity_t*mix(color*opacity,stroke_color*stroke_opacity,color_t);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;uniform bool u_scale_with_map;uniform bool u_pitch_with_map;uniform vec2 u_extrude_scale;uniform lowp float u_device_pixel_ratio;uniform highp float u_camera_to_center_distance;attribute vec2 a_pos;varying vec3 v_data;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define mediump float radius\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define highp vec4 stroke_color\n#pragma mapbox: define mediump float stroke_width\n#pragma mapbox: define lowp float stroke_opacity\nvoid main(void) {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize mediump float radius\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize highp vec4 stroke_color\n#pragma mapbox: initialize mediump float stroke_width\n#pragma mapbox: initialize lowp float stroke_opacity\nvec2 extrude=vec2(mod(a_pos,2.0)*2.0-1.0);vec2 circle_center=floor(a_pos*0.5);if (u_pitch_with_map) {vec2 corner_position=circle_center;if (u_scale_with_map) {corner_position+=extrude*(radius+stroke_width)*u_extrude_scale;} else {vec4 projected_center=u_matrix*vec4(circle_center,0,1);corner_position+=extrude*(radius+stroke_width)*u_extrude_scale*(projected_center.w/u_camera_to_center_distance);}gl_Position=u_matrix*vec4(corner_position,0,1);} else {gl_Position=u_matrix*vec4(circle_center,0,1);if (u_scale_with_map) {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*u_camera_to_center_distance;} else {gl_Position.xy+=extrude*(radius+stroke_width)*u_extrude_scale*gl_Position.w;}}lowp float antialiasblur=1.0/u_device_pixel_ratio/(radius+stroke_width);v_data=vec3(extrude.x,extrude.y,antialiasblur);}"), Ke2 = gi2("void main() {gl_FragColor=vec4(1.0);}", "attribute vec2 a_pos;uniform mat4 u_matrix;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);}"), Ye2 = gi2("uniform highp float u_intensity;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#define GAUSS_COEF 0.3989422804014327\nvoid main() {\n#pragma mapbox: initialize highp float weight\nfloat d=-0.5*3.0*3.0*dot(v_extrude,v_extrude);float val=weight*u_intensity*GAUSS_COEF*exp(d);gl_FragColor=vec4(val,1.0,1.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;uniform float u_extrude_scale;uniform float u_opacity;uniform float u_intensity;attribute vec2 a_pos;varying vec2 v_extrude;\n#pragma mapbox: define highp float weight\n#pragma mapbox: define mediump float radius\nconst highp float ZERO=1.0/255.0/16.0;\n#define GAUSS_COEF 0.3989422804014327\nvoid main(void) {\n#pragma mapbox: initialize highp float weight\n#pragma mapbox: initialize mediump float radius\nvec2 unscaled_extrude=vec2(mod(a_pos,2.0)*2.0-1.0);float S=sqrt(-2.0*log(ZERO/weight/u_intensity/GAUSS_COEF))/3.0;v_extrude=S*unscaled_extrude;vec2 extrude=v_extrude*radius*u_extrude_scale;vec4 pos=vec4(floor(a_pos*0.5)+extrude,0,1);gl_Position=u_matrix*pos;}"), Je2 = gi2("uniform sampler2D u_image;uniform sampler2D u_color_ramp;uniform float u_opacity;varying vec2 v_pos;void main() {float t=texture2D(u_image,v_pos).r;vec4 color=texture2D(u_color_ramp,vec2(t,0.5));gl_FragColor=color*u_opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(0.0);\n#endif\n}", "uniform mat4 u_matrix;uniform vec2 u_world;attribute vec2 a_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos*u_world,0,1);v_pos.x=a_pos.x;v_pos.y=1.0-a_pos.y;}"), Qe2 = gi2("varying float v_placed;varying float v_notUsed;void main() {float alpha=0.5;gl_FragColor=vec4(1.0,0.0,0.0,1.0)*alpha;if (v_placed > 0.5) {gl_FragColor=vec4(0.0,0.0,1.0,0.5)*alpha;}if (v_notUsed > 0.5) {gl_FragColor*=.1;}}", "attribute vec2 a_pos;attribute vec2 a_anchor_pos;attribute vec2 a_extrude;attribute vec2 a_placed;attribute vec2 a_shift;uniform mat4 u_matrix;uniform vec2 u_extrude_scale;uniform float u_camera_to_center_distance;varying float v_placed;varying float v_notUsed;void main() {vec4 projectedPoint=u_matrix*vec4(a_anchor_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);gl_Position=u_matrix*vec4(a_pos,0.0,1.0);gl_Position.xy+=(a_extrude+a_shift)*u_extrude_scale*gl_Position.w*collision_perspective_ratio;v_placed=a_placed.x;v_notUsed=a_placed.y;}"), $e2 = gi2("varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;void main() {float alpha=0.5*min(v_perspective_ratio,1.0);float stroke_radius=0.9*max(v_perspective_ratio,1.0);float distance_to_center=length(v_extrude);float distance_to_edge=abs(distance_to_center-v_radius);float opacity_t=smoothstep(-stroke_radius,0.0,-distance_to_edge);vec4 color=mix(vec4(0.0,0.0,1.0,0.5),vec4(1.0,0.0,0.0,1.0),v_collision);gl_FragColor=color*alpha*opacity_t;}", "attribute vec2 a_pos;attribute float a_radius;attribute vec2 a_flags;uniform mat4 u_matrix;uniform mat4 u_inv_matrix;uniform vec2 u_viewport_size;uniform float u_camera_to_center_distance;varying float v_radius;varying vec2 v_extrude;varying float v_perspective_ratio;varying float v_collision;vec3 toTilePosition(vec2 screenPos) {vec4 rayStart=u_inv_matrix*vec4(screenPos,-1.0,1.0);vec4 rayEnd =u_inv_matrix*vec4(screenPos, 1.0,1.0);rayStart.xyz/=rayStart.w;rayEnd.xyz /=rayEnd.w;highp float t=(0.0-rayStart.z)/(rayEnd.z-rayStart.z);return mix(rayStart.xyz,rayEnd.xyz,t);}void main() {vec2 quadCenterPos=a_pos;float radius=a_radius;float collision=a_flags.x;float vertexIdx=a_flags.y;vec2 quadVertexOffset=vec2(mix(-1.0,1.0,float(vertexIdx >=2.0)),mix(-1.0,1.0,float(vertexIdx >=1.0 && vertexIdx <=2.0)));vec2 quadVertexExtent=quadVertexOffset*radius;vec3 tilePos=toTilePosition(quadCenterPos);vec4 clipPos=u_matrix*vec4(tilePos,1.0);highp float camera_to_anchor_distance=clipPos.w;highp float collision_perspective_ratio=clamp(0.5+0.5*(u_camera_to_center_distance/camera_to_anchor_distance),0.0,4.0);float padding_factor=1.2;v_radius=radius;v_extrude=quadVertexExtent*padding_factor;v_perspective_ratio=collision_perspective_ratio;v_collision=collision;gl_Position=vec4(clipPos.xyz/clipPos.w,1.0)+vec4(quadVertexExtent*padding_factor/u_viewport_size*2.0,0.0,0.0);}"), ti2 = gi2("uniform highp vec4 u_color;uniform sampler2D u_overlay;varying vec2 v_uv;void main() {vec4 overlay_color=texture2D(u_overlay,v_uv);gl_FragColor=mix(u_color,overlay_color,overlay_color.a);}", "attribute vec2 a_pos;varying vec2 v_uv;uniform mat4 u_matrix;uniform float u_overlay_scale;void main() {v_uv=a_pos/8192.0;gl_Position=u_matrix*vec4(a_pos*u_overlay_scale,0,1);}"), ei2 = gi2("#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_FragColor=color*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "attribute vec2 a_pos;uniform mat4 u_matrix;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);}"), ii2 = gi2("varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=outline_color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "attribute vec2 a_pos;uniform mat4 u_matrix;uniform vec2 u_world;varying vec2 v_pos;\n#pragma mapbox: define highp vec4 outline_color\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 outline_color\n#pragma mapbox: initialize lowp float opacity\ngl_Position=u_matrix*vec4(a_pos,0,1);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"), oi2 = gi2("uniform vec2 u_texsize;uniform sampler2D u_image;uniform float u_fade;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);float dist=length(v_pos-gl_FragCoord.xy);float alpha=1.0-smoothstep(0.0,1.0,dist);gl_FragColor=mix(color1,color2,u_fade)*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;uniform vec2 u_world;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec2 v_pos;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;gl_Position=u_matrix*vec4(a_pos,0,1);vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,a_pos);v_pos=(gl_Position.xy/gl_Position.w+1.0)/2.0*u_world;}"), ri2 = gi2("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);gl_FragColor=mix(color1,color2,u_fade)*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform vec3 u_scale;attribute vec2 a_pos;varying vec2 v_pos_a;varying vec2 v_pos_b;\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;gl_Position=u_matrix*vec4(a_pos,0,1);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileZoomRatio,a_pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileZoomRatio,a_pos);}"), ai2 = gi2("varying vec4 v_color;void main() {gl_FragColor=v_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;uniform float u_vertical_gradient;uniform lowp float u_opacity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec4 v_color;\n#pragma mapbox: define highp float base\n#pragma mapbox: define highp float height\n#pragma mapbox: define highp vec4 color\nvoid main() {\n#pragma mapbox: initialize highp float base\n#pragma mapbox: initialize highp float height\n#pragma mapbox: initialize highp vec4 color\nvec3 normal=a_normal_ed.xyz;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);gl_Position=u_matrix*vec4(a_pos,t > 0.0 ? height : base,1);float colorvalue=color.r*0.2126+color.g*0.7152+color.b*0.0722;v_color=vec4(0.0,0.0,0.0,1.0);vec4 ambientlight=vec4(0.03,0.03,0.03,1.0);color+=ambientlight;float directional=clamp(dot(normal/16384.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((1.0-colorvalue+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_color.r+=clamp(color.r*directional*u_lightcolor.r,mix(0.0,0.3,1.0-u_lightcolor.r),1.0);v_color.g+=clamp(color.g*directional*u_lightcolor.g,mix(0.0,0.3,1.0-u_lightcolor.g),1.0);v_color.b+=clamp(color.b*directional*u_lightcolor.b,mix(0.0,0.3,1.0-u_lightcolor.b),1.0);v_color*=u_opacity;}"), ni2 = gi2("uniform vec2 u_texsize;uniform float u_fade;uniform sampler2D u_image;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;vec2 imagecoord=mod(v_pos_a,1.0);vec2 pos=mix(pattern_tl_a/u_texsize,pattern_br_a/u_texsize,imagecoord);vec4 color1=texture2D(u_image,pos);vec2 imagecoord_b=mod(v_pos_b,1.0);vec2 pos2=mix(pattern_tl_b/u_texsize,pattern_br_b/u_texsize,imagecoord_b);vec4 color2=texture2D(u_image,pos2);vec4 mixedColor=mix(color1,color2,u_fade);gl_FragColor=mixedColor*v_lighting;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;uniform vec2 u_pixel_coord_upper;uniform vec2 u_pixel_coord_lower;uniform float u_height_factor;uniform vec3 u_scale;uniform float u_vertical_gradient;uniform lowp float u_opacity;uniform vec3 u_lightcolor;uniform lowp vec3 u_lightpos;uniform lowp float u_lightintensity;attribute vec2 a_pos;attribute vec4 a_normal_ed;varying vec2 v_pos_a;varying vec2 v_pos_b;varying vec4 v_lighting;\n#pragma mapbox: define lowp float base\n#pragma mapbox: define lowp float height\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float base\n#pragma mapbox: initialize lowp float height\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec3 normal=a_normal_ed.xyz;float edgedistance=a_normal_ed.w;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;base=max(0.0,base);height=max(0.0,height);float t=mod(normal.x,2.0);float z=t > 0.0 ? height : base;gl_Position=u_matrix*vec4(a_pos,z,1);vec2 pos=normal.x==1.0 && normal.y==0.0 && normal.z==16384.0\n? a_pos\n: vec2(edgedistance,z*u_height_factor);v_pos_a=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,fromScale*display_size_a,tileRatio,pos);v_pos_b=get_pattern_pos(u_pixel_coord_upper,u_pixel_coord_lower,toScale*display_size_b,tileRatio,pos);v_lighting=vec4(0.0,0.0,0.0,1.0);float directional=clamp(dot(normal/16383.0,u_lightpos),0.0,1.0);directional=mix((1.0-u_lightintensity),max((0.5+u_lightintensity),1.0),directional);if (normal.y !=0.0) {directional*=((1.0-u_vertical_gradient)+(u_vertical_gradient*clamp((t+base)*pow(height/150.0,0.5),mix(0.7,0.98,1.0-u_lightintensity),1.0)));}v_lighting.rgb+=clamp(directional*u_lightcolor,mix(vec3(0.0),vec3(0.3),1.0-u_lightcolor),vec3(1.0));v_lighting*=u_opacity;}"), si2 = gi2("#ifdef GL_ES\nprecision highp float;\n#endif\nuniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_dimension;uniform float u_zoom;uniform vec4 u_unpack;float getElevation(vec2 coord,float bias) {vec4 data=texture2D(u_image,coord)*255.0;data.a=-1.0;return dot(data,u_unpack)/4.0;}void main() {vec2 epsilon=1.0/u_dimension;float a=getElevation(v_pos+vec2(-epsilon.x,-epsilon.y),0.0);float b=getElevation(v_pos+vec2(0,-epsilon.y),0.0);float c=getElevation(v_pos+vec2(epsilon.x,-epsilon.y),0.0);float d=getElevation(v_pos+vec2(-epsilon.x,0),0.0);float e=getElevation(v_pos,0.0);float f=getElevation(v_pos+vec2(epsilon.x,0),0.0);float g=getElevation(v_pos+vec2(-epsilon.x,epsilon.y),0.0);float h=getElevation(v_pos+vec2(0,epsilon.y),0.0);float i=getElevation(v_pos+vec2(epsilon.x,epsilon.y),0.0);float exaggerationFactor=u_zoom < 2.0 ? 0.4 : u_zoom < 4.5 ? 0.35 : 0.3;float exaggeration=u_zoom < 15.0 ? (u_zoom-15.0)*exaggerationFactor : 0.0;vec2 deriv=vec2((c+f+f+i)-(a+d+d+g),(g+h+h+i)-(a+b+b+c))/pow(2.0,exaggeration+(19.2562-u_zoom));gl_FragColor=clamp(vec4(deriv.x/2.0+0.5,deriv.y/2.0+0.5,1.0,1.0),0.0,1.0);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;uniform vec2 u_dimension;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);highp vec2 epsilon=1.0/u_dimension;float scale=(u_dimension.x-2.0)/u_dimension.x;v_pos=(a_texture_pos/8192.0)*scale+epsilon;}"), li2 = gi2("uniform sampler2D u_image;varying vec2 v_pos;uniform vec2 u_latrange;uniform vec2 u_light;uniform vec4 u_shadow;uniform vec4 u_highlight;uniform vec4 u_accent;\n#define PI 3.141592653589793\nvoid main() {vec4 pixel=texture2D(u_image,v_pos);vec2 deriv=((pixel.rg*2.0)-1.0);float scaleFactor=cos(radians((u_latrange[0]-u_latrange[1])*(1.0-v_pos.y)+u_latrange[1]));float slope=atan(1.25*length(deriv)/scaleFactor);float aspect=deriv.x !=0.0 ? atan(deriv.y,-deriv.x) : PI/2.0*(deriv.y > 0.0 ? 1.0 :-1.0);float intensity=u_light.x;float azimuth=u_light.y+PI;float base=1.875-intensity*1.75;float maxValue=0.5*PI;float scaledSlope=intensity !=0.5 ? ((pow(base,slope)-1.0)/(pow(base,maxValue)-1.0))*maxValue : slope;float accent=cos(scaledSlope);vec4 accent_color=(1.0-accent)*u_accent*clamp(intensity*2.0,0.0,1.0);float shade=abs(mod((aspect+azimuth)/PI+0.5,2.0)-1.0);vec4 shade_color=mix(u_shadow,u_highlight,shade)*sin(scaledSlope)*clamp(intensity*2.0,0.0,1.0);gl_FragColor=accent_color*(1.0-shade_color.a)+shade_color;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos=a_texture_pos/8192.0;}"), ci2 = gi2("uniform lowp float u_device_pixel_ratio;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform vec2 u_units_to_pixels;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp float v_linesofar;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;v_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*2.0;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"), ui2 = gi2("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;varying vec2 v_width2;varying vec2 v_normal;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);vec4 color=texture2D(u_image,v_uv);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "\n#define scale 0.015873016\nattribute vec2 a_pos_normal;attribute vec4 a_data;attribute float a_uv_x;attribute float a_split_index;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_units_to_pixels;uniform float u_image_height;varying vec2 v_normal;varying vec2 v_width2;varying float v_gamma_scale;varying highp vec2 v_uv;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;highp float texel_height=1.0/u_image_height;highp float half_texel_height=0.5*texel_height;v_uv=vec2(a_uv_x,a_split_index*texel_height-half_texel_height);vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_width2=vec2(outset,inset);}"), hi2 = gi2("uniform lowp float u_device_pixel_ratio;uniform vec2 u_texsize;uniform float u_fade;uniform mediump vec3 u_scale;uniform sampler2D u_image;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\nvec2 pattern_tl_a=pattern_from.xy;vec2 pattern_br_a=pattern_from.zw;vec2 pattern_tl_b=pattern_to.xy;vec2 pattern_br_b=pattern_to.zw;float tileZoomRatio=u_scale.x;float fromScale=u_scale.y;float toScale=u_scale.z;vec2 display_size_a=(pattern_br_a-pattern_tl_a)/pixel_ratio_from;vec2 display_size_b=(pattern_br_b-pattern_tl_b)/pixel_ratio_to;vec2 pattern_size_a=vec2(display_size_a.x*fromScale/tileZoomRatio,display_size_a.y);vec2 pattern_size_b=vec2(display_size_b.x*toScale/tileZoomRatio,display_size_b.y);float aspect_a=display_size_a.y/v_width;float aspect_b=display_size_b.y/v_width;float dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float x_a=mod(v_linesofar/pattern_size_a.x*aspect_a,1.0);float x_b=mod(v_linesofar/pattern_size_b.x*aspect_b,1.0);float y=0.5*v_normal.y+0.5;vec2 texel_size=1.0/u_texsize;vec2 pos_a=mix(pattern_tl_a*texel_size-texel_size,pattern_br_a*texel_size+texel_size,vec2(x_a,y));vec2 pos_b=mix(pattern_tl_b*texel_size-texel_size,pattern_br_b*texel_size+texel_size,vec2(x_b,y));vec4 color=mix(texture2D(u_image,pos_a),texture2D(u_image,pos_b),u_fade);gl_FragColor=color*alpha*opacity;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform vec2 u_units_to_pixels;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;varying vec2 v_normal;varying vec2 v_width2;varying float v_linesofar;varying float v_gamma_scale;varying float v_width;\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\n#pragma mapbox: define lowp vec4 pattern_from\n#pragma mapbox: define lowp vec4 pattern_to\n#pragma mapbox: define lowp float pixel_ratio_from\n#pragma mapbox: define lowp float pixel_ratio_to\nvoid main() {\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\n#pragma mapbox: initialize mediump vec4 pattern_from\n#pragma mapbox: initialize mediump vec4 pattern_to\n#pragma mapbox: initialize lowp float pixel_ratio_from\n#pragma mapbox: initialize lowp float pixel_ratio_to\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_linesofar=a_linesofar;v_width2=vec2(outset,inset);v_width=floorwidth;}"), pi2 = gi2("uniform lowp float u_device_pixel_ratio;uniform sampler2D u_image;uniform float u_sdfgamma;uniform float u_mix;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat dist=length(v_normal)*v_width2.s;float blur2=(blur+1.0/u_device_pixel_ratio)*v_gamma_scale;float alpha=clamp(min(dist-(v_width2.t-blur2),v_width2.s-dist)/blur2,0.0,1.0);float sdfdist_a=texture2D(u_image,v_tex_a).a;float sdfdist_b=texture2D(u_image,v_tex_b).a;float sdfdist=mix(sdfdist_a,sdfdist_b,u_mix);alpha*=smoothstep(0.5-u_sdfgamma/floorwidth,0.5+u_sdfgamma/floorwidth,sdfdist);gl_FragColor=color*(alpha*opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "\n#define scale 0.015873016\n#define LINE_DISTANCE_SCALE 2.0\nattribute vec2 a_pos_normal;attribute vec4 a_data;uniform mat4 u_matrix;uniform mediump float u_ratio;uniform lowp float u_device_pixel_ratio;uniform vec2 u_patternscale_a;uniform float u_tex_y_a;uniform vec2 u_patternscale_b;uniform float u_tex_y_b;uniform vec2 u_units_to_pixels;varying vec2 v_normal;varying vec2 v_width2;varying vec2 v_tex_a;varying vec2 v_tex_b;varying float v_gamma_scale;\n#pragma mapbox: define highp vec4 color\n#pragma mapbox: define lowp float blur\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define mediump float gapwidth\n#pragma mapbox: define lowp float offset\n#pragma mapbox: define mediump float width\n#pragma mapbox: define lowp float floorwidth\nvoid main() {\n#pragma mapbox: initialize highp vec4 color\n#pragma mapbox: initialize lowp float blur\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize mediump float gapwidth\n#pragma mapbox: initialize lowp float offset\n#pragma mapbox: initialize mediump float width\n#pragma mapbox: initialize lowp float floorwidth\nfloat ANTIALIASING=1.0/u_device_pixel_ratio/2.0;vec2 a_extrude=a_data.xy-128.0;float a_direction=mod(a_data.z,4.0)-1.0;float a_linesofar=(floor(a_data.z/4.0)+a_data.w*64.0)*LINE_DISTANCE_SCALE;vec2 pos=floor(a_pos_normal*0.5);mediump vec2 normal=a_pos_normal-2.0*pos;normal.y=normal.y*2.0-1.0;v_normal=normal;gapwidth=gapwidth/2.0;float halfwidth=width/2.0;offset=-1.0*offset;float inset=gapwidth+(gapwidth > 0.0 ? ANTIALIASING : 0.0);float outset=gapwidth+halfwidth*(gapwidth > 0.0 ? 2.0 : 1.0)+(halfwidth==0.0 ? 0.0 : ANTIALIASING);mediump vec2 dist=outset*a_extrude*scale;mediump float u=0.5*a_direction;mediump float t=1.0-abs(u);mediump vec2 offset2=offset*a_extrude*scale*normal.y*mat2(t,-u,u,t);vec4 projected_extrude=u_matrix*vec4(dist/u_ratio,0.0,0.0);gl_Position=u_matrix*vec4(pos+offset2/u_ratio,0.0,1.0)+projected_extrude;float extrude_length_without_perspective=length(dist);float extrude_length_with_perspective=length(projected_extrude.xy/gl_Position.w*u_units_to_pixels);v_gamma_scale=extrude_length_without_perspective/extrude_length_with_perspective;v_tex_a=vec2(a_linesofar*u_patternscale_a.x/floorwidth,normal.y*u_patternscale_a.y+u_tex_y_a);v_tex_b=vec2(a_linesofar*u_patternscale_b.x/floorwidth,normal.y*u_patternscale_b.y+u_tex_y_b);v_width2=vec2(outset,inset);}"), di2 = gi2("uniform float u_fade_t;uniform float u_opacity;uniform sampler2D u_image0;uniform sampler2D u_image1;varying vec2 v_pos0;varying vec2 v_pos1;uniform float u_brightness_low;uniform float u_brightness_high;uniform float u_saturation_factor;uniform float u_contrast_factor;uniform vec3 u_spin_weights;void main() {vec4 color0=texture2D(u_image0,v_pos0);vec4 color1=texture2D(u_image1,v_pos1);if (color0.a > 0.0) {color0.rgb=color0.rgb/color0.a;}if (color1.a > 0.0) {color1.rgb=color1.rgb/color1.a;}vec4 color=mix(color0,color1,u_fade_t);color.a*=u_opacity;vec3 rgb=color.rgb;rgb=vec3(dot(rgb,u_spin_weights.xyz),dot(rgb,u_spin_weights.zxy),dot(rgb,u_spin_weights.yzx));float average=(color.r+color.g+color.b)/3.0;rgb+=(average-rgb)*u_saturation_factor;rgb=(rgb-0.5)*u_contrast_factor+0.5;vec3 u_high_vec=vec3(u_brightness_low,u_brightness_low,u_brightness_low);vec3 u_low_vec=vec3(u_brightness_high,u_brightness_high,u_brightness_high);gl_FragColor=vec4(mix(u_high_vec,u_low_vec,rgb)*color.a,color.a);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "uniform mat4 u_matrix;uniform vec2 u_tl_parent;uniform float u_scale_parent;uniform float u_buffer_scale;attribute vec2 a_pos;attribute vec2 a_texture_pos;varying vec2 v_pos0;varying vec2 v_pos1;void main() {gl_Position=u_matrix*vec4(a_pos,0,1);v_pos0=(((a_texture_pos/8192.0)-0.5)/u_buffer_scale )+0.5;v_pos1=(v_pos0*u_scale_parent)+u_tl_parent;}"), _i2 = gi2("uniform sampler2D u_texture;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nlowp float alpha=opacity*v_fade_opacity;gl_FragColor=texture2D(u_texture,v_tex)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform highp float u_camera_to_center_distance;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform float u_fade_change;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform vec2 u_texsize;varying vec2 v_tex;varying float v_fade_opacity;\n#pragma mapbox: define lowp float opacity\nvoid main() {\n#pragma mapbox: initialize lowp float opacity\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;vec2 a_minFontScale=a_pixeloffset.zw/256.0;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*max(a_minFontScale,fontScale)+a_pxoffset/16.0),0.0,1.0);v_tex=a_tex/u_texsize;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;v_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));}"), fi2 = gi2("#define SDF_PX 8.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;uniform bool u_is_text;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat EDGE_GAMMA=0.105/u_device_pixel_ratio;vec2 tex=v_data0.xy;float gamma_scale=v_data1.x;float size=v_data1.y;float fade_opacity=v_data1[2];float fontScale=u_is_text ? size/24.0 : size;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec4 a_pixeloffset;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;varying vec2 v_data0;varying vec3 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);vec2 a_pxoffset=a_pixeloffset.xy;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=u_is_text ? size/24.0 : size;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale+a_pxoffset),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0=a_tex/u_texsize;v_data1=vec3(gamma_scale,size,interpolated_fade_opacity);}"), mi2 = gi2("#define SDF_PX 8.0\n#define SDF 1.0\n#define ICON 0.0\nuniform bool u_is_halo;uniform sampler2D u_texture;uniform sampler2D u_texture_icon;uniform highp float u_gamma_scale;uniform lowp float u_device_pixel_ratio;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nfloat fade_opacity=v_data1[2];if (v_data1.w==ICON) {vec2 tex_icon=v_data0.zw;lowp float alpha=opacity*fade_opacity;gl_FragColor=texture2D(u_texture_icon,tex_icon)*alpha;\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\nreturn;}vec2 tex=v_data0.xy;float EDGE_GAMMA=0.105/u_device_pixel_ratio;float gamma_scale=v_data1.x;float size=v_data1.y;float fontScale=size/24.0;lowp vec4 color=fill_color;highp float gamma=EDGE_GAMMA/(fontScale*u_gamma_scale);lowp float buff=(256.0-64.0)/256.0;if (u_is_halo) {color=halo_color;gamma=(halo_blur*1.19/SDF_PX+EDGE_GAMMA)/(fontScale*u_gamma_scale);buff=(6.0-halo_width/fontScale)/SDF_PX;}lowp float dist=texture2D(u_texture,tex).a;highp float gamma_scaled=gamma*gamma_scale;highp float alpha=smoothstep(buff-gamma_scaled,buff+gamma_scaled,dist);gl_FragColor=color*(alpha*opacity*fade_opacity);\n#ifdef OVERDRAW_INSPECTOR\ngl_FragColor=vec4(1.0);\n#endif\n}", "const float PI=3.141592653589793;attribute vec4 a_pos_offset;attribute vec4 a_data;attribute vec3 a_projected_pos;attribute float a_fade_opacity;uniform bool u_is_size_zoom_constant;uniform bool u_is_size_feature_constant;uniform highp float u_size_t;uniform highp float u_size;uniform mat4 u_matrix;uniform mat4 u_label_plane_matrix;uniform mat4 u_coord_matrix;uniform bool u_is_text;uniform bool u_pitch_with_map;uniform highp float u_pitch;uniform bool u_rotate_symbol;uniform highp float u_aspect_ratio;uniform highp float u_camera_to_center_distance;uniform float u_fade_change;uniform vec2 u_texsize;uniform vec2 u_texsize_icon;varying vec4 v_data0;varying vec4 v_data1;\n#pragma mapbox: define highp vec4 fill_color\n#pragma mapbox: define highp vec4 halo_color\n#pragma mapbox: define lowp float opacity\n#pragma mapbox: define lowp float halo_width\n#pragma mapbox: define lowp float halo_blur\nvoid main() {\n#pragma mapbox: initialize highp vec4 fill_color\n#pragma mapbox: initialize highp vec4 halo_color\n#pragma mapbox: initialize lowp float opacity\n#pragma mapbox: initialize lowp float halo_width\n#pragma mapbox: initialize lowp float halo_blur\nvec2 a_pos=a_pos_offset.xy;vec2 a_offset=a_pos_offset.zw;vec2 a_tex=a_data.xy;vec2 a_size=a_data.zw;float a_size_min=floor(a_size[0]*0.5);float is_sdf=a_size[0]-2.0*a_size_min;highp float segment_angle=-a_projected_pos[2];float size;if (!u_is_size_zoom_constant && !u_is_size_feature_constant) {size=mix(a_size_min,a_size[1],u_size_t)/128.0;} else if (u_is_size_zoom_constant && !u_is_size_feature_constant) {size=a_size_min/128.0;} else {size=u_size;}vec4 projectedPoint=u_matrix*vec4(a_pos,0,1);highp float camera_to_anchor_distance=projectedPoint.w;highp float distance_ratio=u_pitch_with_map ?\ncamera_to_anchor_distance/u_camera_to_center_distance :\nu_camera_to_center_distance/camera_to_anchor_distance;highp float perspective_ratio=clamp(0.5+0.5*distance_ratio,0.0,4.0);size*=perspective_ratio;float fontScale=size/24.0;highp float symbol_rotation=0.0;if (u_rotate_symbol) {vec4 offsetProjectedPoint=u_matrix*vec4(a_pos+vec2(1,0),0,1);vec2 a=projectedPoint.xy/projectedPoint.w;vec2 b=offsetProjectedPoint.xy/offsetProjectedPoint.w;symbol_rotation=atan((b.y-a.y)/u_aspect_ratio,b.x-a.x);}highp float angle_sin=sin(segment_angle+symbol_rotation);highp float angle_cos=cos(segment_angle+symbol_rotation);mat2 rotation_matrix=mat2(angle_cos,-1.0*angle_sin,angle_sin,angle_cos);vec4 projected_pos=u_label_plane_matrix*vec4(a_projected_pos.xy,0.0,1.0);gl_Position=u_coord_matrix*vec4(projected_pos.xy/projected_pos.w+rotation_matrix*(a_offset/32.0*fontScale),0.0,1.0);float gamma_scale=gl_Position.w;vec2 fade_opacity=unpack_opacity(a_fade_opacity);float fade_change=fade_opacity[1] > 0.5 ? u_fade_change :-u_fade_change;float interpolated_fade_opacity=max(0.0,min(1.0,fade_opacity[0]+fade_change));v_data0.xy=a_tex/u_texsize;v_data0.zw=a_tex/u_texsize_icon;v_data1=vec4(gamma_scale,size,interpolated_fade_opacity,is_sdf);}");
function gi2(t6, e6) {
var i6 = /#pragma mapbox: ([\w]+) ([\w]+) ([\w]+) ([\w]+)/g, o6 = e6.match(/attribute ([\w]+) ([\w]+)/g), r7 = t6.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g), a6 = e6.match(/uniform ([\w]+) ([\w]+)([\s]*)([\w]*)/g), n8 = a6 ? a6.concat(r7) : r7, s7 = {};
return { fragmentSource: t6 = t6.replace(i6, function(t7, e7, i7, o7, r8) {
return s7[r8] = true, "define" === e7 ? "\n#ifndef HAS_UNIFORM_u_" + r8 + "\nvarying " + i7 + " " + o7 + " " + r8 + ";\n#else\nuniform " + i7 + " " + o7 + " u_" + r8 + ";\n#endif\n" : "\n#ifdef HAS_UNIFORM_u_" + r8 + "\n " + i7 + " " + o7 + " " + r8 + " = u_" + r8 + ";\n#endif\n";
}), vertexSource: e6 = e6.replace(i6, function(t7, e7, i7, o7, r8) {
var a7 = "float" === o7 ? "vec2" : "vec4", n9 = r8.match(/color/) ? "color" : a7;
return s7[r8] ? "define" === e7 ? "\n#ifndef HAS_UNIFORM_u_" + r8 + "\nuniform lowp float u_" + r8 + "_t;\nattribute " + i7 + " " + a7 + " a_" + r8 + ";\nvarying " + i7 + " " + o7 + " " + r8 + ";\n#else\nuniform " + i7 + " " + o7 + " u_" + r8 + ";\n#endif\n" : "vec4" === n9 ? "\n#ifndef HAS_UNIFORM_u_" + r8 + "\n " + r8 + " = a_" + r8 + ";\n#else\n " + i7 + " " + o7 + " " + r8 + " = u_" + r8 + ";\n#endif\n" : "\n#ifndef HAS_UNIFORM_u_" + r8 + "\n " + r8 + " = unpack_mix_" + n9 + "(a_" + r8 + ", u_" + r8 + "_t);\n#else\n " + i7 + " " + o7 + " " + r8 + " = u_" + r8 + ";\n#endif\n" : "define" === e7 ? "\n#ifndef HAS_UNIFORM_u_" + r8 + "\nuniform lowp float u_" + r8 + "_t;\nattribute " + i7 + " " + a7 + " a_" + r8 + ";\n#else\nuniform " + i7 + " " + o7 + " u_" + r8 + ";\n#endif\n" : "vec4" === n9 ? "\n#ifndef HAS_UNIFORM_u_" + r8 + "\n " + i7 + " " + o7 + " " + r8 + " = a_" + r8 + ";\n#else\n " + i7 + " " + o7 + " " + r8 + " = u_" + r8 + ";\n#endif\n" : "\n#ifndef HAS_UNIFORM_u_" + r8 + "\n " + i7 + " " + o7 + " " + r8 + " = unpack_mix_" + n9 + "(a_" + r8 + ", u_" + r8 + "_t);\n#else\n " + i7 + " " + o7 + " " + r8 + " = u_" + r8 + ";\n#endif\n";
}), staticAttributes: o6, staticUniforms: n8 };
}
var vi2 = Object.freeze({ __proto__: null, prelude: Ge2, background: We2, backgroundPattern: Xe2, circle: He2, clippingMask: Ke2, heatmap: Ye2, heatmapTexture: Je2, collisionBox: Qe2, collisionCircle: $e2, debug: ti2, fill: ei2, fillOutline: ii2, fillOutlinePattern: oi2, fillPattern: ri2, fillExtrusion: ai2, fillExtrusionPattern: ni2, hillshadePrepare: si2, hillshade: li2, line: ci2, lineGradient: ui2, linePattern: hi2, lineSDF: pi2, raster: di2, symbolIcon: _i2, symbolSDF: fi2, symbolTextAndIcon: mi2 }), yi2 = function() {
this.boundProgram = null, this.boundLayoutVertexBuffer = null, this.boundPaintVertexBuffers = [], this.boundIndexBuffer = null, this.boundVertexOffset = null, this.boundDynamicVertexBuffer = null, this.vao = null;
};
function xi2(t6) {
for (var e6 = [], i6 = 0; i6 < t6.length; i6++) {
if (null !== t6[i6]) {
var o6 = t6[i6].split(" ");
e6.push(o6.pop());
}
}
return e6;
}
yi2.prototype.bind = function(t6, e6, i6, o6, r7, a6, n8, s7) {
this.context = t6;
for (var l8 = this.boundPaintVertexBuffers.length !== o6.length, c5 = 0; !l8 && c5 < o6.length; c5++) {
this.boundPaintVertexBuffers[c5] !== o6[c5] && (l8 = true);
}
t6.extVertexArrayObject && this.vao && this.boundProgram === e6 && this.boundLayoutVertexBuffer === i6 && !l8 && this.boundIndexBuffer === r7 && this.boundVertexOffset === a6 && this.boundDynamicVertexBuffer === n8 && this.boundDynamicVertexBuffer2 === s7 ? (t6.bindVertexArrayOES.set(this.vao), n8 && n8.bind(), r7 && r7.dynamicDraw && r7.bind(), s7 && s7.bind()) : this.freshBind(e6, i6, o6, r7, a6, n8, s7);
}, yi2.prototype.freshBind = function(t6, e6, i6, o6, r7, a6, n8) {
var s7, l8 = t6.numAttributes, c5 = this.context, u5 = c5.gl;
if (c5.extVertexArrayObject) {
this.vao && this.destroy(), this.vao = c5.extVertexArrayObject.createVertexArrayOES(), c5.bindVertexArrayOES.set(this.vao), s7 = 0, this.boundProgram = t6, this.boundLayoutVertexBuffer = e6, this.boundPaintVertexBuffers = i6, this.boundIndexBuffer = o6, this.boundVertexOffset = r7, this.boundDynamicVertexBuffer = a6, this.boundDynamicVertexBuffer2 = n8;
} else {
s7 = c5.currentNumAttributes || 0;
for (var h7 = l8; h7 < s7; h7++) {
u5.disableVertexAttribArray(h7);
}
}
e6.enableAttributes(u5, t6);
for (var p5 = 0, d5 = i6; p5 < d5.length; p5 += 1) {
d5[p5].enableAttributes(u5, t6);
}
a6 && a6.enableAttributes(u5, t6), n8 && n8.enableAttributes(u5, t6), e6.bind(), e6.setVertexAttribPointers(u5, t6, r7);
for (var _4 = 0, f5 = i6; _4 < f5.length; _4 += 1) {
var m5 = f5[_4];
m5.bind(), m5.setVertexAttribPointers(u5, t6, r7);
}
a6 && (a6.bind(), a6.setVertexAttribPointers(u5, t6, r7)), o6 && o6.bind(), n8 && (n8.bind(), n8.setVertexAttribPointers(u5, t6, r7)), c5.currentNumAttributes = l8;
}, yi2.prototype.destroy = function() {
this.vao && (this.context.extVertexArrayObject.deleteVertexArrayOES(this.vao), this.vao = null);
};
var bi2 = function(t6, e6, i6, o6, r7, a6) {
var n8 = t6.gl;
this.program = n8.createProgram();
for (var s7 = xi2(i6.staticAttributes), l8 = o6 ? o6.getBinderAttributes() : [], c5 = s7.concat(l8), u5 = i6.staticUniforms ? xi2(i6.staticUniforms) : [], h7 = o6 ? o6.getBinderUniforms() : [], p5 = [], d5 = 0, _4 = u5.concat(h7); d5 < _4.length; d5 += 1) {
var f5 = _4[d5];
p5.indexOf(f5) < 0 && p5.push(f5);
}
var m5 = o6 ? o6.defines() : [];
a6 && m5.push("#define OVERDRAW_INSPECTOR;");
var g5 = m5.concat(Ge2.fragmentSource, i6.fragmentSource).join("\n"), v5 = m5.concat(Ge2.vertexSource, i6.vertexSource).join("\n"), y5 = n8.createShader(n8.FRAGMENT_SHADER);
if (n8.isContextLost()) {
this.failedToCreate = true;
} else {
n8.shaderSource(y5, g5), n8.compileShader(y5), n8.attachShader(this.program, y5);
var x5 = n8.createShader(n8.VERTEX_SHADER);
if (n8.isContextLost()) {
this.failedToCreate = true;
} else {
n8.shaderSource(x5, v5), n8.compileShader(x5), n8.attachShader(this.program, x5), this.attributes = {};
var b5 = {};
this.numAttributes = c5.length;
for (var w5 = 0; w5 < this.numAttributes; w5++) {
c5[w5] && (n8.bindAttribLocation(this.program, w5, c5[w5]), this.attributes[c5[w5]] = w5);
}
n8.linkProgram(this.program), n8.deleteShader(x5), n8.deleteShader(y5);
for (var T5 = 0; T5 < p5.length; T5++) {
var E4 = p5[T5];
if (E4 && !b5[E4]) {
var I5 = n8.getUniformLocation(this.program, E4);
I5 && (b5[E4] = I5);
}
}
this.fixedUniforms = r7(t6, b5), this.binderUniforms = o6 ? o6.getUniforms(t6, b5) : [];
}
}
};
function wi2(t6, e6, i6) {
var o6 = 1 / pe2(i6, 1, e6.transform.tileZoom), r7 = Math.pow(2, i6.tileID.overscaledZ), a6 = i6.tileSize * Math.pow(2, e6.transform.tileZoom) / r7, n8 = a6 * (i6.tileID.canonical.x + i6.tileID.wrap * r7), s7 = a6 * i6.tileID.canonical.y;
return { u_image: 0, u_texsize: i6.imageAtlasTexture.size, u_scale: [o6, t6.fromScale, t6.toScale], u_fade: t6.t, u_pixel_coord_upper: [n8 >> 16, s7 >> 16], u_pixel_coord_lower: [65535 & n8, 65535 & s7] };
}
bi2.prototype.draw = function(t6, e6, i6, o6, r7, a6, n8, s7, l8, c5, u5, h7, p5, d5, _4, f5) {
var m5, g5 = t6.gl;
if (!this.failedToCreate) {
for (var v5 in t6.program.set(this.program), t6.setDepthMode(i6), t6.setStencilMode(o6), t6.setColorMode(r7), t6.setCullFace(a6), this.fixedUniforms) {
this.fixedUniforms[v5].set(n8[v5]);
}
d5 && d5.setUniforms(t6, this.binderUniforms, h7, { zoom: p5 });
for (var y5 = (m5 = {}, m5[g5.LINES] = 2, m5[g5.TRIANGLES] = 3, m5[g5.LINE_STRIP] = 1, m5)[e6], x5 = 0, b5 = u5.get(); x5 < b5.length; x5 += 1) {
var w5 = b5[x5], T5 = w5.vaos || (w5.vaos = {});
(T5[s7] || (T5[s7] = new yi2())).bind(t6, this, l8, d5 ? d5.getPaintVertexBuffers() : [], c5, w5.vertexOffset, _4, f5), g5.drawElements(e6, w5.primitiveLength * y5, g5.UNSIGNED_SHORT, w5.primitiveOffset * y5 * 2);
}
}
};
var Ti2 = function(e6, i6, o6, r7) {
var a6 = i6.style.light, n8 = a6.properties.get("position"), s7 = [n8.x, n8.y, n8.z], l8 = t5.create$1();
"viewport" === a6.properties.get("anchor") && t5.fromRotation(l8, -i6.transform.angle), t5.transformMat3(s7, s7, l8);
var c5 = a6.properties.get("color");
return { u_matrix: e6, u_lightpos: s7, u_lightintensity: a6.properties.get("intensity"), u_lightcolor: [c5.r, c5.g, c5.b], u_vertical_gradient: +o6, u_opacity: r7 };
}, Ei2 = function(e6, i6, o6, r7, a6, n8, s7) {
return t5.extend(Ti2(e6, i6, o6, r7), wi2(n8, i6, s7), { u_height_factor: -Math.pow(2, a6.overscaledZ) / s7.tileSize / 8 });
}, Ii2 = function(t6) {
return { u_matrix: t6 };
}, Pi2 = function(e6, i6, o6, r7) {
return t5.extend(Ii2(e6), wi2(o6, i6, r7));
}, Si2 = function(t6, e6) {
return { u_matrix: t6, u_world: e6 };
}, Ci2 = function(e6, i6, o6, r7, a6) {
return t5.extend(Pi2(e6, i6, o6, r7), { u_world: a6 });
}, zi2 = function(e6, i6, o6, r7) {
var a6, n8, s7 = e6.transform;
if ("map" === r7.paint.get("circle-pitch-alignment")) {
var l8 = pe2(o6, 1, s7.zoom);
a6 = true, n8 = [l8, l8];
} else {
a6 = false, n8 = s7.pixelsToGLUnits;
}
return { u_camera_to_center_distance: s7.cameraToCenterDistance, u_scale_with_map: +("map" === r7.paint.get("circle-pitch-scale")), u_matrix: e6.translatePosMatrix(i6.posMatrix, o6, r7.paint.get("circle-translate"), r7.paint.get("circle-translate-anchor")), u_pitch_with_map: +a6, u_device_pixel_ratio: t5.browser.devicePixelRatio, u_extrude_scale: n8 };
}, Di2 = function(t6, e6, i6) {
var o6 = pe2(i6, 1, e6.zoom), r7 = Math.pow(2, e6.zoom - i6.tileID.overscaledZ), a6 = i6.tileID.overscaleFactor();
return { u_matrix: t6, u_camera_to_center_distance: e6.cameraToCenterDistance, u_pixels_to_tile_units: o6, u_extrude_scale: [e6.pixelsToGLUnits[0] / (o6 * r7), e6.pixelsToGLUnits[1] / (o6 * r7)], u_overscale_factor: a6 };
}, Ai2 = function(t6, e6, i6) {
return { u_matrix: t6, u_inv_matrix: e6, u_camera_to_center_distance: i6.cameraToCenterDistance, u_viewport_size: [i6.width, i6.height] };
}, Mi2 = function(t6, e6, i6) {
return void 0 === i6 && (i6 = 1), { u_matrix: t6, u_color: e6, u_overlay: 0, u_overlay_scale: i6 };
}, Li2 = function(t6) {
return { u_matrix: t6 };
}, Ri2 = function(t6, e6, i6, o6) {
return { u_matrix: t6, u_extrude_scale: pe2(e6, 1, i6), u_intensity: o6 };
}, ki2 = function(e6, i6, o6) {
var r7 = e6.transform;
return { u_matrix: Ni2(e6, i6, o6), u_ratio: 1 / pe2(i6, 1, r7.zoom), u_device_pixel_ratio: t5.browser.devicePixelRatio, u_units_to_pixels: [1 / r7.pixelsToGLUnits[0], 1 / r7.pixelsToGLUnits[1]] };
}, Bi2 = function(e6, i6, o6, r7) {
return t5.extend(ki2(e6, i6, o6), { u_image: 0, u_image_height: r7 });
}, Oi2 = function(e6, i6, o6, r7) {
var a6 = e6.transform, n8 = Ui2(i6, a6);
return { u_matrix: Ni2(e6, i6, o6), u_texsize: i6.imageAtlasTexture.size, u_ratio: 1 / pe2(i6, 1, a6.zoom), u_device_pixel_ratio: t5.browser.devicePixelRatio, u_image: 0, u_scale: [n8, r7.fromScale, r7.toScale], u_fade: r7.t, u_units_to_pixels: [1 / a6.pixelsToGLUnits[0], 1 / a6.pixelsToGLUnits[1]] };
}, Fi2 = function(e6, i6, o6, r7, a6) {
var n8 = e6.lineAtlas, s7 = Ui2(i6, e6.transform), l8 = "round" === o6.layout.get("line-cap"), c5 = n8.getDash(r7.from, l8), u5 = n8.getDash(r7.to, l8), h7 = c5.width * a6.fromScale, p5 = u5.width * a6.toScale;
return t5.extend(ki2(e6, i6, o6), { u_patternscale_a: [s7 / h7, -c5.height / 2], u_patternscale_b: [s7 / p5, -u5.height / 2], u_sdfgamma: n8.width / (256 * Math.min(h7, p5) * t5.browser.devicePixelRatio) / 2, u_image: 0, u_tex_y_a: c5.y, u_tex_y_b: u5.y, u_mix: a6.t });
};
function Ui2(t6, e6) {
return 1 / pe2(t6, 1, e6.tileZoom);
}
function Ni2(t6, e6, i6) {
return t6.translatePosMatrix(e6.tileID.posMatrix, e6, i6.paint.get("line-translate"), i6.paint.get("line-translate-anchor"));
}
var Zi2 = function(t6, e6, i6, o6, r7) {
return { u_matrix: t6, u_tl_parent: e6, u_scale_parent: i6, u_buffer_scale: 1, u_fade_t: o6.mix, u_opacity: o6.opacity * r7.paint.get("raster-opacity"), u_image0: 0, u_image1: 1, u_brightness_low: r7.paint.get("raster-brightness-min"), u_brightness_high: r7.paint.get("raster-brightness-max"), u_saturation_factor: (n8 = r7.paint.get("raster-saturation"), n8 > 0 ? 1 - 1 / (1.001 - n8) : -n8), u_contrast_factor: (a6 = r7.paint.get("raster-contrast"), a6 > 0 ? 1 / (1 - a6) : 1 + a6), u_spin_weights: qi2(r7.paint.get("raster-hue-rotate")) };
var a6, n8;
};
function qi2(t6) {
t6 *= Math.PI / 180;
var e6 = Math.sin(t6), i6 = Math.cos(t6);
return [(2 * i6 + 1) / 3, (-Math.sqrt(3) * e6 - i6 + 1) / 3, (Math.sqrt(3) * e6 - i6 + 1) / 3];
}
var ji2, Vi2 = function(t6, e6, i6, o6, r7, a6, n8, s7, l8, c5) {
var u5 = r7.transform;
return { u_is_size_zoom_constant: +("constant" === t6 || "source" === t6), u_is_size_feature_constant: +("constant" === t6 || "camera" === t6), u_size_t: e6 ? e6.uSizeT : 0, u_size: e6 ? e6.uSize : 0, u_camera_to_center_distance: u5.cameraToCenterDistance, u_pitch: u5.pitch / 360 * 2 * Math.PI, u_rotate_symbol: +i6, u_aspect_ratio: u5.width / u5.height, u_fade_change: r7.options.fadeDuration ? r7.symbolFadeChange : 1, u_matrix: a6, u_label_plane_matrix: n8, u_coord_matrix: s7, u_is_text: +l8, u_pitch_with_map: +o6, u_texsize: c5, u_texture: 0 };
}, Gi2 = function(e6, i6, o6, r7, a6, n8, s7, l8, c5, u5, h7) {
var p5 = a6.transform;
return t5.extend(Vi2(e6, i6, o6, r7, a6, n8, s7, l8, c5, u5), { u_gamma_scale: r7 ? Math.cos(p5._pitch) * p5.cameraToCenterDistance : 1, u_device_pixel_ratio: t5.browser.devicePixelRatio, u_is_halo: +h7 });
}, Wi2 = function(e6, i6, o6, r7, a6, n8, s7, l8, c5, u5) {
return t5.extend(Gi2(e6, i6, o6, r7, a6, n8, s7, l8, true, c5, true), { u_texsize_icon: u5, u_texture_icon: 1 });
}, Xi2 = function(t6, e6, i6) {
return { u_matrix: t6, u_opacity: e6, u_color: i6 };
}, Hi2 = function(e6, i6, o6, r7, a6, n8) {
return t5.extend(function(t6, e7, i7, o7) {
var r8 = i7.imageManager.getPattern(t6.from.toString()), a7 = i7.imageManager.getPattern(t6.to.toString()), n9 = i7.imageManager.getPixelSize(), s7 = n9.width, l8 = n9.height, c5 = Math.pow(2, o7.tileID.overscaledZ), u5 = o7.tileSize * Math.pow(2, i7.transform.tileZoom) / c5, h7 = u5 * (o7.tileID.canonical.x + o7.tileID.wrap * c5), p5 = u5 * o7.tileID.canonical.y;
return { u_image: 0, u_pattern_tl_a: r8.tl, u_pattern_br_a: r8.br, u_pattern_tl_b: a7.tl, u_pattern_br_b: a7.br, u_texsize: [s7, l8], u_mix: e7.t, u_pattern_size_a: r8.displaySize, u_pattern_size_b: a7.displaySize, u_scale_a: e7.fromScale, u_scale_b: e7.toScale, u_tile_units_to_pixels: 1 / pe2(o7, 1, i7.transform.tileZoom), u_pixel_coord_upper: [h7 >> 16, p5 >> 16], u_pixel_coord_lower: [65535 & h7, 65535 & p5] };
}(r7, n8, o6, a6), { u_matrix: e6, u_opacity: i6 });
}, Ki2 = { fillExtrusion: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_lightpos: new t5.Uniform3f(e6, i6.u_lightpos), u_lightintensity: new t5.Uniform1f(e6, i6.u_lightintensity), u_lightcolor: new t5.Uniform3f(e6, i6.u_lightcolor), u_vertical_gradient: new t5.Uniform1f(e6, i6.u_vertical_gradient), u_opacity: new t5.Uniform1f(e6, i6.u_opacity) };
}, fillExtrusionPattern: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_lightpos: new t5.Uniform3f(e6, i6.u_lightpos), u_lightintensity: new t5.Uniform1f(e6, i6.u_lightintensity), u_lightcolor: new t5.Uniform3f(e6, i6.u_lightcolor), u_vertical_gradient: new t5.Uniform1f(e6, i6.u_vertical_gradient), u_height_factor: new t5.Uniform1f(e6, i6.u_height_factor), u_image: new t5.Uniform1i(e6, i6.u_image), u_texsize: new t5.Uniform2f(e6, i6.u_texsize), u_pixel_coord_upper: new t5.Uniform2f(e6, i6.u_pixel_coord_upper), u_pixel_coord_lower: new t5.Uniform2f(e6, i6.u_pixel_coord_lower), u_scale: new t5.Uniform3f(e6, i6.u_scale), u_fade: new t5.Uniform1f(e6, i6.u_fade), u_opacity: new t5.Uniform1f(e6, i6.u_opacity) };
}, fill: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix) };
}, fillPattern: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_image: new t5.Uniform1i(e6, i6.u_image), u_texsize: new t5.Uniform2f(e6, i6.u_texsize), u_pixel_coord_upper: new t5.Uniform2f(e6, i6.u_pixel_coord_upper), u_pixel_coord_lower: new t5.Uniform2f(e6, i6.u_pixel_coord_lower), u_scale: new t5.Uniform3f(e6, i6.u_scale), u_fade: new t5.Uniform1f(e6, i6.u_fade) };
}, fillOutline: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_world: new t5.Uniform2f(e6, i6.u_world) };
}, fillOutlinePattern: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_world: new t5.Uniform2f(e6, i6.u_world), u_image: new t5.Uniform1i(e6, i6.u_image), u_texsize: new t5.Uniform2f(e6, i6.u_texsize), u_pixel_coord_upper: new t5.Uniform2f(e6, i6.u_pixel_coord_upper), u_pixel_coord_lower: new t5.Uniform2f(e6, i6.u_pixel_coord_lower), u_scale: new t5.Uniform3f(e6, i6.u_scale), u_fade: new t5.Uniform1f(e6, i6.u_fade) };
}, circle: function(e6, i6) {
return { u_camera_to_center_distance: new t5.Uniform1f(e6, i6.u_camera_to_center_distance), u_scale_with_map: new t5.Uniform1i(e6, i6.u_scale_with_map), u_pitch_with_map: new t5.Uniform1i(e6, i6.u_pitch_with_map), u_extrude_scale: new t5.Uniform2f(e6, i6.u_extrude_scale), u_device_pixel_ratio: new t5.Uniform1f(e6, i6.u_device_pixel_ratio), u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix) };
}, collisionBox: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_camera_to_center_distance: new t5.Uniform1f(e6, i6.u_camera_to_center_distance), u_pixels_to_tile_units: new t5.Uniform1f(e6, i6.u_pixels_to_tile_units), u_extrude_scale: new t5.Uniform2f(e6, i6.u_extrude_scale), u_overscale_factor: new t5.Uniform1f(e6, i6.u_overscale_factor) };
}, collisionCircle: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_inv_matrix: new t5.UniformMatrix4f(e6, i6.u_inv_matrix), u_camera_to_center_distance: new t5.Uniform1f(e6, i6.u_camera_to_center_distance), u_viewport_size: new t5.Uniform2f(e6, i6.u_viewport_size) };
}, debug: function(e6, i6) {
return { u_color: new t5.UniformColor(e6, i6.u_color), u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_overlay: new t5.Uniform1i(e6, i6.u_overlay), u_overlay_scale: new t5.Uniform1f(e6, i6.u_overlay_scale) };
}, clippingMask: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix) };
}, heatmap: function(e6, i6) {
return { u_extrude_scale: new t5.Uniform1f(e6, i6.u_extrude_scale), u_intensity: new t5.Uniform1f(e6, i6.u_intensity), u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix) };
}, heatmapTexture: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_world: new t5.Uniform2f(e6, i6.u_world), u_image: new t5.Uniform1i(e6, i6.u_image), u_color_ramp: new t5.Uniform1i(e6, i6.u_color_ramp), u_opacity: new t5.Uniform1f(e6, i6.u_opacity) };
}, hillshade: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_image: new t5.Uniform1i(e6, i6.u_image), u_latrange: new t5.Uniform2f(e6, i6.u_latrange), u_light: new t5.Uniform2f(e6, i6.u_light), u_shadow: new t5.UniformColor(e6, i6.u_shadow), u_highlight: new t5.UniformColor(e6, i6.u_highlight), u_accent: new t5.UniformColor(e6, i6.u_accent) };
}, hillshadePrepare: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_image: new t5.Uniform1i(e6, i6.u_image), u_dimension: new t5.Uniform2f(e6, i6.u_dimension), u_zoom: new t5.Uniform1f(e6, i6.u_zoom), u_unpack: new t5.Uniform4f(e6, i6.u_unpack) };
}, line: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_ratio: new t5.Uniform1f(e6, i6.u_ratio), u_device_pixel_ratio: new t5.Uniform1f(e6, i6.u_device_pixel_ratio), u_units_to_pixels: new t5.Uniform2f(e6, i6.u_units_to_pixels) };
}, lineGradient: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_ratio: new t5.Uniform1f(e6, i6.u_ratio), u_device_pixel_ratio: new t5.Uniform1f(e6, i6.u_device_pixel_ratio), u_units_to_pixels: new t5.Uniform2f(e6, i6.u_units_to_pixels), u_image: new t5.Uniform1i(e6, i6.u_image), u_image_height: new t5.Uniform1f(e6, i6.u_image_height) };
}, linePattern: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_texsize: new t5.Uniform2f(e6, i6.u_texsize), u_ratio: new t5.Uniform1f(e6, i6.u_ratio), u_device_pixel_ratio: new t5.Uniform1f(e6, i6.u_device_pixel_ratio), u_image: new t5.Uniform1i(e6, i6.u_image), u_units_to_pixels: new t5.Uniform2f(e6, i6.u_units_to_pixels), u_scale: new t5.Uniform3f(e6, i6.u_scale), u_fade: new t5.Uniform1f(e6, i6.u_fade) };
}, lineSDF: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_ratio: new t5.Uniform1f(e6, i6.u_ratio), u_device_pixel_ratio: new t5.Uniform1f(e6, i6.u_device_pixel_ratio), u_units_to_pixels: new t5.Uniform2f(e6, i6.u_units_to_pixels), u_patternscale_a: new t5.Uniform2f(e6, i6.u_patternscale_a), u_patternscale_b: new t5.Uniform2f(e6, i6.u_patternscale_b), u_sdfgamma: new t5.Uniform1f(e6, i6.u_sdfgamma), u_image: new t5.Uniform1i(e6, i6.u_image), u_tex_y_a: new t5.Uniform1f(e6, i6.u_tex_y_a), u_tex_y_b: new t5.Uniform1f(e6, i6.u_tex_y_b), u_mix: new t5.Uniform1f(e6, i6.u_mix) };
}, raster: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_tl_parent: new t5.Uniform2f(e6, i6.u_tl_parent), u_scale_parent: new t5.Uniform1f(e6, i6.u_scale_parent), u_buffer_scale: new t5.Uniform1f(e6, i6.u_buffer_scale), u_fade_t: new t5.Uniform1f(e6, i6.u_fade_t), u_opacity: new t5.Uniform1f(e6, i6.u_opacity), u_image0: new t5.Uniform1i(e6, i6.u_image0), u_image1: new t5.Uniform1i(e6, i6.u_image1), u_brightness_low: new t5.Uniform1f(e6, i6.u_brightness_low), u_brightness_high: new t5.Uniform1f(e6, i6.u_brightness_high), u_saturation_factor: new t5.Uniform1f(e6, i6.u_saturation_factor), u_contrast_factor: new t5.Uniform1f(e6, i6.u_contrast_factor), u_spin_weights: new t5.Uniform3f(e6, i6.u_spin_weights) };
}, symbolIcon: function(e6, i6) {
return { u_is_size_zoom_constant: new t5.Uniform1i(e6, i6.u_is_size_zoom_constant), u_is_size_feature_constant: new t5.Uniform1i(e6, i6.u_is_size_feature_constant), u_size_t: new t5.Uniform1f(e6, i6.u_size_t), u_size: new t5.Uniform1f(e6, i6.u_size), u_camera_to_center_distance: new t5.Uniform1f(e6, i6.u_camera_to_center_distance), u_pitch: new t5.Uniform1f(e6, i6.u_pitch), u_rotate_symbol: new t5.Uniform1i(e6, i6.u_rotate_symbol), u_aspect_ratio: new t5.Uniform1f(e6, i6.u_aspect_ratio), u_fade_change: new t5.Uniform1f(e6, i6.u_fade_change), u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_label_plane_matrix: new t5.UniformMatrix4f(e6, i6.u_label_plane_matrix), u_coord_matrix: new t5.UniformMatrix4f(e6, i6.u_coord_matrix), u_is_text: new t5.Uniform1i(e6, i6.u_is_text), u_pitch_with_map: new t5.Uniform1i(e6, i6.u_pitch_with_map), u_texsize: new t5.Uniform2f(e6, i6.u_texsize), u_texture: new t5.Uniform1i(e6, i6.u_texture) };
}, symbolSDF: function(e6, i6) {
return { u_is_size_zoom_constant: new t5.Uniform1i(e6, i6.u_is_size_zoom_constant), u_is_size_feature_constant: new t5.Uniform1i(e6, i6.u_is_size_feature_constant), u_size_t: new t5.Uniform1f(e6, i6.u_size_t), u_size: new t5.Uniform1f(e6, i6.u_size), u_camera_to_center_distance: new t5.Uniform1f(e6, i6.u_camera_to_center_distance), u_pitch: new t5.Uniform1f(e6, i6.u_pitch), u_rotate_symbol: new t5.Uniform1i(e6, i6.u_rotate_symbol), u_aspect_ratio: new t5.Uniform1f(e6, i6.u_aspect_ratio), u_fade_change: new t5.Uniform1f(e6, i6.u_fade_change), u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_label_plane_matrix: new t5.UniformMatrix4f(e6, i6.u_label_plane_matrix), u_coord_matrix: new t5.UniformMatrix4f(e6, i6.u_coord_matrix), u_is_text: new t5.Uniform1i(e6, i6.u_is_text), u_pitch_with_map: new t5.Uniform1i(e6, i6.u_pitch_with_map), u_texsize: new t5.Uniform2f(e6, i6.u_texsize), u_texture: new t5.Uniform1i(e6, i6.u_texture), u_gamma_scale: new t5.Uniform1f(e6, i6.u_gamma_scale), u_device_pixel_ratio: new t5.Uniform1f(e6, i6.u_device_pixel_ratio), u_is_halo: new t5.Uniform1i(e6, i6.u_is_halo) };
}, symbolTextAndIcon: function(e6, i6) {
return { u_is_size_zoom_constant: new t5.Uniform1i(e6, i6.u_is_size_zoom_constant), u_is_size_feature_constant: new t5.Uniform1i(e6, i6.u_is_size_feature_constant), u_size_t: new t5.Uniform1f(e6, i6.u_size_t), u_size: new t5.Uniform1f(e6, i6.u_size), u_camera_to_center_distance: new t5.Uniform1f(e6, i6.u_camera_to_center_distance), u_pitch: new t5.Uniform1f(e6, i6.u_pitch), u_rotate_symbol: new t5.Uniform1i(e6, i6.u_rotate_symbol), u_aspect_ratio: new t5.Uniform1f(e6, i6.u_aspect_ratio), u_fade_change: new t5.Uniform1f(e6, i6.u_fade_change), u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_label_plane_matrix: new t5.UniformMatrix4f(e6, i6.u_label_plane_matrix), u_coord_matrix: new t5.UniformMatrix4f(e6, i6.u_coord_matrix), u_is_text: new t5.Uniform1i(e6, i6.u_is_text), u_pitch_with_map: new t5.Uniform1i(e6, i6.u_pitch_with_map), u_texsize: new t5.Uniform2f(e6, i6.u_texsize), u_texsize_icon: new t5.Uniform2f(e6, i6.u_texsize_icon), u_texture: new t5.Uniform1i(e6, i6.u_texture), u_texture_icon: new t5.Uniform1i(e6, i6.u_texture_icon), u_gamma_scale: new t5.Uniform1f(e6, i6.u_gamma_scale), u_device_pixel_ratio: new t5.Uniform1f(e6, i6.u_device_pixel_ratio), u_is_halo: new t5.Uniform1i(e6, i6.u_is_halo) };
}, background: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_opacity: new t5.Uniform1f(e6, i6.u_opacity), u_color: new t5.UniformColor(e6, i6.u_color) };
}, backgroundPattern: function(e6, i6) {
return { u_matrix: new t5.UniformMatrix4f(e6, i6.u_matrix), u_opacity: new t5.Uniform1f(e6, i6.u_opacity), u_image: new t5.Uniform1i(e6, i6.u_image), u_pattern_tl_a: new t5.Uniform2f(e6, i6.u_pattern_tl_a), u_pattern_br_a: new t5.Uniform2f(e6, i6.u_pattern_br_a), u_pattern_tl_b: new t5.Uniform2f(e6, i6.u_pattern_tl_b), u_pattern_br_b: new t5.Uniform2f(e6, i6.u_pattern_br_b), u_texsize: new t5.Uniform2f(e6, i6.u_texsize), u_mix: new t5.Uniform1f(e6, i6.u_mix), u_pattern_size_a: new t5.Uniform2f(e6, i6.u_pattern_size_a), u_pattern_size_b: new t5.Uniform2f(e6, i6.u_pattern_size_b), u_scale_a: new t5.Uniform1f(e6, i6.u_scale_a), u_scale_b: new t5.Uniform1f(e6, i6.u_scale_b), u_pixel_coord_upper: new t5.Uniform2f(e6, i6.u_pixel_coord_upper), u_pixel_coord_lower: new t5.Uniform2f(e6, i6.u_pixel_coord_lower), u_tile_units_to_pixels: new t5.Uniform1f(e6, i6.u_tile_units_to_pixels) };
} };
function Yi2(e6, i6, o6, r7, a6, n8, s7) {
for (var l8 = e6.context, c5 = l8.gl, u5 = e6.useProgram("collisionBox"), h7 = [], p5 = 0, d5 = 0, _4 = 0; _4 < r7.length; _4++) {
var f5 = r7[_4], m5 = i6.getTile(f5), g5 = m5.getBucket(o6);
if (g5) {
var v5 = f5.posMatrix;
0 === a6[0] && 0 === a6[1] || (v5 = e6.translatePosMatrix(f5.posMatrix, m5, a6, n8));
var y5 = s7 ? g5.textCollisionBox : g5.iconCollisionBox, x5 = g5.collisionCircleArray;
if (x5.length > 0) {
var b5 = t5.create(), w5 = v5;
t5.mul(b5, g5.placementInvProjMatrix, e6.transform.glCoordMatrix), t5.mul(b5, b5, g5.placementViewportMatrix), h7.push({ circleArray: x5, circleOffset: d5, transform: w5, invTransform: b5 }), d5 = p5 += x5.length / 4;
}
y5 && u5.draw(l8, c5.LINES, It2.disabled, Pt2.disabled, e6.colorModeForRenderPass(), Ct2.disabled, Di2(v5, e6.transform, m5), o6.id, y5.layoutVertexBuffer, y5.indexBuffer, y5.segments, null, e6.transform.zoom, null, null, y5.collisionVertexBuffer);
}
}
if (s7 && h7.length) {
var T5 = e6.useProgram("collisionCircle"), E4 = new t5.StructArrayLayout2f1f2i16();
E4.resize(4 * p5), E4._trim();
for (var I5 = 0, P5 = 0, S5 = h7; P5 < S5.length; P5 += 1) {
for (var C5 = S5[P5], z5 = 0; z5 < C5.circleArray.length / 4; z5++) {
var D5 = 4 * z5, A5 = C5.circleArray[D5 + 0], M5 = C5.circleArray[D5 + 1], L5 = C5.circleArray[D5 + 2], R4 = C5.circleArray[D5 + 3];
E4.emplace(I5++, A5, M5, L5, R4, 0), E4.emplace(I5++, A5, M5, L5, R4, 1), E4.emplace(I5++, A5, M5, L5, R4, 2), E4.emplace(I5++, A5, M5, L5, R4, 3);
}
}
(!ji2 || ji2.length < 2 * p5) && (ji2 = function(e7) {
var i7 = 2 * e7, o7 = new t5.StructArrayLayout3ui6();
o7.resize(i7), o7._trim();
for (var r8 = 0; r8 < i7; r8++) {
var a7 = 6 * r8;
o7.uint16[a7 + 0] = 4 * r8 + 0, o7.uint16[a7 + 1] = 4 * r8 + 1, o7.uint16[a7 + 2] = 4 * r8 + 2, o7.uint16[a7 + 3] = 4 * r8 + 2, o7.uint16[a7 + 4] = 4 * r8 + 3, o7.uint16[a7 + 5] = 4 * r8 + 0;
}
return o7;
}(p5));
for (var k5 = l8.createIndexBuffer(ji2, true), B4 = l8.createVertexBuffer(E4, t5.collisionCircleLayout.members, true), O5 = 0, F4 = h7; O5 < F4.length; O5 += 1) {
var U4 = F4[O5], N5 = Ai2(U4.transform, U4.invTransform, e6.transform);
T5.draw(l8, c5.TRIANGLES, It2.disabled, Pt2.disabled, e6.colorModeForRenderPass(), Ct2.disabled, N5, o6.id, B4, k5, t5.SegmentVector.simpleSegment(0, 2 * U4.circleOffset, U4.circleArray.length, U4.circleArray.length / 2), null, e6.transform.zoom, null, null, null);
}
B4.destroy(), k5.destroy();
}
}
var Ji2 = t5.identity(new Float32Array(16));
function Qi2(e6, i6, o6, r7, a6, n8) {
var s7 = t5.getAnchorAlignment(e6), l8 = -(s7.horizontalAlign - 0.5) * i6, c5 = -(s7.verticalAlign - 0.5) * o6, u5 = t5.evaluateVariableOffset(e6, r7);
return new t5.Point((l8 / a6 + u5[0]) * n8, (c5 / a6 + u5[1]) * n8);
}
function $i2(e6, i6, o6, r7, a6, n8, s7, l8, c5, u5, h7) {
var p5 = e6.text.placedSymbolArray, d5 = e6.text.dynamicLayoutVertexArray, _4 = e6.icon.dynamicLayoutVertexArray, f5 = {};
d5.clear();
for (var m5 = 0; m5 < p5.length; m5++) {
var g5 = p5.get(m5), v5 = g5.hidden || !g5.crossTileID || e6.allowVerticalPlacement && !g5.placedOrientation ? null : r7[g5.crossTileID];
if (v5) {
var y5 = new t5.Point(g5.anchorX, g5.anchorY), x5 = $t2(y5, o6 ? l8 : s7), b5 = te2(n8.cameraToCenterDistance, x5.signedDistanceFromCamera), w5 = a6.evaluateSizeForFeature(e6.textSizeData, u5, g5) * b5 / t5.ONE_EM;
o6 && (w5 *= e6.tilePixelRatio / c5);
for (var T5 = Qi2(v5.anchor, v5.width, v5.height, v5.textOffset, v5.textBoxScale, w5), E4 = o6 ? $t2(y5.add(T5), s7).point : x5.point.add(i6 ? T5.rotate(-n8.angle) : T5), I5 = e6.allowVerticalPlacement && g5.placedOrientation === t5.WritingMode.vertical ? Math.PI / 2 : 0, P5 = 0; P5 < g5.numGlyphs; P5++) {
t5.addDynamicAttributes(d5, E4, I5);
}
h7 && g5.associatedIconIndex >= 0 && (f5[g5.associatedIconIndex] = { shiftedAnchor: E4, angle: I5 });
} else {
ce2(g5.numGlyphs, d5);
}
}
if (h7) {
_4.clear();
for (var S5 = e6.icon.placedSymbolArray, C5 = 0; C5 < S5.length; C5++) {
var z5 = S5.get(C5);
if (z5.hidden) {
ce2(z5.numGlyphs, _4);
} else {
var D5 = f5[C5];
if (D5) {
for (var A5 = 0; A5 < z5.numGlyphs; A5++) {
t5.addDynamicAttributes(_4, D5.shiftedAnchor, D5.angle);
}
} else {
ce2(z5.numGlyphs, _4);
}
}
}
e6.icon.dynamicLayoutVertexBuffer.updateData(_4);
}
e6.text.dynamicLayoutVertexBuffer.updateData(d5);
}
function to(t6, e6, i6) {
return i6.iconsInText && e6 ? "symbolTextAndIcon" : t6 ? "symbolSDF" : "symbolIcon";
}
function eo(e6, i6, o6, r7, a6, n8, s7, l8, c5, u5, h7, p5) {
for (var d5 = e6.context, _4 = d5.gl, f5 = e6.transform, m5 = "map" === l8, g5 = "map" === c5, v5 = m5 && "point" !== o6.layout.get("symbol-placement"), y5 = m5 && !g5 && !v5, x5 = void 0 !== o6.layout.get("symbol-sort-key").constantOr(1), b5 = false, w5 = e6.depthModeForSublayer(0, It2.ReadOnly), T5 = o6.layout.get("text-variable-anchor"), E4 = [], I5 = 0, P5 = r7; I5 < P5.length; I5 += 1) {
var S5 = P5[I5], C5 = i6.getTile(S5), z5 = C5.getBucket(o6);
if (z5) {
var D5 = a6 ? z5.text : z5.icon;
if (D5 && D5.segments.get().length) {
var A5 = D5.programConfigurations.get(o6.id), M5 = a6 || z5.sdfIcons, L5 = a6 ? z5.textSizeData : z5.iconSizeData, R4 = g5 || 0 !== f5.pitch, k5 = e6.useProgram(to(M5, a6, z5), A5), B4 = t5.evaluateSizeForZoom(L5, f5.zoom), O5 = void 0, F4 = [0, 0], U4 = void 0, N5 = void 0, Z3 = null, q5 = void 0;
if (a6) {
U4 = C5.glyphAtlasTexture, N5 = _4.LINEAR, O5 = C5.glyphAtlasTexture.size, z5.iconsInText && (F4 = C5.imageAtlasTexture.size, Z3 = C5.imageAtlasTexture, q5 = R4 || e6.options.rotating || e6.options.zooming || "composite" === L5.kind || "camera" === L5.kind ? _4.LINEAR : _4.NEAREST);
} else {
var j5 = 1 !== o6.layout.get("icon-size").constantOr(0) || z5.iconsNeedLinear;
U4 = C5.imageAtlasTexture, N5 = M5 || e6.options.rotating || e6.options.zooming || j5 || R4 ? _4.LINEAR : _4.NEAREST, O5 = C5.imageAtlasTexture.size;
}
var V4 = pe2(C5, 1, e6.transform.zoom), G4 = Jt2(S5.posMatrix, g5, m5, e6.transform, V4), W4 = Qt2(S5.posMatrix, g5, m5, e6.transform, V4), X4 = T5 && z5.hasTextData(), H5 = "none" !== o6.layout.get("icon-text-fit") && X4 && z5.hasIconData();
v5 && ie4(z5, S5.posMatrix, e6, a6, G4, W4, g5, u5);
var K4 = e6.translatePosMatrix(S5.posMatrix, C5, n8, s7), Y3 = v5 || a6 && T5 || H5 ? Ji2 : G4, J4 = e6.translatePosMatrix(W4, C5, n8, s7, true), Q3 = M5 && 0 !== o6.paint.get(a6 ? "text-halo-width" : "icon-halo-width").constantOr(1), $4 = { program: k5, buffers: D5, uniformValues: M5 ? z5.iconsInText ? Wi2(L5.kind, B4, y5, g5, e6, K4, Y3, J4, O5, F4) : Gi2(L5.kind, B4, y5, g5, e6, K4, Y3, J4, a6, O5, true) : Vi2(L5.kind, B4, y5, g5, e6, K4, Y3, J4, a6, O5), atlasTexture: U4, atlasTextureIcon: Z3, atlasInterpolation: N5, atlasInterpolationIcon: q5, isSDF: M5, hasHalo: Q3 };
if (x5 && z5.canOverlap) {
b5 = true;
for (var tt4 = 0, et3 = D5.segments.get(); tt4 < et3.length; tt4 += 1) {
var it3 = et3[tt4];
E4.push({ segments: new t5.SegmentVector([it3]), sortKey: it3.sortKey, state: $4 });
}
} else {
E4.push({ segments: D5.segments, sortKey: 0, state: $4 });
}
}
}
}
b5 && E4.sort(function(t6, e7) {
return t6.sortKey - e7.sortKey;
});
for (var ot3 = 0, rt3 = E4; ot3 < rt3.length; ot3 += 1) {
var at3 = rt3[ot3], nt3 = at3.state;
if (d5.activeTexture.set(_4.TEXTURE0), nt3.atlasTexture.bind(nt3.atlasInterpolation, _4.CLAMP_TO_EDGE), nt3.atlasTextureIcon && (d5.activeTexture.set(_4.TEXTURE1), nt3.atlasTextureIcon && nt3.atlasTextureIcon.bind(nt3.atlasInterpolationIcon, _4.CLAMP_TO_EDGE)), nt3.isSDF) {
var st3 = nt3.uniformValues;
nt3.hasHalo && (st3.u_is_halo = 1, io(nt3.buffers, at3.segments, o6, e6, nt3.program, w5, h7, p5, st3)), st3.u_is_halo = 0;
}
io(nt3.buffers, at3.segments, o6, e6, nt3.program, w5, h7, p5, nt3.uniformValues);
}
}
function io(t6, e6, i6, o6, r7, a6, n8, s7, l8) {
var c5 = o6.context;
r7.draw(c5, c5.gl.TRIANGLES, a6, n8, s7, Ct2.disabled, l8, i6.id, t6.layoutVertexBuffer, t6.indexBuffer, e6, i6.paint, o6.transform.zoom, t6.programConfigurations.get(i6.id), t6.dynamicLayoutVertexBuffer, t6.opacityVertexBuffer);
}
function oo(t6, e6, i6, o6, r7, a6, n8) {
var s7, l8, c5, u5, h7, p5 = t6.context.gl, d5 = i6.paint.get("fill-pattern"), _4 = d5 && d5.constantOr(1), f5 = i6.getCrossfadeParameters();
n8 ? (l8 = _4 && !i6.getPaintProperty("fill-outline-color") ? "fillOutlinePattern" : "fillOutline", s7 = p5.LINES) : (l8 = _4 ? "fillPattern" : "fill", s7 = p5.TRIANGLES);
for (var m5 = 0, g5 = o6; m5 < g5.length; m5 += 1) {
var v5 = g5[m5], y5 = e6.getTile(v5);
if (!_4 || y5.patternsLoaded()) {
var x5 = y5.getBucket(i6);
if (x5) {
var b5 = x5.programConfigurations.get(i6.id), w5 = t6.useProgram(l8, b5);
_4 && (t6.context.activeTexture.set(p5.TEXTURE0), y5.imageAtlasTexture.bind(p5.LINEAR, p5.CLAMP_TO_EDGE), b5.updatePaintBuffers(f5));
var T5 = d5.constantOr(null);
if (T5 && y5.imageAtlas) {
var E4 = y5.imageAtlas, I5 = E4.patternPositions[T5.to.toString()], P5 = E4.patternPositions[T5.from.toString()];
I5 && P5 && b5.setConstantPatternPositions(I5, P5);
}
var S5 = t6.translatePosMatrix(v5.posMatrix, y5, i6.paint.get("fill-translate"), i6.paint.get("fill-translate-anchor"));
if (n8) {
u5 = x5.indexBuffer2, h7 = x5.segments2;
var C5 = [p5.drawingBufferWidth, p5.drawingBufferHeight];
c5 = "fillOutlinePattern" === l8 && _4 ? Ci2(S5, t6, f5, y5, C5) : Si2(S5, C5);
} else {
u5 = x5.indexBuffer, h7 = x5.segments, c5 = _4 ? Pi2(S5, t6, f5, y5) : Ii2(S5);
}
w5.draw(t6.context, s7, r7, t6.stencilModeForClipping(v5), a6, Ct2.disabled, c5, i6.id, x5.layoutVertexBuffer, u5, h7, i6.paint, t6.transform.zoom, b5);
}
}
}
}
function ro(t6, e6, i6, o6, r7, a6, n8) {
for (var s7 = t6.context, l8 = s7.gl, c5 = i6.paint.get("fill-extrusion-pattern"), u5 = c5.constantOr(1), h7 = i6.getCrossfadeParameters(), p5 = i6.paint.get("fill-extrusion-opacity"), d5 = 0, _4 = o6; d5 < _4.length; d5 += 1) {
var f5 = _4[d5], m5 = e6.getTile(f5), g5 = m5.getBucket(i6);
if (g5) {
var v5 = g5.programConfigurations.get(i6.id), y5 = t6.useProgram(u5 ? "fillExtrusionPattern" : "fillExtrusion", v5);
u5 && (t6.context.activeTexture.set(l8.TEXTURE0), m5.imageAtlasTexture.bind(l8.LINEAR, l8.CLAMP_TO_EDGE), v5.updatePaintBuffers(h7));
var x5 = c5.constantOr(null);
if (x5 && m5.imageAtlas) {
var b5 = m5.imageAtlas, w5 = b5.patternPositions[x5.to.toString()], T5 = b5.patternPositions[x5.from.toString()];
w5 && T5 && v5.setConstantPatternPositions(w5, T5);
}
var E4 = t6.translatePosMatrix(f5.posMatrix, m5, i6.paint.get("fill-extrusion-translate"), i6.paint.get("fill-extrusion-translate-anchor")), I5 = i6.paint.get("fill-extrusion-vertical-gradient"), P5 = u5 ? Ei2(E4, t6, I5, p5, f5, h7, m5) : Ti2(E4, t6, I5, p5);
y5.draw(s7, s7.gl.TRIANGLES, r7, a6, n8, Ct2.backCCW, P5, i6.id, g5.layoutVertexBuffer, g5.indexBuffer, g5.segments, i6.paint, t6.transform.zoom, v5);
}
}
}
function ao(e6, i6, o6, r7, a6, n8) {
var s7 = e6.context, l8 = s7.gl, c5 = i6.fbo;
if (c5) {
var u5 = e6.useProgram("hillshade");
s7.activeTexture.set(l8.TEXTURE0), l8.bindTexture(l8.TEXTURE_2D, c5.colorAttachment.get());
var h7 = function(e7, i7, o7) {
var r8 = o7.paint.get("hillshade-shadow-color"), a7 = o7.paint.get("hillshade-highlight-color"), n9 = o7.paint.get("hillshade-accent-color"), s8 = o7.paint.get("hillshade-illumination-direction") * (Math.PI / 180);
"viewport" === o7.paint.get("hillshade-illumination-anchor") && (s8 -= e7.transform.angle);
var l9, c6, u6, h8 = !e7.options.moving;
return { u_matrix: e7.transform.calculatePosMatrix(i7.tileID.toUnwrapped(), h8), u_image: 0, u_latrange: (l9 = i7.tileID, c6 = Math.pow(2, l9.canonical.z), u6 = l9.canonical.y, [new t5.MercatorCoordinate(0, u6 / c6).toLngLat().lat, new t5.MercatorCoordinate(0, (u6 + 1) / c6).toLngLat().lat]), u_light: [o7.paint.get("hillshade-exaggeration"), s8], u_shadow: r8, u_highlight: a7, u_accent: n9 };
}(e6, i6, o6);
u5.draw(s7, l8.TRIANGLES, r7, a6, n8, Ct2.disabled, h7, o6.id, e6.rasterBoundsBuffer, e6.quadTriangleIndexBuffer, e6.rasterBoundsSegments);
}
}
function no(e6, i6, o6, r7, a6, n8) {
var s7 = e6.context, l8 = s7.gl, c5 = i6.dem;
if (c5 && c5.data) {
var u5 = c5.dim, h7 = c5.stride, p5 = c5.getPixels();
if (s7.activeTexture.set(l8.TEXTURE1), s7.pixelStoreUnpackPremultiplyAlpha.set(false), i6.demTexture = i6.demTexture || e6.getTileTexture(h7), i6.demTexture) {
var d5 = i6.demTexture;
d5.update(p5, { premultiply: false }), d5.bind(l8.NEAREST, l8.CLAMP_TO_EDGE);
} else {
i6.demTexture = new t5.Texture(s7, p5, l8.RGBA, { premultiply: false }), i6.demTexture.bind(l8.NEAREST, l8.CLAMP_TO_EDGE);
}
s7.activeTexture.set(l8.TEXTURE0);
var _4 = i6.fbo;
if (!_4) {
var f5 = new t5.Texture(s7, { width: u5, height: u5, data: null }, l8.RGBA);
f5.bind(l8.LINEAR, l8.CLAMP_TO_EDGE), (_4 = i6.fbo = s7.createFramebuffer(u5, u5, true)).colorAttachment.set(f5.texture);
}
s7.bindFramebuffer.set(_4.framebuffer), s7.viewport.set([0, 0, u5, u5]), e6.useProgram("hillshadePrepare").draw(s7, l8.TRIANGLES, r7, a6, n8, Ct2.disabled, function(e7, i7) {
var o7 = i7.stride, r8 = t5.create();
return t5.ortho(r8, 0, t5.EXTENT, -t5.EXTENT, 0, 0, 1), t5.translate(r8, r8, [0, -t5.EXTENT, 0]), { u_matrix: r8, u_image: 1, u_dimension: [o7, o7], u_zoom: e7.overscaledZ, u_unpack: i7.getUnpackVector() };
}(i6.tileID, c5), o6.id, e6.rasterBoundsBuffer, e6.quadTriangleIndexBuffer, e6.rasterBoundsSegments), i6.needsHillshadePrepare = false;
}
}
function so(e6, i6, o6, r7, a6) {
var n8 = r7.paint.get("raster-fade-duration");
if (n8 > 0) {
var s7 = t5.browser.now(), l8 = (s7 - e6.timeAdded) / n8, c5 = i6 ? (s7 - i6.timeAdded) / n8 : -1, u5 = o6.getSource(), h7 = a6.coveringZoomLevel({ tileSize: u5.tileSize, roundZoom: u5.roundZoom }), p5 = !i6 || Math.abs(i6.tileID.overscaledZ - h7) > Math.abs(e6.tileID.overscaledZ - h7), d5 = p5 && e6.refreshedUponExpiration ? 1 : t5.clamp(p5 ? l8 : 1 - c5, 0, 1);
return e6.refreshedUponExpiration && l8 >= 1 && (e6.refreshedUponExpiration = false), i6 ? { opacity: 1, mix: 1 - d5 } : { opacity: d5, mix: 0 };
}
return { opacity: 1, mix: 0 };
}
var lo = new t5.Color(1, 0, 0, 1), co = new t5.Color(0, 1, 0, 1), uo = new t5.Color(0, 0, 1, 1), ho = new t5.Color(1, 0, 1, 1), po = new t5.Color(0, 1, 1, 1);
function _o(t6, e6, i6, o6) {
mo(t6, 0, e6 + i6 / 2, t6.transform.width, i6, o6);
}
function fo(t6, e6, i6, o6) {
mo(t6, e6 - i6 / 2, 0, i6, t6.transform.height, o6);
}
function mo(e6, i6, o6, r7, a6, n8) {
var s7 = e6.context, l8 = s7.gl;
l8.enable(l8.SCISSOR_TEST), l8.scissor(i6 * t5.browser.devicePixelRatio, o6 * t5.browser.devicePixelRatio, r7 * t5.browser.devicePixelRatio, a6 * t5.browser.devicePixelRatio), s7.clear({ color: n8 }), l8.disable(l8.SCISSOR_TEST);
}
function go(e6, i6, o6) {
var r7 = e6.context, a6 = r7.gl, n8 = o6.posMatrix, s7 = e6.useProgram("debug"), l8 = It2.disabled, c5 = Pt2.disabled, u5 = e6.colorModeForRenderPass();
r7.activeTexture.set(a6.TEXTURE0), e6.emptyTexture.bind(a6.LINEAR, a6.CLAMP_TO_EDGE), s7.draw(r7, a6.LINE_STRIP, l8, c5, u5, Ct2.disabled, Mi2(n8, t5.Color.red), "$debug", e6.debugBuffer, e6.tileBorderIndexBuffer, e6.debugSegments);
var h7 = i6.getTileByID(o6.key).latestRawTileData, p5 = Math.floor((h7 && h7.byteLength || 0) / 1024), d5 = i6.getTile(o6).tileSize, _4 = 512 / Math.min(d5, 512) * (o6.overscaledZ / e6.transform.zoom) * 0.5, f5 = o6.canonical.toString();
o6.overscaledZ !== o6.canonical.z && (f5 += " => " + o6.overscaledZ), function(t6, e7) {
t6.initDebugOverlayCanvas();
var i7 = t6.debugOverlayCanvas, o7 = t6.context.gl, r8 = t6.debugOverlayCanvas.getContext("2d");
r8.clearRect(0, 0, i7.width, i7.height), r8.shadowColor = "white", r8.shadowBlur = 2, r8.lineWidth = 1.5, r8.strokeStyle = "white", r8.textBaseline = "top", r8.font = "bold 36px Open Sans, sans-serif", r8.fillText(e7, 5, 5), r8.strokeText(e7, 5, 5), t6.debugOverlayTexture.update(i7), t6.debugOverlayTexture.bind(o7.LINEAR, o7.CLAMP_TO_EDGE);
}(e6, f5 + " " + p5 + "kb"), s7.draw(r7, a6.TRIANGLES, l8, c5, St2.alphaBlended, Ct2.disabled, Mi2(n8, t5.Color.transparent, _4), "$debug", e6.debugBuffer, e6.quadTriangleIndexBuffer, e6.debugSegments);
}
var vo = { symbol: function(e6, i6, o6, r7, a6) {
if ("translucent" === e6.renderPass) {
var n8 = Pt2.disabled, s7 = e6.colorModeForRenderPass();
o6.layout.get("text-variable-anchor") && function(e7, i7, o7, r8, a7, n9, s8) {
for (var l8 = i7.transform, c5 = "map" === a7, u5 = "map" === n9, h7 = 0, p5 = e7; h7 < p5.length; h7 += 1) {
var d5 = p5[h7], _4 = r8.getTile(d5), f5 = _4.getBucket(o7);
if (f5 && f5.text && f5.text.segments.get().length) {
var m5 = t5.evaluateSizeForZoom(f5.textSizeData, l8.zoom), g5 = pe2(_4, 1, i7.transform.zoom), v5 = Jt2(d5.posMatrix, u5, c5, i7.transform, g5), y5 = "none" !== o7.layout.get("icon-text-fit") && f5.hasIconData();
if (m5) {
var x5 = Math.pow(2, l8.zoom - _4.tileID.overscaledZ);
$i2(f5, c5, u5, s8, t5.symbolSize, l8, v5, d5.posMatrix, x5, m5, y5);
}
}
}
}(r7, e6, o6, i6, o6.layout.get("text-rotation-alignment"), o6.layout.get("text-pitch-alignment"), a6), 0 !== o6.paint.get("icon-opacity").constantOr(1) && eo(e6, i6, o6, r7, false, o6.paint.get("icon-translate"), o6.paint.get("icon-translate-anchor"), o6.layout.get("icon-rotation-alignment"), o6.layout.get("icon-pitch-alignment"), o6.layout.get("icon-keep-upright"), n8, s7), 0 !== o6.paint.get("text-opacity").constantOr(1) && eo(e6, i6, o6, r7, true, o6.paint.get("text-translate"), o6.paint.get("text-translate-anchor"), o6.layout.get("text-rotation-alignment"), o6.layout.get("text-pitch-alignment"), o6.layout.get("text-keep-upright"), n8, s7), i6.map.showCollisionBoxes && (Yi2(e6, i6, o6, r7, o6.paint.get("text-translate"), o6.paint.get("text-translate-anchor"), true), Yi2(e6, i6, o6, r7, o6.paint.get("icon-translate"), o6.paint.get("icon-translate-anchor"), false));
}
}, circle: function(e6, i6, o6, r7) {
if ("translucent" === e6.renderPass) {
var a6 = o6.paint.get("circle-opacity"), n8 = o6.paint.get("circle-stroke-width"), s7 = o6.paint.get("circle-stroke-opacity"), l8 = void 0 !== o6.layout.get("circle-sort-key").constantOr(1);
if (0 !== a6.constantOr(1) || 0 !== n8.constantOr(1) && 0 !== s7.constantOr(1)) {
for (var c5 = e6.context, u5 = c5.gl, h7 = e6.depthModeForSublayer(0, It2.ReadOnly), p5 = Pt2.disabled, d5 = e6.colorModeForRenderPass(), _4 = [], f5 = 0; f5 < r7.length; f5++) {
var m5 = r7[f5], g5 = i6.getTile(m5), v5 = g5.getBucket(o6);
if (v5) {
var y5 = v5.programConfigurations.get(o6.id), x5 = { programConfiguration: y5, program: e6.useProgram("circle", y5), layoutVertexBuffer: v5.layoutVertexBuffer, indexBuffer: v5.indexBuffer, uniformValues: zi2(e6, m5, g5, o6) };
if (l8) {
for (var b5 = 0, w5 = v5.segments.get(); b5 < w5.length; b5 += 1) {
var T5 = w5[b5];
_4.push({ segments: new t5.SegmentVector([T5]), sortKey: T5.sortKey, state: x5 });
}
} else {
_4.push({ segments: v5.segments, sortKey: 0, state: x5 });
}
}
}
l8 && _4.sort(function(t6, e7) {
return t6.sortKey - e7.sortKey;
});
for (var E4 = 0, I5 = _4; E4 < I5.length; E4 += 1) {
var P5 = I5[E4], S5 = P5.state;
S5.program.draw(c5, u5.TRIANGLES, h7, p5, d5, Ct2.disabled, S5.uniformValues, o6.id, S5.layoutVertexBuffer, S5.indexBuffer, P5.segments, o6.paint, e6.transform.zoom, S5.programConfiguration);
}
}
}
}, heatmap: function(e6, i6, o6, r7) {
if (0 !== o6.paint.get("heatmap-opacity")) {
if ("offscreen" === e6.renderPass) {
var a6 = e6.context, n8 = a6.gl, s7 = Pt2.disabled, l8 = new St2([n8.ONE, n8.ONE], t5.Color.transparent, [true, true, true, true]);
!function(t6, e7, i7) {
var o7 = t6.gl;
t6.activeTexture.set(o7.TEXTURE1), t6.viewport.set([0, 0, e7.width / 4, e7.height / 4]);
var r8 = i7.heatmapFbo;
if (r8) {
o7.bindTexture(o7.TEXTURE_2D, r8.colorAttachment.get()), t6.bindFramebuffer.set(r8.framebuffer);
} else {
var a7 = o7.createTexture();
o7.bindTexture(o7.TEXTURE_2D, a7), o7.texParameteri(o7.TEXTURE_2D, o7.TEXTURE_WRAP_S, o7.CLAMP_TO_EDGE), o7.texParameteri(o7.TEXTURE_2D, o7.TEXTURE_WRAP_T, o7.CLAMP_TO_EDGE), o7.texParameteri(o7.TEXTURE_2D, o7.TEXTURE_MIN_FILTER, o7.LINEAR), o7.texParameteri(o7.TEXTURE_2D, o7.TEXTURE_MAG_FILTER, o7.LINEAR), r8 = i7.heatmapFbo = t6.createFramebuffer(e7.width / 4, e7.height / 4, false), function(t7, e8, i8, o8) {
var r9 = t7.gl;
r9.texImage2D(r9.TEXTURE_2D, 0, r9.RGBA, e8.width / 4, e8.height / 4, 0, r9.RGBA, t7.extRenderToTextureHalfFloat ? t7.extTextureHalfFloat.HALF_FLOAT_OES : r9.UNSIGNED_BYTE, null), o8.colorAttachment.set(i8);
}(t6, e7, a7, r8);
}
}(a6, e6, o6), a6.clear({ color: t5.Color.transparent });
for (var c5 = 0; c5 < r7.length; c5++) {
var u5 = r7[c5];
if (!i6.hasRenderableParent(u5)) {
var h7 = i6.getTile(u5), p5 = h7.getBucket(o6);
if (p5) {
var d5 = p5.programConfigurations.get(o6.id);
e6.useProgram("heatmap", d5).draw(a6, n8.TRIANGLES, It2.disabled, s7, l8, Ct2.disabled, Ri2(u5.posMatrix, h7, e6.transform.zoom, o6.paint.get("heatmap-intensity")), o6.id, p5.layoutVertexBuffer, p5.indexBuffer, p5.segments, o6.paint, e6.transform.zoom, d5);
}
}
}
a6.viewport.set([0, 0, e6.width, e6.height]);
} else {
"translucent" === e6.renderPass && (e6.context.setColorMode(e6.colorModeForRenderPass()), function(e7, i7) {
var o7 = e7.context, r8 = o7.gl, a7 = i7.heatmapFbo;
if (a7) {
o7.activeTexture.set(r8.TEXTURE0), r8.bindTexture(r8.TEXTURE_2D, a7.colorAttachment.get()), o7.activeTexture.set(r8.TEXTURE1);
var n9 = i7.colorRampTexture;
n9 || (n9 = i7.colorRampTexture = new t5.Texture(o7, i7.colorRamp, r8.RGBA)), n9.bind(r8.LINEAR, r8.CLAMP_TO_EDGE), e7.useProgram("heatmapTexture").draw(o7, r8.TRIANGLES, It2.disabled, Pt2.disabled, e7.colorModeForRenderPass(), Ct2.disabled, function(e8, i8, o8, r9) {
var a8 = t5.create();
t5.ortho(a8, 0, e8.width, e8.height, 0, 0, 1);
var n10 = e8.context.gl;
return { u_matrix: a8, u_world: [n10.drawingBufferWidth, n10.drawingBufferHeight], u_image: 0, u_color_ramp: 1, u_opacity: i8.paint.get("heatmap-opacity") };
}(e7, i7), i7.id, e7.viewportBuffer, e7.quadTriangleIndexBuffer, e7.viewportSegments, i7.paint, e7.transform.zoom);
}
}(e6, o6));
}
}
}, line: function(e6, i6, o6, r7) {
if ("translucent" === e6.renderPass) {
var a6 = o6.paint.get("line-opacity"), n8 = o6.paint.get("line-width");
if (0 !== a6.constantOr(1) && 0 !== n8.constantOr(1)) {
for (var s7 = e6.depthModeForSublayer(0, It2.ReadOnly), l8 = e6.colorModeForRenderPass(), c5 = o6.paint.get("line-dasharray"), u5 = o6.paint.get("line-pattern"), h7 = u5.constantOr(1), p5 = o6.paint.get("line-gradient"), d5 = o6.getCrossfadeParameters(), _4 = h7 ? "linePattern" : c5 ? "lineSDF" : p5 ? "lineGradient" : "line", f5 = e6.context, m5 = f5.gl, g5 = true, v5 = 0, y5 = r7; v5 < y5.length; v5 += 1) {
var x5 = y5[v5], b5 = i6.getTile(x5);
if (!h7 || b5.patternsLoaded()) {
var w5 = b5.getBucket(o6);
if (w5) {
var T5 = w5.programConfigurations.get(o6.id), E4 = e6.context.program.get(), I5 = e6.useProgram(_4, T5), P5 = g5 || I5.program !== E4, S5 = u5.constantOr(null);
if (S5 && b5.imageAtlas) {
var C5 = b5.imageAtlas, z5 = C5.patternPositions[S5.to.toString()], D5 = C5.patternPositions[S5.from.toString()];
z5 && D5 && T5.setConstantPatternPositions(z5, D5);
}
var A5 = h7 ? Oi2(e6, b5, o6, d5) : c5 ? Fi2(e6, b5, o6, c5, d5) : p5 ? Bi2(e6, b5, o6, w5.lineClipsArray.length) : ki2(e6, b5, o6);
if (h7) {
f5.activeTexture.set(m5.TEXTURE0), b5.imageAtlasTexture.bind(m5.LINEAR, m5.CLAMP_TO_EDGE), T5.updatePaintBuffers(d5);
} else if (c5 && (P5 || e6.lineAtlas.dirty)) {
f5.activeTexture.set(m5.TEXTURE0), e6.lineAtlas.bind(f5);
} else if (p5) {
var M5 = w5.gradients[o6.id], L5 = M5.texture;
if (o6.gradientVersion !== M5.version) {
var R4 = 256;
if (o6.stepInterpolant) {
var k5 = i6.getSource().maxzoom, B4 = x5.canonical.z === k5 ? Math.ceil(1 << e6.transform.maxZoom - x5.canonical.z) : 1;
R4 = t5.clamp(t5.nextPowerOfTwo(w5.maxLineLength / t5.EXTENT * 1024 * B4), 256, f5.maxTextureSize);
}
M5.gradient = t5.renderColorRamp({ expression: o6.gradientExpression(), evaluationKey: "lineProgress", resolution: R4, image: M5.gradient || void 0, clips: w5.lineClipsArray }), M5.texture ? M5.texture.update(M5.gradient) : M5.texture = new t5.Texture(f5, M5.gradient, m5.RGBA), M5.version = o6.gradientVersion, L5 = M5.texture;
}
f5.activeTexture.set(m5.TEXTURE0), L5.bind(o6.stepInterpolant ? m5.NEAREST : m5.LINEAR, m5.CLAMP_TO_EDGE);
}
I5.draw(f5, m5.TRIANGLES, s7, e6.stencilModeForClipping(x5), l8, Ct2.disabled, A5, o6.id, w5.layoutVertexBuffer, w5.indexBuffer, w5.segments, o6.paint, e6.transform.zoom, T5, w5.layoutVertexBuffer2), g5 = false;
}
}
}
}
}
}, fill: function(e6, i6, o6, r7) {
var a6 = o6.paint.get("fill-color"), n8 = o6.paint.get("fill-opacity");
if (0 !== n8.constantOr(1)) {
var s7 = e6.colorModeForRenderPass(), l8 = o6.paint.get("fill-pattern"), c5 = e6.opaquePassEnabledForLayer() && !l8.constantOr(1) && 1 === a6.constantOr(t5.Color.transparent).a && 1 === n8.constantOr(0) ? "opaque" : "translucent";
if (e6.renderPass === c5) {
var u5 = e6.depthModeForSublayer(1, "opaque" === e6.renderPass ? It2.ReadWrite : It2.ReadOnly);
oo(e6, i6, o6, r7, u5, s7, false);
}
if ("translucent" === e6.renderPass && o6.paint.get("fill-antialias")) {
var h7 = e6.depthModeForSublayer(o6.getPaintProperty("fill-outline-color") ? 2 : 0, It2.ReadOnly);
oo(e6, i6, o6, r7, h7, s7, true);
}
}
}, "fill-extrusion": function(t6, e6, i6, o6) {
var r7 = i6.paint.get("fill-extrusion-opacity");
if (0 !== r7 && "translucent" === t6.renderPass) {
var a6 = new It2(t6.context.gl.LEQUAL, It2.ReadWrite, t6.depthRangeFor3D);
if (1 !== r7 || i6.paint.get("fill-extrusion-pattern").constantOr(1)) {
ro(t6, e6, i6, o6, a6, Pt2.disabled, St2.disabled), ro(t6, e6, i6, o6, a6, t6.stencilModeFor3D(), t6.colorModeForRenderPass());
} else {
var n8 = t6.colorModeForRenderPass();
ro(t6, e6, i6, o6, a6, Pt2.disabled, n8);
}
}
}, hillshade: function(t6, e6, i6, o6) {
if ("offscreen" === t6.renderPass || "translucent" === t6.renderPass) {
for (var r7 = t6.context, a6 = t6.depthModeForSublayer(0, It2.ReadOnly), n8 = t6.colorModeForRenderPass(), s7 = "translucent" === t6.renderPass ? t6.stencilConfigForOverlap(o6) : [{}, o6], l8 = s7[0], c5 = 0, u5 = s7[1]; c5 < u5.length; c5 += 1) {
var h7 = u5[c5], p5 = e6.getTile(h7);
p5.needsHillshadePrepare && "offscreen" === t6.renderPass ? no(t6, p5, i6, a6, Pt2.disabled, n8) : "translucent" === t6.renderPass && ao(t6, p5, i6, a6, l8[h7.overscaledZ], n8);
}
r7.viewport.set([0, 0, t6.width, t6.height]);
}
}, raster: function(t6, e6, i6, o6) {
if ("translucent" === t6.renderPass && 0 !== i6.paint.get("raster-opacity") && o6.length) {
for (var r7 = t6.context, a6 = r7.gl, n8 = e6.getSource(), s7 = t6.useProgram("raster"), l8 = t6.colorModeForRenderPass(), c5 = n8 instanceof M4 ? [{}, o6] : t6.stencilConfigForOverlap(o6), u5 = c5[0], h7 = c5[1], p5 = h7[h7.length - 1].overscaledZ, d5 = !t6.options.moving, _4 = 0, f5 = h7; _4 < f5.length; _4 += 1) {
var m5 = f5[_4], g5 = t6.depthModeForSublayer(m5.overscaledZ - p5, 1 === i6.paint.get("raster-opacity") ? It2.ReadWrite : It2.ReadOnly, a6.LESS), v5 = e6.getTile(m5), y5 = t6.transform.calculatePosMatrix(m5.toUnwrapped(), d5);
v5.registerFadeDuration(i6.paint.get("raster-fade-duration"));
var x5 = e6.findLoadedParent(m5, 0), b5 = so(v5, x5, e6, i6, t6.transform), w5 = void 0, T5 = void 0, E4 = "nearest" === i6.paint.get("raster-resampling") ? a6.NEAREST : a6.LINEAR;
r7.activeTexture.set(a6.TEXTURE0), v5.texture.bind(E4, a6.CLAMP_TO_EDGE, a6.LINEAR_MIPMAP_NEAREST), r7.activeTexture.set(a6.TEXTURE1), x5 ? (x5.texture.bind(E4, a6.CLAMP_TO_EDGE, a6.LINEAR_MIPMAP_NEAREST), w5 = Math.pow(2, x5.tileID.overscaledZ - v5.tileID.overscaledZ), T5 = [v5.tileID.canonical.x * w5 % 1, v5.tileID.canonical.y * w5 % 1]) : v5.texture.bind(E4, a6.CLAMP_TO_EDGE, a6.LINEAR_MIPMAP_NEAREST);
var I5 = Zi2(y5, T5 || [0, 0], w5 || 1, b5, i6);
n8 instanceof M4 ? s7.draw(r7, a6.TRIANGLES, g5, Pt2.disabled, l8, Ct2.disabled, I5, i6.id, n8.boundsBuffer, t6.quadTriangleIndexBuffer, n8.boundsSegments) : s7.draw(r7, a6.TRIANGLES, g5, u5[m5.overscaledZ], l8, Ct2.disabled, I5, i6.id, t6.rasterBoundsBuffer, t6.quadTriangleIndexBuffer, t6.rasterBoundsSegments);
}
}
}, background: function(t6, e6, i6) {
var o6 = i6.paint.get("background-color"), r7 = i6.paint.get("background-opacity");
if (0 !== r7) {
var a6 = t6.context, n8 = a6.gl, s7 = t6.transform, l8 = s7.tileSize, c5 = i6.paint.get("background-pattern");
if (!t6.isPatternMissing(c5)) {
var u5 = !c5 && 1 === o6.a && 1 === r7 && t6.opaquePassEnabledForLayer() ? "opaque" : "translucent";
if (t6.renderPass === u5) {
var h7 = Pt2.disabled, p5 = t6.depthModeForSublayer(0, "opaque" === u5 ? It2.ReadWrite : It2.ReadOnly), d5 = t6.colorModeForRenderPass(), _4 = t6.useProgram(c5 ? "backgroundPattern" : "background"), f5 = s7.coveringTiles({ tileSize: l8 });
c5 && (a6.activeTexture.set(n8.TEXTURE0), t6.imageManager.bind(t6.context));
for (var m5 = i6.getCrossfadeParameters(), g5 = 0, v5 = f5; g5 < v5.length; g5 += 1) {
var y5 = v5[g5], x5 = t6.transform.calculatePosMatrix(y5.toUnwrapped()), b5 = c5 ? Hi2(x5, r7, t6, c5, { tileID: y5, tileSize: l8 }, m5) : Xi2(x5, r7, o6);
_4.draw(a6, n8.TRIANGLES, p5, h7, d5, Ct2.disabled, b5, i6.id, t6.tileExtentBuffer, t6.quadTriangleIndexBuffer, t6.tileExtentSegments);
}
}
}
}
}, debug: function(t6, e6, i6) {
for (var o6 = 0; o6 < i6.length; o6++) {
go(t6, e6, i6[o6]);
}
}, custom: function(t6, e6, i6) {
var o6 = t6.context, r7 = i6.implementation;
if ("offscreen" === t6.renderPass) {
var a6 = r7.prerender;
a6 && (t6.setCustomLayerDefaults(), o6.setColorMode(t6.colorModeForRenderPass()), a6.call(r7, o6.gl, t6.transform.customLayerMatrix()), o6.setDirty(), t6.setBaseState());
} else if ("translucent" === t6.renderPass) {
t6.setCustomLayerDefaults(), o6.setColorMode(t6.colorModeForRenderPass()), o6.setStencilMode(Pt2.disabled);
var n8 = "3d" === r7.renderingMode ? new It2(t6.context.gl.LEQUAL, It2.ReadWrite, t6.depthRangeFor3D) : t6.depthModeForSublayer(0, It2.ReadOnly);
o6.setDepthMode(n8), r7.render(o6.gl, t6.transform.customLayerMatrix()), o6.setDirty(), t6.setBaseState(), o6.bindFramebuffer.set(null);
}
} }, yo = function(t6, e6) {
this.context = new zt2(t6), this.transform = e6, this._tileTextures = {}, this.setup(), this.numSublayers = Dt2.maxUnderzooming + Dt2.maxOverzooming + 1, this.depthEpsilon = 1 / Math.pow(2, 16), this.crossTileSymbolIndex = new Fe2(), this.gpuTimers = {};
};
yo.prototype.resize = function(e6, i6) {
if (this.width = e6 * t5.browser.devicePixelRatio, this.height = i6 * t5.browser.devicePixelRatio, this.context.viewport.set([0, 0, this.width, this.height]), this.style) {
for (var o6 = 0, r7 = this.style._order; o6 < r7.length; o6 += 1) {
this.style._layers[r7[o6]].resize();
}
}
}, yo.prototype.setup = function() {
var e6 = this.context, i6 = new t5.StructArrayLayout2i4();
i6.emplaceBack(0, 0), i6.emplaceBack(t5.EXTENT, 0), i6.emplaceBack(0, t5.EXTENT), i6.emplaceBack(t5.EXTENT, t5.EXTENT), this.tileExtentBuffer = e6.createVertexBuffer(i6, Ve2.members), this.tileExtentSegments = t5.SegmentVector.simpleSegment(0, 0, 4, 2);
var o6 = new t5.StructArrayLayout2i4();
o6.emplaceBack(0, 0), o6.emplaceBack(t5.EXTENT, 0), o6.emplaceBack(0, t5.EXTENT), o6.emplaceBack(t5.EXTENT, t5.EXTENT), this.debugBuffer = e6.createVertexBuffer(o6, Ve2.members), this.debugSegments = t5.SegmentVector.simpleSegment(0, 0, 4, 5);
var r7 = new t5.StructArrayLayout4i8();
r7.emplaceBack(0, 0, 0, 0), r7.emplaceBack(t5.EXTENT, 0, t5.EXTENT, 0), r7.emplaceBack(0, t5.EXTENT, 0, t5.EXTENT), r7.emplaceBack(t5.EXTENT, t5.EXTENT, t5.EXTENT, t5.EXTENT), this.rasterBoundsBuffer = e6.createVertexBuffer(r7, A4.members), this.rasterBoundsSegments = t5.SegmentVector.simpleSegment(0, 0, 4, 2);
var a6 = new t5.StructArrayLayout2i4();
a6.emplaceBack(0, 0), a6.emplaceBack(1, 0), a6.emplaceBack(0, 1), a6.emplaceBack(1, 1), this.viewportBuffer = e6.createVertexBuffer(a6, Ve2.members), this.viewportSegments = t5.SegmentVector.simpleSegment(0, 0, 4, 2);
var n8 = new t5.StructArrayLayout1ui2();
n8.emplaceBack(0), n8.emplaceBack(1), n8.emplaceBack(3), n8.emplaceBack(2), n8.emplaceBack(0), this.tileBorderIndexBuffer = e6.createIndexBuffer(n8);
var s7 = new t5.StructArrayLayout3ui6();
s7.emplaceBack(0, 1, 2), s7.emplaceBack(2, 1, 3), this.quadTriangleIndexBuffer = e6.createIndexBuffer(s7), this.emptyTexture = new t5.Texture(e6, { width: 1, height: 1, data: new Uint8Array([0, 0, 0, 0]) }, e6.gl.RGBA);
var l8 = this.context.gl;
this.stencilClearMode = new Pt2({ func: l8.ALWAYS, mask: 0 }, 0, 255, l8.ZERO, l8.ZERO, l8.ZERO);
}, yo.prototype.clearStencil = function() {
var e6 = this.context, i6 = e6.gl;
this.nextStencilID = 1, this.currentStencilSource = void 0;
var o6 = t5.create();
t5.ortho(o6, 0, this.width, this.height, 0, 0, 1), t5.scale(o6, o6, [i6.drawingBufferWidth, i6.drawingBufferHeight, 0]), this.useProgram("clippingMask").draw(e6, i6.TRIANGLES, It2.disabled, this.stencilClearMode, St2.disabled, Ct2.disabled, Li2(o6), "$clipping", this.viewportBuffer, this.quadTriangleIndexBuffer, this.viewportSegments);
}, yo.prototype._renderTileClippingMasks = function(t6, e6) {
if (this.currentStencilSource !== t6.source && t6.isTileClipped() && e6 && e6.length) {
this.currentStencilSource = t6.source;
var i6 = this.context, o6 = i6.gl;
this.nextStencilID + e6.length > 256 && this.clearStencil(), i6.setColorMode(St2.disabled), i6.setDepthMode(It2.disabled);
var r7 = this.useProgram("clippingMask");
this._tileClippingMaskIDs = {};
for (var a6 = 0, n8 = e6; a6 < n8.length; a6 += 1) {
var s7 = n8[a6], l8 = this._tileClippingMaskIDs[s7.key] = this.nextStencilID++;
r7.draw(i6, o6.TRIANGLES, It2.disabled, new Pt2({ func: o6.ALWAYS, mask: 0 }, l8, 255, o6.KEEP, o6.KEEP, o6.REPLACE), St2.disabled, Ct2.disabled, Li2(s7.posMatrix), "$clipping", this.tileExtentBuffer, this.quadTriangleIndexBuffer, this.tileExtentSegments);
}
}
}, yo.prototype.stencilModeFor3D = function() {
this.currentStencilSource = void 0, this.nextStencilID + 1 > 256 && this.clearStencil();
var t6 = this.nextStencilID++, e6 = this.context.gl;
return new Pt2({ func: e6.NOTEQUAL, mask: 255 }, t6, 255, e6.KEEP, e6.KEEP, e6.REPLACE);
}, yo.prototype.stencilModeForClipping = function(t6) {
var e6 = this.context.gl;
return new Pt2({ func: e6.EQUAL, mask: 255 }, this._tileClippingMaskIDs[t6.key], 0, e6.KEEP, e6.KEEP, e6.REPLACE);
}, yo.prototype.stencilConfigForOverlap = function(t6) {
var e6, i6 = this.context.gl, o6 = t6.sort(function(t7, e7) {
return e7.overscaledZ - t7.overscaledZ;
}), r7 = o6[o6.length - 1].overscaledZ, a6 = o6[0].overscaledZ - r7 + 1;
if (a6 > 1) {
this.currentStencilSource = void 0, this.nextStencilID + a6 > 256 && this.clearStencil();
for (var n8 = {}, s7 = 0; s7 < a6; s7++) {
n8[s7 + r7] = new Pt2({ func: i6.GEQUAL, mask: 255 }, s7 + this.nextStencilID, 255, i6.KEEP, i6.KEEP, i6.REPLACE);
}
return this.nextStencilID += a6, [n8, o6];
}
return [(e6 = {}, e6[r7] = Pt2.disabled, e6), o6];
}, yo.prototype.colorModeForRenderPass = function() {
var e6 = this.context.gl;
return this._showOverdrawInspector ? new St2([e6.CONSTANT_COLOR, e6.ONE], new t5.Color(1 / 8, 1 / 8, 1 / 8, 0), [true, true, true, true]) : "opaque" === this.renderPass ? St2.unblended : St2.alphaBlended;
}, yo.prototype.depthModeForSublayer = function(t6, e6, i6) {
if (!this.opaquePassEnabledForLayer()) {
return It2.disabled;
}
var o6 = 1 - ((1 + this.currentLayer) * this.numSublayers + t6) * this.depthEpsilon;
return new It2(i6 || this.context.gl.LEQUAL, e6, [o6, o6]);
}, yo.prototype.opaquePassEnabledForLayer = function() {
return this.currentLayer < this.opaquePassCutoff;
}, yo.prototype.render = function(e6, i6) {
var o6 = this;
this.style = e6, this.options = i6, this.lineAtlas = e6.lineAtlas, this.imageManager = e6.imageManager, this.glyphManager = e6.glyphManager, this.symbolFadeChange = e6.placement.symbolFadeChange(t5.browser.now()), this.imageManager.beginFrame();
var r7 = this.style._order, a6 = this.style.sourceCaches;
for (var n8 in a6) {
var s7 = a6[n8];
s7.used && s7.prepare(this.context);
}
var l8, c5, u5 = {}, h7 = {}, p5 = {};
for (var d5 in a6) {
var _4 = a6[d5];
u5[d5] = _4.getVisibleCoordinates(), h7[d5] = u5[d5].slice().reverse(), p5[d5] = _4.getVisibleCoordinates(true).reverse();
}
this.opaquePassCutoff = 1 / 0;
for (var f5 = 0; f5 < r7.length; f5++) {
if (this.style._layers[r7[f5]].is3D()) {
this.opaquePassCutoff = f5;
break;
}
}
this.renderPass = "offscreen";
for (var m5 = 0, g5 = r7; m5 < g5.length; m5 += 1) {
var v5 = this.style._layers[g5[m5]];
if (v5.hasOffscreenPass() && !v5.isHidden(this.transform.zoom)) {
var y5 = h7[v5.source];
("custom" === v5.type || y5.length) && this.renderLayer(this, a6[v5.source], v5, y5);
}
}
for (this.context.bindFramebuffer.set(null), this.context.clear({ color: i6.showOverdrawInspector ? t5.Color.black : t5.Color.transparent, depth: 1 }), this.clearStencil(), this._showOverdrawInspector = i6.showOverdrawInspector, this.depthRangeFor3D = [0, 1 - (e6._order.length + 2) * this.numSublayers * this.depthEpsilon], this.renderPass = "opaque", this.currentLayer = r7.length - 1; this.currentLayer >= 0; this.currentLayer--) {
var x5 = this.style._layers[r7[this.currentLayer]], b5 = a6[x5.source], w5 = u5[x5.source];
this._renderTileClippingMasks(x5, w5), this.renderLayer(this, b5, x5, w5);
}
for (this.renderPass = "translucent", this.currentLayer = 0; this.currentLayer < r7.length; this.currentLayer++) {
var T5 = this.style._layers[r7[this.currentLayer]], E4 = a6[T5.source], I5 = ("symbol" === T5.type ? p5 : h7)[T5.source];
this._renderTileClippingMasks(T5, u5[T5.source]), this.renderLayer(this, E4, T5, I5);
}
this.options.showTileBoundaries && (t5.values(this.style._layers).forEach(function(t6) {
t6.source && !t6.isHidden(o6.transform.zoom) && (t6.source !== (c5 && c5.id) && (c5 = o6.style.sourceCaches[t6.source]), (!l8 || l8.getSource().maxzoom < c5.getSource().maxzoom) && (l8 = c5));
}), l8 && vo.debug(this, l8, l8.getVisibleCoordinates())), this.options.showPadding && function(t6) {
var e7 = t6.transform.padding;
_o(t6, t6.transform.height - (e7.top || 0), 3, lo), _o(t6, e7.bottom || 0, 3, co), fo(t6, e7.left || 0, 3, uo), fo(t6, t6.transform.width - (e7.right || 0), 3, ho);
var i7 = t6.transform.centerPoint;
!function(t7, e8, i8, o7) {
mo(t7, e8 - 1, i8 - 10, 2, 20, o7), mo(t7, e8 - 10, i8 - 1, 20, 2, o7);
}(t6, i7.x, t6.transform.height - i7.y, po);
}(this), this.context.setDefault();
}, yo.prototype.renderLayer = function(t6, e6, i6, o6) {
i6.isHidden(this.transform.zoom) || ("background" === i6.type || "custom" === i6.type || o6.length) && (this.id = i6.id, this.gpuTimingStart(i6), vo[i6.type](t6, e6, i6, o6, this.style.placement.variableOffsets), this.gpuTimingEnd());
}, yo.prototype.gpuTimingStart = function(t6) {
if (this.options.gpuTiming) {
var e6 = this.context.extTimerQuery, i6 = this.gpuTimers[t6.id];
i6 || (i6 = this.gpuTimers[t6.id] = { calls: 0, cpuTime: 0, query: e6.createQueryEXT() }), i6.calls++, e6.beginQueryEXT(e6.TIME_ELAPSED_EXT, i6.query);
}
}, yo.prototype.gpuTimingEnd = function() {
if (this.options.gpuTiming) {
var t6 = this.context.extTimerQuery;
t6.endQueryEXT(t6.TIME_ELAPSED_EXT);
}
}, yo.prototype.collectGpuTimers = function() {
var t6 = this.gpuTimers;
return this.gpuTimers = {}, t6;
}, yo.prototype.queryGpuTimers = function(t6) {
var e6 = {};
for (var i6 in t6) {
var o6 = t6[i6], r7 = this.context.extTimerQuery, a6 = r7.getQueryObjectEXT(o6.query, r7.QUERY_RESULT_EXT) / 1e6;
r7.deleteQueryEXT(o6.query), e6[i6] = a6;
}
return e6;
}, yo.prototype.translatePosMatrix = function(e6, i6, o6, r7, a6) {
if (!o6[0] && !o6[1]) {
return e6;
}
var n8 = a6 ? "map" === r7 ? this.transform.angle : 0 : "viewport" === r7 ? -this.transform.angle : 0;
if (n8) {
var s7 = Math.sin(n8), l8 = Math.cos(n8);
o6 = [o6[0] * l8 - o6[1] * s7, o6[0] * s7 + o6[1] * l8];
}
var c5 = [a6 ? o6[0] : pe2(i6, o6[0], this.transform.zoom), a6 ? o6[1] : pe2(i6, o6[1], this.transform.zoom), 0], u5 = new Float32Array(16);
return t5.translate(u5, e6, c5), u5;
}, yo.prototype.saveTileTexture = function(t6) {
var e6 = this._tileTextures[t6.size[0]];
e6 ? e6.push(t6) : this._tileTextures[t6.size[0]] = [t6];
}, yo.prototype.getTileTexture = function(t6) {
var e6 = this._tileTextures[t6];
return e6 && e6.length > 0 ? e6.pop() : null;
}, yo.prototype.isPatternMissing = function(t6) {
if (!t6) {
return false;
}
if (!t6.from || !t6.to) {
return true;
}
var e6 = this.imageManager.getPattern(t6.from.toString()), i6 = this.imageManager.getPattern(t6.to.toString());
return !e6 || !i6;
}, yo.prototype.useProgram = function(t6, e6) {
this.cache = this.cache || {};
var i6 = "" + t6 + (e6 ? e6.cacheKey : "") + (this._showOverdrawInspector ? "/overdraw" : "");
return this.cache[i6] || (this.cache[i6] = new bi2(this.context, t6, vi2[t6], e6, Ki2[t6], this._showOverdrawInspector)), this.cache[i6];
}, yo.prototype.setCustomLayerDefaults = function() {
this.context.unbindVAO(), this.context.cullFace.setDefault(), this.context.activeTexture.setDefault(), this.context.pixelStoreUnpack.setDefault(), this.context.pixelStoreUnpackPremultiplyAlpha.setDefault(), this.context.pixelStoreUnpackFlipY.setDefault();
}, yo.prototype.setBaseState = function() {
var t6 = this.context.gl;
this.context.cullFace.set(false), this.context.viewport.set([0, 0, this.width, this.height]), this.context.blendEquation.set(t6.FUNC_ADD);
}, yo.prototype.initDebugOverlayCanvas = function() {
null == this.debugOverlayCanvas && (this.debugOverlayCanvas = t5.window.document.createElement("canvas"), this.debugOverlayCanvas.width = 512, this.debugOverlayCanvas.height = 512, this.debugOverlayTexture = new t5.Texture(this.context, this.debugOverlayCanvas, this.context.gl.RGBA));
}, yo.prototype.destroy = function() {
this.emptyTexture.destroy(), this.debugOverlayTexture && this.debugOverlayTexture.destroy();
};
var xo = function(t6, e6) {
this.points = t6, this.planes = e6;
};
xo.fromInvProjectionMatrix = function(e6, i6, o6) {
var r7 = Math.pow(2, o6), a6 = [[-1, 1, -1, 1], [1, 1, -1, 1], [1, -1, -1, 1], [-1, -1, -1, 1], [-1, 1, 1, 1], [1, 1, 1, 1], [1, -1, 1, 1], [-1, -1, 1, 1]].map(function(i7) {
return t5.transformMat4([], i7, e6);
}).map(function(e7) {
return t5.scale$1([], e7, 1 / e7[3] / i6 * r7);
}), n8 = [[0, 1, 2], [6, 5, 4], [0, 3, 7], [2, 1, 5], [3, 2, 6], [0, 4, 5]].map(function(e7) {
var i7 = t5.sub([], a6[e7[0]], a6[e7[1]]), o7 = t5.sub([], a6[e7[2]], a6[e7[1]]), r8 = t5.normalize([], t5.cross([], i7, o7)), n9 = -t5.dot(r8, a6[e7[1]]);
return r8.concat(n9);
});
return new xo(a6, n8);
};
var bo = function(e6, i6) {
this.min = e6, this.max = i6, this.center = t5.scale$2([], t5.add([], this.min, this.max), 0.5);
};
bo.prototype.quadrant = function(e6) {
for (var i6 = [e6 % 2 == 0, e6 < 2], o6 = t5.clone$2(this.min), r7 = t5.clone$2(this.max), a6 = 0; a6 < i6.length; a6++) {
o6[a6] = i6[a6] ? this.min[a6] : this.center[a6], r7[a6] = i6[a6] ? this.center[a6] : this.max[a6];
}
return r7[2] = this.max[2], new bo(o6, r7);
}, bo.prototype.distanceX = function(t6) {
return Math.max(Math.min(this.max[0], t6[0]), this.min[0]) - t6[0];
}, bo.prototype.distanceY = function(t6) {
return Math.max(Math.min(this.max[1], t6[1]), this.min[1]) - t6[1];
}, bo.prototype.intersects = function(e6) {
for (var i6 = [[this.min[0], this.min[1], 0, 1], [this.max[0], this.min[1], 0, 1], [this.max[0], this.max[1], 0, 1], [this.min[0], this.max[1], 0, 1]], o6 = true, r7 = 0; r7 < e6.planes.length; r7++) {
for (var a6 = e6.planes[r7], n8 = 0, s7 = 0; s7 < i6.length; s7++) {
n8 += t5.dot$1(a6, i6[s7]) >= 0;
}
if (0 === n8) {
return 0;
}
n8 !== i6.length && (o6 = false);
}
if (o6) {
return 2;
}
for (var l8 = 0; l8 < 3; l8++) {
for (var c5 = Number.MAX_VALUE, u5 = -Number.MAX_VALUE, h7 = 0; h7 < e6.points.length; h7++) {
var p5 = e6.points[h7][l8] - this.min[l8];
c5 = Math.min(c5, p5), u5 = Math.max(u5, p5);
}
if (u5 < 0 || c5 > this.max[l8] - this.min[l8]) {
return 0;
}
}
return 1;
};
var wo = function(t6, e6, i6, o6) {
if (void 0 === t6 && (t6 = 0), void 0 === e6 && (e6 = 0), void 0 === i6 && (i6 = 0), void 0 === o6 && (o6 = 0), isNaN(t6) || t6 < 0 || isNaN(e6) || e6 < 0 || isNaN(i6) || i6 < 0 || isNaN(o6) || o6 < 0) {
throw new Error("Invalid value for edge-insets, top, bottom, left and right must all be numbers");
}
this.top = t6, this.bottom = e6, this.left = i6, this.right = o6;
};
wo.prototype.interpolate = function(e6, i6, o6) {
return null != i6.top && null != e6.top && (this.top = t5.number(e6.top, i6.top, o6)), null != i6.bottom && null != e6.bottom && (this.bottom = t5.number(e6.bottom, i6.bottom, o6)), null != i6.left && null != e6.left && (this.left = t5.number(e6.left, i6.left, o6)), null != i6.right && null != e6.right && (this.right = t5.number(e6.right, i6.right, o6)), this;
}, wo.prototype.getCenter = function(e6, i6) {
var o6 = t5.clamp((this.left + e6 - this.right) / 2, 0, e6), r7 = t5.clamp((this.top + i6 - this.bottom) / 2, 0, i6);
return new t5.Point(o6, r7);
}, wo.prototype.equals = function(t6) {
return this.top === t6.top && this.bottom === t6.bottom && this.left === t6.left && this.right === t6.right;
}, wo.prototype.clone = function() {
return new wo(this.top, this.bottom, this.left, this.right);
}, wo.prototype.toJSON = function() {
return { top: this.top, bottom: this.bottom, left: this.left, right: this.right };
};
var To = function(e6, i6, o6, r7, a6) {
this.tileSize = 512, this.maxValidLatitude = 85.051129, this._renderWorldCopies = void 0 === a6 || a6, this._minZoom = e6 || 0, this._maxZoom = i6 || 22, this._minPitch = null == o6 ? 0 : o6, this._maxPitch = null == r7 ? 60 : r7, this.setMaxBounds(), this.width = 0, this.height = 0, this._center = new t5.LngLat(0, 0), this.zoom = 0, this.angle = 0, this._fov = 0.6435011087932844, this._pitch = 0, this._unmodified = true, this._edgeInsets = new wo(), this._posMatrixCache = {}, this._alignedPosMatrixCache = {};
}, Eo = { minZoom: { configurable: true }, maxZoom: { configurable: true }, minPitch: { configurable: true }, maxPitch: { configurable: true }, renderWorldCopies: { configurable: true }, worldSize: { configurable: true }, centerOffset: { configurable: true }, size: { configurable: true }, bearing: { configurable: true }, pitch: { configurable: true }, fov: { configurable: true }, zoom: { configurable: true }, center: { configurable: true }, padding: { configurable: true }, centerPoint: { configurable: true }, unmodified: { configurable: true }, point: { configurable: true } };
To.prototype.clone = function() {
var t6 = new To(this._minZoom, this._maxZoom, this._minPitch, this.maxPitch, this._renderWorldCopies);
return t6.tileSize = this.tileSize, t6.latRange = this.latRange, t6.width = this.width, t6.height = this.height, t6._center = this._center, t6.zoom = this.zoom, t6.angle = this.angle, t6._fov = this._fov, t6._pitch = this._pitch, t6._unmodified = this._unmodified, t6._edgeInsets = this._edgeInsets.clone(), t6._calcMatrices(), t6;
}, Eo.minZoom.get = function() {
return this._minZoom;
}, Eo.minZoom.set = function(t6) {
this._minZoom !== t6 && (this._minZoom = t6, this.zoom = Math.max(this.zoom, t6));
}, Eo.maxZoom.get = function() {
return this._maxZoom;
}, Eo.maxZoom.set = function(t6) {
this._maxZoom !== t6 && (this._maxZoom = t6, this.zoom = Math.min(this.zoom, t6));
}, Eo.minPitch.get = function() {
return this._minPitch;
}, Eo.minPitch.set = function(t6) {
this._minPitch !== t6 && (this._minPitch = t6, this.pitch = Math.max(this.pitch, t6));
}, Eo.maxPitch.get = function() {
return this._maxPitch;
}, Eo.maxPitch.set = function(t6) {
this._maxPitch !== t6 && (this._maxPitch = t6, this.pitch = Math.min(this.pitch, t6));
}, Eo.renderWorldCopies.get = function() {
return this._renderWorldCopies;
}, Eo.renderWorldCopies.set = function(t6) {
void 0 === t6 ? t6 = true : null === t6 && (t6 = false), this._renderWorldCopies = t6;
}, Eo.worldSize.get = function() {
return this.tileSize * this.scale;
}, Eo.centerOffset.get = function() {
return this.centerPoint._sub(this.size._div(2));
}, Eo.size.get = function() {
return new t5.Point(this.width, this.height);
}, Eo.bearing.get = function() {
return -this.angle / Math.PI * 180;
}, Eo.bearing.set = function(e6) {
var i6 = -t5.wrap(e6, -180, 180) * Math.PI / 180;
this.angle !== i6 && (this._unmodified = false, this.angle = i6, this._calcMatrices(), this.rotationMatrix = t5.create$2(), t5.rotate(this.rotationMatrix, this.rotationMatrix, this.angle));
}, Eo.pitch.get = function() {
return this._pitch / Math.PI * 180;
}, Eo.pitch.set = function(e6) {
var i6 = t5.clamp(e6, this.minPitch, this.maxPitch) / 180 * Math.PI;
this._pitch !== i6 && (this._unmodified = false, this._pitch = i6, this._calcMatrices());
}, Eo.fov.get = function() {
return this._fov / Math.PI * 180;
}, Eo.fov.set = function(t6) {
t6 = Math.max(0.01, Math.min(60, t6)), this._fov !== t6 && (this._unmodified = false, this._fov = t6 / 180 * Math.PI, this._calcMatrices());
}, Eo.zoom.get = function() {
return this._zoom;
}, Eo.zoom.set = function(t6) {
var e6 = Math.min(Math.max(t6, this.minZoom), this.maxZoom);
this._zoom !== e6 && (this._unmodified = false, this._zoom = e6, this.scale = this.zoomScale(e6), this.tileZoom = Math.floor(e6), this.zoomFraction = e6 - this.tileZoom, this._constrain(), this._calcMatrices());
}, Eo.center.get = function() {
return this._center;
}, Eo.center.set = function(t6) {
t6.lat === this._center.lat && t6.lng === this._center.lng || (this._unmodified = false, this._center = t6, this._constrain(), this._calcMatrices());
}, Eo.padding.get = function() {
return this._edgeInsets.toJSON();
}, Eo.padding.set = function(t6) {
this._edgeInsets.equals(t6) || (this._unmodified = false, this._edgeInsets.interpolate(this._edgeInsets, t6, 1), this._calcMatrices());
}, Eo.centerPoint.get = function() {
return this._edgeInsets.getCenter(this.width, this.height);
}, To.prototype.isPaddingEqual = function(t6) {
return this._edgeInsets.equals(t6);
}, To.prototype.interpolatePadding = function(t6, e6, i6) {
this._unmodified = false, this._edgeInsets.interpolate(t6, e6, i6), this._constrain(), this._calcMatrices();
}, To.prototype.coveringZoomLevel = function(t6) {
var e6 = (t6.roundZoom ? Math.round : Math.floor)(this.zoom + this.scaleZoom(this.tileSize / t6.tileSize));
return Math.max(0, e6);
}, To.prototype.getVisibleUnwrappedCoordinates = function(e6) {
var i6 = [new t5.UnwrappedTileID(0, e6)];
if (this._renderWorldCopies) {
for (var o6 = this.pointCoordinate(new t5.Point(0, 0)), r7 = this.pointCoordinate(new t5.Point(this.width, 0)), a6 = this.pointCoordinate(new t5.Point(this.width, this.height)), n8 = this.pointCoordinate(new t5.Point(0, this.height)), s7 = Math.floor(Math.min(o6.x, r7.x, a6.x, n8.x)), l8 = Math.floor(Math.max(o6.x, r7.x, a6.x, n8.x)), c5 = s7 - 1; c5 <= l8 + 1; c5++) {
0 !== c5 && i6.push(new t5.UnwrappedTileID(c5, e6));
}
}
return i6;
}, To.prototype.coveringTiles = function(e6) {
var i6 = this.coveringZoomLevel(e6), o6 = i6;
if (void 0 !== e6.minzoom && i6 < e6.minzoom) {
return [];
}
void 0 !== e6.maxzoom && i6 > e6.maxzoom && (i6 = e6.maxzoom);
var r7 = t5.MercatorCoordinate.fromLngLat(this.center), a6 = Math.pow(2, i6), n8 = [a6 * r7.x, a6 * r7.y, 0], s7 = xo.fromInvProjectionMatrix(this.invProjMatrix, this.worldSize, i6), l8 = e6.minzoom || 0;
this.pitch <= 60 && this._edgeInsets.top < 0.1 && (l8 = i6);
var c5 = function(t6) {
return { aabb: new bo([t6 * a6, 0, 0], [(t6 + 1) * a6, a6, 0]), zoom: 0, x: 0, y: 0, wrap: t6, fullyVisible: false };
}, u5 = [], h7 = [], p5 = i6, d5 = e6.reparseOverscaled ? o6 : i6;
if (this._renderWorldCopies) {
for (var _4 = 1; _4 <= 3; _4++) {
u5.push(c5(-_4)), u5.push(c5(_4));
}
}
for (u5.push(c5(0)); u5.length > 0; ) {
var f5 = u5.pop(), m5 = f5.x, g5 = f5.y, v5 = f5.fullyVisible;
if (!v5) {
var y5 = f5.aabb.intersects(s7);
if (0 === y5) {
continue;
}
v5 = 2 === y5;
}
var x5 = f5.aabb.distanceX(n8), b5 = f5.aabb.distanceY(n8), w5 = Math.max(Math.abs(x5), Math.abs(b5));
if (f5.zoom === p5 || w5 > 3 + (1 << p5 - f5.zoom) - 2 && f5.zoom >= l8) {
h7.push({ tileID: new t5.OverscaledTileID(f5.zoom === p5 ? d5 : f5.zoom, f5.wrap, f5.zoom, m5, g5), distanceSq: t5.sqrLen([n8[0] - 0.5 - m5, n8[1] - 0.5 - g5]) });
} else {
for (var T5 = 0; T5 < 4; T5++) {
var E4 = (m5 << 1) + T5 % 2, I5 = (g5 << 1) + (T5 >> 1);
u5.push({ aabb: f5.aabb.quadrant(T5), zoom: f5.zoom + 1, x: E4, y: I5, wrap: f5.wrap, fullyVisible: v5 });
}
}
}
return h7.sort(function(t6, e7) {
return t6.distanceSq - e7.distanceSq;
}).map(function(t6) {
return t6.tileID;
});
}, To.prototype.resize = function(t6, e6) {
this.width = t6, this.height = e6, this.pixelsToGLUnits = [2 / t6, -2 / e6], this._constrain(), this._calcMatrices();
}, Eo.unmodified.get = function() {
return this._unmodified;
}, To.prototype.zoomScale = function(t6) {
return Math.pow(2, t6);
}, To.prototype.scaleZoom = function(t6) {
return Math.log(t6) / Math.LN2;
}, To.prototype.project = function(e6) {
var i6 = t5.clamp(e6.lat, -this.maxValidLatitude, this.maxValidLatitude);
return new t5.Point(t5.mercatorXfromLng(e6.lng) * this.worldSize, t5.mercatorYfromLat(i6) * this.worldSize);
}, To.prototype.unproject = function(e6) {
return new t5.MercatorCoordinate(e6.x / this.worldSize, e6.y / this.worldSize).toLngLat();
}, Eo.point.get = function() {
return this.project(this.center);
}, To.prototype.setLocationAtPoint = function(e6, i6) {
var o6 = this.pointCoordinate(i6), r7 = this.pointCoordinate(this.centerPoint), a6 = this.locationCoordinate(e6), n8 = new t5.MercatorCoordinate(a6.x - (o6.x - r7.x), a6.y - (o6.y - r7.y));
this.center = this.coordinateLocation(n8), this._renderWorldCopies && (this.center = this.center.wrap());
}, To.prototype.locationPoint = function(t6) {
return this.coordinatePoint(this.locationCoordinate(t6));
}, To.prototype.pointLocation = function(t6) {
return this.coordinateLocation(this.pointCoordinate(t6));
}, To.prototype.locationCoordinate = function(e6) {
return t5.MercatorCoordinate.fromLngLat(e6);
}, To.prototype.coordinateLocation = function(t6) {
return t6.toLngLat();
}, To.prototype.pointCoordinate = function(e6) {
var i6 = [e6.x, e6.y, 0, 1], o6 = [e6.x, e6.y, 1, 1];
t5.transformMat4(i6, i6, this.pixelMatrixInverse), t5.transformMat4(o6, o6, this.pixelMatrixInverse);
var r7 = i6[3], a6 = o6[3], n8 = i6[1] / r7, s7 = o6[1] / a6, l8 = i6[2] / r7, c5 = o6[2] / a6, u5 = l8 === c5 ? 0 : (0 - l8) / (c5 - l8);
return new t5.MercatorCoordinate(t5.number(i6[0] / r7, o6[0] / a6, u5) / this.worldSize, t5.number(n8, s7, u5) / this.worldSize);
}, To.prototype.coordinatePoint = function(e6) {
var i6 = [e6.x * this.worldSize, e6.y * this.worldSize, 0, 1];
return t5.transformMat4(i6, i6, this.pixelMatrix), new t5.Point(i6[0] / i6[3], i6[1] / i6[3]);
}, To.prototype.getBounds = function() {
return new t5.LngLatBounds().extend(this.pointLocation(new t5.Point(0, 0))).extend(this.pointLocation(new t5.Point(this.width, 0))).extend(this.pointLocation(new t5.Point(this.width, this.height))).extend(this.pointLocation(new t5.Point(0, this.height)));
}, To.prototype.getMaxBounds = function() {
return this.latRange && 2 === this.latRange.length && this.lngRange && 2 === this.lngRange.length ? new t5.LngLatBounds([this.lngRange[0], this.latRange[0]], [this.lngRange[1], this.latRange[1]]) : null;
}, To.prototype.setMaxBounds = function(t6) {
t6 ? (this.lngRange = [t6.getWest(), t6.getEast()], this.latRange = [t6.getSouth(), t6.getNorth()], this._constrain()) : (this.lngRange = null, this.latRange = [-this.maxValidLatitude, this.maxValidLatitude]);
}, To.prototype.calculatePosMatrix = function(e6, i6) {
void 0 === i6 && (i6 = false);
var o6 = e6.key, r7 = i6 ? this._alignedPosMatrixCache : this._posMatrixCache;
if (r7[o6]) {
return r7[o6];
}
var a6 = e6.canonical, n8 = this.worldSize / this.zoomScale(a6.z), s7 = a6.x + Math.pow(2, a6.z) * e6.wrap, l8 = t5.identity(new Float64Array(16));
return t5.translate(l8, l8, [s7 * n8, a6.y * n8, 0]), t5.scale(l8, l8, [n8 / t5.EXTENT, n8 / t5.EXTENT, 1]), t5.multiply(l8, i6 ? this.alignedProjMatrix : this.projMatrix, l8), r7[o6] = new Float32Array(l8), r7[o6];
}, To.prototype.customLayerMatrix = function() {
return this.mercatorMatrix.slice();
}, To.prototype._constrain = function() {
if (this.center && this.width && this.height && !this._constraining) {
this._constraining = true;
var e6, i6, o6, r7, a6 = -90, n8 = 90, s7 = -180, l8 = 180, c5 = this.size, u5 = this._unmodified;
if (this.latRange) {
var h7 = this.latRange;
a6 = t5.mercatorYfromLat(h7[1]) * this.worldSize, e6 = (n8 = t5.mercatorYfromLat(h7[0]) * this.worldSize) - a6 < c5.y ? c5.y / (n8 - a6) : 0;
}
if (this.lngRange) {
var p5 = this.lngRange;
s7 = t5.mercatorXfromLng(p5[0]) * this.worldSize, i6 = (l8 = t5.mercatorXfromLng(p5[1]) * this.worldSize) - s7 < c5.x ? c5.x / (l8 - s7) : 0;
}
var d5 = this.point, _4 = Math.max(i6 || 0, e6 || 0);
if (_4) {
return this.center = this.unproject(new t5.Point(i6 ? (l8 + s7) / 2 : d5.x, e6 ? (n8 + a6) / 2 : d5.y)), this.zoom += this.scaleZoom(_4), this._unmodified = u5, void (this._constraining = false);
}
if (this.latRange) {
var f5 = d5.y, m5 = c5.y / 2;
f5 - m5 < a6 && (r7 = a6 + m5), f5 + m5 > n8 && (r7 = n8 - m5);
}
if (this.lngRange) {
var g5 = d5.x, v5 = c5.x / 2;
g5 - v5 < s7 && (o6 = s7 + v5), g5 + v5 > l8 && (o6 = l8 - v5);
}
void 0 === o6 && void 0 === r7 || (this.center = this.unproject(new t5.Point(void 0 !== o6 ? o6 : d5.x, void 0 !== r7 ? r7 : d5.y))), this._unmodified = u5, this._constraining = false;
}
}, To.prototype._calcMatrices = function() {
if (this.height) {
var e6 = this.centerOffset;
this.cameraToCenterDistance = 0.5 / Math.tan(this._fov / 2) * this.height;
var i6 = Math.PI / 2 + this._pitch, o6 = this._fov * (0.5 + e6.y / this.height), r7 = Math.sin(o6) * this.cameraToCenterDistance / Math.sin(t5.clamp(Math.PI - i6 - o6, 0.01, Math.PI - 0.01)), a6 = this.point, n8 = a6.x, s7 = a6.y, l8 = 1.01 * (Math.cos(Math.PI / 2 - this._pitch) * r7 + this.cameraToCenterDistance), c5 = this.height / 50, u5 = new Float64Array(16);
t5.perspective(u5, this._fov, this.width / this.height, c5, l8), u5[8] = 2 * -e6.x / this.width, u5[9] = 2 * e6.y / this.height, t5.scale(u5, u5, [1, -1, 1]), t5.translate(u5, u5, [0, 0, -this.cameraToCenterDistance]), t5.rotateX(u5, u5, this._pitch), t5.rotateZ(u5, u5, this.angle), t5.translate(u5, u5, [-n8, -s7, 0]), this.mercatorMatrix = t5.scale([], u5, [this.worldSize, this.worldSize, this.worldSize]), t5.scale(u5, u5, [1, 1, t5.mercatorZfromAltitude(1, this.center.lat) * this.worldSize, 1]), this.projMatrix = u5, this.invProjMatrix = t5.invert([], this.projMatrix);
var h7 = this.width % 2 / 2, p5 = this.height % 2 / 2, d5 = Math.cos(this.angle), _4 = Math.sin(this.angle), f5 = n8 - Math.round(n8) + d5 * h7 + _4 * p5, m5 = s7 - Math.round(s7) + d5 * p5 + _4 * h7, g5 = new Float64Array(u5);
if (t5.translate(g5, g5, [f5 > 0.5 ? f5 - 1 : f5, m5 > 0.5 ? m5 - 1 : m5, 0]), this.alignedProjMatrix = g5, u5 = t5.create(), t5.scale(u5, u5, [this.width / 2, -this.height / 2, 1]), t5.translate(u5, u5, [1, -1, 0]), this.labelPlaneMatrix = u5, u5 = t5.create(), t5.scale(u5, u5, [1, -1, 1]), t5.translate(u5, u5, [-1, -1, 0]), t5.scale(u5, u5, [2 / this.width, 2 / this.height, 1]), this.glCoordMatrix = u5, this.pixelMatrix = t5.multiply(new Float64Array(16), this.labelPlaneMatrix, this.projMatrix), !(u5 = t5.invert(new Float64Array(16), this.pixelMatrix))) {
throw new Error("failed to invert matrix");
}
this.pixelMatrixInverse = u5, this._posMatrixCache = {}, this._alignedPosMatrixCache = {};
}
}, To.prototype.maxPitchScaleFactor = function() {
if (!this.pixelMatrixInverse) {
return 1;
}
var e6 = this.pointCoordinate(new t5.Point(0, 0)), i6 = [e6.x * this.worldSize, e6.y * this.worldSize, 0, 1];
return t5.transformMat4(i6, i6, this.pixelMatrix)[3] / this.cameraToCenterDistance;
}, To.prototype.getCameraPoint = function() {
var e6 = Math.tan(this._pitch) * (this.cameraToCenterDistance || 1);
return this.centerPoint.add(new t5.Point(0, e6));
}, To.prototype.getCameraQueryGeometry = function(e6) {
var i6 = this.getCameraPoint();
if (1 === e6.length) {
return [e6[0], i6];
}
for (var o6 = i6.x, r7 = i6.y, a6 = i6.x, n8 = i6.y, s7 = 0, l8 = e6; s7 < l8.length; s7 += 1) {
var c5 = l8[s7];
o6 = Math.min(o6, c5.x), r7 = Math.min(r7, c5.y), a6 = Math.max(a6, c5.x), n8 = Math.max(n8, c5.y);
}
return [new t5.Point(o6, r7), new t5.Point(a6, r7), new t5.Point(a6, n8), new t5.Point(o6, n8), new t5.Point(o6, r7)];
}, Object.defineProperties(To.prototype, Eo);
var Io = function(e6) {
var i6, o6, r7, a6;
this._hashName = e6 && encodeURIComponent(e6), t5.bindAll(["_getCurrentHash", "_onHashChange", "_updateHash"], this), this._updateHash = (i6 = this._updateHashUnthrottled.bind(this), o6 = false, r7 = null, a6 = function() {
r7 = null, o6 && (i6(), r7 = setTimeout(a6, 300), o6 = false);
}, function() {
return o6 = true, r7 || a6(), r7;
});
};
Io.prototype.addTo = function(e6) {
return this._map = e6, t5.window.addEventListener("hashchange", this._onHashChange, false), this._map.on("moveend", this._updateHash), this;
}, Io.prototype.remove = function() {
return t5.window.removeEventListener("hashchange", this._onHashChange, false), this._map.off("moveend", this._updateHash), clearTimeout(this._updateHash()), delete this._map, this;
}, Io.prototype.getHashString = function(e6) {
var i6 = this._map.getCenter(), o6 = Math.round(100 * this._map.getZoom()) / 100, r7 = Math.ceil((o6 * Math.LN2 + Math.log(512 / 360 / 0.5)) / Math.LN10), a6 = Math.pow(10, r7), n8 = Math.round(i6.lng * a6) / a6, s7 = Math.round(i6.lat * a6) / a6, l8 = this._map.getBearing(), c5 = this._map.getPitch(), u5 = "";
if (u5 += e6 ? "/" + n8 + "/" + s7 + "/" + o6 : o6 + "/" + s7 + "/" + n8, (l8 || c5) && (u5 += "/" + Math.round(10 * l8) / 10), c5 && (u5 += "/" + Math.round(c5)), this._hashName) {
var h7 = this._hashName, p5 = false, d5 = t5.window.location.hash.slice(1).split("&").map(function(t6) {
var e7 = t6.split("=")[0];
return e7 === h7 ? (p5 = true, e7 + "=" + u5) : t6;
}).filter(function(t6) {
return t6;
});
return p5 || d5.push(h7 + "=" + u5), "#" + d5.join("&");
}
return "#" + u5;
}, Io.prototype._getCurrentHash = function() {
var e6, i6 = this, o6 = t5.window.location.hash.replace("#", "");
return this._hashName ? (o6.split("&").map(function(t6) {
return t6.split("=");
}).forEach(function(t6) {
t6[0] === i6._hashName && (e6 = t6);
}), (e6 && e6[1] || "").split("/")) : o6.split("/");
}, Io.prototype._onHashChange = function() {
var t6 = this._getCurrentHash();
if (t6.length >= 3 && !t6.some(function(t7) {
return isNaN(t7);
})) {
var e6 = this._map.dragRotate.isEnabled() && this._map.touchZoomRotate.isEnabled() ? +(t6[3] || 0) : this._map.getBearing();
return this._map.jumpTo({ center: [+t6[2], +t6[1]], zoom: +t6[0], bearing: e6, pitch: +(t6[4] || 0) }), true;
}
return false;
}, Io.prototype._updateHashUnthrottled = function() {
var e6 = t5.window.location.href.replace(/(#.+)?$/, this.getHashString());
try {
t5.window.history.replaceState(t5.window.history.state, null, e6);
} catch (t$1) {
}
};
var Po = { linearity: 0.3, easing: t5.bezier(0, 0, 0.3, 1) }, So = t5.extend({ deceleration: 2500, maxSpeed: 1400 }, Po), Co = t5.extend({ deceleration: 20, maxSpeed: 1400 }, Po), zo = t5.extend({ deceleration: 1e3, maxSpeed: 360 }, Po), Do = t5.extend({ deceleration: 1e3, maxSpeed: 90 }, Po), Ao = function(t6) {
this._map = t6, this.clear();
};
function Mo(t6, e6) {
(!t6.duration || t6.duration < e6.duration) && (t6.duration = e6.duration, t6.easing = e6.easing);
}
function Lo(e6, i6, o6) {
var r7 = o6.maxSpeed, a6 = o6.linearity, n8 = o6.deceleration, s7 = t5.clamp(e6 * a6 / (i6 / 1e3), -r7, r7), l8 = Math.abs(s7) / (n8 * a6);
return { easing: o6.easing, duration: 1e3 * l8, amount: s7 * (l8 / 2) };
}
Ao.prototype.clear = function() {
this._inertiaBuffer = [];
}, Ao.prototype.record = function(e6) {
this._drainInertiaBuffer(), this._inertiaBuffer.push({ time: t5.browser.now(), settings: e6 });
}, Ao.prototype._drainInertiaBuffer = function() {
for (var e6 = this._inertiaBuffer, i6 = t5.browser.now(); e6.length > 0 && i6 - e6[0].time > 160; ) {
e6.shift();
}
}, Ao.prototype._onMoveEnd = function(e6) {
if (this._drainInertiaBuffer(), !(this._inertiaBuffer.length < 2)) {
for (var i6 = { zoom: 0, bearing: 0, pitch: 0, pan: new t5.Point(0, 0), pinchAround: void 0, around: void 0 }, o6 = 0, r7 = this._inertiaBuffer; o6 < r7.length; o6 += 1) {
var a6 = r7[o6].settings;
i6.zoom += a6.zoomDelta || 0, i6.bearing += a6.bearingDelta || 0, i6.pitch += a6.pitchDelta || 0, a6.panDelta && i6.pan._add(a6.panDelta), a6.around && (i6.around = a6.around), a6.pinchAround && (i6.pinchAround = a6.pinchAround);
}
var n8 = this._inertiaBuffer[this._inertiaBuffer.length - 1].time - this._inertiaBuffer[0].time, s7 = {};
if (i6.pan.mag()) {
var l8 = Lo(i6.pan.mag(), n8, t5.extend({}, So, e6 || {}));
s7.offset = i6.pan.mult(l8.amount / i6.pan.mag()), s7.center = this._map.transform.center, Mo(s7, l8);
}
if (i6.zoom) {
var c5 = Lo(i6.zoom, n8, Co);
s7.zoom = this._map.transform.zoom + c5.amount, Mo(s7, c5);
}
if (i6.bearing) {
var u5 = Lo(i6.bearing, n8, zo);
s7.bearing = this._map.transform.bearing + t5.clamp(u5.amount, -179, 179), Mo(s7, u5);
}
if (i6.pitch) {
var h7 = Lo(i6.pitch, n8, Do);
s7.pitch = this._map.transform.pitch + h7.amount, Mo(s7, h7);
}
if (s7.zoom || s7.bearing) {
var p5 = void 0 === i6.pinchAround ? i6.around : i6.pinchAround;
s7.around = p5 ? this._map.unproject(p5) : this._map.getCenter();
}
return this.clear(), t5.extend(s7, { noMoveStart: true });
}
};
var Ro = function(e6) {
function o6(o7, r8, a6, n8) {
void 0 === n8 && (n8 = {});
var s7 = i5.mousePos(r8.getCanvasContainer(), a6), l8 = r8.unproject(s7);
e6.call(this, o7, t5.extend({ point: s7, lngLat: l8, originalEvent: a6 }, n8)), this._defaultPrevented = false, this.target = r8;
}
e6 && (o6.__proto__ = e6), (o6.prototype = Object.create(e6 && e6.prototype)).constructor = o6;
var r7 = { defaultPrevented: { configurable: true } };
return o6.prototype.preventDefault = function() {
this._defaultPrevented = true;
}, r7.defaultPrevented.get = function() {
return this._defaultPrevented;
}, Object.defineProperties(o6.prototype, r7), o6;
}(t5.Event), ko = function(e6) {
function o6(o7, r8, a6) {
var n8 = "touchend" === o7 ? a6.changedTouches : a6.touches, s7 = i5.touchPos(r8.getCanvasContainer(), n8), l8 = s7.map(function(t6) {
return r8.unproject(t6);
}), c5 = s7.reduce(function(t6, e7, i6, o8) {
return t6.add(e7.div(o8.length));
}, new t5.Point(0, 0)), u5 = r8.unproject(c5);
e6.call(this, o7, { points: s7, point: c5, lngLats: l8, lngLat: u5, originalEvent: a6 }), this._defaultPrevented = false;
}
e6 && (o6.__proto__ = e6), (o6.prototype = Object.create(e6 && e6.prototype)).constructor = o6;
var r7 = { defaultPrevented: { configurable: true } };
return o6.prototype.preventDefault = function() {
this._defaultPrevented = true;
}, r7.defaultPrevented.get = function() {
return this._defaultPrevented;
}, Object.defineProperties(o6.prototype, r7), o6;
}(t5.Event), Bo = function(t6) {
function e6(e7, i7, o6) {
t6.call(this, e7, { originalEvent: o6 }), this._defaultPrevented = false;
}
t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6;
var i6 = { defaultPrevented: { configurable: true } };
return e6.prototype.preventDefault = function() {
this._defaultPrevented = true;
}, i6.defaultPrevented.get = function() {
return this._defaultPrevented;
}, Object.defineProperties(e6.prototype, i6), e6;
}(t5.Event), Oo = function(t6, e6) {
this._map = t6, this._clickTolerance = e6.clickTolerance;
};
Oo.prototype.reset = function() {
delete this._mousedownPos;
}, Oo.prototype.wheel = function(t6) {
return this._firePreventable(new Bo(t6.type, this._map, t6));
}, Oo.prototype.mousedown = function(t6, e6) {
return this._mousedownPos = e6, this._firePreventable(new Ro(t6.type, this._map, t6));
}, Oo.prototype.mouseup = function(t6) {
this._map.fire(new Ro(t6.type, this._map, t6));
}, Oo.prototype.click = function(t6, e6) {
this._mousedownPos && this._mousedownPos.dist(e6) >= this._clickTolerance || this._map.fire(new Ro(t6.type, this._map, t6));
}, Oo.prototype.dblclick = function(t6) {
return this._firePreventable(new Ro(t6.type, this._map, t6));
}, Oo.prototype.mouseover = function(t6) {
this._map.fire(new Ro(t6.type, this._map, t6));
}, Oo.prototype.mouseout = function(t6) {
this._map.fire(new Ro(t6.type, this._map, t6));
}, Oo.prototype.touchstart = function(t6) {
return this._firePreventable(new ko(t6.type, this._map, t6));
}, Oo.prototype.touchmove = function(t6) {
this._map.fire(new ko(t6.type, this._map, t6));
}, Oo.prototype.touchend = function(t6) {
this._map.fire(new ko(t6.type, this._map, t6));
}, Oo.prototype.touchcancel = function(t6) {
this._map.fire(new ko(t6.type, this._map, t6));
}, Oo.prototype._firePreventable = function(t6) {
if (this._map.fire(t6), t6.defaultPrevented) {
return {};
}
}, Oo.prototype.isEnabled = function() {
return true;
}, Oo.prototype.isActive = function() {
return false;
}, Oo.prototype.enable = function() {
}, Oo.prototype.disable = function() {
};
var Fo = function(t6) {
this._map = t6;
};
Fo.prototype.reset = function() {
this._delayContextMenu = false, delete this._contextMenuEvent;
}, Fo.prototype.mousemove = function(t6) {
this._map.fire(new Ro(t6.type, this._map, t6));
}, Fo.prototype.mousedown = function() {
this._delayContextMenu = true;
}, Fo.prototype.mouseup = function() {
this._delayContextMenu = false, this._contextMenuEvent && (this._map.fire(new Ro("contextmenu", this._map, this._contextMenuEvent)), delete this._contextMenuEvent);
}, Fo.prototype.contextmenu = function(t6) {
this._delayContextMenu ? this._contextMenuEvent = t6 : this._map.fire(new Ro(t6.type, this._map, t6)), this._map.listens("contextmenu") && t6.preventDefault();
}, Fo.prototype.isEnabled = function() {
return true;
}, Fo.prototype.isActive = function() {
return false;
}, Fo.prototype.enable = function() {
}, Fo.prototype.disable = function() {
};
var Uo = function(t6, e6) {
this._map = t6, this._el = t6.getCanvasContainer(), this._container = t6.getContainer(), this._clickTolerance = e6.clickTolerance || 1;
};
function No(t6, e6) {
for (var i6 = {}, o6 = 0; o6 < t6.length; o6++) {
i6[t6[o6].identifier] = e6[o6];
}
return i6;
}
Uo.prototype.isEnabled = function() {
return !!this._enabled;
}, Uo.prototype.isActive = function() {
return !!this._active;
}, Uo.prototype.enable = function() {
this.isEnabled() || (this._enabled = true);
}, Uo.prototype.disable = function() {
this.isEnabled() && (this._enabled = false);
}, Uo.prototype.mousedown = function(t6, e6) {
this.isEnabled() && t6.shiftKey && 0 === t6.button && (i5.disableDrag(), this._startPos = this._lastPos = e6, this._active = true);
}, Uo.prototype.mousemoveWindow = function(t6, e6) {
if (this._active) {
var o6 = e6;
if (!(this._lastPos.equals(o6) || !this._box && o6.dist(this._startPos) < this._clickTolerance)) {
var r7 = this._startPos;
this._lastPos = o6, this._box || (this._box = i5.create("div", "mapboxgl-boxzoom", this._container), this._container.classList.add("mapboxgl-crosshair"), this._fireEvent("boxzoomstart", t6));
var a6 = Math.min(r7.x, o6.x), n8 = Math.max(r7.x, o6.x), s7 = Math.min(r7.y, o6.y), l8 = Math.max(r7.y, o6.y);
i5.setTransform(this._box, "translate(" + a6 + "px," + s7 + "px)"), this._box.style.width = n8 - a6 + "px", this._box.style.height = l8 - s7 + "px";
}
}
}, Uo.prototype.mouseupWindow = function(e6, o6) {
var r7 = this;
if (this._active && 0 === e6.button) {
var a6 = this._startPos, n8 = o6;
if (this.reset(), i5.suppressClick(), a6.x !== n8.x || a6.y !== n8.y) {
return this._map.fire(new t5.Event("boxzoomend", { originalEvent: e6 })), { cameraAnimation: function(t6) {
return t6.fitScreenCoordinates(a6, n8, r7._map.getBearing(), { linear: true });
} };
}
this._fireEvent("boxzoomcancel", e6);
}
}, Uo.prototype.keydown = function(t6) {
this._active && 27 === t6.keyCode && (this.reset(), this._fireEvent("boxzoomcancel", t6));
}, Uo.prototype.blur = function() {
this.reset();
}, Uo.prototype.reset = function() {
this._active = false, this._container.classList.remove("mapboxgl-crosshair"), this._box && (i5.remove(this._box), this._box = null), i5.enableDrag(), delete this._startPos, delete this._lastPos;
}, Uo.prototype._fireEvent = function(e6, i6) {
return this._map.fire(new t5.Event(e6, { originalEvent: i6 }));
};
var Zo = function(t6) {
this.reset(), this.numTouches = t6.numTouches;
};
Zo.prototype.reset = function() {
delete this.centroid, delete this.startTime, delete this.touches, this.aborted = false;
}, Zo.prototype.touchstart = function(e6, i6, o6) {
(this.centroid || o6.length > this.numTouches) && (this.aborted = true), this.aborted || (void 0 === this.startTime && (this.startTime = e6.timeStamp), o6.length === this.numTouches && (this.centroid = function(e7) {
for (var i7 = new t5.Point(0, 0), o7 = 0, r7 = e7; o7 < r7.length; o7 += 1) {
i7._add(r7[o7]);
}
return i7.div(e7.length);
}(i6), this.touches = No(o6, i6)));
}, Zo.prototype.touchmove = function(t6, e6, i6) {
if (!this.aborted && this.centroid) {
var o6 = No(i6, e6);
for (var r7 in this.touches) {
var a6 = o6[r7];
(!a6 || a6.dist(this.touches[r7]) > 30) && (this.aborted = true);
}
}
}, Zo.prototype.touchend = function(t6, e6, i6) {
if ((!this.centroid || t6.timeStamp - this.startTime > 500) && (this.aborted = true), 0 === i6.length) {
var o6 = !this.aborted && this.centroid;
if (this.reset(), o6) {
return o6;
}
}
};
var qo = function(t6) {
this.singleTap = new Zo(t6), this.numTaps = t6.numTaps, this.reset();
};
qo.prototype.reset = function() {
this.lastTime = 1 / 0, delete this.lastTap, this.count = 0, this.singleTap.reset();
}, qo.prototype.touchstart = function(t6, e6, i6) {
this.singleTap.touchstart(t6, e6, i6);
}, qo.prototype.touchmove = function(t6, e6, i6) {
this.singleTap.touchmove(t6, e6, i6);
}, qo.prototype.touchend = function(t6, e6, i6) {
var o6 = this.singleTap.touchend(t6, e6, i6);
if (o6) {
var r7 = t6.timeStamp - this.lastTime < 500, a6 = !this.lastTap || this.lastTap.dist(o6) < 30;
if (r7 && a6 || this.reset(), this.count++, this.lastTime = t6.timeStamp, this.lastTap = o6, this.count === this.numTaps) {
return this.reset(), o6;
}
}
};
var jo = function() {
this._zoomIn = new qo({ numTouches: 1, numTaps: 2 }), this._zoomOut = new qo({ numTouches: 2, numTaps: 1 }), this.reset();
};
jo.prototype.reset = function() {
this._active = false, this._zoomIn.reset(), this._zoomOut.reset();
}, jo.prototype.touchstart = function(t6, e6, i6) {
this._zoomIn.touchstart(t6, e6, i6), this._zoomOut.touchstart(t6, e6, i6);
}, jo.prototype.touchmove = function(t6, e6, i6) {
this._zoomIn.touchmove(t6, e6, i6), this._zoomOut.touchmove(t6, e6, i6);
}, jo.prototype.touchend = function(t6, e6, i6) {
var o6 = this, r7 = this._zoomIn.touchend(t6, e6, i6), a6 = this._zoomOut.touchend(t6, e6, i6);
return r7 ? (this._active = true, t6.preventDefault(), setTimeout(function() {
return o6.reset();
}, 0), { cameraAnimation: function(e7) {
return e7.easeTo({ duration: 300, zoom: e7.getZoom() + 1, around: e7.unproject(r7) }, { originalEvent: t6 });
} }) : a6 ? (this._active = true, t6.preventDefault(), setTimeout(function() {
return o6.reset();
}, 0), { cameraAnimation: function(e7) {
return e7.easeTo({ duration: 300, zoom: e7.getZoom() - 1, around: e7.unproject(a6) }, { originalEvent: t6 });
} }) : void 0;
}, jo.prototype.touchcancel = function() {
this.reset();
}, jo.prototype.enable = function() {
this._enabled = true;
}, jo.prototype.disable = function() {
this._enabled = false, this.reset();
}, jo.prototype.isEnabled = function() {
return this._enabled;
}, jo.prototype.isActive = function() {
return this._active;
};
var Vo = { 0: 1, 2: 2 }, Go = function(t6) {
this.reset(), this._clickTolerance = t6.clickTolerance || 1;
};
Go.prototype.blur = function() {
this.reset();
}, Go.prototype.reset = function() {
this._active = false, this._moved = false, delete this._lastPoint, delete this._eventButton;
}, Go.prototype._correctButton = function(t6, e6) {
return false;
}, Go.prototype._move = function(t6, e6) {
return {};
}, Go.prototype.mousedown = function(t6, e6) {
if (!this._lastPoint) {
var o6 = i5.mouseButton(t6);
this._correctButton(t6, o6) && (this._lastPoint = e6, this._eventButton = o6);
}
}, Go.prototype.mousemoveWindow = function(t6, e6) {
var i6 = this._lastPoint;
if (i6) {
if (t6.preventDefault(), function(t7, e7) {
var i7 = Vo[e7];
return void 0 === t7.buttons || (t7.buttons & i7) !== i7;
}(t6, this._eventButton)) {
this.reset();
} else if (this._moved || !(e6.dist(i6) < this._clickTolerance)) {
return this._moved = true, this._lastPoint = e6, this._move(i6, e6);
}
}
}, Go.prototype.mouseupWindow = function(t6) {
this._lastPoint && i5.mouseButton(t6) === this._eventButton && (this._moved && i5.suppressClick(), this.reset());
}, Go.prototype.enable = function() {
this._enabled = true;
}, Go.prototype.disable = function() {
this._enabled = false, this.reset();
}, Go.prototype.isEnabled = function() {
return this._enabled;
}, Go.prototype.isActive = function() {
return this._active;
};
var Wo = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.mousedown = function(e7, i6) {
t6.prototype.mousedown.call(this, e7, i6), this._lastPoint && (this._active = true);
}, e6.prototype._correctButton = function(t7, e7) {
return 0 === e7 && !t7.ctrlKey;
}, e6.prototype._move = function(t7, e7) {
return { around: e7, panDelta: e7.sub(t7) };
}, e6;
}(Go), Xo = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._correctButton = function(t7, e7) {
return 0 === e7 && t7.ctrlKey || 2 === e7;
}, e6.prototype._move = function(t7, e7) {
var i6 = 0.8 * (e7.x - t7.x);
if (i6) {
return this._active = true, { bearingDelta: i6 };
}
}, e6.prototype.contextmenu = function(t7) {
t7.preventDefault();
}, e6;
}(Go), Ho = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype._correctButton = function(t7, e7) {
return 0 === e7 && t7.ctrlKey || 2 === e7;
}, e6.prototype._move = function(t7, e7) {
var i6 = -0.5 * (e7.y - t7.y);
if (i6) {
return this._active = true, { pitchDelta: i6 };
}
}, e6.prototype.contextmenu = function(t7) {
t7.preventDefault();
}, e6;
}(Go), Ko = function(t6) {
this._minTouches = 1, this._clickTolerance = t6.clickTolerance || 1, this.reset();
};
Ko.prototype.reset = function() {
this._active = false, this._touches = {}, this._sum = new t5.Point(0, 0);
}, Ko.prototype.touchstart = function(t6, e6, i6) {
return this._calculateTransform(t6, e6, i6);
}, Ko.prototype.touchmove = function(t6, e6, i6) {
if (this._active && !(i6.length < this._minTouches)) {
return t6.preventDefault(), this._calculateTransform(t6, e6, i6);
}
}, Ko.prototype.touchend = function(t6, e6, i6) {
this._calculateTransform(t6, e6, i6), this._active && i6.length < this._minTouches && this.reset();
}, Ko.prototype.touchcancel = function() {
this.reset();
}, Ko.prototype._calculateTransform = function(e6, i6, o6) {
o6.length > 0 && (this._active = true);
var r7 = No(o6, i6), a6 = new t5.Point(0, 0), n8 = new t5.Point(0, 0), s7 = 0;
for (var l8 in r7) {
var c5 = r7[l8], u5 = this._touches[l8];
u5 && (a6._add(c5), n8._add(c5.sub(u5)), s7++, r7[l8] = c5);
}
if (this._touches = r7, !(s7 < this._minTouches) && n8.mag()) {
var h7 = n8.div(s7);
if (this._sum._add(h7), !(this._sum.mag() < this._clickTolerance)) {
return { around: a6.div(s7), panDelta: h7 };
}
}
}, Ko.prototype.enable = function() {
this._enabled = true;
}, Ko.prototype.disable = function() {
this._enabled = false, this.reset();
}, Ko.prototype.isEnabled = function() {
return this._enabled;
}, Ko.prototype.isActive = function() {
return this._active;
};
var Yo = function() {
this.reset();
};
function Jo(t6, e6, i6) {
for (var o6 = 0; o6 < t6.length; o6++) {
if (t6[o6].identifier === i6) {
return e6[o6];
}
}
}
function Qo(t6, e6) {
return Math.log(t6 / e6) / Math.LN2;
}
Yo.prototype.reset = function() {
this._active = false, delete this._firstTwoTouches;
}, Yo.prototype._start = function(t6) {
}, Yo.prototype._move = function(t6, e6, i6) {
return {};
}, Yo.prototype.touchstart = function(t6, e6, i6) {
this._firstTwoTouches || i6.length < 2 || (this._firstTwoTouches = [i6[0].identifier, i6[1].identifier], this._start([e6[0], e6[1]]));
}, Yo.prototype.touchmove = function(t6, e6, i6) {
if (this._firstTwoTouches) {
t6.preventDefault();
var o6 = this._firstTwoTouches, r7 = o6[1], a6 = Jo(i6, e6, o6[0]), n8 = Jo(i6, e6, r7);
if (a6 && n8) {
var s7 = this._aroundCenter ? null : a6.add(n8).div(2);
return this._move([a6, n8], s7, t6);
}
}
}, Yo.prototype.touchend = function(t6, e6, o6) {
if (this._firstTwoTouches) {
var r7 = this._firstTwoTouches, a6 = r7[1], n8 = Jo(o6, e6, r7[0]), s7 = Jo(o6, e6, a6);
n8 && s7 || (this._active && i5.suppressClick(), this.reset());
}
}, Yo.prototype.touchcancel = function() {
this.reset();
}, Yo.prototype.enable = function(t6) {
this._enabled = true, this._aroundCenter = !!t6 && "center" === t6.around;
}, Yo.prototype.disable = function() {
this._enabled = false, this.reset();
}, Yo.prototype.isEnabled = function() {
return this._enabled;
}, Yo.prototype.isActive = function() {
return this._active;
};
var $o = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.reset = function() {
t6.prototype.reset.call(this), delete this._distance, delete this._startDistance;
}, e6.prototype._start = function(t7) {
this._startDistance = this._distance = t7[0].dist(t7[1]);
}, e6.prototype._move = function(t7, e7) {
var i6 = this._distance;
if (this._distance = t7[0].dist(t7[1]), this._active || !(Math.abs(Qo(this._distance, this._startDistance)) < 0.1)) {
return this._active = true, { zoomDelta: Qo(this._distance, i6), pinchAround: e7 };
}
}, e6;
}(Yo);
function tr2(t6, e6) {
return 180 * t6.angleWith(e6) / Math.PI;
}
var er = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.reset = function() {
t6.prototype.reset.call(this), delete this._minDiameter, delete this._startVector, delete this._vector;
}, e6.prototype._start = function(t7) {
this._startVector = this._vector = t7[0].sub(t7[1]), this._minDiameter = t7[0].dist(t7[1]);
}, e6.prototype._move = function(t7, e7) {
var i6 = this._vector;
if (this._vector = t7[0].sub(t7[1]), this._active || !this._isBelowThreshold(this._vector)) {
return this._active = true, { bearingDelta: tr2(this._vector, i6), pinchAround: e7 };
}
}, e6.prototype._isBelowThreshold = function(t7) {
this._minDiameter = Math.min(this._minDiameter, t7.mag());
var e7 = 25 / (Math.PI * this._minDiameter) * 360, i6 = tr2(t7, this._startVector);
return Math.abs(i6) < e7;
}, e6;
}(Yo);
function ir(t6) {
return Math.abs(t6.y) > Math.abs(t6.x);
}
var or = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6.prototype.reset = function() {
t6.prototype.reset.call(this), this._valid = void 0, delete this._firstMove, delete this._lastPoints;
}, e6.prototype._start = function(t7) {
this._lastPoints = t7, ir(t7[0].sub(t7[1])) && (this._valid = false);
}, e6.prototype._move = function(t7, e7, i6) {
var o6 = t7[0].sub(this._lastPoints[0]), r7 = t7[1].sub(this._lastPoints[1]);
if (this._valid = this.gestureBeginsVertically(o6, r7, i6.timeStamp), this._valid) {
return this._lastPoints = t7, this._active = true, { pitchDelta: (o6.y + r7.y) / 2 * -0.5 };
}
}, e6.prototype.gestureBeginsVertically = function(t7, e7, i6) {
if (void 0 !== this._valid) {
return this._valid;
}
var o6 = t7.mag() >= 2, r7 = e7.mag() >= 2;
if (o6 || r7) {
if (!o6 || !r7) {
return void 0 === this._firstMove && (this._firstMove = i6), i6 - this._firstMove < 100 && void 0;
}
var a6 = t7.y > 0 == e7.y > 0;
return ir(t7) && ir(e7) && a6;
}
}, e6;
}(Yo), rr = { panStep: 100, bearingStep: 15, pitchStep: 10 }, ar = function() {
var t6 = rr;
this._panStep = t6.panStep, this._bearingStep = t6.bearingStep, this._pitchStep = t6.pitchStep, this._rotationDisabled = false;
};
function nr(t6) {
return t6 * (2 - t6);
}
ar.prototype.blur = function() {
this.reset();
}, ar.prototype.reset = function() {
this._active = false;
}, ar.prototype.keydown = function(t6) {
var e6 = this;
if (!(t6.altKey || t6.ctrlKey || t6.metaKey)) {
var i6 = 0, o6 = 0, r7 = 0, a6 = 0, n8 = 0;
switch (t6.keyCode) {
case 61:
case 107:
case 171:
case 187:
i6 = 1;
break;
case 189:
case 109:
case 173:
i6 = -1;
break;
case 37:
t6.shiftKey ? o6 = -1 : (t6.preventDefault(), a6 = -1);
break;
case 39:
t6.shiftKey ? o6 = 1 : (t6.preventDefault(), a6 = 1);
break;
case 38:
t6.shiftKey ? r7 = 1 : (t6.preventDefault(), n8 = -1);
break;
case 40:
t6.shiftKey ? r7 = -1 : (t6.preventDefault(), n8 = 1);
break;
default:
return;
}
return this._rotationDisabled && (o6 = 0, r7 = 0), { cameraAnimation: function(s7) {
var l8 = s7.getZoom();
s7.easeTo({ duration: 300, easeId: "keyboardHandler", easing: nr, zoom: i6 ? Math.round(l8) + i6 * (t6.shiftKey ? 2 : 1) : l8, bearing: s7.getBearing() + o6 * e6._bearingStep, pitch: s7.getPitch() + r7 * e6._pitchStep, offset: [-a6 * e6._panStep, -n8 * e6._panStep], center: s7.getCenter() }, { originalEvent: t6 });
} };
}
}, ar.prototype.enable = function() {
this._enabled = true;
}, ar.prototype.disable = function() {
this._enabled = false, this.reset();
}, ar.prototype.isEnabled = function() {
return this._enabled;
}, ar.prototype.isActive = function() {
return this._active;
}, ar.prototype.disableRotation = function() {
this._rotationDisabled = true;
}, ar.prototype.enableRotation = function() {
this._rotationDisabled = false;
};
var sr = function(e6, i6) {
this._map = e6, this._el = e6.getCanvasContainer(), this._handler = i6, this._delta = 0, this._defaultZoomRate = 0.01, this._wheelZoomRate = 1 / 450, t5.bindAll(["_onTimeout"], this);
};
sr.prototype.setZoomRate = function(t6) {
this._defaultZoomRate = t6;
}, sr.prototype.setWheelZoomRate = function(t6) {
this._wheelZoomRate = t6;
}, sr.prototype.isEnabled = function() {
return !!this._enabled;
}, sr.prototype.isActive = function() {
return !!this._active || void 0 !== this._finishTimeout;
}, sr.prototype.isZooming = function() {
return !!this._zooming;
}, sr.prototype.enable = function(t6) {
this.isEnabled() || (this._enabled = true, this._aroundCenter = t6 && "center" === t6.around);
}, sr.prototype.disable = function() {
this.isEnabled() && (this._enabled = false);
}, sr.prototype.wheel = function(e6) {
if (this.isEnabled()) {
var i6 = e6.deltaMode === t5.window.WheelEvent.DOM_DELTA_LINE ? 40 * e6.deltaY : e6.deltaY, o6 = t5.browser.now(), r7 = o6 - (this._lastWheelEventTime || 0);
this._lastWheelEventTime = o6, 0 !== i6 && i6 % 4.000244140625 == 0 ? this._type = "wheel" : 0 !== i6 && Math.abs(i6) < 4 ? this._type = "trackpad" : r7 > 400 ? (this._type = null, this._lastValue = i6, this._timeout = setTimeout(this._onTimeout, 40, e6)) : this._type || (this._type = Math.abs(r7 * i6) < 200 ? "trackpad" : "wheel", this._timeout && (clearTimeout(this._timeout), this._timeout = null, i6 += this._lastValue)), e6.shiftKey && i6 && (i6 /= 4), this._type && (this._lastWheelEvent = e6, this._delta -= i6, this._active || this._start(e6)), e6.preventDefault();
}
}, sr.prototype._onTimeout = function(t6) {
this._type = "wheel", this._delta -= this._lastValue, this._active || this._start(t6);
}, sr.prototype._start = function(e6) {
if (this._delta) {
this._frameId && (this._frameId = null), this._active = true, this.isZooming() || (this._zooming = true), this._finishTimeout && (clearTimeout(this._finishTimeout), delete this._finishTimeout);
var o6 = i5.mousePos(this._el, e6);
this._around = t5.LngLat.convert(this._aroundCenter ? this._map.getCenter() : this._map.unproject(o6)), this._aroundPoint = this._map.transform.locationPoint(this._around), this._frameId || (this._frameId = true, this._handler._triggerRenderFrame());
}
}, sr.prototype.renderFrame = function() {
var e6 = this;
if (this._frameId && (this._frameId = null, this.isActive())) {
var i6 = this._map.transform;
if (0 !== this._delta) {
var o6 = "wheel" === this._type && Math.abs(this._delta) > 4.000244140625 ? this._wheelZoomRate : this._defaultZoomRate, r7 = 2 / (1 + Math.exp(-Math.abs(this._delta * o6)));
this._delta < 0 && 0 !== r7 && (r7 = 1 / r7);
var a6 = "number" == typeof this._targetZoom ? i6.zoomScale(this._targetZoom) : i6.scale;
this._targetZoom = Math.min(i6.maxZoom, Math.max(i6.minZoom, i6.scaleZoom(a6 * r7))), "wheel" === this._type && (this._startZoom = i6.zoom, this._easing = this._smoothOutEasing(200)), this._delta = 0;
}
var n8, s7 = "number" == typeof this._targetZoom ? this._targetZoom : i6.zoom, l8 = this._startZoom, c5 = this._easing, u5 = false;
if ("wheel" === this._type && l8 && c5) {
var h7 = Math.min((t5.browser.now() - this._lastWheelEventTime) / 200, 1), p5 = c5(h7);
n8 = t5.number(l8, s7, p5), h7 < 1 ? this._frameId || (this._frameId = true) : u5 = true;
} else {
n8 = s7, u5 = true;
}
return this._active = true, u5 && (this._active = false, this._finishTimeout = setTimeout(function() {
e6._zooming = false, e6._handler._triggerRenderFrame(), delete e6._targetZoom, delete e6._finishTimeout;
}, 200)), { noInertia: true, needsRenderFrame: !u5, zoomDelta: n8 - i6.zoom, around: this._aroundPoint, originalEvent: this._lastWheelEvent };
}
}, sr.prototype._smoothOutEasing = function(e6) {
var i6 = t5.ease;
if (this._prevEase) {
var o6 = this._prevEase, r7 = (t5.browser.now() - o6.start) / o6.duration, a6 = o6.easing(r7 + 0.01) - o6.easing(r7), n8 = 0.27 / Math.sqrt(a6 * a6 + 1e-4) * 0.01, s7 = Math.sqrt(0.0729 - n8 * n8);
i6 = t5.bezier(n8, s7, 0.25, 1);
}
return this._prevEase = { start: t5.browser.now(), duration: e6, easing: i6 }, i6;
}, sr.prototype.blur = function() {
this.reset();
}, sr.prototype.reset = function() {
this._active = false;
};
var lr = function(t6, e6) {
this._clickZoom = t6, this._tapZoom = e6;
};
lr.prototype.enable = function() {
this._clickZoom.enable(), this._tapZoom.enable();
}, lr.prototype.disable = function() {
this._clickZoom.disable(), this._tapZoom.disable();
}, lr.prototype.isEnabled = function() {
return this._clickZoom.isEnabled() && this._tapZoom.isEnabled();
}, lr.prototype.isActive = function() {
return this._clickZoom.isActive() || this._tapZoom.isActive();
};
var cr = function() {
this.reset();
};
cr.prototype.reset = function() {
this._active = false;
}, cr.prototype.blur = function() {
this.reset();
}, cr.prototype.dblclick = function(t6, e6) {
return t6.preventDefault(), { cameraAnimation: function(i6) {
i6.easeTo({ duration: 300, zoom: i6.getZoom() + (t6.shiftKey ? -1 : 1), around: i6.unproject(e6) }, { originalEvent: t6 });
} };
}, cr.prototype.enable = function() {
this._enabled = true;
}, cr.prototype.disable = function() {
this._enabled = false, this.reset();
}, cr.prototype.isEnabled = function() {
return this._enabled;
}, cr.prototype.isActive = function() {
return this._active;
};
var ur = function() {
this._tap = new qo({ numTouches: 1, numTaps: 1 }), this.reset();
};
ur.prototype.reset = function() {
this._active = false, delete this._swipePoint, delete this._swipeTouch, delete this._tapTime, this._tap.reset();
}, ur.prototype.touchstart = function(t6, e6, i6) {
this._swipePoint || (this._tapTime && t6.timeStamp - this._tapTime > 500 && this.reset(), this._tapTime ? i6.length > 0 && (this._swipePoint = e6[0], this._swipeTouch = i6[0].identifier) : this._tap.touchstart(t6, e6, i6));
}, ur.prototype.touchmove = function(t6, e6, i6) {
if (this._tapTime) {
if (this._swipePoint) {
if (i6[0].identifier !== this._swipeTouch) {
return;
}
var o6 = e6[0], r7 = o6.y - this._swipePoint.y;
return this._swipePoint = o6, t6.preventDefault(), this._active = true, { zoomDelta: r7 / 128 };
}
} else {
this._tap.touchmove(t6, e6, i6);
}
}, ur.prototype.touchend = function(t6, e6, i6) {
this._tapTime ? this._swipePoint && 0 === i6.length && this.reset() : this._tap.touchend(t6, e6, i6) && (this._tapTime = t6.timeStamp);
}, ur.prototype.touchcancel = function() {
this.reset();
}, ur.prototype.enable = function() {
this._enabled = true;
}, ur.prototype.disable = function() {
this._enabled = false, this.reset();
}, ur.prototype.isEnabled = function() {
return this._enabled;
}, ur.prototype.isActive = function() {
return this._active;
};
var hr = function(t6, e6, i6) {
this._el = t6, this._mousePan = e6, this._touchPan = i6;
};
hr.prototype.enable = function(t6) {
this._inertiaOptions = t6 || {}, this._mousePan.enable(), this._touchPan.enable(), this._el.classList.add("mapboxgl-touch-drag-pan");
}, hr.prototype.disable = function() {
this._mousePan.disable(), this._touchPan.disable(), this._el.classList.remove("mapboxgl-touch-drag-pan");
}, hr.prototype.isEnabled = function() {
return this._mousePan.isEnabled() && this._touchPan.isEnabled();
}, hr.prototype.isActive = function() {
return this._mousePan.isActive() || this._touchPan.isActive();
};
var pr = function(t6, e6, i6) {
this._pitchWithRotate = t6.pitchWithRotate, this._mouseRotate = e6, this._mousePitch = i6;
};
pr.prototype.enable = function() {
this._mouseRotate.enable(), this._pitchWithRotate && this._mousePitch.enable();
}, pr.prototype.disable = function() {
this._mouseRotate.disable(), this._mousePitch.disable();
}, pr.prototype.isEnabled = function() {
return this._mouseRotate.isEnabled() && (!this._pitchWithRotate || this._mousePitch.isEnabled());
}, pr.prototype.isActive = function() {
return this._mouseRotate.isActive() || this._mousePitch.isActive();
};
var dr = function(t6, e6, i6, o6) {
this._el = t6, this._touchZoom = e6, this._touchRotate = i6, this._tapDragZoom = o6, this._rotationDisabled = false, this._enabled = true;
};
dr.prototype.enable = function(t6) {
this._touchZoom.enable(t6), this._rotationDisabled || this._touchRotate.enable(t6), this._tapDragZoom.enable(), this._el.classList.add("mapboxgl-touch-zoom-rotate");
}, dr.prototype.disable = function() {
this._touchZoom.disable(), this._touchRotate.disable(), this._tapDragZoom.disable(), this._el.classList.remove("mapboxgl-touch-zoom-rotate");
}, dr.prototype.isEnabled = function() {
return this._touchZoom.isEnabled() && (this._rotationDisabled || this._touchRotate.isEnabled()) && this._tapDragZoom.isEnabled();
}, dr.prototype.isActive = function() {
return this._touchZoom.isActive() || this._touchRotate.isActive() || this._tapDragZoom.isActive();
}, dr.prototype.disableRotation = function() {
this._rotationDisabled = true, this._touchRotate.disable();
}, dr.prototype.enableRotation = function() {
this._rotationDisabled = false, this._touchZoom.isEnabled() && this._touchRotate.enable();
};
var _r = function(t6) {
return t6.zoom || t6.drag || t6.pitch || t6.rotate;
}, fr = function(t6) {
function e6() {
t6.apply(this, arguments);
}
return t6 && (e6.__proto__ = t6), (e6.prototype = Object.create(t6 && t6.prototype)).constructor = e6, e6;
}(t5.Event);
function mr(t6) {
return t6.panDelta && t6.panDelta.mag() || t6.zoomDelta || t6.bearingDelta || t6.pitchDelta;
}
var gr = function(e6, o6) {
this._map = e6, this._el = this._map.getCanvasContainer(), this._handlers = [], this._handlersById = {}, this._changes = [], this._inertia = new Ao(e6), this._bearingSnap = o6.bearingSnap, this._previousActiveHandlers = {}, this._eventsInProgress = {}, this._addDefaultHandlers(o6), t5.bindAll(["handleEvent", "handleWindowEvent"], this);
var r7 = this._el;
this._listeners = [[r7, "touchstart", { passive: true }], [r7, "touchmove", { passive: false }], [r7, "touchend", void 0], [r7, "touchcancel", void 0], [r7, "mousedown", void 0], [r7, "mousemove", void 0], [r7, "mouseup", void 0], [t5.window.document, "mousemove", { capture: true }], [t5.window.document, "mouseup", void 0], [r7, "mouseover", void 0], [r7, "mouseout", void 0], [r7, "dblclick", void 0], [r7, "click", void 0], [r7, "keydown", { capture: false }], [r7, "keyup", void 0], [r7, "wheel", { passive: false }], [r7, "contextmenu", void 0], [t5.window, "blur", void 0]];
for (var a6 = 0, n8 = this._listeners; a6 < n8.length; a6 += 1) {
var s7 = n8[a6], l8 = s7[0];
i5.addEventListener(l8, s7[1], l8 === t5.window.document ? this.handleWindowEvent : this.handleEvent, s7[2]);
}
};
gr.prototype.destroy = function() {
for (var e6 = 0, o6 = this._listeners; e6 < o6.length; e6 += 1) {
var r7 = o6[e6], a6 = r7[0];
i5.removeEventListener(a6, r7[1], a6 === t5.window.document ? this.handleWindowEvent : this.handleEvent, r7[2]);
}
}, gr.prototype._addDefaultHandlers = function(t6) {
var e6 = this._map, i6 = e6.getCanvasContainer();
this._add("mapEvent", new Oo(e6, t6));
var o6 = e6.boxZoom = new Uo(e6, t6);
this._add("boxZoom", o6);
var r7 = new jo(), a6 = new cr();
e6.doubleClickZoom = new lr(a6, r7), this._add("tapZoom", r7), this._add("clickZoom", a6);
var n8 = new ur();
this._add("tapDragZoom", n8);
var s7 = e6.touchPitch = new or();
this._add("touchPitch", s7);
var l8 = new Xo(t6), c5 = new Ho(t6);
e6.dragRotate = new pr(t6, l8, c5), this._add("mouseRotate", l8, ["mousePitch"]), this._add("mousePitch", c5, ["mouseRotate"]);
var u5 = new Wo(t6), h7 = new Ko(t6);
e6.dragPan = new hr(i6, u5, h7), this._add("mousePan", u5), this._add("touchPan", h7, ["touchZoom", "touchRotate"]);
var p5 = new er(), d5 = new $o();
e6.touchZoomRotate = new dr(i6, d5, p5, n8), this._add("touchRotate", p5, ["touchPan", "touchZoom"]), this._add("touchZoom", d5, ["touchPan", "touchRotate"]);
var _4 = e6.scrollZoom = new sr(e6, this);
this._add("scrollZoom", _4, ["mousePan"]);
var f5 = e6.keyboard = new ar();
this._add("keyboard", f5), this._add("blockableMapEvent", new Fo(e6));
for (var m5 = 0, g5 = ["boxZoom", "doubleClickZoom", "tapDragZoom", "touchPitch", "dragRotate", "dragPan", "touchZoomRotate", "scrollZoom", "keyboard"]; m5 < g5.length; m5 += 1) {
var v5 = g5[m5];
t6.interactive && t6[v5] && e6[v5].enable(t6[v5]);
}
}, gr.prototype._add = function(t6, e6, i6) {
this._handlers.push({ handlerName: t6, handler: e6, allowed: i6 }), this._handlersById[t6] = e6;
}, gr.prototype.stop = function(t6) {
if (!this._updatingCamera) {
for (var e6 = 0, i6 = this._handlers; e6 < i6.length; e6 += 1) {
i6[e6].handler.reset();
}
this._inertia.clear(), this._fireEvents({}, {}, t6), this._changes = [];
}
}, gr.prototype.isActive = function() {
for (var t6 = 0, e6 = this._handlers; t6 < e6.length; t6 += 1) {
if (e6[t6].handler.isActive()) {
return true;
}
}
return false;
}, gr.prototype.isZooming = function() {
return !!this._eventsInProgress.zoom || this._map.scrollZoom.isZooming();
}, gr.prototype.isRotating = function() {
return !!this._eventsInProgress.rotate;
}, gr.prototype.isMoving = function() {
return Boolean(_r(this._eventsInProgress)) || this.isZooming();
}, gr.prototype._blockedByActive = function(t6, e6, i6) {
for (var o6 in t6) {
if (o6 !== i6 && (!e6 || e6.indexOf(o6) < 0)) {
return true;
}
}
return false;
}, gr.prototype.handleWindowEvent = function(t6) {
this.handleEvent(t6, t6.type + "Window");
}, gr.prototype._getMapTouches = function(t6) {
for (var e6 = [], i6 = 0, o6 = t6; i6 < o6.length; i6 += 1) {
var r7 = o6[i6];
this._el.contains(r7.target) && e6.push(r7);
}
return e6;
}, gr.prototype.handleEvent = function(t6, e6) {
this._updatingCamera = true;
for (var o6 = "renderFrame" === t6.type ? void 0 : t6, r7 = { needsRenderFrame: false }, a6 = {}, n8 = {}, s7 = t6.touches ? this._getMapTouches(t6.touches) : void 0, l8 = s7 ? i5.touchPos(this._el, s7) : i5.mousePos(this._el, t6), c5 = 0, u5 = this._handlers; c5 < u5.length; c5 += 1) {
var h7 = u5[c5], p5 = h7.handlerName, d5 = h7.handler, _4 = h7.allowed;
if (d5.isEnabled()) {
var f5 = void 0;
this._blockedByActive(n8, _4, p5) ? d5.reset() : d5[e6 || t6.type] && (f5 = d5[e6 || t6.type](t6, l8, s7), this.mergeHandlerResult(r7, a6, f5, p5, o6), f5 && f5.needsRenderFrame && this._triggerRenderFrame()), (f5 || d5.isActive()) && (n8[p5] = d5);
}
}
var m5 = {};
for (var g5 in this._previousActiveHandlers) {
n8[g5] || (m5[g5] = o6);
}
this._previousActiveHandlers = n8, (Object.keys(m5).length || mr(r7)) && (this._changes.push([r7, a6, m5]), this._triggerRenderFrame()), (Object.keys(n8).length || mr(r7)) && this._map._stop(true), this._updatingCamera = false;
var v5 = r7.cameraAnimation;
v5 && (this._inertia.clear(), this._fireEvents({}, {}, true), this._changes = [], v5(this._map));
}, gr.prototype.mergeHandlerResult = function(e6, i6, o6, r7, a6) {
if (o6) {
t5.extend(e6, o6);
var n8 = { handlerName: r7, originalEvent: o6.originalEvent || a6 };
void 0 !== o6.zoomDelta && (i6.zoom = n8), void 0 !== o6.panDelta && (i6.drag = n8), void 0 !== o6.pitchDelta && (i6.pitch = n8), void 0 !== o6.bearingDelta && (i6.rotate = n8);
}
}, gr.prototype._applyChanges = function() {
for (var e6 = {}, i6 = {}, o6 = {}, r7 = 0, a6 = this._changes; r7 < a6.length; r7 += 1) {
var n8 = a6[r7], s7 = n8[0], l8 = n8[1], c5 = n8[2];
s7.panDelta && (e6.panDelta = (e6.panDelta || new t5.Point(0, 0))._add(s7.panDelta)), s7.zoomDelta && (e6.zoomDelta = (e6.zoomDelta || 0) + s7.zoomDelta), s7.bearingDelta && (e6.bearingDelta = (e6.bearingDelta || 0) + s7.bearingDelta), s7.pitchDelta && (e6.pitchDelta = (e6.pitchDelta || 0) + s7.pitchDelta), void 0 !== s7.around && (e6.around = s7.around), void 0 !== s7.pinchAround && (e6.pinchAround = s7.pinchAround), s7.noInertia && (e6.noInertia = s7.noInertia), t5.extend(i6, l8), t5.extend(o6, c5);
}
this._updateMapTransform(e6, i6, o6), this._changes = [];
}, gr.prototype._updateMapTransform = function(t6, e6, i6) {
var o6 = this._map, r7 = o6.transform;
if (!mr(t6)) {
return this._fireEvents(e6, i6, true);
}
var a6 = t6.panDelta, n8 = t6.zoomDelta, s7 = t6.bearingDelta, l8 = t6.pitchDelta, c5 = t6.around, u5 = t6.pinchAround;
void 0 !== u5 && (c5 = u5), o6._stop(true), c5 = c5 || o6.transform.centerPoint;
var h7 = r7.pointLocation(a6 ? c5.sub(a6) : c5);
s7 && (r7.bearing += s7), l8 && (r7.pitch += l8), n8 && (r7.zoom += n8), r7.setLocationAtPoint(h7, c5), this._map._update(), t6.noInertia || this._inertia.record(t6), this._fireEvents(e6, i6, true);
}, gr.prototype._fireEvents = function(e6, i6, o6) {
var r7 = this, a6 = _r(this._eventsInProgress), n8 = _r(e6), s7 = {};
for (var l8 in e6) {
this._eventsInProgress[l8] || (s7[l8 + "start"] = e6[l8].originalEvent), this._eventsInProgress[l8] = e6[l8];
}
for (var c5 in !a6 && n8 && this._fireEvent("movestart", n8.originalEvent), s7) {
this._fireEvent(c5, s7[c5]);
}
for (var u5 in n8 && this._fireEvent("move", n8.originalEvent), e6) {
this._fireEvent(u5, e6[u5].originalEvent);
}
var h7, p5 = {};
for (var d5 in this._eventsInProgress) {
var _4 = this._eventsInProgress[d5], f5 = _4.handlerName, m5 = _4.originalEvent;
this._handlersById[f5].isActive() || (delete this._eventsInProgress[d5], p5[d5 + "end"] = h7 = i6[f5] || m5);
}
for (var g5 in p5) {
this._fireEvent(g5, p5[g5]);
}
var v5 = _r(this._eventsInProgress);
if (o6 && (a6 || n8) && !v5) {
this._updatingCamera = true;
var y5 = this._inertia._onMoveEnd(this._map.dragPan._inertiaOptions), x5 = function(t6) {
return 0 !== t6 && -r7._bearingSnap < t6 && t6 < r7._bearingSnap;
};
y5 ? (x5(y5.bearing || this._map.getBearing()) && (y5.bearing = 0), this._map.easeTo(y5, { originalEvent: h7 })) : (this._map.fire(new t5.Event("moveend", { originalEvent: h7 })), x5(this._map.getBearing()) && this._map.resetNorth()), this._updatingCamera = false;
}
}, gr.prototype._fireEvent = function(e6, i6) {
this._map.fire(new t5.Event(e6, i6 ? { originalEvent: i6 } : {}));
}, gr.prototype._requestFrame = function() {
var t6 = this;
return this._map.triggerRepaint(), this._map._renderTaskQueue.add(function(e6) {
delete t6._frameId, t6.handleEvent(new fr("renderFrame", { timeStamp: e6 })), t6._applyChanges();
});
}, gr.prototype._triggerRenderFrame = function() {
void 0 === this._frameId && (this._frameId = this._requestFrame());
};
var vr = function(e6) {
function i6(i7, o6) {
e6.call(this), this._moving = false, this._zooming = false, this.transform = i7, this._bearingSnap = o6.bearingSnap, t5.bindAll(["_renderFrameCallback"], this);
}
return e6 && (i6.__proto__ = e6), (i6.prototype = Object.create(e6 && e6.prototype)).constructor = i6, i6.prototype.getCenter = function() {
return new t5.LngLat(this.transform.center.lng, this.transform.center.lat);
}, i6.prototype.setCenter = function(t6, e7) {
return this.jumpTo({ center: t6 }, e7);
}, i6.prototype.panBy = function(e7, i7, o6) {
return e7 = t5.Point.convert(e7).mult(-1), this.panTo(this.transform.center, t5.extend({ offset: e7 }, i7), o6);
}, i6.prototype.panTo = function(e7, i7, o6) {
return this.easeTo(t5.extend({ center: e7 }, i7), o6);
}, i6.prototype.getZoom = function() {
return this.transform.zoom;
}, i6.prototype.setZoom = function(t6, e7) {
return this.jumpTo({ zoom: t6 }, e7), this;
}, i6.prototype.zoomTo = function(e7, i7, o6) {
return this.easeTo(t5.extend({ zoom: e7 }, i7), o6);
}, i6.prototype.zoomIn = function(t6, e7) {
return this.zoomTo(this.getZoom() + 1, t6, e7), this;
}, i6.prototype.zoomOut = function(t6, e7) {
return this.zoomTo(this.getZoom() - 1, t6, e7), this;
}, i6.prototype.getBearing = function() {
return this.transform.bearing;
}, i6.prototype.setBearing = function(t6, e7) {
return this.jumpTo({ bearing: t6 }, e7), this;
}, i6.prototype.getPadding = function() {
return this.transform.padding;
}, i6.prototype.setPadding = function(t6, e7) {
return this.jumpTo({ padding: t6 }, e7), this;
}, i6.prototype.rotateTo = function(e7, i7, o6) {
return this.easeTo(t5.extend({ bearing: e7 }, i7), o6);
}, i6.prototype.resetNorth = function(e7, i7) {
return this.rotateTo(0, t5.extend({ duration: 1e3 }, e7), i7), this;
}, i6.prototype.resetNorthPitch = function(e7, i7) {
return this.easeTo(t5.extend({ bearing: 0, pitch: 0, duration: 1e3 }, e7), i7), this;
}, i6.prototype.snapToNorth = function(t6, e7) {
return Math.abs(this.getBearing()) < this._bearingSnap ? this.resetNorth(t6, e7) : this;
}, i6.prototype.getPitch = function() {
return this.transform.pitch;
}, i6.prototype.setPitch = function(t6, e7) {
return this.jumpTo({ pitch: t6 }, e7), this;
}, i6.prototype.cameraForBounds = function(e7, i7) {
e7 = t5.LngLatBounds.convert(e7);
var o6 = i7 && i7.bearing || 0;
return this._cameraForBoxAndBearing(e7.getNorthWest(), e7.getSouthEast(), o6, i7);
}, i6.prototype._cameraForBoxAndBearing = function(e7, i7, o6, r7) {
var a6 = { top: 0, bottom: 0, right: 0, left: 0 };
if ("number" == typeof (r7 = t5.extend({ padding: a6, offset: [0, 0], maxZoom: this.transform.maxZoom }, r7)).padding) {
var n8 = r7.padding;
r7.padding = { top: n8, bottom: n8, right: n8, left: n8 };
}
r7.padding = t5.extend(a6, r7.padding);
var s7 = this.transform, l8 = s7.padding, c5 = s7.project(t5.LngLat.convert(e7)), u5 = s7.project(t5.LngLat.convert(i7)), h7 = c5.rotate(-o6 * Math.PI / 180), p5 = u5.rotate(-o6 * Math.PI / 180), d5 = new t5.Point(Math.max(h7.x, p5.x), Math.max(h7.y, p5.y)), _4 = new t5.Point(Math.min(h7.x, p5.x), Math.min(h7.y, p5.y)), f5 = d5.sub(_4), m5 = (s7.width - (l8.left + l8.right + r7.padding.left + r7.padding.right)) / f5.x, g5 = (s7.height - (l8.top + l8.bottom + r7.padding.top + r7.padding.bottom)) / f5.y;
if (!(g5 < 0 || m5 < 0)) {
var v5 = Math.min(s7.scaleZoom(s7.scale * Math.min(m5, g5)), r7.maxZoom), y5 = "number" == typeof r7.offset.x ? new t5.Point(r7.offset.x, r7.offset.y) : t5.Point.convert(r7.offset), x5 = new t5.Point((r7.padding.left - r7.padding.right) / 2, (r7.padding.top - r7.padding.bottom) / 2).rotate(o6 * Math.PI / 180), b5 = y5.add(x5).mult(s7.scale / s7.zoomScale(v5));
return { center: s7.unproject(c5.add(u5).div(2).sub(b5)), zoom: v5, bearing: o6 };
}
t5.warnOnce("Map cannot fit within canvas with the given bounds, padding, and/or offset.");
}, i6.prototype.fitBounds = function(t6, e7, i7) {
return this._fitInternal(this.cameraForBounds(t6, e7), e7, i7);
}, i6.prototype.fitScreenCoordinates = function(e7, i7, o6, r7, a6) {
return this._fitInternal(this._cameraForBoxAndBearing(this.transform.pointLocation(t5.Point.convert(e7)), this.transform.pointLocation(t5.Point.convert(i7)), o6, r7), r7, a6);
}, i6.prototype._fitInternal = function(e7, i7, o6) {
return e7 ? (delete (i7 = t5.extend(e7, i7)).padding, i7.linear ? this.easeTo(i7, o6) : this.flyTo(i7, o6)) : this;
}, i6.prototype.jumpTo = function(e7, i7) {
this.stop();
var o6 = this.transform, r7 = false, a6 = false, n8 = false;
return "zoom" in e7 && o6.zoom !== +e7.zoom && (r7 = true, o6.zoom = +e7.zoom), void 0 !== e7.center && (o6.center = t5.LngLat.convert(e7.center)), "bearing" in e7 && o6.bearing !== +e7.bearing && (a6 = true, o6.bearing = +e7.bearing), "pitch" in e7 && o6.pitch !== +e7.pitch && (n8 = true, o6.pitch = +e7.pitch), null == e7.padding || o6.isPaddingEqual(e7.padding) || (o6.padding = e7.padding), this.fire(new t5.Event("movestart", i7)).fire(new t5.Event("move", i7)), r7 && this.fire(new t5.Event("zoomstart", i7)).fire(new t5.Event("zoom", i7)).fire(new t5.Event("zoomend", i7)), a6 && this.fire(new t5.Event("rotatestart", i7)).fire(new t5.Event("rotate", i7)).fire(new t5.Event("rotateend", i7)), n8 && this.fire(new t5.Event("pitchstart", i7)).fire(new t5.Event("pitch", i7)).fire(new t5.Event("pitchend", i7)), this.fire(new t5.Event("moveend", i7));
}, i6.prototype.easeTo = function(e7, i7) {
var o6 = this;
this._stop(false, e7.easeId), (false === (e7 = t5.extend({ offset: [0, 0], duration: 500, easing: t5.ease }, e7)).animate || !e7.essential && t5.browser.prefersReducedMotion) && (e7.duration = 0);
var r7 = this.transform, a6 = this.getZoom(), n8 = this.getBearing(), s7 = this.getPitch(), l8 = this.getPadding(), c5 = "zoom" in e7 ? +e7.zoom : a6, u5 = "bearing" in e7 ? this._normalizeBearing(e7.bearing, n8) : n8, h7 = "pitch" in e7 ? +e7.pitch : s7, p5 = "padding" in e7 ? e7.padding : r7.padding, d5 = t5.Point.convert(e7.offset), _4 = r7.centerPoint.add(d5), f5 = r7.pointLocation(_4), m5 = t5.LngLat.convert(e7.center || f5);
this._normalizeCenter(m5);
var g5, v5, y5 = r7.project(f5), x5 = r7.project(m5).sub(y5), b5 = r7.zoomScale(c5 - a6);
e7.around && (g5 = t5.LngLat.convert(e7.around), v5 = r7.locationPoint(g5));
var w5 = { moving: this._moving, zooming: this._zooming, rotating: this._rotating, pitching: this._pitching };
return this._zooming = this._zooming || c5 !== a6, this._rotating = this._rotating || n8 !== u5, this._pitching = this._pitching || h7 !== s7, this._padding = !r7.isPaddingEqual(p5), this._easeId = e7.easeId, this._prepareEase(i7, e7.noMoveStart, w5), this._ease(function(e8) {
if (o6._zooming && (r7.zoom = t5.number(a6, c5, e8)), o6._rotating && (r7.bearing = t5.number(n8, u5, e8)), o6._pitching && (r7.pitch = t5.number(s7, h7, e8)), o6._padding && (r7.interpolatePadding(l8, p5, e8), _4 = r7.centerPoint.add(d5)), g5) {
r7.setLocationAtPoint(g5, v5);
} else {
var f6 = r7.zoomScale(r7.zoom - a6), m6 = c5 > a6 ? Math.min(2, b5) : Math.max(0.5, b5), w6 = Math.pow(m6, 1 - e8), T5 = r7.unproject(y5.add(x5.mult(e8 * w6)).mult(f6));
r7.setLocationAtPoint(r7.renderWorldCopies ? T5.wrap() : T5, _4);
}
o6._fireMoveEvents(i7);
}, function(t6) {
o6._afterEase(i7, t6);
}, e7), this;
}, i6.prototype._prepareEase = function(e7, i7, o6) {
void 0 === o6 && (o6 = {}), this._moving = true, i7 || o6.moving || this.fire(new t5.Event("movestart", e7)), this._zooming && !o6.zooming && this.fire(new t5.Event("zoomstart", e7)), this._rotating && !o6.rotating && this.fire(new t5.Event("rotatestart", e7)), this._pitching && !o6.pitching && this.fire(new t5.Event("pitchstart", e7));
}, i6.prototype._fireMoveEvents = function(e7) {
this.fire(new t5.Event("move", e7)), this._zooming && this.fire(new t5.Event("zoom", e7)), this._rotating && this.fire(new t5.Event("rotate", e7)), this._pitching && this.fire(new t5.Event("pitch", e7));
}, i6.prototype._afterEase = function(e7, i7) {
if (!this._easeId || !i7 || this._easeId !== i7) {
delete this._easeId;
var o6 = this._zooming, r7 = this._rotating, a6 = this._pitching;
this._moving = false, this._zooming = false, this._rotating = false, this._pitching = false, this._padding = false, o6 && this.fire(new t5.Event("zoomend", e7)), r7 && this.fire(new t5.Event("rotateend", e7)), a6 && this.fire(new t5.Event("pitchend", e7)), this.fire(new t5.Event("moveend", e7));
}
}, i6.prototype.flyTo = function(e7, i7) {
var o6 = this;
if (!e7.essential && t5.browser.prefersReducedMotion) {
var r7 = t5.pick(e7, ["center", "zoom", "bearing", "pitch", "around"]);
return this.jumpTo(r7, i7);
}
this.stop(), e7 = t5.extend({ offset: [0, 0], speed: 1.2, curve: 1.42, easing: t5.ease }, e7);
var a6 = this.transform, n8 = this.getZoom(), s7 = this.getBearing(), l8 = this.getPitch(), c5 = this.getPadding(), u5 = "zoom" in e7 ? t5.clamp(+e7.zoom, a6.minZoom, a6.maxZoom) : n8, h7 = "bearing" in e7 ? this._normalizeBearing(e7.bearing, s7) : s7, p5 = "pitch" in e7 ? +e7.pitch : l8, d5 = "padding" in e7 ? e7.padding : a6.padding, _4 = a6.zoomScale(u5 - n8), f5 = t5.Point.convert(e7.offset), m5 = a6.centerPoint.add(f5), g5 = a6.pointLocation(m5), v5 = t5.LngLat.convert(e7.center || g5);
this._normalizeCenter(v5);
var y5 = a6.project(g5), x5 = a6.project(v5).sub(y5), b5 = e7.curve, w5 = Math.max(a6.width, a6.height), T5 = w5 / _4, E4 = x5.mag();
if ("minZoom" in e7) {
var I5 = t5.clamp(Math.min(e7.minZoom, n8, u5), a6.minZoom, a6.maxZoom), P5 = w5 / a6.zoomScale(I5 - n8);
b5 = Math.sqrt(P5 / E4 * 2);
}
var S5 = b5 * b5;
function C5(t6) {
var e8 = (T5 * T5 - w5 * w5 + (t6 ? -1 : 1) * S5 * S5 * E4 * E4) / (2 * (t6 ? T5 : w5) * S5 * E4);
return Math.log(Math.sqrt(e8 * e8 + 1) - e8);
}
function z5(t6) {
return (Math.exp(t6) - Math.exp(-t6)) / 2;
}
function D5(t6) {
return (Math.exp(t6) + Math.exp(-t6)) / 2;
}
var A5 = C5(0), M5 = function(t6) {
return D5(A5) / D5(A5 + b5 * t6);
}, L5 = function(t6) {
return w5 * ((D5(A5) * (z5(e8 = A5 + b5 * t6) / D5(e8)) - z5(A5)) / S5) / E4;
var e8;
}, R4 = (C5(1) - A5) / b5;
if (Math.abs(E4) < 1e-6 || !isFinite(R4)) {
if (Math.abs(w5 - T5) < 1e-6) {
return this.easeTo(e7, i7);
}
var k5 = T5 < w5 ? -1 : 1;
R4 = Math.abs(Math.log(T5 / w5)) / b5, L5 = function() {
return 0;
}, M5 = function(t6) {
return Math.exp(k5 * b5 * t6);
};
}
return e7.duration = "duration" in e7 ? +e7.duration : 1e3 * R4 / ("screenSpeed" in e7 ? +e7.screenSpeed / b5 : +e7.speed), e7.maxDuration && e7.duration > e7.maxDuration && (e7.duration = 0), this._zooming = true, this._rotating = s7 !== h7, this._pitching = p5 !== l8, this._padding = !a6.isPaddingEqual(d5), this._prepareEase(i7, false), this._ease(function(e8) {
var r8 = e8 * R4, _5 = 1 / M5(r8);
a6.zoom = 1 === e8 ? u5 : n8 + a6.scaleZoom(_5), o6._rotating && (a6.bearing = t5.number(s7, h7, e8)), o6._pitching && (a6.pitch = t5.number(l8, p5, e8)), o6._padding && (a6.interpolatePadding(c5, d5, e8), m5 = a6.centerPoint.add(f5));
var g6 = 1 === e8 ? v5 : a6.unproject(y5.add(x5.mult(L5(r8))).mult(_5));
a6.setLocationAtPoint(a6.renderWorldCopies ? g6.wrap() : g6, m5), o6._fireMoveEvents(i7);
}, function() {
return o6._afterEase(i7);
}, e7), this;
}, i6.prototype.isEasing = function() {
return !!this._easeFrameId;
}, i6.prototype.stop = function() {
return this._stop();
}, i6.prototype._stop = function(t6, e7) {
if (this._easeFrameId && (this._cancelRenderFrame(this._easeFrameId), delete this._easeFrameId, delete this._onEaseFrame), this._onEaseEnd) {
var i7 = this._onEaseEnd;
delete this._onEaseEnd, i7.call(this, e7);
}
if (!t6) {
var o6 = this.handlers;
o6 && o6.stop(false);
}
return this;
}, i6.prototype._ease = function(e7, i7, o6) {
false === o6.animate || 0 === o6.duration ? (e7(1), i7()) : (this._easeStart = t5.browser.now(), this._easeOptions = o6, this._onEaseFrame = e7, this._onEaseEnd = i7, this._easeFrameId = this._requestRenderFrame(this._renderFrameCallback));
}, i6.prototype._renderFrameCallback = function() {
var e7 = Math.min((t5.browser.now() - this._easeStart) / this._easeOptions.duration, 1);
this._onEaseFrame(this._easeOptions.easing(e7)), e7 < 1 ? this._easeFrameId = this._requestRenderFrame(this._renderFrameCallback) : this.stop();
}, i6.prototype._normalizeBearing = function(e7, i7) {
e7 = t5.wrap(e7, -180, 180);
var o6 = Math.abs(e7 - i7);
return Math.abs(e7 - 360 - i7) < o6 && (e7 -= 360), Math.abs(e7 + 360 - i7) < o6 && (e7 += 360), e7;
}, i6.prototype._normalizeCenter = function(t6) {
var e7 = this.transform;
if (e7.renderWorldCopies && !e7.lngRange) {
var i7 = t6.lng - e7.center.lng;
t6.lng += i7 > 180 ? -360 : i7 < -180 ? 360 : 0;
}
}, i6;
}(t5.Evented), yr = function(e6) {
void 0 === e6 && (e6 = {}), this.options = e6, t5.bindAll(["_toggleAttribution", "_updateEditLink", "_updateData", "_updateCompact"], this);
};
yr.prototype.getDefaultPosition = function() {
return "bottom-right";
}, yr.prototype.onAdd = function(t6) {
var e6 = this.options && this.options.compact;
return this._map = t6, this._container = i5.create("div", "mapboxgl-ctrl mapboxgl-ctrl-attrib"), this._compactButton = i5.create("button", "mapboxgl-ctrl-attrib-button", this._container), this._compactButton.addEventListener("click", this._toggleAttribution), this._setElementTitle(this._compactButton, "ToggleAttribution"), this._innerContainer = i5.create("div", "mapboxgl-ctrl-attrib-inner", this._container), this._innerContainer.setAttribute("role", "list"), e6 && this._container.classList.add("mapboxgl-compact"), this._updateAttributions(), this._updateEditLink(), this._map.on("styledata", this._updateData), this._map.on("sourcedata", this._updateData), this._map.on("moveend", this._updateEditLink), void 0 === e6 && (this._map.on("resize", this._updateCompact), this._updateCompact()), this._container;
}, yr.prototype.onRemove = function() {
i5.remove(this._container), this._map.off("styledata", this._updateData), this._map.off("sourcedata", this._updateData), this._map.off("moveend", this._updateEditLink), this._map.off("resize", this._updateCompact), this._map = void 0, this._attribHTML = void 0;
}, yr.prototype._setElementTitle = function(t6, e6) {
var i6 = this._map._getUIString("AttributionControl." + e6);
t6.title = i6, t6.setAttribute("aria-label", i6);
}, yr.prototype._toggleAttribution = function() {
this._container.classList.contains("mapboxgl-compact-show") ? (this._container.classList.remove("mapboxgl-compact-show"), this._compactButton.setAttribute("aria-pressed", "false")) : (this._container.classList.add("mapboxgl-compact-show"), this._compactButton.setAttribute("aria-pressed", "true"));
}, yr.prototype._updateEditLink = function() {
var e6 = this._editLink;
e6 || (e6 = this._editLink = this._container.querySelector(".mapbox-improve-map"));
var i6 = [{ key: "owner", value: this.styleOwner }, { key: "id", value: this.styleId }, { key: "access_token", value: this._map._requestManager._customAccessToken || t5.config.ACCESS_TOKEN }];
if (e6) {
var o6 = i6.reduce(function(t6, e7, o7) {
return e7.value && (t6 += e7.key + "=" + e7.value + (o7 < i6.length - 1 ? "&" : "")), t6;
}, "?");
e6.href = t5.config.FEEDBACK_URL + "/" + o6 + (this._map._hash ? this._map._hash.getHashString(true) : ""), e6.rel = "noopener nofollow", this._setElementTitle(e6, "MapFeedback");
}
}, yr.prototype._updateData = function(t6) {
!t6 || "metadata" !== t6.sourceDataType && "visibility" !== t6.sourceDataType && "style" !== t6.dataType || (this._updateAttributions(), this._updateEditLink());
}, yr.prototype._updateAttributions = function() {
if (this._map.style) {
var t6 = [];
if (this.options.customAttribution && (Array.isArray(this.options.customAttribution) ? t6 = t6.concat(this.options.customAttribution.map(function(t7) {
return "string" != typeof t7 ? "" : t7;
})) : "string" == typeof this.options.customAttribution && t6.push(this.options.customAttribution)), this._map.style.stylesheet) {
var e6 = this._map.style.stylesheet;
this.styleOwner = e6.owner, this.styleId = e6.id;
}
var i6 = this._map.style.sourceCaches;
for (var o6 in i6) {
var r7 = i6[o6];
if (r7.used) {
var a6 = r7.getSource();
a6.attribution && t6.indexOf(a6.attribution) < 0 && t6.push(a6.attribution);
}
}
t6.sort(function(t7, e7) {
return t7.length - e7.length;
});
var n8 = (t6 = t6.filter(function(e7, i7) {
for (var o7 = i7 + 1; o7 < t6.length; o7++) {
if (t6[o7].indexOf(e7) >= 0) {
return false;
}
}
return true;
})).join(" | ");
n8 !== this._attribHTML && (this._attribHTML = n8, t6.length ? (this._innerContainer.innerHTML = n8, this._container.classList.remove("mapboxgl-attrib-empty")) : this._container.classList.add("mapboxgl-attrib-empty"), this._editLink = null);
}
}, yr.prototype._updateCompact = function() {
this._map.getCanvasContainer().offsetWidth <= 640 ? this._container.classList.add("mapboxgl-compact") : this._container.classList.remove("mapboxgl-compact", "mapboxgl-compact-show");
};
var xr = function() {
t5.bindAll(["_updateLogo"], this), t5.bindAll(["_updateCompact"], this);
};
xr.prototype.onAdd = function(t6) {
this._map = t6, this._container = i5.create("div", "mapboxgl-ctrl");
var e6 = i5.create("a", "mapboxgl-ctrl-logo");
return e6.target = "_blank", e6.rel = "noopener nofollow", e6.href = "https://www.mapbox.com/", e6.setAttribute("aria-label", this._map._getUIString("LogoControl.Title")), e6.setAttribute("rel", "noopener nofollow"), this._container.appendChild(e6), this._container.style.display = "none", this._map.on("sourcedata", this._updateLogo), this._updateLogo(), this._map.on("resize", this._updateCompact), this._updateCompact(), this._container;
}, xr.prototype.onRemove = function() {
i5.remove(this._container), this._map.off("sourcedata", this._updateLogo), this._map.off("resize", this._updateCompact);
}, xr.prototype.getDefaultPosition = function() {
return "bottom-left";
}, xr.prototype._updateLogo = function(t6) {
t6 && "metadata" !== t6.sourceDataType || (this._container.style.display = this._logoRequired() ? "block" : "none");
}, xr.prototype._logoRequired = function() {
if (this._map.style) {
var t6 = this._map.style.sourceCaches;
for (var e6 in t6) {
if (t6[e6].getSource().mapbox_logo) {
return true;
}
}
return false;
}
}, xr.prototype._updateCompact = function() {
var t6 = this._container.children;
if (t6.length) {
var e6 = t6[0];
this._map.getCanvasContainer().offsetWidth < 250 ? e6.classList.add("mapboxgl-compact") : e6.classList.remove("mapboxgl-compact");
}
};
var br = function() {
this._queue = [], this._id = 0, this._cleared = false, this._currentlyRunning = false;
};
br.prototype.add = function(t6) {
var e6 = ++this._id;
return this._queue.push({ callback: t6, id: e6, cancelled: false }), e6;
}, br.prototype.remove = function(t6) {
for (var e6 = this._currentlyRunning, i6 = 0, o6 = e6 ? this._queue.concat(e6) : this._queue; i6 < o6.length; i6 += 1) {
var r7 = o6[i6];
if (r7.id === t6) {
return void (r7.cancelled = true);
}
}
}, br.prototype.run = function(t6) {
void 0 === t6 && (t6 = 0);
var e6 = this._currentlyRunning = this._queue;
this._queue = [];
for (var i6 = 0, o6 = e6; i6 < o6.length; i6 += 1) {
var r7 = o6[i6];
if (!r7.cancelled && (r7.callback(t6), this._cleared)) {
break;
}
}
this._cleared = false, this._currentlyRunning = false;
}, br.prototype.clear = function() {
this._currentlyRunning && (this._cleared = true), this._queue = [];
};
var wr = { "AttributionControl.ToggleAttribution": "Toggle attribution", "AttributionControl.MapFeedback": "Map feedback", "FullscreenControl.Enter": "Enter fullscreen", "FullscreenControl.Exit": "Exit fullscreen", "GeolocateControl.FindMyLocation": "Find my location", "GeolocateControl.LocationNotAvailable": "Location not available", "LogoControl.Title": "Mapbox logo", "NavigationControl.ResetBearing": "Reset bearing to north", "NavigationControl.ZoomIn": "Zoom in", "NavigationControl.ZoomOut": "Zoom out", "ScaleControl.Feet": "ft", "ScaleControl.Meters": "m", "ScaleControl.Kilometers": "km", "ScaleControl.Miles": "mi", "ScaleControl.NauticalMiles": "nm" }, Tr = t5.window.HTMLImageElement, Er = t5.window.HTMLElement, Ir = t5.window.ImageBitmap, Pr = { center: [0, 0], zoom: 0, bearing: 0, pitch: 0, minZoom: -2, maxZoom: 22, minPitch: 0, maxPitch: 60, interactive: true, scrollZoom: true, boxZoom: true, dragRotate: true, dragPan: true, keyboard: true, doubleClickZoom: true, touchZoomRotate: true, touchPitch: true, bearingSnap: 7, clickTolerance: 3, pitchWithRotate: true, hash: false, attributionControl: true, failIfMajorPerformanceCaveat: false, preserveDrawingBuffer: false, trackResize: true, renderWorldCopies: true, refreshExpiredTiles: true, maxTileCacheSize: null, localIdeographFontFamily: "sans-serif", transformRequest: null, accessToken: null, fadeDuration: 300, crossSourceCollisions: true }, Sr = function(o6) {
function r7(e6) {
var i6 = this;
if (null != (e6 = t5.extend({}, Pr, e6)).minZoom && null != e6.maxZoom && e6.minZoom > e6.maxZoom) {
throw new Error("maxZoom must be greater than or equal to minZoom");
}
if (null != e6.minPitch && null != e6.maxPitch && e6.minPitch > e6.maxPitch) {
throw new Error("maxPitch must be greater than or equal to minPitch");
}
if (null != e6.minPitch && e6.minPitch < 0) {
throw new Error("minPitch must be greater than or equal to 0");
}
if (null != e6.maxPitch && e6.maxPitch > 60) {
throw new Error("maxPitch must be less than or equal to 60");
}
var r8 = new To(e6.minZoom, e6.maxZoom, e6.minPitch, e6.maxPitch, e6.renderWorldCopies);
if (o6.call(this, r8, e6), this._interactive = e6.interactive, this._maxTileCacheSize = e6.maxTileCacheSize, this._failIfMajorPerformanceCaveat = e6.failIfMajorPerformanceCaveat, this._preserveDrawingBuffer = e6.preserveDrawingBuffer, this._antialias = e6.antialias, this._trackResize = e6.trackResize, this._bearingSnap = e6.bearingSnap, this._refreshExpiredTiles = e6.refreshExpiredTiles, this._fadeDuration = e6.fadeDuration, this._crossSourceCollisions = e6.crossSourceCollisions, this._crossFadingFactor = 1, this._collectResourceTiming = e6.collectResourceTiming, this._renderTaskQueue = new br(), this._controls = [], this._mapId = t5.uniqueId(), this._locale = t5.extend({}, wr, e6.locale), this._clickTolerance = e6.clickTolerance, this._requestManager = new t5.RequestManager(e6.transformRequest, e6.accessToken), "string" == typeof e6.container) {
if (this._container = t5.window.document.getElementById(e6.container), !this._container) {
throw new Error("Container '" + e6.container + "' not found.");
}
} else {
if (!(e6.container instanceof Er)) {
throw new Error("Invalid type: 'container' must be a String or HTMLElement.");
}
this._container = e6.container;
}
if (e6.maxBounds && this.setMaxBounds(e6.maxBounds), t5.bindAll(["_onWindowOnline", "_onWindowResize", "_onMapScroll", "_contextLost", "_contextRestored"], this), this._setupContainer(), this._setupPainter(), void 0 === this.painter) {
throw new Error("Failed to initialize WebGL.");
}
this.on("move", function() {
return i6._update(false);
}), this.on("moveend", function() {
return i6._update(false);
}), this.on("zoom", function() {
return i6._update(true);
}), void 0 !== t5.window && (t5.window.addEventListener("online", this._onWindowOnline, false), t5.window.addEventListener("resize", this._onWindowResize, false), t5.window.addEventListener("orientationchange", this._onWindowResize, false)), this.handlers = new gr(this, e6), this._hash = e6.hash && new Io("string" == typeof e6.hash && e6.hash || void 0).addTo(this), this._hash && this._hash._onHashChange() || (this.jumpTo({ center: e6.center, zoom: e6.zoom, bearing: e6.bearing, pitch: e6.pitch }), e6.bounds && (this.resize(), this.fitBounds(e6.bounds, t5.extend({}, e6.fitBoundsOptions, { duration: 0 })))), this.resize(), this._localIdeographFontFamily = e6.localIdeographFontFamily, e6.style && this.setStyle(e6.style, { localIdeographFontFamily: e6.localIdeographFontFamily }), e6.attributionControl && this.addControl(new yr({ customAttribution: e6.customAttribution })), this.addControl(new xr(), e6.logoPosition), this.on("style.load", function() {
i6.transform.unmodified && i6.jumpTo(i6.style.stylesheet);
}), this.on("data", function(e7) {
i6._update("style" === e7.dataType), i6.fire(new t5.Event(e7.dataType + "data", e7));
}), this.on("dataloading", function(e7) {
i6.fire(new t5.Event(e7.dataType + "dataloading", e7));
});
}
o6 && (r7.__proto__ = o6), (r7.prototype = Object.create(o6 && o6.prototype)).constructor = r7;
var a6 = { showTileBoundaries: { configurable: true }, showPadding: { configurable: true }, showCollisionBoxes: { configurable: true }, showOverdrawInspector: { configurable: true }, repaint: { configurable: true }, vertices: { configurable: true }, version: { configurable: true } };
return r7.prototype._getMapId = function() {
return this._mapId;
}, r7.prototype.addControl = function(e6, i6) {
if (void 0 === i6 && (i6 = e6.getDefaultPosition ? e6.getDefaultPosition() : "top-right"), !e6 || !e6.onAdd) {
return this.fire(new t5.ErrorEvent(new Error("Invalid argument to map.addControl(). Argument must be a control with onAdd and onRemove methods.")));
}
var o7 = e6.onAdd(this);
this._controls.push(e6);
var r8 = this._controlPositions[i6];
return -1 !== i6.indexOf("bottom") ? r8.insertBefore(o7, r8.firstChild) : r8.appendChild(o7), this;
}, r7.prototype.removeControl = function(e6) {
if (!e6 || !e6.onRemove) {
return this.fire(new t5.ErrorEvent(new Error("Invalid argument to map.removeControl(). Argument must be a control with onAdd and onRemove methods.")));
}
var i6 = this._controls.indexOf(e6);
return i6 > -1 && this._controls.splice(i6, 1), e6.onRemove(this), this;
}, r7.prototype.hasControl = function(t6) {
return this._controls.indexOf(t6) > -1;
}, r7.prototype.resize = function(e6) {
var i6 = this._containerDimensions(), o7 = i6[0], r8 = i6[1];
if (o7 === this.transform.width && r8 === this.transform.height) {
return this;
}
this._resizeCanvas(o7, r8), this.transform.resize(o7, r8), this.painter.resize(o7, r8);
var a7 = !this._moving;
return a7 && this.fire(new t5.Event("movestart", e6)).fire(new t5.Event("move", e6)), this.fire(new t5.Event("resize", e6)), a7 && this.fire(new t5.Event("moveend", e6)), this;
}, r7.prototype.getBounds = function() {
return this.transform.getBounds();
}, r7.prototype.getMaxBounds = function() {
return this.transform.getMaxBounds();
}, r7.prototype.setMaxBounds = function(e6) {
return this.transform.setMaxBounds(t5.LngLatBounds.convert(e6)), this._update();
}, r7.prototype.setMinZoom = function(t6) {
if ((t6 = null == t6 ? -2 : t6) >= -2 && t6 <= this.transform.maxZoom) {
return this.transform.minZoom = t6, this._update(), this.getZoom() < t6 && this.setZoom(t6), this;
}
throw new Error("minZoom must be between -2 and the current maxZoom, inclusive");
}, r7.prototype.getMinZoom = function() {
return this.transform.minZoom;
}, r7.prototype.setMaxZoom = function(t6) {
if ((t6 = null == t6 ? 22 : t6) >= this.transform.minZoom) {
return this.transform.maxZoom = t6, this._update(), this.getZoom() > t6 && this.setZoom(t6), this;
}
throw new Error("maxZoom must be greater than the current minZoom");
}, r7.prototype.getMaxZoom = function() {
return this.transform.maxZoom;
}, r7.prototype.setMinPitch = function(t6) {
if ((t6 = null == t6 ? 0 : t6) < 0) {
throw new Error("minPitch must be greater than or equal to 0");
}
if (t6 >= 0 && t6 <= this.transform.maxPitch) {
return this.transform.minPitch = t6, this._update(), this.getPitch() < t6 && this.setPitch(t6), this;
}
throw new Error("minPitch must be between 0 and the current maxPitch, inclusive");
}, r7.prototype.getMinPitch = function() {
return this.transform.minPitch;
}, r7.prototype.setMaxPitch = function(t6) {
if ((t6 = null == t6 ? 60 : t6) > 60) {
throw new Error("maxPitch must be less than or equal to 60");
}
if (t6 >= this.transform.minPitch) {
return this.transform.maxPitch = t6, this._update(), this.getPitch() > t6 && this.setPitch(t6), this;
}
throw new Error("maxPitch must be greater than the current minPitch");
}, r7.prototype.getMaxPitch = function() {
return this.transform.maxPitch;
}, r7.prototype.getRenderWorldCopies = function() {
return this.transform.renderWorldCopies;
}, r7.prototype.setRenderWorldCopies = function(t6) {
return this.transform.renderWorldCopies = t6, this._update();
}, r7.prototype.project = function(e6) {
return this.transform.locationPoint(t5.LngLat.convert(e6));
}, r7.prototype.unproject = function(e6) {
return this.transform.pointLocation(t5.Point.convert(e6));
}, r7.prototype.isMoving = function() {
return this._moving || this.handlers.isMoving();
}, r7.prototype.isZooming = function() {
return this._zooming || this.handlers.isZooming();
}, r7.prototype.isRotating = function() {
return this._rotating || this.handlers.isRotating();
}, r7.prototype._createDelegatedListener = function(t6, e6, i6) {
var o7, r8 = this;
if ("mouseenter" === t6 || "mouseover" === t6) {
var a7 = false;
return { layer: e6, listener: i6, delegates: { mousemove: function(o8) {
var n9 = r8.getLayer(e6) ? r8.queryRenderedFeatures(o8.point, { layers: [e6] }) : [];
n9.length ? a7 || (a7 = true, i6.call(r8, new Ro(t6, r8, o8.originalEvent, { features: n9 }))) : a7 = false;
}, mouseout: function() {
a7 = false;
} } };
}
if ("mouseleave" === t6 || "mouseout" === t6) {
var n8 = false;
return { layer: e6, listener: i6, delegates: { mousemove: function(o8) {
(r8.getLayer(e6) ? r8.queryRenderedFeatures(o8.point, { layers: [e6] }) : []).length ? n8 = true : n8 && (n8 = false, i6.call(r8, new Ro(t6, r8, o8.originalEvent)));
}, mouseout: function(e7) {
n8 && (n8 = false, i6.call(r8, new Ro(t6, r8, e7.originalEvent)));
} } };
}
return { layer: e6, listener: i6, delegates: (o7 = {}, o7[t6] = function(t7) {
var o8 = r8.getLayer(e6) ? r8.queryRenderedFeatures(t7.point, { layers: [e6] }) : [];
o8.length && (t7.features = o8, i6.call(r8, t7), delete t7.features);
}, o7) };
}, r7.prototype.on = function(t6, e6, i6) {
if (void 0 === i6) {
return o6.prototype.on.call(this, t6, e6);
}
var r8 = this._createDelegatedListener(t6, e6, i6);
for (var a7 in this._delegatedListeners = this._delegatedListeners || {}, this._delegatedListeners[t6] = this._delegatedListeners[t6] || [], this._delegatedListeners[t6].push(r8), r8.delegates) {
this.on(a7, r8.delegates[a7]);
}
return this;
}, r7.prototype.once = function(t6, e6, i6) {
if (void 0 === i6) {
return o6.prototype.once.call(this, t6, e6);
}
var r8 = this._createDelegatedListener(t6, e6, i6);
for (var a7 in r8.delegates) {
this.once(a7, r8.delegates[a7]);
}
return this;
}, r7.prototype.off = function(t6, e6, i6) {
var r8 = this;
return void 0 === i6 ? o6.prototype.off.call(this, t6, e6) : (this._delegatedListeners && this._delegatedListeners[t6] && function(o7) {
for (var a7 = o7[t6], n8 = 0; n8 < a7.length; n8++) {
var s7 = a7[n8];
if (s7.layer === e6 && s7.listener === i6) {
for (var l8 in s7.delegates) {
r8.off(l8, s7.delegates[l8]);
}
return a7.splice(n8, 1), r8;
}
}
}(this._delegatedListeners), this);
}, r7.prototype.queryRenderedFeatures = function(e6, i6) {
if (!this.style) {
return [];
}
var o7;
if (void 0 !== i6 || void 0 === e6 || e6 instanceof t5.Point || Array.isArray(e6) || (i6 = e6, e6 = void 0), i6 = i6 || {}, (e6 = e6 || [[0, 0], [this.transform.width, this.transform.height]]) instanceof t5.Point || "number" == typeof e6[0]) {
o7 = [t5.Point.convert(e6)];
} else {
var r8 = t5.Point.convert(e6[0]), a7 = t5.Point.convert(e6[1]);
o7 = [r8, new t5.Point(a7.x, r8.y), a7, new t5.Point(r8.x, a7.y), r8];
}
return this.style.queryRenderedFeatures(o7, i6, this.transform);
}, r7.prototype.querySourceFeatures = function(t6, e6) {
return this.style.querySourceFeatures(t6, e6);
}, r7.prototype.setStyle = function(e6, i6) {
return false !== (i6 = t5.extend({}, { localIdeographFontFamily: this._localIdeographFontFamily }, i6)).diff && i6.localIdeographFontFamily === this._localIdeographFontFamily && this.style && e6 ? (this._diffStyle(e6, i6), this) : (this._localIdeographFontFamily = i6.localIdeographFontFamily, this._updateStyle(e6, i6));
}, r7.prototype._getUIString = function(t6) {
var e6 = this._locale[t6];
if (null == e6) {
throw new Error("Missing UI string '" + t6 + "'");
}
return e6;
}, r7.prototype._updateStyle = function(t6, e6) {
return this.style && (this.style.setEventedParent(null), this.style._remove()), t6 ? (this.style = new je2(this, e6 || {}), this.style.setEventedParent(this, { style: this.style }), "string" == typeof t6 ? this.style.loadURL(t6) : this.style.loadJSON(t6), this) : (delete this.style, this);
}, r7.prototype._lazyInitEmptyStyle = function() {
this.style || (this.style = new je2(this, {}), this.style.setEventedParent(this, { style: this.style }), this.style.loadEmpty());
}, r7.prototype._diffStyle = function(e6, i6) {
var o7 = this;
if ("string" == typeof e6) {
var r8 = this._requestManager.normalizeStyleURL(e6), a7 = this._requestManager.transformRequest(r8, t5.ResourceType.Style);
t5.getJSON(a7, function(e7, r9) {
e7 ? o7.fire(new t5.ErrorEvent(e7)) : r9 && o7._updateDiff(r9, i6);
});
} else {
"object" == typeof e6 && this._updateDiff(e6, i6);
}
}, r7.prototype._updateDiff = function(e6, i6) {
try {
this.style.setState(e6) && this._update(true);
} catch (o7) {
t5.warnOnce("Unable to perform style diff: " + (o7.message || o7.error || o7) + ". Rebuilding the style from scratch."), this._updateStyle(e6, i6);
}
}, r7.prototype.getStyle = function() {
if (this.style) {
return this.style.serialize();
}
}, r7.prototype.isStyleLoaded = function() {
return this.style ? this.style.loaded() : t5.warnOnce("There is no style added to the map.");
}, r7.prototype.addSource = function(t6, e6) {
return this._lazyInitEmptyStyle(), this.style.addSource(t6, e6), this._update(true);
}, r7.prototype.isSourceLoaded = function(e6) {
var i6 = this.style && this.style.sourceCaches[e6];
if (void 0 !== i6) {
return i6.loaded();
}
this.fire(new t5.ErrorEvent(new Error("There is no source with ID '" + e6 + "'")));
}, r7.prototype.areTilesLoaded = function() {
var t6 = this.style && this.style.sourceCaches;
for (var e6 in t6) {
var i6 = t6[e6]._tiles;
for (var o7 in i6) {
var r8 = i6[o7];
if ("loaded" !== r8.state && "errored" !== r8.state) {
return false;
}
}
}
return true;
}, r7.prototype.addSourceType = function(t6, e6, i6) {
return this._lazyInitEmptyStyle(), this.style.addSourceType(t6, e6, i6);
}, r7.prototype.removeSource = function(t6) {
return this.style.removeSource(t6), this._update(true);
}, r7.prototype.getSource = function(t6) {
return this.style.getSource(t6);
}, r7.prototype.addImage = function(e6, i6, o7) {
void 0 === o7 && (o7 = {});
var r8 = o7.pixelRatio;
void 0 === r8 && (r8 = 1);
var a7 = o7.sdf;
void 0 === a7 && (a7 = false);
var n8 = o7.stretchX, s7 = o7.stretchY, l8 = o7.content;
if (this._lazyInitEmptyStyle(), i6 instanceof Tr || Ir && i6 instanceof Ir) {
var c5 = t5.browser.getImageData(i6);
this.style.addImage(e6, { data: new t5.RGBAImage({ width: c5.width, height: c5.height }, c5.data), pixelRatio: r8, stretchX: n8, stretchY: s7, content: l8, sdf: a7, version: 0 });
} else {
if (void 0 === i6.width || void 0 === i6.height) {
return this.fire(new t5.ErrorEvent(new Error("Invalid arguments to map.addImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`")));
}
var u5 = i6;
this.style.addImage(e6, { data: new t5.RGBAImage({ width: i6.width, height: i6.height }, new Uint8Array(i6.data)), pixelRatio: r8, stretchX: n8, stretchY: s7, content: l8, sdf: a7, version: 0, userImage: u5 }), u5.onAdd && u5.onAdd(this, e6);
}
}, r7.prototype.updateImage = function(e6, i6) {
var o7 = this.style.getImage(e6);
if (!o7) {
return this.fire(new t5.ErrorEvent(new Error("The map has no image with that id. If you are adding a new image use `map.addImage(...)` instead.")));
}
var r8 = i6 instanceof Tr || Ir && i6 instanceof Ir ? t5.browser.getImageData(i6) : i6, a7 = r8.width, n8 = r8.height, s7 = r8.data;
return void 0 === a7 || void 0 === n8 ? this.fire(new t5.ErrorEvent(new Error("Invalid arguments to map.updateImage(). The second argument must be an `HTMLImageElement`, `ImageData`, `ImageBitmap`, or object with `width`, `height`, and `data` properties with the same format as `ImageData`"))) : a7 !== o7.data.width || n8 !== o7.data.height ? this.fire(new t5.ErrorEvent(new Error("The width and height of the updated image must be that same as the previous version of the image"))) : (o7.data.replace(s7, !(i6 instanceof Tr || Ir && i6 instanceof Ir)), void this.style.updateImage(e6, o7));
}, r7.prototype.hasImage = function(e6) {
return e6 ? !!this.style.getImage(e6) : (this.fire(new t5.ErrorEvent(new Error("Missing required image id"))), false);
}, r7.prototype.removeImage = function(t6) {
this.style.removeImage(t6);
}, r7.prototype.loadImage = function(e6, i6) {
t5.getImage(this._requestManager.transformRequest(e6, t5.ResourceType.Image), i6);
}, r7.prototype.listImages = function() {
return this.style.listImages();
}, r7.prototype.addLayer = function(t6, e6) {
return this._lazyInitEmptyStyle(), this.style.addLayer(t6, e6), this._update(true);
}, r7.prototype.moveLayer = function(t6, e6) {
return this.style.moveLayer(t6, e6), this._update(true);
}, r7.prototype.removeLayer = function(t6) {
return this.style.removeLayer(t6), this._update(true);
}, r7.prototype.getLayer = function(t6) {
return this.style.getLayer(t6);
}, r7.prototype.setLayerZoomRange = function(t6, e6, i6) {
return this.style.setLayerZoomRange(t6, e6, i6), this._update(true);
}, r7.prototype.setFilter = function(t6, e6, i6) {
return void 0 === i6 && (i6 = {}), this.style.setFilter(t6, e6, i6), this._update(true);
}, r7.prototype.getFilter = function(t6) {
return this.style.getFilter(t6);
}, r7.prototype.setPaintProperty = function(t6, e6, i6, o7) {
return void 0 === o7 && (o7 = {}), this.style.setPaintProperty(t6, e6, i6, o7), this._update(true);
}, r7.prototype.getPaintProperty = function(t6, e6) {
return this.style.getPaintProperty(t6, e6);
}, r7.prototype.setLayoutProperty = function(t6, e6, i6, o7) {
return void 0 === o7 && (o7 = {}), this.style.setLayoutProperty(t6, e6, i6, o7), this._update(true);
}, r7.prototype.getLayoutProperty = function(t6, e6) {
return this.style.getLayoutProperty(t6, e6);
}, r7.prototype.setLight = function(t6, e6) {
return void 0 === e6 && (e6 = {}), this._lazyInitEmptyStyle(), this.style.setLight(t6, e6), this._update(true);
}, r7.prototype.getLight = function() {
return this.style.getLight();
}, r7.prototype.setFeatureState = function(t6, e6) {
return this.style.setFeatureState(t6, e6), this._update();
}, r7.prototype.removeFeatureState = function(t6, e6) {
return this.style.removeFeatureState(t6, e6), this._update();
}, r7.prototype.getFeatureState = function(t6) {
return this.style.getFeatureState(t6);
}, r7.prototype.getContainer = function() {
return this._container;
}, r7.prototype.getCanvasContainer = function() {
return this._canvasContainer;
}, r7.prototype.getCanvas = function() {
return this._canvas;
}, r7.prototype._containerDimensions = function() {
var t6 = 0, e6 = 0;
return this._container && (t6 = this._container.clientWidth || 400, e6 = this._container.clientHeight || 300), [t6, e6];
}, r7.prototype._detectMissingCSS = function() {
"rgb(250, 128, 114)" !== t5.window.getComputedStyle(this._missingCSSCanary).getPropertyValue("background-color") && t5.warnOnce("This page appears to be missing CSS declarations for Mapbox GL JS, which may cause the map to display incorrectly. Please ensure your page includes mapbox-gl.css, as described in https://www.mapbox.com/mapbox-gl-js/api/.");
}, r7.prototype._setupContainer = function() {
var t6 = this._container;
t6.classList.add("mapboxgl-map"), (this._missingCSSCanary = i5.create("div", "mapboxgl-canary", t6)).style.visibility = "hidden", this._detectMissingCSS();
var e6 = this._canvasContainer = i5.create("div", "mapboxgl-canvas-container", t6);
this._interactive && e6.classList.add("mapboxgl-interactive"), this._canvas = i5.create("canvas", "mapboxgl-canvas", e6), this._canvas.addEventListener("webglcontextlost", this._contextLost, false), this._canvas.addEventListener("webglcontextrestored", this._contextRestored, false), this._canvas.setAttribute("tabindex", "0"), this._canvas.setAttribute("aria-label", "Map"), this._canvas.setAttribute("role", "region");
var o7 = this._containerDimensions();
this._resizeCanvas(o7[0], o7[1]);
var r8 = this._controlContainer = i5.create("div", "mapboxgl-control-container", t6), a7 = this._controlPositions = {};
["top-left", "top-right", "bottom-left", "bottom-right"].forEach(function(t7) {
a7[t7] = i5.create("div", "mapboxgl-ctrl-" + t7, r8);
}), this._container.addEventListener("scroll", this._onMapScroll, false);
}, r7.prototype._resizeCanvas = function(e6, i6) {
var o7 = t5.browser.devicePixelRatio || 1;
this._canvas.width = o7 * e6, this._canvas.height = o7 * i6, this._canvas.style.width = e6 + "px", this._canvas.style.height = i6 + "px";
}, r7.prototype._setupPainter = function() {
var i6 = t5.extend({}, e5.webGLContextAttributes, { failIfMajorPerformanceCaveat: this._failIfMajorPerformanceCaveat, preserveDrawingBuffer: this._preserveDrawingBuffer, antialias: this._antialias || false }), o7 = this._canvas.getContext("webgl", i6) || this._canvas.getContext("experimental-webgl", i6);
o7 ? (this.painter = new yo(o7, this.transform), t5.webpSupported.testSupport(o7)) : this.fire(new t5.ErrorEvent(new Error("Failed to initialize WebGL")));
}, r7.prototype._contextLost = function(e6) {
e6.preventDefault(), this._frame && (this._frame.cancel(), this._frame = null), this.fire(new t5.Event("webglcontextlost", { originalEvent: e6 }));
}, r7.prototype._contextRestored = function(e6) {
this._setupPainter(), this.resize(), this._update(), this.fire(new t5.Event("webglcontextrestored", { originalEvent: e6 }));
}, r7.prototype._onMapScroll = function(t6) {
if (t6.target === this._container) {
return this._container.scrollTop = 0, this._container.scrollLeft = 0, false;
}
}, r7.prototype.loaded = function() {
return !this._styleDirty && !this._sourcesDirty && !!this.style && this.style.loaded();
}, r7.prototype._update = function(t6) {
return this.style ? (this._styleDirty = this._styleDirty || t6, this._sourcesDirty = true, this.triggerRepaint(), this) : this;
}, r7.prototype._requestRenderFrame = function(t6) {
return this._update(), this._renderTaskQueue.add(t6);
}, r7.prototype._cancelRenderFrame = function(t6) {
this._renderTaskQueue.remove(t6);
}, r7.prototype._render = function(e6) {
var i6, o7 = this, r8 = 0, a7 = this.painter.context.extTimerQuery;
if (this.listens("gpu-timing-frame") && (i6 = a7.createQueryEXT(), a7.beginQueryEXT(a7.TIME_ELAPSED_EXT, i6), r8 = t5.browser.now()), this.painter.context.setDirty(), this.painter.setBaseState(), this._renderTaskQueue.run(e6), !this._removed) {
var n8 = false;
if (this.style && this._styleDirty) {
this._styleDirty = false;
var s7 = this.transform.zoom, l8 = t5.browser.now();
this.style.zoomHistory.update(s7, l8);
var c5 = new t5.EvaluationParameters(s7, { now: l8, fadeDuration: this._fadeDuration, zoomHistory: this.style.zoomHistory, transition: this.style.getTransition() }), u5 = c5.crossFadingFactor();
1 === u5 && u5 === this._crossFadingFactor || (n8 = true, this._crossFadingFactor = u5), this.style.update(c5);
}
if (this.style && this._sourcesDirty && (this._sourcesDirty = false, this.style._updateSources(this.transform)), this._placementDirty = this.style && this.style._updatePlacement(this.painter.transform, this.showCollisionBoxes, this._fadeDuration, this._crossSourceCollisions), this.painter.render(this.style, { showTileBoundaries: this.showTileBoundaries, showOverdrawInspector: this._showOverdrawInspector, rotating: this.isRotating(), zooming: this.isZooming(), moving: this.isMoving(), fadeDuration: this._fadeDuration, showPadding: this.showPadding, gpuTiming: !!this.listens("gpu-timing-layer") }), this.fire(new t5.Event("render")), this.loaded() && !this._loaded && (this._loaded = true, this.fire(new t5.Event("load"))), this.style && (this.style.hasTransitions() || n8) && (this._styleDirty = true), this.style && !this._placementDirty && this.style._releaseSymbolFadeTiles(), this.listens("gpu-timing-frame")) {
var h7 = t5.browser.now() - r8;
a7.endQueryEXT(a7.TIME_ELAPSED_EXT, i6), setTimeout(function() {
var e7 = a7.getQueryObjectEXT(i6, a7.QUERY_RESULT_EXT) / 1e6;
a7.deleteQueryEXT(i6), o7.fire(new t5.Event("gpu-timing-frame", { cpuTime: h7, gpuTime: e7 }));
}, 50);
}
if (this.listens("gpu-timing-layer")) {
var p5 = this.painter.collectGpuTimers();
setTimeout(function() {
var e7 = o7.painter.queryGpuTimers(p5);
o7.fire(new t5.Event("gpu-timing-layer", { layerTimes: e7 }));
}, 50);
}
var d5 = this._sourcesDirty || this._styleDirty || this._placementDirty;
return d5 || this._repaint ? this.triggerRepaint() : !this.isMoving() && this.loaded() && this.fire(new t5.Event("idle")), !this._loaded || this._fullyLoaded || d5 || (this._fullyLoaded = true), this;
}
}, r7.prototype.remove = function() {
this._hash && this._hash.remove();
for (var e6 = 0, i6 = this._controls; e6 < i6.length; e6 += 1) {
i6[e6].onRemove(this);
}
this._controls = [], this._frame && (this._frame.cancel(), this._frame = null), this._renderTaskQueue.clear(), this.painter.destroy(), this.handlers.destroy(), delete this.handlers, this.setStyle(null), void 0 !== t5.window && (t5.window.removeEventListener("resize", this._onWindowResize, false), t5.window.removeEventListener("orientationchange", this._onWindowResize, false), t5.window.removeEventListener("online", this._onWindowOnline, false));
var o7 = this.painter.context.gl.getExtension("WEBGL_lose_context");
o7 && o7.loseContext(), Cr(this._canvasContainer), Cr(this._controlContainer), Cr(this._missingCSSCanary), this._container.classList.remove("mapboxgl-map"), this._removed = true, this.fire(new t5.Event("remove"));
}, r7.prototype.triggerRepaint = function() {
var e6 = this;
this.style && !this._frame && (this._frame = t5.browser.frame(function(t6) {
e6._frame = null, e6._render(t6);
}));
}, r7.prototype._onWindowOnline = function() {
this._update();
}, r7.prototype._onWindowResize = function(t6) {
this._trackResize && this.resize({ originalEvent: t6 })._update();
}, a6.showTileBoundaries.get = function() {
return !!this._showTileBoundaries;
}, a6.showTileBoundaries.set = function(t6) {
this._showTileBoundaries !== t6 && (this._showTileBoundaries = t6, this._update());
}, a6.showPadding.get = function() {
return !!this._showPadding;
}, a6.showPadding.set = function(t6) {
this._showPadding !== t6 && (this._showPadding = t6, this._update());
}, a6.showCollisionBoxes.get = function() {
return !!this._showCollisionBoxes;
}, a6.showCollisionBoxes.set = function(t6) {
this._showCollisionBoxes !== t6 && (this._showCollisionBoxes = t6, t6 ? this.style._generateCollisionBoxes() : this._update());
}, a6.showOverdrawInspector.get = function() {
return !!this._showOverdrawInspector;
}, a6.showOverdrawInspector.set = function(t6) {
this._showOverdrawInspector !== t6 && (this._showOverdrawInspector = t6, this._update());
}, a6.repaint.get = function() {
return !!this._repaint;
}, a6.repaint.set = function(t6) {
this._repaint !== t6 && (this._repaint = t6, this.triggerRepaint());
}, a6.vertices.get = function() {
return !!this._vertices;
}, a6.vertices.set = function(t6) {
this._vertices = t6, this._update();
}, r7.prototype._setCacheLimits = function(e6, i6) {
t5.setCacheLimits(e6, i6);
}, a6.version.get = function() {
return t5.version;
}, Object.defineProperties(r7.prototype, a6), r7;
}(vr);
function Cr(t6) {
t6.parentNode && t6.parentNode.removeChild(t6);
}
var zr = { showCompass: true, showZoom: true, visualizePitch: false }, Dr = function(e6) {
var o6 = this;
this.options = t5.extend({}, zr, e6), this._container = i5.create("div", "mapboxgl-ctrl mapboxgl-ctrl-group"), this._container.addEventListener("contextmenu", function(t6) {
return t6.preventDefault();
}), this.options.showZoom && (t5.bindAll(["_setButtonTitle", "_updateZoomButtons"], this), this._zoomInButton = this._createButton("mapboxgl-ctrl-zoom-in", function(t6) {
return o6._map.zoomIn({}, { originalEvent: t6 });
}), i5.create("span", "mapboxgl-ctrl-icon", this._zoomInButton).setAttribute("aria-hidden", true), this._zoomOutButton = this._createButton("mapboxgl-ctrl-zoom-out", function(t6) {
return o6._map.zoomOut({}, { originalEvent: t6 });
}), i5.create("span", "mapboxgl-ctrl-icon", this._zoomOutButton).setAttribute("aria-hidden", true)), this.options.showCompass && (t5.bindAll(["_rotateCompassArrow"], this), this._compass = this._createButton("mapboxgl-ctrl-compass", function(t6) {
o6.options.visualizePitch ? o6._map.resetNorthPitch({}, { originalEvent: t6 }) : o6._map.resetNorth({}, { originalEvent: t6 });
}), this._compassIcon = i5.create("span", "mapboxgl-ctrl-icon", this._compass), this._compassIcon.setAttribute("aria-hidden", true));
};
Dr.prototype._updateZoomButtons = function() {
var t6 = this._map.getZoom(), e6 = t6 === this._map.getMaxZoom(), i6 = t6 === this._map.getMinZoom();
this._zoomInButton.disabled = e6, this._zoomOutButton.disabled = i6, this._zoomInButton.setAttribute("aria-disabled", e6.toString()), this._zoomOutButton.setAttribute("aria-disabled", i6.toString());
}, Dr.prototype._rotateCompassArrow = function() {
var t6 = this.options.visualizePitch ? "scale(" + 1 / Math.pow(Math.cos(this._map.transform.pitch * (Math.PI / 180)), 0.5) + ") rotateX(" + this._map.transform.pitch + "deg) rotateZ(" + this._map.transform.angle * (180 / Math.PI) + "deg)" : "rotate(" + this._map.transform.angle * (180 / Math.PI) + "deg)";
this._compassIcon.style.transform = t6;
}, Dr.prototype.onAdd = function(t6) {
return this._map = t6, this.options.showZoom && (this._setButtonTitle(this._zoomInButton, "ZoomIn"), this._setButtonTitle(this._zoomOutButton, "ZoomOut"), this._map.on("zoom", this._updateZoomButtons), this._updateZoomButtons()), this.options.showCompass && (this._setButtonTitle(this._compass, "ResetBearing"), this.options.visualizePitch && this._map.on("pitch", this._rotateCompassArrow), this._map.on("rotate", this._rotateCompassArrow), this._rotateCompassArrow(), this._handler = new Ar(this._map, this._compass, this.options.visualizePitch)), this._container;
}, Dr.prototype.onRemove = function() {
i5.remove(this._container), this.options.showZoom && this._map.off("zoom", this._updateZoomButtons), this.options.showCompass && (this.options.visualizePitch && this._map.off("pitch", this._rotateCompassArrow), this._map.off("rotate", this._rotateCompassArrow), this._handler.off(), delete this._handler), delete this._map;
}, Dr.prototype._createButton = function(t6, e6) {
var o6 = i5.create("button", t6, this._container);
return o6.type = "button", o6.addEventListener("click", e6), o6;
}, Dr.prototype._setButtonTitle = function(t6, e6) {
var i6 = this._map._getUIString("NavigationControl." + e6);
t6.title = i6, t6.setAttribute("aria-label", i6);
};
var Ar = function(e6, o6, r7) {
void 0 === r7 && (r7 = false), this._clickTolerance = 10, this.element = o6, this.mouseRotate = new Xo({ clickTolerance: e6.dragRotate._mouseRotate._clickTolerance }), this.map = e6, r7 && (this.mousePitch = new Ho({ clickTolerance: e6.dragRotate._mousePitch._clickTolerance })), t5.bindAll(["mousedown", "mousemove", "mouseup", "touchstart", "touchmove", "touchend", "reset"], this), i5.addEventListener(o6, "mousedown", this.mousedown), i5.addEventListener(o6, "touchstart", this.touchstart, { passive: false }), i5.addEventListener(o6, "touchmove", this.touchmove), i5.addEventListener(o6, "touchend", this.touchend), i5.addEventListener(o6, "touchcancel", this.reset);
};
function Mr(e6, i6, o6) {
if (e6 = new t5.LngLat(e6.lng, e6.lat), i6) {
var r7 = new t5.LngLat(e6.lng - 360, e6.lat), a6 = new t5.LngLat(e6.lng + 360, e6.lat), n8 = o6.locationPoint(e6).distSqr(i6);
o6.locationPoint(r7).distSqr(i6) < n8 ? e6 = r7 : o6.locationPoint(a6).distSqr(i6) < n8 && (e6 = a6);
}
for (; Math.abs(e6.lng - o6.center.lng) > 180; ) {
var s7 = o6.locationPoint(e6);
if (s7.x >= 0 && s7.y >= 0 && s7.x <= o6.width && s7.y <= o6.height) {
break;
}
e6.lng > o6.center.lng ? e6.lng -= 360 : e6.lng += 360;
}
return e6;
}
Ar.prototype.down = function(t6, e6) {
this.mouseRotate.mousedown(t6, e6), this.mousePitch && this.mousePitch.mousedown(t6, e6), i5.disableDrag();
}, Ar.prototype.move = function(t6, e6) {
var i6 = this.map, o6 = this.mouseRotate.mousemoveWindow(t6, e6);
if (o6 && o6.bearingDelta && i6.setBearing(i6.getBearing() + o6.bearingDelta), this.mousePitch) {
var r7 = this.mousePitch.mousemoveWindow(t6, e6);
r7 && r7.pitchDelta && i6.setPitch(i6.getPitch() + r7.pitchDelta);
}
}, Ar.prototype.off = function() {
var t6 = this.element;
i5.removeEventListener(t6, "mousedown", this.mousedown), i5.removeEventListener(t6, "touchstart", this.touchstart, { passive: false }), i5.removeEventListener(t6, "touchmove", this.touchmove), i5.removeEventListener(t6, "touchend", this.touchend), i5.removeEventListener(t6, "touchcancel", this.reset), this.offTemp();
}, Ar.prototype.offTemp = function() {
i5.enableDrag(), i5.removeEventListener(t5.window, "mousemove", this.mousemove), i5.removeEventListener(t5.window, "mouseup", this.mouseup);
}, Ar.prototype.mousedown = function(e6) {
this.down(t5.extend({}, e6, { ctrlKey: true, preventDefault: function() {
return e6.preventDefault();
} }), i5.mousePos(this.element, e6)), i5.addEventListener(t5.window, "mousemove", this.mousemove), i5.addEventListener(t5.window, "mouseup", this.mouseup);
}, Ar.prototype.mousemove = function(t6) {
this.move(t6, i5.mousePos(this.element, t6));
}, Ar.prototype.mouseup = function(t6) {
this.mouseRotate.mouseupWindow(t6), this.mousePitch && this.mousePitch.mouseupWindow(t6), this.offTemp();
}, Ar.prototype.touchstart = function(t6) {
1 !== t6.targetTouches.length ? this.reset() : (this._startPos = this._lastPos = i5.touchPos(this.element, t6.targetTouches)[0], this.down({ type: "mousedown", button: 0, ctrlKey: true, preventDefault: function() {
return t6.preventDefault();
} }, this._startPos));
}, Ar.prototype.touchmove = function(t6) {
1 !== t6.targetTouches.length ? this.reset() : (this._lastPos = i5.touchPos(this.element, t6.targetTouches)[0], this.move({ preventDefault: function() {
return t6.preventDefault();
} }, this._lastPos));
}, Ar.prototype.touchend = function(t6) {
0 === t6.targetTouches.length && this._startPos && this._lastPos && this._startPos.dist(this._lastPos) < this._clickTolerance && this.element.click(), this.reset();
}, Ar.prototype.reset = function() {
this.mouseRotate.reset(), this.mousePitch && this.mousePitch.reset(), delete this._startPos, delete this._lastPos, this.offTemp();
};
var Lr = { center: "translate(-50%,-50%)", top: "translate(-50%,0)", "top-left": "translate(0,0)", "top-right": "translate(-100%,0)", bottom: "translate(-50%,-100%)", "bottom-left": "translate(0,-100%)", "bottom-right": "translate(-100%,-100%)", left: "translate(0,-50%)", right: "translate(-100%,-50%)" };
function Rr(t6, e6, i6) {
var o6 = t6.classList;
for (var r7 in Lr) {
o6.remove("mapboxgl-" + i6 + "-anchor-" + r7);
}
o6.add("mapboxgl-" + i6 + "-anchor-" + e6);
}
var kr, Br = function(e6) {
function o6(o7, r7) {
if (e6.call(this), (o7 instanceof t5.window.HTMLElement || r7) && (o7 = t5.extend({ element: o7 }, r7)), t5.bindAll(["_update", "_onMove", "_onUp", "_addDragHandler", "_onMapClick", "_onKeyPress"], this), this._anchor = o7 && o7.anchor || "center", this._color = o7 && o7.color || "#3FB1CE", this._scale = o7 && o7.scale || 1, this._draggable = o7 && o7.draggable || false, this._clickTolerance = o7 && o7.clickTolerance || 0, this._isDragging = false, this._state = "inactive", this._rotation = o7 && o7.rotation || 0, this._rotationAlignment = o7 && o7.rotationAlignment || "auto", this._pitchAlignment = o7 && o7.pitchAlignment && "auto" !== o7.pitchAlignment ? o7.pitchAlignment : this._rotationAlignment, o7 && o7.element) {
this._element = o7.element, this._offset = t5.Point.convert(o7 && o7.offset || [0, 0]);
} else {
this._defaultMarker = true, this._element = i5.create("div"), this._element.setAttribute("aria-label", "Map marker");
var a6 = i5.createNS("http://www.w3.org/2000/svg", "svg");
a6.setAttributeNS(null, "display", "block"), a6.setAttributeNS(null, "height", "41px"), a6.setAttributeNS(null, "width", "27px"), a6.setAttributeNS(null, "viewBox", "0 0 27 41");
var n8 = i5.createNS("http://www.w3.org/2000/svg", "g");
n8.setAttributeNS(null, "stroke", "none"), n8.setAttributeNS(null, "stroke-width", "1"), n8.setAttributeNS(null, "fill", "none"), n8.setAttributeNS(null, "fill-rule", "evenodd");
var s7 = i5.createNS("http://www.w3.org/2000/svg", "g");
s7.setAttributeNS(null, "fill-rule", "nonzero");
var l8 = i5.createNS("http://www.w3.org/2000/svg", "g");
l8.setAttributeNS(null, "transform", "translate(3.0, 29.0)"), l8.setAttributeNS(null, "fill", "#000000");
for (var c5 = 0, u5 = [{ rx: "10.5", ry: "5.25002273" }, { rx: "10.5", ry: "5.25002273" }, { rx: "9.5", ry: "4.77275007" }, { rx: "8.5", ry: "4.29549936" }, { rx: "7.5", ry: "3.81822308" }, { rx: "6.5", ry: "3.34094679" }, { rx: "5.5", ry: "2.86367051" }, { rx: "4.5", ry: "2.38636864" }]; c5 < u5.length; c5 += 1) {
var h7 = u5[c5], p5 = i5.createNS("http://www.w3.org/2000/svg", "ellipse");
p5.setAttributeNS(null, "opacity", "0.04"), p5.setAttributeNS(null, "cx", "10.5"), p5.setAttributeNS(null, "cy", "5.80029008"), p5.setAttributeNS(null, "rx", h7.rx), p5.setAttributeNS(null, "ry", h7.ry), l8.appendChild(p5);
}
var d5 = i5.createNS("http://www.w3.org/2000/svg", "g");
d5.setAttributeNS(null, "fill", this._color);
var _4 = i5.createNS("http://www.w3.org/2000/svg", "path");
_4.setAttributeNS(null, "d", "M27,13.5 C27,19.074644 20.250001,27.000002 14.75,34.500002 C14.016665,35.500004 12.983335,35.500004 12.25,34.500002 C6.7499993,27.000002 0,19.222562 0,13.5 C0,6.0441559 6.0441559,0 13.5,0 C20.955844,0 27,6.0441559 27,13.5 Z"), d5.appendChild(_4);
var f5 = i5.createNS("http://www.w3.org/2000/svg", "g");
f5.setAttributeNS(null, "opacity", "0.25"), f5.setAttributeNS(null, "fill", "#000000");
var m5 = i5.createNS("http://www.w3.org/2000/svg", "path");
m5.setAttributeNS(null, "d", "M13.5,0 C6.0441559,0 0,6.0441559 0,13.5 C0,19.222562 6.7499993,27 12.25,34.5 C13,35.522727 14.016664,35.500004 14.75,34.5 C20.250001,27 27,19.074644 27,13.5 C27,6.0441559 20.955844,0 13.5,0 Z M13.5,1 C20.415404,1 26,6.584596 26,13.5 C26,15.898657 24.495584,19.181431 22.220703,22.738281 C19.945823,26.295132 16.705119,30.142167 13.943359,33.908203 C13.743445,34.180814 13.612715,34.322738 13.5,34.441406 C13.387285,34.322738 13.256555,34.180814 13.056641,33.908203 C10.284481,30.127985 7.4148684,26.314159 5.015625,22.773438 C2.6163816,19.232715 1,15.953538 1,13.5 C1,6.584596 6.584596,1 13.5,1 Z"), f5.appendChild(m5);
var g5 = i5.createNS("http://www.w3.org/2000/svg", "g");
g5.setAttributeNS(null, "transform", "translate(6.0, 7.0)"), g5.setAttributeNS(null, "fill", "#FFFFFF");
var v5 = i5.createNS("http://www.w3.org/2000/svg", "g");
v5.setAttributeNS(null, "transform", "translate(8.0, 8.0)");
var y5 = i5.createNS("http://www.w3.org/2000/svg", "circle");
y5.setAttributeNS(null, "fill", "#000000"), y5.setAttributeNS(null, "opacity", "0.25"), y5.setAttributeNS(null, "cx", "5.5"), y5.setAttributeNS(null, "cy", "5.5"), y5.setAttributeNS(null, "r", "5.4999962");
var x5 = i5.createNS("http://www.w3.org/2000/svg", "circle");
x5.setAttributeNS(null, "fill", "#FFFFFF"), x5.setAttributeNS(null, "cx", "5.5"), x5.setAttributeNS(null, "cy", "5.5"), x5.setAttributeNS(null, "r", "5.4999962"), v5.appendChild(y5), v5.appendChild(x5), s7.appendChild(l8), s7.appendChild(d5), s7.appendChild(f5), s7.appendChild(g5), s7.appendChild(v5), a6.appendChild(s7), a6.setAttributeNS(null, "height", 41 * this._scale + "px"), a6.setAttributeNS(null, "width", 27 * this._scale + "px"), this._element.appendChild(a6), this._offset = t5.Point.convert(o7 && o7.offset || [0, -14]);
}
this._element.classList.add("mapboxgl-marker"), this._element.addEventListener("dragstart", function(t6) {
t6.preventDefault();
}), this._element.addEventListener("mousedown", function(t6) {
t6.preventDefault();
}), Rr(this._element, this._anchor, "marker"), this._popup = null;
}
return e6 && (o6.__proto__ = e6), (o6.prototype = Object.create(e6 && e6.prototype)).constructor = o6, o6.prototype.addTo = function(t6) {
return this.remove(), this._map = t6, t6.getCanvasContainer().appendChild(this._element), t6.on("move", this._update), t6.on("moveend", this._update), this.setDraggable(this._draggable), this._update(), this._map.on("click", this._onMapClick), this;
}, o6.prototype.remove = function() {
return this._map && (this._map.off("click", this._onMapClick), this._map.off("move", this._update), this._map.off("moveend", this._update), this._map.off("mousedown", this._addDragHandler), this._map.off("touchstart", this._addDragHandler), this._map.off("mouseup", this._onUp), this._map.off("touchend", this._onUp), this._map.off("mousemove", this._onMove), this._map.off("touchmove", this._onMove), delete this._map), i5.remove(this._element), this._popup && this._popup.remove(), this;
}, o6.prototype.getLngLat = function() {
return this._lngLat;
}, o6.prototype.setLngLat = function(e7) {
return this._lngLat = t5.LngLat.convert(e7), this._pos = null, this._popup && this._popup.setLngLat(this._lngLat), this._update(), this;
}, o6.prototype.getElement = function() {
return this._element;
}, o6.prototype.setPopup = function(t6) {
if (this._popup && (this._popup.remove(), this._popup = null, this._element.removeEventListener("keypress", this._onKeyPress), this._originalTabIndex || this._element.removeAttribute("tabindex")), t6) {
if (!("offset" in t6.options)) {
var e7 = Math.sqrt(Math.pow(13.5, 2) / 2);
t6.options.offset = this._defaultMarker ? { top: [0, 0], "top-left": [0, 0], "top-right": [0, 0], bottom: [0, -38.1], "bottom-left": [e7, -1 * (24.6 + e7)], "bottom-right": [-e7, -1 * (24.6 + e7)], left: [13.5, -24.6], right: [-13.5, -24.6] } : this._offset;
}
this._popup = t6, this._lngLat && this._popup.setLngLat(this._lngLat), this._originalTabIndex = this._element.getAttribute("tabindex"), this._originalTabIndex || this._element.setAttribute("tabindex", "0"), this._element.addEventListener("keypress", this._onKeyPress);
}
return this;
}, o6.prototype._onKeyPress = function(t6) {
var e7 = t6.code, i6 = t6.charCode || t6.keyCode;
"Space" !== e7 && "Enter" !== e7 && 32 !== i6 && 13 !== i6 || this.togglePopup();
}, o6.prototype._onMapClick = function(t6) {
var e7 = t6.originalEvent.target, i6 = this._element;
this._popup && (e7 === i6 || i6.contains(e7)) && this.togglePopup();
}, o6.prototype.getPopup = function() {
return this._popup;
}, o6.prototype.togglePopup = function() {
var t6 = this._popup;
return t6 ? (t6.isOpen() ? t6.remove() : t6.addTo(this._map), this) : this;
}, o6.prototype._update = function(t6) {
if (this._map) {
this._map.transform.renderWorldCopies && (this._lngLat = Mr(this._lngLat, this._pos, this._map.transform)), this._pos = this._map.project(this._lngLat)._add(this._offset);
var e7 = "";
"viewport" === this._rotationAlignment || "auto" === this._rotationAlignment ? e7 = "rotateZ(" + this._rotation + "deg)" : "map" === this._rotationAlignment && (e7 = "rotateZ(" + (this._rotation - this._map.getBearing()) + "deg)");
var o7 = "";
"viewport" === this._pitchAlignment || "auto" === this._pitchAlignment ? o7 = "rotateX(0deg)" : "map" === this._pitchAlignment && (o7 = "rotateX(" + this._map.getPitch() + "deg)"), t6 && "moveend" !== t6.type || (this._pos = this._pos.round()), i5.setTransform(this._element, Lr[this._anchor] + " translate(" + this._pos.x + "px, " + this._pos.y + "px) " + o7 + " " + e7);
}
}, o6.prototype.getOffset = function() {
return this._offset;
}, o6.prototype.setOffset = function(e7) {
return this._offset = t5.Point.convert(e7), this._update(), this;
}, o6.prototype._onMove = function(e7) {
if (!this._isDragging) {
var i6 = this._clickTolerance || this._map._clickTolerance;
this._isDragging = e7.point.dist(this._pointerdownPos) >= i6;
}
this._isDragging && (this._pos = e7.point.sub(this._positionDelta), this._lngLat = this._map.unproject(this._pos), this.setLngLat(this._lngLat), this._element.style.pointerEvents = "none", "pending" === this._state && (this._state = "active", this.fire(new t5.Event("dragstart"))), this.fire(new t5.Event("drag")));
}, o6.prototype._onUp = function() {
this._element.style.pointerEvents = "auto", this._positionDelta = null, this._pointerdownPos = null, this._isDragging = false, this._map.off("mousemove", this._onMove), this._map.off("touchmove", this._onMove), "active" === this._state && this.fire(new t5.Event("dragend")), this._state = "inactive";
}, o6.prototype._addDragHandler = function(t6) {
this._element.contains(t6.originalEvent.target) && (t6.preventDefault(), this._positionDelta = t6.point.sub(this._pos).add(this._offset), this._pointerdownPos = t6.point, this._state = "pending", this._map.on("mousemove", this._onMove), this._map.on("touchmove", this._onMove), this._map.once("mouseup", this._onUp), this._map.once("touchend", this._onUp));
}, o6.prototype.setDraggable = function(t6) {
return this._draggable = !!t6, this._map && (t6 ? (this._map.on("mousedown", this._addDragHandler), this._map.on("touchstart", this._addDragHandler)) : (this._map.off("mousedown", this._addDragHandler), this._map.off("touchstart", this._addDragHandler))), this;
}, o6.prototype.isDraggable = function() {
return this._draggable;
}, o6.prototype.setRotation = function(t6) {
return this._rotation = t6 || 0, this._update(), this;
}, o6.prototype.getRotation = function() {
return this._rotation;
}, o6.prototype.setRotationAlignment = function(t6) {
return this._rotationAlignment = t6 || "auto", this._update(), this;
}, o6.prototype.getRotationAlignment = function() {
return this._rotationAlignment;
}, o6.prototype.setPitchAlignment = function(t6) {
return this._pitchAlignment = t6 && "auto" !== t6 ? t6 : this._rotationAlignment, this._update(), this;
}, o6.prototype.getPitchAlignment = function() {
return this._pitchAlignment;
}, o6;
}(t5.Evented), Or = { positionOptions: { enableHighAccuracy: false, maximumAge: 0, timeout: 6e3 }, fitBoundsOptions: { maxZoom: 15 }, trackUserLocation: false, showAccuracyCircle: true, showUserLocation: true }, Fr = 0, Ur = false, Nr = function(e6) {
function o6(i6) {
e6.call(this), this.options = t5.extend({}, Or, i6), t5.bindAll(["_onSuccess", "_onError", "_onZoom", "_finish", "_setupUI", "_updateCamera", "_updateMarker"], this);
}
return e6 && (o6.__proto__ = e6), (o6.prototype = Object.create(e6 && e6.prototype)).constructor = o6, o6.prototype.onAdd = function(e7) {
var o7;
return this._map = e7, this._container = i5.create("div", "mapboxgl-ctrl mapboxgl-ctrl-group"), o7 = this._setupUI, void 0 !== kr ? o7(kr) : void 0 !== t5.window.navigator.permissions ? t5.window.navigator.permissions.query({ name: "geolocation" }).then(function(t6) {
o7(kr = "denied" !== t6.state);
}) : o7(kr = !!t5.window.navigator.geolocation), this._container;
}, o6.prototype.onRemove = function() {
void 0 !== this._geolocationWatchID && (t5.window.navigator.geolocation.clearWatch(this._geolocationWatchID), this._geolocationWatchID = void 0), this.options.showUserLocation && this._userLocationDotMarker && this._userLocationDotMarker.remove(), this.options.showAccuracyCircle && this._accuracyCircleMarker && this._accuracyCircleMarker.remove(), i5.remove(this._container), this._map.off("zoom", this._onZoom), this._map = void 0, Fr = 0, Ur = false;
}, o6.prototype._isOutOfMapMaxBounds = function(t6) {
var e7 = this._map.getMaxBounds(), i6 = t6.coords;
return e7 && (i6.longitude < e7.getWest() || i6.longitude > e7.getEast() || i6.latitude < e7.getSouth() || i6.latitude > e7.getNorth());
}, o6.prototype._setErrorState = function() {
switch (this._watchState) {
case "WAITING_ACTIVE":
this._watchState = "ACTIVE_ERROR", this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");
break;
case "ACTIVE_LOCK":
this._watchState = "ACTIVE_ERROR", this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");
break;
case "BACKGROUND":
this._watchState = "BACKGROUND_ERROR", this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting");
}
}, o6.prototype._onSuccess = function(e7) {
if (this._map) {
if (this._isOutOfMapMaxBounds(e7)) {
return this._setErrorState(), this.fire(new t5.Event("outofmaxbounds", e7)), this._updateMarker(), void this._finish();
}
if (this.options.trackUserLocation) {
switch (this._lastKnownPosition = e7, this._watchState) {
case "WAITING_ACTIVE":
case "ACTIVE_LOCK":
case "ACTIVE_ERROR":
this._watchState = "ACTIVE_LOCK", this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");
break;
case "BACKGROUND":
case "BACKGROUND_ERROR":
this._watchState = "BACKGROUND", this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");
}
}
this.options.showUserLocation && "OFF" !== this._watchState && this._updateMarker(e7), this.options.trackUserLocation && "ACTIVE_LOCK" !== this._watchState || this._updateCamera(e7), this.options.showUserLocation && this._dotElement.classList.remove("mapboxgl-user-location-dot-stale"), this.fire(new t5.Event("geolocate", e7)), this._finish();
}
}, o6.prototype._updateCamera = function(e7) {
var i6 = new t5.LngLat(e7.coords.longitude, e7.coords.latitude), o7 = e7.coords.accuracy, r7 = this._map.getBearing(), a6 = t5.extend({ bearing: r7 }, this.options.fitBoundsOptions);
this._map.fitBounds(i6.toBounds(o7), a6, { geolocateSource: true });
}, o6.prototype._updateMarker = function(e7) {
if (e7) {
var i6 = new t5.LngLat(e7.coords.longitude, e7.coords.latitude);
this._accuracyCircleMarker.setLngLat(i6).addTo(this._map), this._userLocationDotMarker.setLngLat(i6).addTo(this._map), this._accuracy = e7.coords.accuracy, this.options.showUserLocation && this.options.showAccuracyCircle && this._updateCircleRadius();
} else {
this._userLocationDotMarker.remove(), this._accuracyCircleMarker.remove();
}
}, o6.prototype._updateCircleRadius = function() {
var t6 = this._map._container.clientHeight / 2, e7 = this._map.unproject([0, t6]), i6 = this._map.unproject([1, t6]), o7 = e7.distanceTo(i6), r7 = Math.ceil(2 * this._accuracy / o7);
this._circleElement.style.width = r7 + "px", this._circleElement.style.height = r7 + "px";
}, o6.prototype._onZoom = function() {
this.options.showUserLocation && this.options.showAccuracyCircle && this._updateCircleRadius();
}, o6.prototype._onError = function(e7) {
if (this._map) {
if (this.options.trackUserLocation) {
if (1 === e7.code) {
this._watchState = "OFF", this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"), this._geolocateButton.disabled = true;
var i6 = this._map._getUIString("GeolocateControl.LocationNotAvailable");
this._geolocateButton.title = i6, this._geolocateButton.setAttribute("aria-label", i6), void 0 !== this._geolocationWatchID && this._clearWatch();
} else {
if (3 === e7.code && Ur) {
return;
}
this._setErrorState();
}
}
"OFF" !== this._watchState && this.options.showUserLocation && this._dotElement.classList.add("mapboxgl-user-location-dot-stale"), this.fire(new t5.Event("error", e7)), this._finish();
}
}, o6.prototype._finish = function() {
this._timeoutId && clearTimeout(this._timeoutId), this._timeoutId = void 0;
}, o6.prototype._setupUI = function(e7) {
var o7 = this;
if (this._container.addEventListener("contextmenu", function(t6) {
return t6.preventDefault();
}), this._geolocateButton = i5.create("button", "mapboxgl-ctrl-geolocate", this._container), i5.create("span", "mapboxgl-ctrl-icon", this._geolocateButton).setAttribute("aria-hidden", true), this._geolocateButton.type = "button", false === e7) {
t5.warnOnce("Geolocation support is not available so the GeolocateControl will be disabled.");
var r7 = this._map._getUIString("GeolocateControl.LocationNotAvailable");
this._geolocateButton.disabled = true, this._geolocateButton.title = r7, this._geolocateButton.setAttribute("aria-label", r7);
} else {
var a6 = this._map._getUIString("GeolocateControl.FindMyLocation");
this._geolocateButton.title = a6, this._geolocateButton.setAttribute("aria-label", a6);
}
this.options.trackUserLocation && (this._geolocateButton.setAttribute("aria-pressed", "false"), this._watchState = "OFF"), this.options.showUserLocation && (this._dotElement = i5.create("div", "mapboxgl-user-location-dot"), this._userLocationDotMarker = new Br(this._dotElement), this._circleElement = i5.create("div", "mapboxgl-user-location-accuracy-circle"), this._accuracyCircleMarker = new Br({ element: this._circleElement, pitchAlignment: "map" }), this.options.trackUserLocation && (this._watchState = "OFF"), this._map.on("zoom", this._onZoom)), this._geolocateButton.addEventListener("click", this.trigger.bind(this)), this._setup = true, this.options.trackUserLocation && this._map.on("movestart", function(e8) {
e8.geolocateSource || "ACTIVE_LOCK" !== o7._watchState || e8.originalEvent && "resize" === e8.originalEvent.type || (o7._watchState = "BACKGROUND", o7._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background"), o7._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"), o7.fire(new t5.Event("trackuserlocationend")));
});
}, o6.prototype.trigger = function() {
if (!this._setup) {
return t5.warnOnce("Geolocate control triggered before added to a map"), false;
}
if (this.options.trackUserLocation) {
switch (this._watchState) {
case "OFF":
this._watchState = "WAITING_ACTIVE", this.fire(new t5.Event("trackuserlocationstart"));
break;
case "WAITING_ACTIVE":
case "ACTIVE_LOCK":
case "ACTIVE_ERROR":
case "BACKGROUND_ERROR":
Fr--, Ur = false, this._watchState = "OFF", this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-active-error"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"), this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background-error"), this.fire(new t5.Event("trackuserlocationend"));
break;
case "BACKGROUND":
this._watchState = "ACTIVE_LOCK", this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-background"), this._lastKnownPosition && this._updateCamera(this._lastKnownPosition), this.fire(new t5.Event("trackuserlocationstart"));
}
switch (this._watchState) {
case "WAITING_ACTIVE":
this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");
break;
case "ACTIVE_LOCK":
this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active");
break;
case "ACTIVE_ERROR":
this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-active-error");
break;
case "BACKGROUND":
this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background");
break;
case "BACKGROUND_ERROR":
this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-background-error");
}
if ("OFF" === this._watchState && void 0 !== this._geolocationWatchID) {
this._clearWatch();
} else if (void 0 === this._geolocationWatchID) {
var e7;
this._geolocateButton.classList.add("mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.setAttribute("aria-pressed", "true"), ++Fr > 1 ? (e7 = { maximumAge: 6e5, timeout: 0 }, Ur = true) : (e7 = this.options.positionOptions, Ur = false), this._geolocationWatchID = t5.window.navigator.geolocation.watchPosition(this._onSuccess, this._onError, e7);
}
} else {
t5.window.navigator.geolocation.getCurrentPosition(this._onSuccess, this._onError, this.options.positionOptions), this._timeoutId = setTimeout(this._finish, 1e4);
}
return true;
}, o6.prototype._clearWatch = function() {
t5.window.navigator.geolocation.clearWatch(this._geolocationWatchID), this._geolocationWatchID = void 0, this._geolocateButton.classList.remove("mapboxgl-ctrl-geolocate-waiting"), this._geolocateButton.setAttribute("aria-pressed", "false"), this.options.showUserLocation && this._updateMarker(null);
}, o6;
}(t5.Evented), Zr = { maxWidth: 100, unit: "metric" }, qr = function(e6) {
this.options = t5.extend({}, Zr, e6), t5.bindAll(["_onMove", "setUnit"], this);
};
function jr(t6, e6, i6) {
var o6 = i6 && i6.maxWidth || 100, r7 = t6._container.clientHeight / 2, a6 = t6.unproject([0, r7]), n8 = t6.unproject([o6, r7]), s7 = a6.distanceTo(n8);
if (i6 && "imperial" === i6.unit) {
var l8 = 3.2808 * s7;
l8 > 5280 ? Vr(e6, o6, l8 / 5280, t6._getUIString("ScaleControl.Miles")) : Vr(e6, o6, l8, t6._getUIString("ScaleControl.Feet"));
} else {
i6 && "nautical" === i6.unit ? Vr(e6, o6, s7 / 1852, t6._getUIString("ScaleControl.NauticalMiles")) : s7 >= 1e3 ? Vr(e6, o6, s7 / 1e3, t6._getUIString("ScaleControl.Kilometers")) : Vr(e6, o6, s7, t6._getUIString("ScaleControl.Meters"));
}
}
function Vr(t6, e6, i6, o6) {
var r7, a6, n8, s7 = (r7 = i6, (a6 = Math.pow(10, ("" + Math.floor(r7)).length - 1)) * (n8 = (n8 = r7 / a6) >= 10 ? 10 : n8 >= 5 ? 5 : n8 >= 3 ? 3 : n8 >= 2 ? 2 : n8 >= 1 ? 1 : function(t7) {
var e7 = Math.pow(10, Math.ceil(-Math.log(t7) / Math.LN10));
return Math.round(t7 * e7) / e7;
}(n8)));
t6.style.width = e6 * (s7 / i6) + "px", t6.innerHTML = s7 + " " + o6;
}
qr.prototype.getDefaultPosition = function() {
return "bottom-left";
}, qr.prototype._onMove = function() {
jr(this._map, this._container, this.options);
}, qr.prototype.onAdd = function(t6) {
return this._map = t6, this._container = i5.create("div", "mapboxgl-ctrl mapboxgl-ctrl-scale", t6.getContainer()), this._map.on("move", this._onMove), this._onMove(), this._container;
}, qr.prototype.onRemove = function() {
i5.remove(this._container), this._map.off("move", this._onMove), this._map = void 0;
}, qr.prototype.setUnit = function(t6) {
this.options.unit = t6, jr(this._map, this._container, this.options);
};
var Gr = function(e6) {
this._fullscreen = false, e6 && e6.container && (e6.container instanceof t5.window.HTMLElement ? this._container = e6.container : t5.warnOnce("Full screen control 'container' must be a DOM element.")), t5.bindAll(["_onClickFullscreen", "_changeIcon"], this), "onfullscreenchange" in t5.window.document ? this._fullscreenchange = "fullscreenchange" : "onmozfullscreenchange" in t5.window.document ? this._fullscreenchange = "mozfullscreenchange" : "onwebkitfullscreenchange" in t5.window.document ? this._fullscreenchange = "webkitfullscreenchange" : "onmsfullscreenchange" in t5.window.document && (this._fullscreenchange = "MSFullscreenChange");
};
Gr.prototype.onAdd = function(e6) {
return this._map = e6, this._container || (this._container = this._map.getContainer()), this._controlContainer = i5.create("div", "mapboxgl-ctrl mapboxgl-ctrl-group"), this._checkFullscreenSupport() ? this._setupUI() : (this._controlContainer.style.display = "none", t5.warnOnce("This device does not support fullscreen mode.")), this._controlContainer;
}, Gr.prototype.onRemove = function() {
i5.remove(this._controlContainer), this._map = null, t5.window.document.removeEventListener(this._fullscreenchange, this._changeIcon);
}, Gr.prototype._checkFullscreenSupport = function() {
return !!(t5.window.document.fullscreenEnabled || t5.window.document.mozFullScreenEnabled || t5.window.document.msFullscreenEnabled || t5.window.document.webkitFullscreenEnabled);
}, Gr.prototype._setupUI = function() {
var e6 = this._fullscreenButton = i5.create("button", "mapboxgl-ctrl-fullscreen", this._controlContainer);
i5.create("span", "mapboxgl-ctrl-icon", e6).setAttribute("aria-hidden", true), e6.type = "button", this._updateTitle(), this._fullscreenButton.addEventListener("click", this._onClickFullscreen), t5.window.document.addEventListener(this._fullscreenchange, this._changeIcon);
}, Gr.prototype._updateTitle = function() {
var t6 = this._getTitle();
this._fullscreenButton.setAttribute("aria-label", t6), this._fullscreenButton.title = t6;
}, Gr.prototype._getTitle = function() {
return this._map._getUIString(this._isFullscreen() ? "FullscreenControl.Exit" : "FullscreenControl.Enter");
}, Gr.prototype._isFullscreen = function() {
return this._fullscreen;
}, Gr.prototype._changeIcon = function() {
(t5.window.document.fullscreenElement || t5.window.document.mozFullScreenElement || t5.window.document.webkitFullscreenElement || t5.window.document.msFullscreenElement) === this._container !== this._fullscreen && (this._fullscreen = !this._fullscreen, this._fullscreenButton.classList.toggle("mapboxgl-ctrl-shrink"), this._fullscreenButton.classList.toggle("mapboxgl-ctrl-fullscreen"), this._updateTitle());
}, Gr.prototype._onClickFullscreen = function() {
this._isFullscreen() ? t5.window.document.exitFullscreen ? t5.window.document.exitFullscreen() : t5.window.document.mozCancelFullScreen ? t5.window.document.mozCancelFullScreen() : t5.window.document.msExitFullscreen ? t5.window.document.msExitFullscreen() : t5.window.document.webkitCancelFullScreen && t5.window.document.webkitCancelFullScreen() : this._container.requestFullscreen ? this._container.requestFullscreen() : this._container.mozRequestFullScreen ? this._container.mozRequestFullScreen() : this._container.msRequestFullscreen ? this._container.msRequestFullscreen() : this._container.webkitRequestFullscreen && this._container.webkitRequestFullscreen();
};
var Wr = { closeButton: true, closeOnClick: true, focusAfterOpen: true, className: "", maxWidth: "240px" }, Xr = ["a[href]", "[tabindex]:not([tabindex='-1'])", "[contenteditable]:not([contenteditable='false'])", "button:not([disabled])", "input:not([disabled])", "select:not([disabled])", "textarea:not([disabled])"].join(", "), Hr = function(e6) {
function o6(i6) {
e6.call(this), this.options = t5.extend(Object.create(Wr), i6), t5.bindAll(["_update", "_onClose", "remove", "_onMouseMove", "_onMouseUp", "_onDrag"], this);
}
return e6 && (o6.__proto__ = e6), (o6.prototype = Object.create(e6 && e6.prototype)).constructor = o6, o6.prototype.addTo = function(e7) {
return this._map && this.remove(), this._map = e7, this.options.closeOnClick && this._map.on("click", this._onClose), this.options.closeOnMove && this._map.on("move", this._onClose), this._map.on("remove", this.remove), this._update(), this._focusFirstElement(), this._trackPointer ? (this._map.on("mousemove", this._onMouseMove), this._map.on("mouseup", this._onMouseUp), this._container && this._container.classList.add("mapboxgl-popup-track-pointer"), this._map._canvasContainer.classList.add("mapboxgl-track-pointer")) : this._map.on("move", this._update), this.fire(new t5.Event("open")), this;
}, o6.prototype.isOpen = function() {
return !!this._map;
}, o6.prototype.remove = function() {
return this._content && i5.remove(this._content), this._container && (i5.remove(this._container), delete this._container), this._map && (this._map.off("move", this._update), this._map.off("move", this._onClose), this._map.off("click", this._onClose), this._map.off("remove", this.remove), this._map.off("mousemove", this._onMouseMove), this._map.off("mouseup", this._onMouseUp), this._map.off("drag", this._onDrag), delete this._map), this.fire(new t5.Event("close")), this;
}, o6.prototype.getLngLat = function() {
return this._lngLat;
}, o6.prototype.setLngLat = function(e7) {
return this._lngLat = t5.LngLat.convert(e7), this._pos = null, this._trackPointer = false, this._update(), this._map && (this._map.on("move", this._update), this._map.off("mousemove", this._onMouseMove), this._container && this._container.classList.remove("mapboxgl-popup-track-pointer"), this._map._canvasContainer.classList.remove("mapboxgl-track-pointer")), this;
}, o6.prototype.trackPointer = function() {
return this._trackPointer = true, this._pos = null, this._update(), this._map && (this._map.off("move", this._update), this._map.on("mousemove", this._onMouseMove), this._map.on("drag", this._onDrag), this._container && this._container.classList.add("mapboxgl-popup-track-pointer"), this._map._canvasContainer.classList.add("mapboxgl-track-pointer")), this;
}, o6.prototype.getElement = function() {
return this._container;
}, o6.prototype.setText = function(e7) {
return this.setDOMContent(t5.window.document.createTextNode(e7));
}, o6.prototype.setHTML = function(e7) {
var i6, o7 = t5.window.document.createDocumentFragment(), r7 = t5.window.document.createElement("body");
for (r7.innerHTML = e7; i6 = r7.firstChild; ) {
o7.appendChild(i6);
}
return this.setDOMContent(o7);
}, o6.prototype.getMaxWidth = function() {
return this._container && this._container.style.maxWidth;
}, o6.prototype.setMaxWidth = function(t6) {
return this.options.maxWidth = t6, this._update(), this;
}, o6.prototype.setDOMContent = function(t6) {
if (this._content) {
for (; this._content.hasChildNodes(); ) {
this._content.firstChild && this._content.removeChild(this._content.firstChild);
}
} else {
this._content = i5.create("div", "mapboxgl-popup-content", this._container);
}
return this._content.appendChild(t6), this._createCloseButton(), this._update(), this._focusFirstElement(), this;
}, o6.prototype.addClassName = function(t6) {
this._container && this._container.classList.add(t6);
}, o6.prototype.removeClassName = function(t6) {
this._container && this._container.classList.remove(t6);
}, o6.prototype.setOffset = function(t6) {
return this.options.offset = t6, this._update(), this;
}, o6.prototype.toggleClassName = function(t6) {
if (this._container) {
return this._container.classList.toggle(t6);
}
}, o6.prototype._createCloseButton = function() {
this.options.closeButton && (this._closeButton = i5.create("button", "mapboxgl-popup-close-button", this._content), this._closeButton.type = "button", this._closeButton.setAttribute("aria-label", "Close popup"), this._closeButton.innerHTML = "×", this._closeButton.addEventListener("click", this._onClose));
}, o6.prototype._onMouseUp = function(t6) {
this._update(t6.point);
}, o6.prototype._onMouseMove = function(t6) {
this._update(t6.point);
}, o6.prototype._onDrag = function(t6) {
this._update(t6.point);
}, o6.prototype._update = function(e7) {
var o7 = this;
if (this._map && (this._lngLat || this._trackPointer) && this._content && (this._container || (this._container = i5.create("div", "mapboxgl-popup", this._map.getContainer()), this._tip = i5.create("div", "mapboxgl-popup-tip", this._container), this._container.appendChild(this._content), this.options.className && this.options.className.split(" ").forEach(function(t6) {
return o7._container.classList.add(t6);
}), this._trackPointer && this._container.classList.add("mapboxgl-popup-track-pointer")), this.options.maxWidth && this._container.style.maxWidth !== this.options.maxWidth && (this._container.style.maxWidth = this.options.maxWidth), this._map.transform.renderWorldCopies && !this._trackPointer && (this._lngLat = Mr(this._lngLat, this._pos, this._map.transform)), !this._trackPointer || e7)) {
var r7 = this._pos = this._trackPointer && e7 ? e7 : this._map.project(this._lngLat), a6 = this.options.anchor, n8 = function e8(i6) {
if (i6) {
if ("number" == typeof i6) {
var o8 = Math.round(Math.sqrt(0.5 * Math.pow(i6, 2)));
return { center: new t5.Point(0, 0), top: new t5.Point(0, i6), "top-left": new t5.Point(o8, o8), "top-right": new t5.Point(-o8, o8), bottom: new t5.Point(0, -i6), "bottom-left": new t5.Point(o8, -o8), "bottom-right": new t5.Point(-o8, -o8), left: new t5.Point(i6, 0), right: new t5.Point(-i6, 0) };
}
if (i6 instanceof t5.Point || Array.isArray(i6)) {
var r8 = t5.Point.convert(i6);
return { center: r8, top: r8, "top-left": r8, "top-right": r8, bottom: r8, "bottom-left": r8, "bottom-right": r8, left: r8, right: r8 };
}
return { center: t5.Point.convert(i6.center || [0, 0]), top: t5.Point.convert(i6.top || [0, 0]), "top-left": t5.Point.convert(i6["top-left"] || [0, 0]), "top-right": t5.Point.convert(i6["top-right"] || [0, 0]), bottom: t5.Point.convert(i6.bottom || [0, 0]), "bottom-left": t5.Point.convert(i6["bottom-left"] || [0, 0]), "bottom-right": t5.Point.convert(i6["bottom-right"] || [0, 0]), left: t5.Point.convert(i6.left || [0, 0]), right: t5.Point.convert(i6.right || [0, 0]) };
}
return e8(new t5.Point(0, 0));
}(this.options.offset);
if (!a6) {
var s7, l8 = this._container.offsetWidth, c5 = this._container.offsetHeight;
s7 = r7.y + n8.bottom.y < c5 ? ["top"] : r7.y > this._map.transform.height - c5 ? ["bottom"] : [], r7.x < l8 / 2 ? s7.push("left") : r7.x > this._map.transform.width - l8 / 2 && s7.push("right"), a6 = 0 === s7.length ? "bottom" : s7.join("-");
}
var u5 = r7.add(n8[a6]).round();
i5.setTransform(this._container, Lr[a6] + " translate(" + u5.x + "px," + u5.y + "px)"), Rr(this._container, a6, "popup");
}
}, o6.prototype._focusFirstElement = function() {
if (this.options.focusAfterOpen && this._container) {
var t6 = this._container.querySelector(Xr);
t6 && t6.focus();
}
}, o6.prototype._onClose = function() {
this.remove();
}, o6;
}(t5.Evented), Kr = { version: t5.version, supported: e5, setRTLTextPlugin: t5.setRTLTextPlugin, getRTLTextPluginStatus: t5.getRTLTextPluginStatus, Map: Sr, NavigationControl: Dr, GeolocateControl: Nr, AttributionControl: yr, ScaleControl: qr, FullscreenControl: Gr, Popup: Hr, Marker: Br, Style: je2, LngLat: t5.LngLat, LngLatBounds: t5.LngLatBounds, Point: t5.Point, MercatorCoordinate: t5.MercatorCoordinate, Evented: t5.Evented, config: t5.config, prewarm: function() {
Ft2().acquire(Rt2);
}, clearPrewarmedResources: function() {
var t6 = Bt2;
t6 && (t6.isPreloaded() && 1 === t6.numActive() ? (t6.release(Rt2), Bt2 = null) : console.warn("Could not clear WebWorkers since there are active Map instances that still reference it. The pre-warmed WebWorker pool can only be cleared when all map instances have been removed with map.remove()"));
}, get accessToken() {
return t5.config.ACCESS_TOKEN;
}, set accessToken(e6) {
t5.config.ACCESS_TOKEN = e6;
}, get baseApiUrl() {
return t5.config.API_URL;
}, set baseApiUrl(e6) {
t5.config.API_URL = e6;
}, get workerCount() {
return kt2.workerCount;
}, set workerCount(t6) {
kt2.workerCount = t6;
}, get maxParallelImageRequests() {
return t5.config.MAX_PARALLEL_IMAGE_REQUESTS;
}, set maxParallelImageRequests(e6) {
t5.config.MAX_PARALLEL_IMAGE_REQUESTS = e6;
}, clearStorage: function(e6) {
t5.clearTileCache(e6);
}, workerUrl: "" };
return Kr;
});
return mapboxgl2;
});
})(mapboxGl);
var mapboxgl = mapboxGlExports;
function getElement(element) {
if (typeof element === "string") {
var elementId = element;
element = document.getElementById(element);
if (!element) {
throw new Error("No element with id " + elementId);
}
}
return element;
}
function validateColor(color2) {
if (!/^#([0-9a-f]{3}){1,2}$/i.test(color2) && !/^[a-z]+$/i.test(color2)) {
throw new Error("Invalid color");
}
}
function createMarkerImage(library, color2) {
var height = 41;
var width = 27;
var scale = 2;
var svg = new library.Marker()._element.querySelector("svg");
svg.removeAttribute("display");
svg.setAttribute("xmlns", "http://www.w3.org/2000/svg");
svg.setAttribute("height", height);
svg.setAttribute("width", width);
svg.setAttribute("viewBox", "0 0 " + width + " " + height);
validateColor(color2);
svg.querySelector("*[fill='#3FB1CE']").setAttribute("fill", color2);
var circles = svg.querySelectorAll("circle");
var circle = circles[circles.length - 1];
if (circles.length == 1) {
var c4 = circle.cloneNode();
c4.setAttribute("fill", "#000000");
c4.setAttribute("opacity", 0.25);
circle.parentNode.insertBefore(c4, circle);
}
circle.setAttribute("r", 4.5);
var image = new Image(width * scale, height * scale);
image.src = "data:image/svg+xml;utf8," + encodeURIComponent(svg.outerHTML);
return image;
}
var maps = {};
var BaseMap = function BaseMap2(element, data, options, mapType) {
var this$1$1 = this;
if (!Mapkick.library && typeof window !== "undefined") {
Mapkick.library = window.mapboxgl || window.maplibregl || null;
}
var library = Mapkick.library;
if (!library) {
throw new Error("No mapping library found");
}
var map3;
var trails = {};
var groupedData = {};
var timestamps = [];
var timeIndex = 0;
element = getElement(element);
if (element.id) {
maps[element.id] = this;
}
function getJSON(element2, url, success) {
var xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.setRequestHeader("Content-Type", "application/json");
xhr.onload = function() {
if (xhr.status === 200) {
success(JSON.parse(xhr.responseText));
} else {
showError(element2, xhr.statusText);
}
};
xhr.send();
}
function onMapLoad(callback2) {
if (map3.loaded()) {
callback2();
} else {
map3.on("load", callback2);
}
}
function toTimestamp(ts2) {
if (typeof ts2 === "number") {
return ts2;
} else {
return new Date(ts2).getTime() / 1e3;
}
}
function generateReplayMap(element2, data2, options2) {
for (var i5 = 0; i5 < data2.length; i5++) {
var row = data2[i5];
var ts2 = toTimestamp(row.time);
if (ts2) {
if (!groupedData[ts2]) {
groupedData[ts2] = [];
}
groupedData[ts2].push(row);
bounds.extend(rowCoordinates(row));
}
}
for (var i$1 in groupedData) {
if (Object.prototype.hasOwnProperty.call(groupedData, i$1)) {
timestamps.push(parseInt(i$1));
}
}
timestamps.sort();
generateMap(element2, groupedData[timestamps[timeIndex]], options2);
onMapLoad(function() {
setTimeout(function() {
nextFrame2(element2, options2);
}, 100);
});
}
function nextFrame2(element2, options2) {
timeIndex++;
updateMap(element2, groupedData[timestamps[timeIndex]], options2);
if (timeIndex < timestamps.length - 1) {
setTimeout(function() {
nextFrame2(element2, options2);
}, 100);
}
}
function showError(element2, message) {
element2.textContent = message;
}
function errorCatcher(element2, data2, options2, callback2) {
try {
callback2(element2, data2, options2);
} catch (err) {
showError(element2, err.message);
throw err;
}
}
function fetchData(element2, data2, options2, callback2) {
if (typeof data2 === "string") {
getJSON(element2, data2, function(newData) {
errorCatcher(element2, newData, options2, callback2);
});
} else if (typeof data2 === "function") {
data2(function(newData) {
errorCatcher(element2, newData, options2, callback2);
}, function(message) {
showError(element2, message);
});
} else {
errorCatcher(element2, data2, options2, callback2);
}
}
function updateMap(element2, data2, options2) {
onLayersReady(function() {
if (options2.trail) {
recordTrails(data2, options2.trail);
map3.getSource("trails").setData(generateTrailsGeoJSON(data2));
}
map3.getSource("objects").setData(generateGeoJSON(data2, options2));
});
}
var markerIds = new window.Map();
function generateGeoJSON(data2, options2) {
var geojson = {
type: "FeatureCollection",
features: []
};
for (var i5 = 0; i5 < data2.length; i5++) {
var row = data2[i5];
var properties = Object.assign({}, row);
var geometry = void 0;
if (mapType === "point") {
if (!properties.icon) {
properties.icon = options2.defaultIcon || "mapkick";
}
properties.mapkickIconSize = properties.icon === "mapkick" ? 0.5 : 1;
properties.mapkickIconAnchor = properties.icon === "mapkick" ? "bottom" : "center";
properties.mapkickIconOffset = properties.icon === "mapkick" ? [0, 10] : [0, 0];
if (properties.icon === "mapkick") {
var color2 = properties.color || markerOptions.color || "#f84d4d";
var markerId = markerIds.get(color2);
if (markerId === void 0) {
markerId = markerIds.size;
validateColor(color2);
markerIds.set(color2, markerId);
}
properties.icon = "mapkick-" + markerId;
}
var coordinates = rowCoordinates(row);
if (!coordinates[1]) {
throw new Error("missing latitude (index: " + i5 + ")");
}
if (!coordinates[0]) {
throw new Error("missing longitude (index: " + i5 + ")");
}
geometry = {
type: "Point",
coordinates
};
} else {
geometry = row.geometry;
if (!geometry) {
throw new Error("missing geometry (index: " + i5 + ")");
}
delete properties.geometry;
properties.mapkickColor = properties.color || markerOptions.color || "#0090ff";
}
geojson.features.push({
type: "Feature",
id: i5,
geometry,
properties
});
}
return geojson;
}
function rowCoordinates(row) {
return [row.longitude || row.lng || row.lon, row.latitude || row.lat];
}
function getTrailId(row) {
return row.id;
}
function recordTrails(data2, trailOptions) {
for (var i5 = 0; i5 < data2.length; i5++) {
var row = data2[i5];
var trailId = getTrailId(row);
if (!trails[trailId]) {
trails[trailId] = [];
}
trails[trailId].push(rowCoordinates(row));
if (trailOptions && trailOptions.len && trails[trailId].length > trailOptions.len) {
trails[trailId].shift();
}
}
}
function generateTrailsGeoJSON(data2) {
var geojson = {
type: "FeatureCollection",
features: []
};
for (var i5 = 0; i5 < data2.length; i5++) {
var row = data2[i5];
geojson.features.push({
type: "Feature",
geometry: {
type: "LineString",
coordinates: trails[getTrailId(row)]
}
});
}
return geojson;
}
function generateLabelGeoJSON(data2) {
var geojson = {
type: "FeatureCollection",
features: []
};
for (var i5 = 0; i5 < data2.features.length; i5++) {
var feature = data2.features[i5];
var coordinates = void 0;
var bounds2 = new library.LngLatBounds();
extendBounds(bounds2, feature.geometry);
if (!bounds2.isEmpty()) {
var center = bounds2.getCenter();
coordinates = [center.lng, center.lat];
}
if (coordinates) {
geojson.features.push({
type: "Feature",
id: i5,
geometry: {
type: "Point",
coordinates
},
properties: feature.properties
});
}
}
return geojson;
}
function layerBeforeFill(map4) {
var layers = map4.getStyle().layers;
var beforeId;
for (var i5 = layers.length - 1; i5 >= 0; i5--) {
var layer = layers[i5];
if (!(layer.metadata && layer.metadata["mapbox:featureComponent"] === "place-labels")) {
break;
}
beforeId = layer.id;
}
return beforeId;
}
function addLayer(name, geojson) {
var centersById = {};
map3.addSource(name, {
type: "geojson",
data: geojson
});
if (mapType === "point") {
map3.addLayer({
id: name + "-text",
source: name,
type: "symbol",
layout: {
"text-field": "{label}",
"text-size": 11,
"text-anchor": "top",
"text-offset": [0, 1]
},
paint: {
"text-halo-color": "rgba(255, 255, 255, 1)",
"text-halo-width": 1
}
});
map3.addLayer({
id: name,
source: name,
type: "symbol",
layout: {
"icon-image": "{icon}-15",
"icon-allow-overlap": true,
"icon-size": { type: "identity", property: "mapkickIconSize" },
"icon-anchor": { type: "identity", property: "mapkickIconAnchor" },
"icon-offset": { type: "identity", property: "mapkickIconOffset" }
}
});
} else {
var beforeId = layerBeforeFill(map3);
var outlineId = name + "-outline";
map3.addLayer({
id: outlineId,
source: name,
type: "line",
paint: {
"line-color": { type: "identity", property: "mapkickColor" },
"line-opacity": 0.7,
"line-width": 1
}
}, beforeId);
map3.addLayer({
id: name,
source: name,
type: "fill",
paint: {
"fill-color": { type: "identity", property: "mapkickColor" },
"fill-opacity": 0.3
}
}, outlineId);
var labelName = name + "-text";
var labelData = generateLabelGeoJSON(geojson);
for (var i5 = 0; i5 < labelData.features.length; i5++) {
var feature = labelData.features[i5];
centersById[feature.id] = feature.geometry.coordinates;
}
map3.addSource(labelName, {
type: "geojson",
data: labelData
});
map3.addLayer({
id: name + "-text",
source: labelName,
type: "symbol",
layout: {
"text-field": "{label}",
"text-size": 11
},
paint: {
"text-halo-color": "rgba(255, 255, 255, 1)",
"text-halo-width": 1
}
});
}
var hover = !("hover" in tooltipOptions) || tooltipOptions.hover;
var popupOptions = {
closeButton: false,
closeOnClick: false
};
if (!hover) {
popupOptions.anchor = "bottom";
}
var popup = new library.Popup(popupOptions);
var panMap = function(map4, popup2) {
var style2 = window.getComputedStyle(popup2.getElement());
var matrix2 = new DOMMatrixReadOnly(style2.transform);
var padding = 5;
var extra = 5;
var top2 = matrix2.m42;
var left2 = matrix2.m41;
if (top2 < padding || left2 < padding) {
map4.panBy([Math.min(left2 - padding - extra, 0), Math.min(top2 - padding - extra, 0)]);
}
};
var showPopup = function(e5) {
var feature2 = selectedFeature(e5);
var tooltip = feature2.properties.tooltip;
if (!tooltip) {
return;
}
if (mapType === "point" && feature2.properties.icon.startsWith("mapkick-")) {
popup.options.offset = {
"top": [0, 14],
"top-left": [0, 14],
"top-right": [0, 14],
"bottom": [0, -44],
"bottom-left": [0, -44],
"bottom-right": [0, -44],
"left": [14, 0],
"right": [-14, 0]
};
} else {
popup.options.offset = 14;
}
var coordinates;
if (mapType === "point") {
coordinates = feature2.geometry.coordinates;
} else {
coordinates = centersById[feature2.id];
}
popup.setLngLat(coordinates);
if (tooltipOptions.html) {
popup.setHTML(tooltip);
} else {
popup.setText(tooltip);
}
popup.addTo(map3);
if (popup._container.offsetWidth % 2 !== 0) {
popup._container.style.width = popup._container.offsetWidth + 1 + "px";
}
if (mapType !== "area") {
panMap(map3, popup);
}
};
var getLatitude = function(feature2) {
return feature2.geometry.coordinates[1];
};
var selectedFeature = function(e5) {
var features = e5.features;
var selected = features[0];
for (var i6 = 1; i6 < features.length; i6++) {
var feature2 = features[i6];
if (getLatitude(feature2) < getLatitude(selected)) {
selected = feature2;
}
}
return selected;
};
if (!hover) {
var currentPoint = null;
map3.on("click", name, function(e5) {
var point = selectedFeature(e5).id;
if (point !== currentPoint) {
showPopup(e5);
currentPoint = point;
e5.mapkickPopupOpened = true;
}
});
map3.on("click", function(e5) {
if (!e5.mapkickPopupOpened) {
popup.remove();
currentPoint = null;
}
});
}
map3.on("mouseenter", name, function(e5) {
var tooltip = selectedFeature(e5).properties.tooltip;
if (tooltip) {
map3.getCanvas().style.cursor = "pointer";
if (hover) {
showPopup(e5);
}
}
});
map3.on("mouseleave", name, function() {
map3.getCanvas().style.cursor = "";
if (hover) {
popup.remove();
}
});
}
function extendBounds(bounds2, geometry) {
if (geometry.type === "Point") {
bounds2.extend(geometry.coordinates);
} else if (geometry.type === "Polygon") {
var coordinates = geometry.coordinates[0];
for (var j4 = 0; j4 < coordinates.length; j4++) {
bounds2.extend(coordinates[j4]);
}
} else if (geometry.type === "MultiPolygon") {
var coordinates$1 = geometry.coordinates;
for (var j$1 = 0; j$1 < coordinates$1.length; j$1++) {
var polygon = coordinates$1[j$1][0];
for (var k4 = 0; k4 < polygon.length; k4++) {
bounds2.extend(polygon[k4]);
}
}
}
}
var generateMap = function(element2, data2, options2) {
var geojson = generateGeoJSON(data2, options2);
options2 = options2 || {};
for (var i5 = 0; i5 < geojson.features.length; i5++) {
extendBounds(bounds, geojson.features[i5].geometry);
}
element2.textContent = "";
var style2 = options2.style;
if (!style2) {
var isMapLibre = !("accessToken" in library) || /^1\.1[45]/.test(library.version);
if (isMapLibre) {
throw new Error("style required for MapLibre");
} else {
style2 = "mapbox://styles/mapbox/streets-v12";
}
}
var zoom = options2.zoom;
var center = options2.center;
if (!center) {
if (!bounds.isEmpty()) {
center = bounds.getCenter();
} else {
center = [0, 0];
if (!zoom) {
zoom = 1;
}
}
}
if (!zoom) {
zoom = 15;
}
var mapOptions = {
container: element2,
style: style2,
dragRotate: false,
touchZoomRotate: false,
center,
zoom
};
if (!options2.style) {
mapOptions.projection = "mercator";
}
if (options2.accessToken) {
mapOptions.accessToken = options2.accessToken;
}
if (options2.library) {
Object.assign(mapOptions, options2.library);
}
map3 = new library.Map(mapOptions);
if (options2.controls) {
map3.addControl(new library.NavigationControl({ showCompass: false }));
}
if (!options2.zoom) {
if (!map3.style.stylesheet) {
map3.style.stylesheet = {};
}
if (!bounds.isEmpty() && map3.getZoom() === zoom) {
map3.fitBounds(bounds, { padding: 40, animate: false, maxZoom: 15 });
}
}
this$1$1.map = map3;
onMapLoad(function() {
if (options2.trail) {
recordTrails(data2);
map3.addSource("trails", {
type: "geojson",
data: generateTrailsGeoJSON([])
});
map3.addLayer({
id: "trails",
source: "trails",
type: "line",
layout: {
"line-join": "round",
"line-cap": "round"
},
paint: {
"line-color": "#888",
"line-width": 2
}
});
}
var outstanding = markerIds.size;
function checkReady() {
if (outstanding !== 0) {
outstanding--;
return;
}
addLayer("objects", geojson);
layersReady = true;
var cb;
while (cb = layersReadyQueue.shift()) {
cb();
}
}
markerIds.forEach(function(id, color2) {
var image = createMarkerImage(library, color2);
image.addEventListener("load", function() {
map3.addImage("mapkick-" + id + "-15", image);
checkReady();
});
});
checkReady();
});
};
var layersReady = false;
var layersReadyQueue = [];
function onLayersReady(callback2) {
if (layersReady) {
callback2();
} else {
layersReadyQueue.push(callback2);
}
}
options = options || {};
options = Object.assign({}, Mapkick.options, options);
var tooltipOptions = options.tooltips || {};
var markerOptions = options.markers || {};
var bounds = new library.LngLatBounds();
if (options.replay) {
fetchData(element, data, options, generateReplayMap);
} else {
fetchData(element, data, options, generateMap);
if (options.refresh) {
this.intervalId = setInterval(function() {
fetchData(element, data, options, updateMap);
}, options.refresh * 1e3);
}
}
};
BaseMap.prototype.getMapObject = function getMapObject() {
return this.map;
};
BaseMap.prototype.destroy = function destroy2() {
this.stopRefresh();
if (this.map) {
this.map.remove();
this.map = null;
}
};
BaseMap.prototype.stopRefresh = function stopRefresh() {
if (this.intervalId) {
clearInterval(this.intervalId);
this.intervalId = null;
}
};
var Map2 = /* @__PURE__ */ function(BaseMap2) {
function Map3(element, data, options) {
BaseMap2.call(this, element, data, options, "point");
}
if (BaseMap2)
Map3.__proto__ = BaseMap2;
Map3.prototype = Object.create(BaseMap2 && BaseMap2.prototype);
Map3.prototype.constructor = Map3;
return Map3;
}(BaseMap);
var AreaMap = /* @__PURE__ */ function(BaseMap2) {
function AreaMap2(element, data, options) {
BaseMap2.call(this, element, data, options, "area");
}
if (BaseMap2)
AreaMap2.__proto__ = BaseMap2;
AreaMap2.prototype = Object.create(BaseMap2 && BaseMap2.prototype);
AreaMap2.prototype.constructor = AreaMap2;
return AreaMap2;
}(BaseMap);
var Mapkick = {
Map: Map2,
AreaMap,
maps,
options: {},
library: null
};
Mapkick.use = function(library) {
Mapkick.library = library;
};
if (typeof window !== "undefined" && !window.Mapkick) {
window.Mapkick = Mapkick;
setTimeout(function() {
window.dispatchEvent(new Event("mapkick:load"));
}, 0);
}
Mapkick.use(mapboxgl);
return Mapkick;
});
}
});
// node_modules/regenerator-runtime/runtime.js
var require_runtime = __commonJS({
"node_modules/regenerator-runtime/runtime.js"(exports2, module2) {
var runtime = function(exports3) {
"use strict";
var Op = Object.prototype;
var hasOwn = Op.hasOwnProperty;
var defineProperty = Object.defineProperty || function(obj, key, desc) {
obj[key] = desc.value;
};
var undefined2;
var $Symbol = typeof Symbol === "function" ? Symbol : {};
var iteratorSymbol = $Symbol.iterator || "@@iterator";
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
function define2(obj, key, value) {
Object.defineProperty(obj, key, {
value,
enumerable: true,
configurable: true,
writable: true
});
return obj[key];
}
try {
define2({}, "");
} catch (err) {
define2 = function(obj, key, value) {
return obj[key] = value;
};
}
function wrap3(innerFn, outerFn, self2, tryLocsList) {
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
var generator = Object.create(protoGenerator.prototype);
var context = new Context2(tryLocsList || []);
defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self2, context) });
return generator;
}
exports3.wrap = wrap3;
function tryCatch(fn3, obj, arg) {
try {
return { type: "normal", arg: fn3.call(obj, arg) };
} catch (err) {
return { type: "throw", arg: err };
}
}
var GenStateSuspendedStart = "suspendedStart";
var GenStateSuspendedYield = "suspendedYield";
var GenStateExecuting = "executing";
var GenStateCompleted = "completed";
var ContinueSentinel = {};
function Generator() {
}
function GeneratorFunction() {
}
function GeneratorFunctionPrototype() {
}
var IteratorPrototype = {};
define2(IteratorPrototype, iteratorSymbol, function() {
return this;
});
var getProto = Object.getPrototypeOf;
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
if (NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
IteratorPrototype = NativeIteratorPrototype;
}
var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
GeneratorFunction.prototype = GeneratorFunctionPrototype;
defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: true });
defineProperty(
GeneratorFunctionPrototype,
"constructor",
{ value: GeneratorFunction, configurable: true }
);
GeneratorFunction.displayName = define2(
GeneratorFunctionPrototype,
toStringTagSymbol,
"GeneratorFunction"
);
function defineIteratorMethods(prototype) {
["next", "throw", "return"].forEach(function(method) {
define2(prototype, method, function(arg) {
return this._invoke(method, arg);
});
});
}
exports3.isGeneratorFunction = function(genFun) {
var ctor = typeof genFun === "function" && genFun.constructor;
return ctor ? ctor === GeneratorFunction || (ctor.displayName || ctor.name) === "GeneratorFunction" : false;
};
exports3.mark = function(genFun) {
if (Object.setPrototypeOf) {
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
} else {
genFun.__proto__ = GeneratorFunctionPrototype;
define2(genFun, toStringTagSymbol, "GeneratorFunction");
}
genFun.prototype = Object.create(Gp);
return genFun;
};
exports3.awrap = function(arg) {
return { __await: arg };
};
function AsyncIterator(generator, PromiseImpl) {
function invoke2(method, arg, resolve3, reject) {
var record = tryCatch(generator[method], generator, arg);
if (record.type === "throw") {
reject(record.arg);
} else {
var result = record.arg;
var value = result.value;
if (value && typeof value === "object" && hasOwn.call(value, "__await")) {
return PromiseImpl.resolve(value.__await).then(function(value2) {
invoke2("next", value2, resolve3, reject);
}, function(err) {
invoke2("throw", err, resolve3, reject);
});
}
return PromiseImpl.resolve(value).then(function(unwrapped) {
result.value = unwrapped;
resolve3(result);
}, function(error2) {
return invoke2("throw", error2, resolve3, reject);
});
}
}
var previousPromise;
function enqueue(method, arg) {
function callInvokeWithMethodAndArg() {
return new PromiseImpl(function(resolve3, reject) {
invoke2(method, arg, resolve3, reject);
});
}
return previousPromise = previousPromise ? previousPromise.then(
callInvokeWithMethodAndArg,
callInvokeWithMethodAndArg
) : callInvokeWithMethodAndArg();
}
defineProperty(this, "_invoke", { value: enqueue });
}
defineIteratorMethods(AsyncIterator.prototype);
define2(AsyncIterator.prototype, asyncIteratorSymbol, function() {
return this;
});
exports3.AsyncIterator = AsyncIterator;
exports3.async = function(innerFn, outerFn, self2, tryLocsList, PromiseImpl) {
if (PromiseImpl === void 0)
PromiseImpl = Promise;
var iter = new AsyncIterator(
wrap3(innerFn, outerFn, self2, tryLocsList),
PromiseImpl
);
return exports3.isGeneratorFunction(outerFn) ? iter : iter.next().then(function(result) {
return result.done ? result.value : iter.next();
});
};
function makeInvokeMethod(innerFn, self2, context) {
var state = GenStateSuspendedStart;
return function invoke2(method, arg) {
if (state === GenStateExecuting) {
throw new Error("Generator is already running");
}
if (state === GenStateCompleted) {
if (method === "throw") {
throw arg;
}
return doneResult();
}
context.method = method;
context.arg = arg;
while (true) {
var delegate = context.delegate;
if (delegate) {
var delegateResult = maybeInvokeDelegate(delegate, context);
if (delegateResult) {
if (delegateResult === ContinueSentinel)
continue;
return delegateResult;
}
}
if (context.method === "next") {
context.sent = context._sent = context.arg;
} else if (context.method === "throw") {
if (state === GenStateSuspendedStart) {
state = GenStateCompleted;
throw context.arg;
}
context.dispatchException(context.arg);
} else if (context.method === "return") {
context.abrupt("return", context.arg);
}
state = GenStateExecuting;
var record = tryCatch(innerFn, self2, context);
if (record.type === "normal") {
state = context.done ? GenStateCompleted : GenStateSuspendedYield;
if (record.arg === ContinueSentinel) {
continue;
}
return {
value: record.arg,
done: context.done
};
} else if (record.type === "throw") {
state = GenStateCompleted;
context.method = "throw";
context.arg = record.arg;
}
}
};
}
function maybeInvokeDelegate(delegate, context) {
var methodName = context.method;
var method = delegate.iterator[methodName];
if (method === undefined2) {
context.delegate = null;
if (methodName === "throw" && delegate.iterator["return"]) {
context.method = "return";
context.arg = undefined2;
maybeInvokeDelegate(delegate, context);
if (context.method === "throw") {
return ContinueSentinel;
}
}
if (methodName !== "return") {
context.method = "throw";
context.arg = new TypeError(
"The iterator does not provide a '" + methodName + "' method"
);
}
return ContinueSentinel;
}
var record = tryCatch(method, delegate.iterator, context.arg);
if (record.type === "throw") {
context.method = "throw";
context.arg = record.arg;
context.delegate = null;
return ContinueSentinel;
}
var info = record.arg;
if (!info) {
context.method = "throw";
context.arg = new TypeError("iterator result is not an object");
context.delegate = null;
return ContinueSentinel;
}
if (info.done) {
context[delegate.resultName] = info.value;
context.next = delegate.nextLoc;
if (context.method !== "return") {
context.method = "next";
context.arg = undefined2;
}
} else {
return info;
}
context.delegate = null;
return ContinueSentinel;
}
defineIteratorMethods(Gp);
define2(Gp, toStringTagSymbol, "Generator");
define2(Gp, iteratorSymbol, function() {
return this;
});
define2(Gp, "toString", function() {
return "[object Generator]";
});
function pushTryEntry(locs) {
var entry = { tryLoc: locs[0] };
if (1 in locs) {
entry.catchLoc = locs[1];
}
if (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 Context2(tryLocsList) {
this.tryEntries = [{ tryLoc: "root" }];
tryLocsList.forEach(pushTryEntry, this);
this.reset(true);
}
exports3.keys = function(val) {
var object = Object(val);
var keys2 = [];
for (var key in object) {
keys2.push(key);
}
keys2.reverse();
return function next() {
while (keys2.length) {
var key2 = keys2.pop();
if (key2 in object) {
next.value = key2;
next.done = false;
return next;
}
}
next.done = true;
return next;
};
};
function values(iterable) {
if (iterable) {
var iteratorMethod = iterable[iteratorSymbol];
if (iteratorMethod) {
return iteratorMethod.call(iterable);
}
if (typeof iterable.next === "function") {
return iterable;
}
if (!isNaN(iterable.length)) {
var i5 = -1, next = function next2() {
while (++i5 < iterable.length) {
if (hasOwn.call(iterable, i5)) {
next2.value = iterable[i5];
next2.done = false;
return next2;
}
}
next2.value = undefined2;
next2.done = true;
return next2;
};
return next.next = next;
}
}
return { next: doneResult };
}
exports3.values = values;
function doneResult() {
return { value: undefined2, done: true };
}
Context2.prototype = {
constructor: Context2,
reset: function(skipTempReset) {
this.prev = 0;
this.next = 0;
this.sent = this._sent = undefined2;
this.done = false;
this.delegate = null;
this.method = "next";
this.arg = undefined2;
this.tryEntries.forEach(resetTryEntry);
if (!skipTempReset) {
for (var name in this) {
if (name.charAt(0) === "t" && hasOwn.call(this, name) && !isNaN(+name.slice(1))) {
this[name] = undefined2;
}
}
}
},
stop: function() {
this.done = true;
var rootEntry = this.tryEntries[0];
var rootRecord = rootEntry.completion;
if (rootRecord.type === "throw") {
throw rootRecord.arg;
}
return this.rval;
},
dispatchException: function(exception) {
if (this.done) {
throw exception;
}
var context = this;
function handle(loc, caught) {
record.type = "throw";
record.arg = exception;
context.next = loc;
if (caught) {
context.method = "next";
context.arg = undefined2;
}
return !!caught;
}
for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
var entry = this.tryEntries[i5];
var record = entry.completion;
if (entry.tryLoc === "root") {
return handle("end");
}
if (entry.tryLoc <= this.prev) {
var hasCatch = hasOwn.call(entry, "catchLoc");
var hasFinally = hasOwn.call(entry, "finallyLoc");
if (hasCatch && hasFinally) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
} else if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else if (hasCatch) {
if (this.prev < entry.catchLoc) {
return handle(entry.catchLoc, true);
}
} else if (hasFinally) {
if (this.prev < entry.finallyLoc) {
return handle(entry.finallyLoc);
}
} else {
throw new Error("try statement without catch or finally");
}
}
}
},
abrupt: function(type, arg) {
for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
var entry = this.tryEntries[i5];
if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
var finallyEntry = entry;
break;
}
}
if (finallyEntry && (type === "break" || type === "continue") && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc) {
finallyEntry = null;
}
var record = finallyEntry ? finallyEntry.completion : {};
record.type = type;
record.arg = arg;
if (finallyEntry) {
this.method = "next";
this.next = finallyEntry.finallyLoc;
return ContinueSentinel;
}
return this.complete(record);
},
complete: function(record, afterLoc) {
if (record.type === "throw") {
throw record.arg;
}
if (record.type === "break" || record.type === "continue") {
this.next = record.arg;
} else if (record.type === "return") {
this.rval = this.arg = record.arg;
this.method = "return";
this.next = "end";
} else if (record.type === "normal" && afterLoc) {
this.next = afterLoc;
}
return ContinueSentinel;
},
finish: function(finallyLoc) {
for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
var entry = this.tryEntries[i5];
if (entry.finallyLoc === finallyLoc) {
this.complete(entry.completion, entry.afterLoc);
resetTryEntry(entry);
return ContinueSentinel;
}
}
},
"catch": function(tryLoc) {
for (var i5 = this.tryEntries.length - 1; i5 >= 0; --i5) {
var entry = this.tryEntries[i5];
if (entry.tryLoc === tryLoc) {
var record = entry.completion;
if (record.type === "throw") {
var thrown = record.arg;
resetTryEntry(entry);
}
return thrown;
}
}
throw new Error("illegal catch attempt");
},
delegateYield: function(iterable, resultName, nextLoc) {
this.delegate = {
iterator: values(iterable),
resultName,
nextLoc
};
if (this.method === "next") {
this.arg = undefined2;
}
return ContinueSentinel;
}
};
return exports3;
}(
typeof module2 === "object" ? module2.exports : {}
);
try {
regeneratorRuntime = runtime;
} catch (accidentalStrictMode) {
if (typeof globalThis === "object") {
globalThis.regeneratorRuntime = runtime;
} else {
Function("r", "regeneratorRuntime = r")(runtime);
}
}
}
});
// node_modules/@rails/activestorage/app/assets/javascripts/activestorage.js
var require_activestorage = __commonJS({
"node_modules/@rails/activestorage/app/assets/javascripts/activestorage.js"(exports2, module2) {
(function(global2, factory) {
typeof exports2 === "object" && typeof module2 !== "undefined" ? factory(exports2) : typeof define === "function" && define.amd ? define(["exports"], factory) : factory(global2.ActiveStorage = {});
})(exports2, function(exports3) {
"use strict";
function createCommonjsModule(fn3, module3) {
return module3 = {
exports: {}
}, fn3(module3, module3.exports), module3.exports;
}
var sparkMd5 = createCommonjsModule(function(module3, exports4) {
(function(factory) {
{
module3.exports = factory();
}
})(function(undefined2) {
var hex_chr = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"];
function md5cycle(x4, k4) {
var a5 = x4[0], b4 = x4[1], c4 = x4[2], d4 = x4[3];
a5 += (b4 & c4 | ~b4 & d4) + k4[0] - 680876936 | 0;
a5 = (a5 << 7 | a5 >>> 25) + b4 | 0;
d4 += (a5 & b4 | ~a5 & c4) + k4[1] - 389564586 | 0;
d4 = (d4 << 12 | d4 >>> 20) + a5 | 0;
c4 += (d4 & a5 | ~d4 & b4) + k4[2] + 606105819 | 0;
c4 = (c4 << 17 | c4 >>> 15) + d4 | 0;
b4 += (c4 & d4 | ~c4 & a5) + k4[3] - 1044525330 | 0;
b4 = (b4 << 22 | b4 >>> 10) + c4 | 0;
a5 += (b4 & c4 | ~b4 & d4) + k4[4] - 176418897 | 0;
a5 = (a5 << 7 | a5 >>> 25) + b4 | 0;
d4 += (a5 & b4 | ~a5 & c4) + k4[5] + 1200080426 | 0;
d4 = (d4 << 12 | d4 >>> 20) + a5 | 0;
c4 += (d4 & a5 | ~d4 & b4) + k4[6] - 1473231341 | 0;
c4 = (c4 << 17 | c4 >>> 15) + d4 | 0;
b4 += (c4 & d4 | ~c4 & a5) + k4[7] - 45705983 | 0;
b4 = (b4 << 22 | b4 >>> 10) + c4 | 0;
a5 += (b4 & c4 | ~b4 & d4) + k4[8] + 1770035416 | 0;
a5 = (a5 << 7 | a5 >>> 25) + b4 | 0;
d4 += (a5 & b4 | ~a5 & c4) + k4[9] - 1958414417 | 0;
d4 = (d4 << 12 | d4 >>> 20) + a5 | 0;
c4 += (d4 & a5 | ~d4 & b4) + k4[10] - 42063 | 0;
c4 = (c4 << 17 | c4 >>> 15) + d4 | 0;
b4 += (c4 & d4 | ~c4 & a5) + k4[11] - 1990404162 | 0;
b4 = (b4 << 22 | b4 >>> 10) + c4 | 0;
a5 += (b4 & c4 | ~b4 & d4) + k4[12] + 1804603682 | 0;
a5 = (a5 << 7 | a5 >>> 25) + b4 | 0;
d4 += (a5 & b4 | ~a5 & c4) + k4[13] - 40341101 | 0;
d4 = (d4 << 12 | d4 >>> 20) + a5 | 0;
c4 += (d4 & a5 | ~d4 & b4) + k4[14] - 1502002290 | 0;
c4 = (c4 << 17 | c4 >>> 15) + d4 | 0;
b4 += (c4 & d4 | ~c4 & a5) + k4[15] + 1236535329 | 0;
b4 = (b4 << 22 | b4 >>> 10) + c4 | 0;
a5 += (b4 & d4 | c4 & ~d4) + k4[1] - 165796510 | 0;
a5 = (a5 << 5 | a5 >>> 27) + b4 | 0;
d4 += (a5 & c4 | b4 & ~c4) + k4[6] - 1069501632 | 0;
d4 = (d4 << 9 | d4 >>> 23) + a5 | 0;
c4 += (d4 & b4 | a5 & ~b4) + k4[11] + 643717713 | 0;
c4 = (c4 << 14 | c4 >>> 18) + d4 | 0;
b4 += (c4 & a5 | d4 & ~a5) + k4[0] - 373897302 | 0;
b4 = (b4 << 20 | b4 >>> 12) + c4 | 0;
a5 += (b4 & d4 | c4 & ~d4) + k4[5] - 701558691 | 0;
a5 = (a5 << 5 | a5 >>> 27) + b4 | 0;
d4 += (a5 & c4 | b4 & ~c4) + k4[10] + 38016083 | 0;
d4 = (d4 << 9 | d4 >>> 23) + a5 | 0;
c4 += (d4 & b4 | a5 & ~b4) + k4[15] - 660478335 | 0;
c4 = (c4 << 14 | c4 >>> 18) + d4 | 0;
b4 += (c4 & a5 | d4 & ~a5) + k4[4] - 405537848 | 0;
b4 = (b4 << 20 | b4 >>> 12) + c4 | 0;
a5 += (b4 & d4 | c4 & ~d4) + k4[9] + 568446438 | 0;
a5 = (a5 << 5 | a5 >>> 27) + b4 | 0;
d4 += (a5 & c4 | b4 & ~c4) + k4[14] - 1019803690 | 0;
d4 = (d4 << 9 | d4 >>> 23) + a5 | 0;
c4 += (d4 & b4 | a5 & ~b4) + k4[3] - 187363961 | 0;
c4 = (c4 << 14 | c4 >>> 18) + d4 | 0;
b4 += (c4 & a5 | d4 & ~a5) + k4[8] + 1163531501 | 0;
b4 = (b4 << 20 | b4 >>> 12) + c4 | 0;
a5 += (b4 & d4 | c4 & ~d4) + k4[13] - 1444681467 | 0;
a5 = (a5 << 5 | a5 >>> 27) + b4 | 0;
d4 += (a5 & c4 | b4 & ~c4) + k4[2] - 51403784 | 0;
d4 = (d4 << 9 | d4 >>> 23) + a5 | 0;
c4 += (d4 & b4 | a5 & ~b4) + k4[7] + 1735328473 | 0;
c4 = (c4 << 14 | c4 >>> 18) + d4 | 0;
b4 += (c4 & a5 | d4 & ~a5) + k4[12] - 1926607734 | 0;
b4 = (b4 << 20 | b4 >>> 12) + c4 | 0;
a5 += (b4 ^ c4 ^ d4) + k4[5] - 378558 | 0;
a5 = (a5 << 4 | a5 >>> 28) + b4 | 0;
d4 += (a5 ^ b4 ^ c4) + k4[8] - 2022574463 | 0;
d4 = (d4 << 11 | d4 >>> 21) + a5 | 0;
c4 += (d4 ^ a5 ^ b4) + k4[11] + 1839030562 | 0;
c4 = (c4 << 16 | c4 >>> 16) + d4 | 0;
b4 += (c4 ^ d4 ^ a5) + k4[14] - 35309556 | 0;
b4 = (b4 << 23 | b4 >>> 9) + c4 | 0;
a5 += (b4 ^ c4 ^ d4) + k4[1] - 1530992060 | 0;
a5 = (a5 << 4 | a5 >>> 28) + b4 | 0;
d4 += (a5 ^ b4 ^ c4) + k4[4] + 1272893353 | 0;
d4 = (d4 << 11 | d4 >>> 21) + a5 | 0;
c4 += (d4 ^ a5 ^ b4) + k4[7] - 155497632 | 0;
c4 = (c4 << 16 | c4 >>> 16) + d4 | 0;
b4 += (c4 ^ d4 ^ a5) + k4[10] - 1094730640 | 0;
b4 = (b4 << 23 | b4 >>> 9) + c4 | 0;
a5 += (b4 ^ c4 ^ d4) + k4[13] + 681279174 | 0;
a5 = (a5 << 4 | a5 >>> 28) + b4 | 0;
d4 += (a5 ^ b4 ^ c4) + k4[0] - 358537222 | 0;
d4 = (d4 << 11 | d4 >>> 21) + a5 | 0;
c4 += (d4 ^ a5 ^ b4) + k4[3] - 722521979 | 0;
c4 = (c4 << 16 | c4 >>> 16) + d4 | 0;
b4 += (c4 ^ d4 ^ a5) + k4[6] + 76029189 | 0;
b4 = (b4 << 23 | b4 >>> 9) + c4 | 0;
a5 += (b4 ^ c4 ^ d4) + k4[9] - 640364487 | 0;
a5 = (a5 << 4 | a5 >>> 28) + b4 | 0;
d4 += (a5 ^ b4 ^ c4) + k4[12] - 421815835 | 0;
d4 = (d4 << 11 | d4 >>> 21) + a5 | 0;
c4 += (d4 ^ a5 ^ b4) + k4[15] + 530742520 | 0;
c4 = (c4 << 16 | c4 >>> 16) + d4 | 0;
b4 += (c4 ^ d4 ^ a5) + k4[2] - 995338651 | 0;
b4 = (b4 << 23 | b4 >>> 9) + c4 | 0;
a5 += (c4 ^ (b4 | ~d4)) + k4[0] - 198630844 | 0;
a5 = (a5 << 6 | a5 >>> 26) + b4 | 0;
d4 += (b4 ^ (a5 | ~c4)) + k4[7] + 1126891415 | 0;
d4 = (d4 << 10 | d4 >>> 22) + a5 | 0;
c4 += (a5 ^ (d4 | ~b4)) + k4[14] - 1416354905 | 0;
c4 = (c4 << 15 | c4 >>> 17) + d4 | 0;
b4 += (d4 ^ (c4 | ~a5)) + k4[5] - 57434055 | 0;
b4 = (b4 << 21 | b4 >>> 11) + c4 | 0;
a5 += (c4 ^ (b4 | ~d4)) + k4[12] + 1700485571 | 0;
a5 = (a5 << 6 | a5 >>> 26) + b4 | 0;
d4 += (b4 ^ (a5 | ~c4)) + k4[3] - 1894986606 | 0;
d4 = (d4 << 10 | d4 >>> 22) + a5 | 0;
c4 += (a5 ^ (d4 | ~b4)) + k4[10] - 1051523 | 0;
c4 = (c4 << 15 | c4 >>> 17) + d4 | 0;
b4 += (d4 ^ (c4 | ~a5)) + k4[1] - 2054922799 | 0;
b4 = (b4 << 21 | b4 >>> 11) + c4 | 0;
a5 += (c4 ^ (b4 | ~d4)) + k4[8] + 1873313359 | 0;
a5 = (a5 << 6 | a5 >>> 26) + b4 | 0;
d4 += (b4 ^ (a5 | ~c4)) + k4[15] - 30611744 | 0;
d4 = (d4 << 10 | d4 >>> 22) + a5 | 0;
c4 += (a5 ^ (d4 | ~b4)) + k4[6] - 1560198380 | 0;
c4 = (c4 << 15 | c4 >>> 17) + d4 | 0;
b4 += (d4 ^ (c4 | ~a5)) + k4[13] + 1309151649 | 0;
b4 = (b4 << 21 | b4 >>> 11) + c4 | 0;
a5 += (c4 ^ (b4 | ~d4)) + k4[4] - 145523070 | 0;
a5 = (a5 << 6 | a5 >>> 26) + b4 | 0;
d4 += (b4 ^ (a5 | ~c4)) + k4[11] - 1120210379 | 0;
d4 = (d4 << 10 | d4 >>> 22) + a5 | 0;
c4 += (a5 ^ (d4 | ~b4)) + k4[2] + 718787259 | 0;
c4 = (c4 << 15 | c4 >>> 17) + d4 | 0;
b4 += (d4 ^ (c4 | ~a5)) + k4[9] - 343485551 | 0;
b4 = (b4 << 21 | b4 >>> 11) + c4 | 0;
x4[0] = a5 + x4[0] | 0;
x4[1] = b4 + x4[1] | 0;
x4[2] = c4 + x4[2] | 0;
x4[3] = d4 + x4[3] | 0;
}
function md5blk(s6) {
var md5blks = [], i5;
for (i5 = 0; i5 < 64; i5 += 4) {
md5blks[i5 >> 2] = s6.charCodeAt(i5) + (s6.charCodeAt(i5 + 1) << 8) + (s6.charCodeAt(i5 + 2) << 16) + (s6.charCodeAt(i5 + 3) << 24);
}
return md5blks;
}
function md5blk_array(a5) {
var md5blks = [], i5;
for (i5 = 0; i5 < 64; i5 += 4) {
md5blks[i5 >> 2] = a5[i5] + (a5[i5 + 1] << 8) + (a5[i5 + 2] << 16) + (a5[i5 + 3] << 24);
}
return md5blks;
}
function md51(s6) {
var n7 = s6.length, state = [1732584193, -271733879, -1732584194, 271733878], i5, length, tail, tmp, lo, hi2;
for (i5 = 64; i5 <= n7; i5 += 64) {
md5cycle(state, md5blk(s6.substring(i5 - 64, i5)));
}
s6 = s6.substring(i5 - 64);
length = s6.length;
tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
for (i5 = 0; i5 < length; i5 += 1) {
tail[i5 >> 2] |= s6.charCodeAt(i5) << (i5 % 4 << 3);
}
tail[i5 >> 2] |= 128 << (i5 % 4 << 3);
if (i5 > 55) {
md5cycle(state, tail);
for (i5 = 0; i5 < 16; i5 += 1) {
tail[i5] = 0;
}
}
tmp = n7 * 8;
tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
lo = parseInt(tmp[2], 16);
hi2 = parseInt(tmp[1], 16) || 0;
tail[14] = lo;
tail[15] = hi2;
md5cycle(state, tail);
return state;
}
function md51_array(a5) {
var n7 = a5.length, state = [1732584193, -271733879, -1732584194, 271733878], i5, length, tail, tmp, lo, hi2;
for (i5 = 64; i5 <= n7; i5 += 64) {
md5cycle(state, md5blk_array(a5.subarray(i5 - 64, i5)));
}
a5 = i5 - 64 < n7 ? a5.subarray(i5 - 64) : new Uint8Array(0);
length = a5.length;
tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
for (i5 = 0; i5 < length; i5 += 1) {
tail[i5 >> 2] |= a5[i5] << (i5 % 4 << 3);
}
tail[i5 >> 2] |= 128 << (i5 % 4 << 3);
if (i5 > 55) {
md5cycle(state, tail);
for (i5 = 0; i5 < 16; i5 += 1) {
tail[i5] = 0;
}
}
tmp = n7 * 8;
tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
lo = parseInt(tmp[2], 16);
hi2 = parseInt(tmp[1], 16) || 0;
tail[14] = lo;
tail[15] = hi2;
md5cycle(state, tail);
return state;
}
function rhex(n7) {
var s6 = "", j4;
for (j4 = 0; j4 < 4; j4 += 1) {
s6 += hex_chr[n7 >> j4 * 8 + 4 & 15] + hex_chr[n7 >> j4 * 8 & 15];
}
return s6;
}
function hex2(x4) {
var i5;
for (i5 = 0; i5 < x4.length; i5 += 1) {
x4[i5] = rhex(x4[i5]);
}
return x4.join("");
}
if (hex2(md51("hello")) !== "5d41402abc4b2a76b9719d911017c592")
;
if (typeof ArrayBuffer !== "undefined" && !ArrayBuffer.prototype.slice) {
(function() {
function clamp(val, length) {
val = val | 0 || 0;
if (val < 0) {
return Math.max(val + length, 0);
}
return Math.min(val, length);
}
ArrayBuffer.prototype.slice = function(from, to) {
var length = this.byteLength, begin = clamp(from, length), end2 = length, num, target, targetArray, sourceArray;
if (to !== undefined2) {
end2 = clamp(to, length);
}
if (begin > end2) {
return new ArrayBuffer(0);
}
num = end2 - begin;
target = new ArrayBuffer(num);
targetArray = new Uint8Array(target);
sourceArray = new Uint8Array(this, begin, num);
targetArray.set(sourceArray);
return target;
};
})();
}
function toUtf8(str) {
if (/[\u0080-\uFFFF]/.test(str)) {
str = unescape(encodeURIComponent(str));
}
return str;
}
function utf8Str2ArrayBuffer(str, returnUInt8Array) {
var length = str.length, buff = new ArrayBuffer(length), arr = new Uint8Array(buff), i5;
for (i5 = 0; i5 < length; i5 += 1) {
arr[i5] = str.charCodeAt(i5);
}
return returnUInt8Array ? arr : buff;
}
function arrayBuffer2Utf8Str(buff) {
return String.fromCharCode.apply(null, new Uint8Array(buff));
}
function concatenateArrayBuffers(first3, second, returnUInt8Array) {
var result = new Uint8Array(first3.byteLength + second.byteLength);
result.set(new Uint8Array(first3));
result.set(new Uint8Array(second), first3.byteLength);
return returnUInt8Array ? result : result.buffer;
}
function hexToBinaryString(hex3) {
var bytes = [], length = hex3.length, x4;
for (x4 = 0; x4 < length - 1; x4 += 2) {
bytes.push(parseInt(hex3.substr(x4, 2), 16));
}
return String.fromCharCode.apply(String, bytes);
}
function SparkMD5() {
this.reset();
}
SparkMD5.prototype.append = function(str) {
this.appendBinary(toUtf8(str));
return this;
};
SparkMD5.prototype.appendBinary = function(contents) {
this._buff += contents;
this._length += contents.length;
var length = this._buff.length, i5;
for (i5 = 64; i5 <= length; i5 += 64) {
md5cycle(this._hash, md5blk(this._buff.substring(i5 - 64, i5)));
}
this._buff = this._buff.substring(i5 - 64);
return this;
};
SparkMD5.prototype.end = function(raw) {
var buff = this._buff, length = buff.length, i5, tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ret;
for (i5 = 0; i5 < length; i5 += 1) {
tail[i5 >> 2] |= buff.charCodeAt(i5) << (i5 % 4 << 3);
}
this._finish(tail, length);
ret = hex2(this._hash);
if (raw) {
ret = hexToBinaryString(ret);
}
this.reset();
return ret;
};
SparkMD5.prototype.reset = function() {
this._buff = "";
this._length = 0;
this._hash = [1732584193, -271733879, -1732584194, 271733878];
return this;
};
SparkMD5.prototype.getState = function() {
return {
buff: this._buff,
length: this._length,
hash: this._hash
};
};
SparkMD5.prototype.setState = function(state) {
this._buff = state.buff;
this._length = state.length;
this._hash = state.hash;
return this;
};
SparkMD5.prototype.destroy = function() {
delete this._hash;
delete this._buff;
delete this._length;
};
SparkMD5.prototype._finish = function(tail, length) {
var i5 = length, tmp, lo, hi2;
tail[i5 >> 2] |= 128 << (i5 % 4 << 3);
if (i5 > 55) {
md5cycle(this._hash, tail);
for (i5 = 0; i5 < 16; i5 += 1) {
tail[i5] = 0;
}
}
tmp = this._length * 8;
tmp = tmp.toString(16).match(/(.*?)(.{0,8})$/);
lo = parseInt(tmp[2], 16);
hi2 = parseInt(tmp[1], 16) || 0;
tail[14] = lo;
tail[15] = hi2;
md5cycle(this._hash, tail);
};
SparkMD5.hash = function(str, raw) {
return SparkMD5.hashBinary(toUtf8(str), raw);
};
SparkMD5.hashBinary = function(content, raw) {
var hash3 = md51(content), ret = hex2(hash3);
return raw ? hexToBinaryString(ret) : ret;
};
SparkMD5.ArrayBuffer = function() {
this.reset();
};
SparkMD5.ArrayBuffer.prototype.append = function(arr) {
var buff = concatenateArrayBuffers(this._buff.buffer, arr, true), length = buff.length, i5;
this._length += arr.byteLength;
for (i5 = 64; i5 <= length; i5 += 64) {
md5cycle(this._hash, md5blk_array(buff.subarray(i5 - 64, i5)));
}
this._buff = i5 - 64 < length ? new Uint8Array(buff.buffer.slice(i5 - 64)) : new Uint8Array(0);
return this;
};
SparkMD5.ArrayBuffer.prototype.end = function(raw) {
var buff = this._buff, length = buff.length, tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], i5, ret;
for (i5 = 0; i5 < length; i5 += 1) {
tail[i5 >> 2] |= buff[i5] << (i5 % 4 << 3);
}
this._finish(tail, length);
ret = hex2(this._hash);
if (raw) {
ret = hexToBinaryString(ret);
}
this.reset();
return ret;
};
SparkMD5.ArrayBuffer.prototype.reset = function() {
this._buff = new Uint8Array(0);
this._length = 0;
this._hash = [1732584193, -271733879, -1732584194, 271733878];
return this;
};
SparkMD5.ArrayBuffer.prototype.getState = function() {
var state = SparkMD5.prototype.getState.call(this);
state.buff = arrayBuffer2Utf8Str(state.buff);
return state;
};
SparkMD5.ArrayBuffer.prototype.setState = function(state) {
state.buff = utf8Str2ArrayBuffer(state.buff, true);
return SparkMD5.prototype.setState.call(this, state);
};
SparkMD5.ArrayBuffer.prototype.destroy = SparkMD5.prototype.destroy;
SparkMD5.ArrayBuffer.prototype._finish = SparkMD5.prototype._finish;
SparkMD5.ArrayBuffer.hash = function(arr, raw) {
var hash3 = md51_array(new Uint8Array(arr)), ret = hex2(hash3);
return raw ? hexToBinaryString(ret) : ret;
};
return SparkMD5;
});
});
var classCallCheck = function(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
};
var createClass = function() {
function defineProperties(target, props) {
for (var i5 = 0; i5 < props.length; i5++) {
var descriptor = props[i5];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor)
descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
return function(Constructor, protoProps, staticProps) {
if (protoProps)
defineProperties(Constructor.prototype, protoProps);
if (staticProps)
defineProperties(Constructor, staticProps);
return Constructor;
};
}();
var fileSlice = File.prototype.slice || File.prototype.mozSlice || File.prototype.webkitSlice;
var FileChecksum = function() {
createClass(FileChecksum2, null, [{
key: "create",
value: function create(file, callback2) {
var instance = new FileChecksum2(file);
instance.create(callback2);
}
}]);
function FileChecksum2(file) {
classCallCheck(this, FileChecksum2);
this.file = file;
this.chunkSize = 2097152;
this.chunkCount = Math.ceil(this.file.size / this.chunkSize);
this.chunkIndex = 0;
}
createClass(FileChecksum2, [{
key: "create",
value: function create(callback2) {
var _this = this;
this.callback = callback2;
this.md5Buffer = new sparkMd5.ArrayBuffer();
this.fileReader = new FileReader();
this.fileReader.addEventListener("load", function(event2) {
return _this.fileReaderDidLoad(event2);
});
this.fileReader.addEventListener("error", function(event2) {
return _this.fileReaderDidError(event2);
});
this.readNextChunk();
}
}, {
key: "fileReaderDidLoad",
value: function fileReaderDidLoad(event2) {
this.md5Buffer.append(event2.target.result);
if (!this.readNextChunk()) {
var binaryDigest = this.md5Buffer.end(true);
var base64digest = btoa(binaryDigest);
this.callback(null, base64digest);
}
}
}, {
key: "fileReaderDidError",
value: function fileReaderDidError(event2) {
this.callback("Error reading " + this.file.name);
}
}, {
key: "readNextChunk",
value: function readNextChunk() {
if (this.chunkIndex < this.chunkCount || this.chunkIndex == 0 && this.chunkCount == 0) {
var start4 = this.chunkIndex * this.chunkSize;
var end2 = Math.min(start4 + this.chunkSize, this.file.size);
var bytes = fileSlice.call(this.file, start4, end2);
this.fileReader.readAsArrayBuffer(bytes);
this.chunkIndex++;
return true;
} else {
return false;
}
}
}]);
return FileChecksum2;
}();
function getMetaValue(name) {
var element = findElement(document.head, 'meta[name="' + name + '"]');
if (element) {
return element.getAttribute("content");
}
}
function findElements(root, selector) {
if (typeof root == "string") {
selector = root;
root = document;
}
var elements2 = root.querySelectorAll(selector);
return toArray$1(elements2);
}
function findElement(root, selector) {
if (typeof root == "string") {
selector = root;
root = document;
}
return root.querySelector(selector);
}
function dispatchEvent4(element, type) {
var eventInit = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
var disabled = element.disabled;
var bubbles = eventInit.bubbles, cancelable2 = eventInit.cancelable, detail = eventInit.detail;
var event2 = document.createEvent("Event");
event2.initEvent(type, bubbles || true, cancelable2 || true);
event2.detail = detail || {};
try {
element.disabled = false;
element.dispatchEvent(event2);
} finally {
element.disabled = disabled;
}
return event2;
}
function toArray$1(value) {
if (Array.isArray(value)) {
return value;
} else if (Array.from) {
return Array.from(value);
} else {
return [].slice.call(value);
}
}
var BlobRecord = function() {
function BlobRecord2(file, checksum, url) {
var _this = this;
classCallCheck(this, BlobRecord2);
this.file = file;
this.attributes = {
filename: file.name,
content_type: file.type || "application/octet-stream",
byte_size: file.size,
checksum
};
this.xhr = new XMLHttpRequest();
this.xhr.open("POST", url, true);
this.xhr.responseType = "json";
this.xhr.setRequestHeader("Content-Type", "application/json");
this.xhr.setRequestHeader("Accept", "application/json");
this.xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
var csrfToken = getMetaValue("csrf-token");
if (csrfToken != void 0) {
this.xhr.setRequestHeader("X-CSRF-Token", csrfToken);
}
this.xhr.addEventListener("load", function(event2) {
return _this.requestDidLoad(event2);
});
this.xhr.addEventListener("error", function(event2) {
return _this.requestDidError(event2);
});
}
createClass(BlobRecord2, [{
key: "create",
value: function create(callback2) {
this.callback = callback2;
this.xhr.send(JSON.stringify({
blob: this.attributes
}));
}
}, {
key: "requestDidLoad",
value: function requestDidLoad(event2) {
if (this.status >= 200 && this.status < 300) {
var response = this.response;
var direct_upload = response.direct_upload;
delete response.direct_upload;
this.attributes = response;
this.directUploadData = direct_upload;
this.callback(null, this.toJSON());
} else {
this.requestDidError(event2);
}
}
}, {
key: "requestDidError",
value: function requestDidError(event2) {
this.callback('Error creating Blob for "' + this.file.name + '". Status: ' + this.status);
}
}, {
key: "toJSON",
value: function toJSON() {
var result = {};
for (var key in this.attributes) {
result[key] = this.attributes[key];
}
return result;
}
}, {
key: "status",
get: function get$$1() {
return this.xhr.status;
}
}, {
key: "response",
get: function get$$1() {
var _xhr = this.xhr, responseType = _xhr.responseType, response = _xhr.response;
if (responseType == "json") {
return response;
} else {
return JSON.parse(response);
}
}
}]);
return BlobRecord2;
}();
var BlobUpload = function() {
function BlobUpload2(blob) {
var _this = this;
classCallCheck(this, BlobUpload2);
this.blob = blob;
this.file = blob.file;
var _blob$directUploadDat = blob.directUploadData, url = _blob$directUploadDat.url, headers = _blob$directUploadDat.headers;
this.xhr = new XMLHttpRequest();
this.xhr.open("PUT", url, true);
this.xhr.responseType = "text";
for (var key in headers) {
this.xhr.setRequestHeader(key, headers[key]);
}
this.xhr.addEventListener("load", function(event2) {
return _this.requestDidLoad(event2);
});
this.xhr.addEventListener("error", function(event2) {
return _this.requestDidError(event2);
});
}
createClass(BlobUpload2, [{
key: "create",
value: function create(callback2) {
this.callback = callback2;
this.xhr.send(this.file.slice());
}
}, {
key: "requestDidLoad",
value: function requestDidLoad(event2) {
var _xhr = this.xhr, status = _xhr.status, response = _xhr.response;
if (status >= 200 && status < 300) {
this.callback(null, response);
} else {
this.requestDidError(event2);
}
}
}, {
key: "requestDidError",
value: function requestDidError(event2) {
this.callback('Error storing "' + this.file.name + '". Status: ' + this.xhr.status);
}
}]);
return BlobUpload2;
}();
var id = 0;
var DirectUpload = function() {
function DirectUpload2(file, url, delegate) {
classCallCheck(this, DirectUpload2);
this.id = ++id;
this.file = file;
this.url = url;
this.delegate = delegate;
}
createClass(DirectUpload2, [{
key: "create",
value: function create(callback2) {
var _this = this;
FileChecksum.create(this.file, function(error2, checksum) {
if (error2) {
callback2(error2);
return;
}
var blob = new BlobRecord(_this.file, checksum, _this.url);
notify(_this.delegate, "directUploadWillCreateBlobWithXHR", blob.xhr);
blob.create(function(error3) {
if (error3) {
callback2(error3);
} else {
var upload = new BlobUpload(blob);
notify(_this.delegate, "directUploadWillStoreFileWithXHR", upload.xhr);
upload.create(function(error4) {
if (error4) {
callback2(error4);
} else {
callback2(null, blob.toJSON());
}
});
}
});
});
}
}]);
return DirectUpload2;
}();
function notify(object, methodName) {
if (object && typeof object[methodName] == "function") {
for (var _len = arguments.length, messages = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
messages[_key - 2] = arguments[_key];
}
return object[methodName].apply(object, messages);
}
}
var DirectUploadController = function() {
function DirectUploadController2(input, file) {
classCallCheck(this, DirectUploadController2);
this.input = input;
this.file = file;
this.directUpload = new DirectUpload(this.file, this.url, this);
this.dispatch("initialize");
}
createClass(DirectUploadController2, [{
key: "start",
value: function start4(callback2) {
var _this = this;
var hiddenInput = document.createElement("input");
hiddenInput.type = "hidden";
hiddenInput.name = this.input.name;
this.input.insertAdjacentElement("beforebegin", hiddenInput);
this.dispatch("start");
this.directUpload.create(function(error2, attributes) {
if (error2) {
hiddenInput.parentNode.removeChild(hiddenInput);
_this.dispatchError(error2);
} else {
hiddenInput.value = attributes.signed_id;
}
_this.dispatch("end");
callback2(error2);
});
}
}, {
key: "uploadRequestDidProgress",
value: function uploadRequestDidProgress(event2) {
var progress = event2.loaded / event2.total * 100;
if (progress) {
this.dispatch("progress", {
progress
});
}
}
}, {
key: "dispatch",
value: function dispatch3(name) {
var detail = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
detail.file = this.file;
detail.id = this.directUpload.id;
return dispatchEvent4(this.input, "direct-upload:" + name, {
detail
});
}
}, {
key: "dispatchError",
value: function dispatchError(error2) {
var event2 = this.dispatch("error", {
error: error2
});
if (!event2.defaultPrevented) {
alert(error2);
}
}
}, {
key: "directUploadWillCreateBlobWithXHR",
value: function directUploadWillCreateBlobWithXHR(xhr) {
this.dispatch("before-blob-request", {
xhr
});
}
}, {
key: "directUploadWillStoreFileWithXHR",
value: function directUploadWillStoreFileWithXHR(xhr) {
var _this2 = this;
this.dispatch("before-storage-request", {
xhr
});
xhr.upload.addEventListener("progress", function(event2) {
return _this2.uploadRequestDidProgress(event2);
});
}
}, {
key: "url",
get: function get$$1() {
return this.input.getAttribute("data-direct-upload-url");
}
}]);
return DirectUploadController2;
}();
var inputSelector = "input[type=file][data-direct-upload-url]:not([disabled])";
var DirectUploadsController = function() {
function DirectUploadsController2(form) {
classCallCheck(this, DirectUploadsController2);
this.form = form;
this.inputs = findElements(form, inputSelector).filter(function(input) {
return input.files.length;
});
}
createClass(DirectUploadsController2, [{
key: "start",
value: function start4(callback2) {
var _this = this;
var controllers2 = this.createDirectUploadControllers();
var startNextController = function startNextController2() {
var controller = controllers2.shift();
if (controller) {
controller.start(function(error2) {
if (error2) {
callback2(error2);
_this.dispatch("end");
} else {
startNextController2();
}
});
} else {
callback2();
_this.dispatch("end");
}
};
this.dispatch("start");
startNextController();
}
}, {
key: "createDirectUploadControllers",
value: function createDirectUploadControllers() {
var controllers2 = [];
this.inputs.forEach(function(input) {
toArray$1(input.files).forEach(function(file) {
var controller = new DirectUploadController(input, file);
controllers2.push(controller);
});
});
return controllers2;
}
}, {
key: "dispatch",
value: function dispatch3(name) {
var detail = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
return dispatchEvent4(this.form, "direct-uploads:" + name, {
detail
});
}
}]);
return DirectUploadsController2;
}();
var processingAttribute = "data-direct-uploads-processing";
var submitButtonsByForm = /* @__PURE__ */ new WeakMap();
var started = false;
function start3() {
if (!started) {
started = true;
document.addEventListener("click", didClick, true);
document.addEventListener("submit", didSubmitForm);
document.addEventListener("ajax:before", didSubmitRemoteElement);
}
}
function didClick(event2) {
var target = event2.target;
if ((target.tagName == "INPUT" || target.tagName == "BUTTON") && target.type == "submit" && target.form) {
submitButtonsByForm.set(target.form, target);
}
}
function didSubmitForm(event2) {
handleFormSubmissionEvent(event2);
}
function didSubmitRemoteElement(event2) {
if (event2.target.tagName == "FORM") {
handleFormSubmissionEvent(event2);
}
}
function handleFormSubmissionEvent(event2) {
var form = event2.target;
if (form.hasAttribute(processingAttribute)) {
event2.preventDefault();
return;
}
var controller = new DirectUploadsController(form);
var inputs = controller.inputs;
if (inputs.length) {
event2.preventDefault();
form.setAttribute(processingAttribute, "");
inputs.forEach(disable);
controller.start(function(error2) {
form.removeAttribute(processingAttribute);
if (error2) {
inputs.forEach(enable);
} else {
submitForm(form);
}
});
}
}
function submitForm(form) {
var button = submitButtonsByForm.get(form) || findElement(form, "input[type=submit], button[type=submit]");
if (button) {
var _button = button, disabled = _button.disabled;
button.disabled = false;
button.focus();
button.click();
button.disabled = disabled;
} else {
button = document.createElement("input");
button.type = "submit";
button.style.display = "none";
form.appendChild(button);
button.click();
form.removeChild(button);
}
submitButtonsByForm.delete(form);
}
function disable(input) {
input.disabled = true;
}
function enable(input) {
input.disabled = false;
}
function autostart() {
if (window.ActiveStorage) {
start3();
}
}
setTimeout(autostart, 1);
exports3.start = start3;
exports3.DirectUpload = DirectUpload;
Object.defineProperty(exports3, "__esModule", {
value: true
});
});
}
});
// node_modules/mousetrap/mousetrap.js
var require_mousetrap = __commonJS({
"node_modules/mousetrap/mousetrap.js"(exports2, module2) {
(function(window2, document2, undefined2) {
if (!window2) {
return;
}
var _MAP = {
8: "backspace",
9: "tab",
13: "enter",
16: "shift",
17: "ctrl",
18: "alt",
20: "capslock",
27: "esc",
32: "space",
33: "pageup",
34: "pagedown",
35: "end",
36: "home",
37: "left",
38: "up",
39: "right",
40: "down",
45: "ins",
46: "del",
91: "meta",
93: "meta",
224: "meta"
};
var _KEYCODE_MAP = {
106: "*",
107: "+",
109: "-",
110: ".",
111: "/",
186: ";",
187: "=",
188: ",",
189: "-",
190: ".",
191: "/",
192: "`",
219: "[",
220: "\\",
221: "]",
222: "'"
};
var _SHIFT_MAP = {
"~": "`",
"!": "1",
"@": "2",
"#": "3",
"$": "4",
"%": "5",
"^": "6",
"&": "7",
"*": "8",
"(": "9",
")": "0",
"_": "-",
"+": "=",
":": ";",
'"': "'",
"<": ",",
">": ".",
"?": "/",
"|": "\\"
};
var _SPECIAL_ALIASES = {
"option": "alt",
"command": "meta",
"return": "enter",
"escape": "esc",
"plus": "+",
"mod": /Mac|iPod|iPhone|iPad/.test(navigator.platform) ? "meta" : "ctrl"
};
var _REVERSE_MAP;
for (var i5 = 1; i5 < 20; ++i5) {
_MAP[111 + i5] = "f" + i5;
}
for (i5 = 0; i5 <= 9; ++i5) {
_MAP[i5 + 96] = i5.toString();
}
function _addEvent(object, type, callback2) {
if (object.addEventListener) {
object.addEventListener(type, callback2, false);
return;
}
object.attachEvent("on" + type, callback2);
}
function _characterFromEvent(e5) {
if (e5.type == "keypress") {
var character = String.fromCharCode(e5.which);
if (!e5.shiftKey) {
character = character.toLowerCase();
}
return character;
}
if (_MAP[e5.which]) {
return _MAP[e5.which];
}
if (_KEYCODE_MAP[e5.which]) {
return _KEYCODE_MAP[e5.which];
}
return String.fromCharCode(e5.which).toLowerCase();
}
function _modifiersMatch(modifiers1, modifiers2) {
return modifiers1.sort().join(",") === modifiers2.sort().join(",");
}
function _eventModifiers(e5) {
var modifiers2 = [];
if (e5.shiftKey) {
modifiers2.push("shift");
}
if (e5.altKey) {
modifiers2.push("alt");
}
if (e5.ctrlKey) {
modifiers2.push("ctrl");
}
if (e5.metaKey) {
modifiers2.push("meta");
}
return modifiers2;
}
function _preventDefault(e5) {
if (e5.preventDefault) {
e5.preventDefault();
return;
}
e5.returnValue = false;
}
function _stopPropagation(e5) {
if (e5.stopPropagation) {
e5.stopPropagation();
return;
}
e5.cancelBubble = true;
}
function _isModifier(key) {
return key == "shift" || key == "ctrl" || key == "alt" || key == "meta";
}
function _getReverseMap() {
if (!_REVERSE_MAP) {
_REVERSE_MAP = {};
for (var key in _MAP) {
if (key > 95 && key < 112) {
continue;
}
if (_MAP.hasOwnProperty(key)) {
_REVERSE_MAP[_MAP[key]] = key;
}
}
}
return _REVERSE_MAP;
}
function _pickBestAction(key, modifiers2, action) {
if (!action) {
action = _getReverseMap()[key] ? "keydown" : "keypress";
}
if (action == "keypress" && modifiers2.length) {
action = "keydown";
}
return action;
}
function _keysFromString(combination) {
if (combination === "+") {
return ["+"];
}
combination = combination.replace(/\+{2}/g, "+plus");
return combination.split("+");
}
function _getKeyInfo(combination, action) {
var keys2;
var key;
var i6;
var modifiers2 = [];
keys2 = _keysFromString(combination);
for (i6 = 0; i6 < keys2.length; ++i6) {
key = keys2[i6];
if (_SPECIAL_ALIASES[key]) {
key = _SPECIAL_ALIASES[key];
}
if (action && action != "keypress" && _SHIFT_MAP[key]) {
key = _SHIFT_MAP[key];
modifiers2.push("shift");
}
if (_isModifier(key)) {
modifiers2.push(key);
}
}
action = _pickBestAction(key, modifiers2, action);
return {
key,
modifiers: modifiers2,
action
};
}
function _belongsTo(element, ancestor) {
if (element === null || element === document2) {
return false;
}
if (element === ancestor) {
return true;
}
return _belongsTo(element.parentNode, ancestor);
}
function Mousetrap2(targetElement) {
var self2 = this;
targetElement = targetElement || document2;
if (!(self2 instanceof Mousetrap2)) {
return new Mousetrap2(targetElement);
}
self2.target = targetElement;
self2._callbacks = {};
self2._directMap = {};
var _sequenceLevels = {};
var _resetTimer;
var _ignoreNextKeyup = false;
var _ignoreNextKeypress = false;
var _nextExpectedAction = false;
function _resetSequences(doNotReset) {
doNotReset = doNotReset || {};
var activeSequences = false, key;
for (key in _sequenceLevels) {
if (doNotReset[key]) {
activeSequences = true;
continue;
}
_sequenceLevels[key] = 0;
}
if (!activeSequences) {
_nextExpectedAction = false;
}
}
function _getMatches(character, modifiers2, e5, sequenceName, combination, level) {
var i6;
var callback2;
var matches3 = [];
var action = e5.type;
if (!self2._callbacks[character]) {
return [];
}
if (action == "keyup" && _isModifier(character)) {
modifiers2 = [character];
}
for (i6 = 0; i6 < self2._callbacks[character].length; ++i6) {
callback2 = self2._callbacks[character][i6];
if (!sequenceName && callback2.seq && _sequenceLevels[callback2.seq] != callback2.level) {
continue;
}
if (action != callback2.action) {
continue;
}
if (action == "keypress" && !e5.metaKey && !e5.ctrlKey || _modifiersMatch(modifiers2, callback2.modifiers)) {
var deleteCombo = !sequenceName && callback2.combo == combination;
var deleteSequence = sequenceName && callback2.seq == sequenceName && callback2.level == level;
if (deleteCombo || deleteSequence) {
self2._callbacks[character].splice(i6, 1);
}
matches3.push(callback2);
}
}
return matches3;
}
function _fireCallback(callback2, e5, combo, sequence) {
if (self2.stopCallback(e5, e5.target || e5.srcElement, combo, sequence)) {
return;
}
if (callback2(e5, combo) === false) {
_preventDefault(e5);
_stopPropagation(e5);
}
}
self2._handleKey = function(character, modifiers2, e5) {
var callbacks = _getMatches(character, modifiers2, e5);
var i6;
var doNotReset = {};
var maxLevel = 0;
var processedSequenceCallback = false;
for (i6 = 0; i6 < callbacks.length; ++i6) {
if (callbacks[i6].seq) {
maxLevel = Math.max(maxLevel, callbacks[i6].level);
}
}
for (i6 = 0; i6 < callbacks.length; ++i6) {
if (callbacks[i6].seq) {
if (callbacks[i6].level != maxLevel) {
continue;
}
processedSequenceCallback = true;
doNotReset[callbacks[i6].seq] = 1;
_fireCallback(callbacks[i6].callback, e5, callbacks[i6].combo, callbacks[i6].seq);
continue;
}
if (!processedSequenceCallback) {
_fireCallback(callbacks[i6].callback, e5, callbacks[i6].combo);
}
}
var ignoreThisKeypress = e5.type == "keypress" && _ignoreNextKeypress;
if (e5.type == _nextExpectedAction && !_isModifier(character) && !ignoreThisKeypress) {
_resetSequences(doNotReset);
}
_ignoreNextKeypress = processedSequenceCallback && e5.type == "keydown";
};
function _handleKeyEvent(e5) {
if (typeof e5.which !== "number") {
e5.which = e5.keyCode;
}
var character = _characterFromEvent(e5);
if (!character) {
return;
}
if (e5.type == "keyup" && _ignoreNextKeyup === character) {
_ignoreNextKeyup = false;
return;
}
self2.handleKey(character, _eventModifiers(e5), e5);
}
function _resetSequenceTimer() {
clearTimeout(_resetTimer);
_resetTimer = setTimeout(_resetSequences, 1e3);
}
function _bindSequence(combo, keys2, callback2, action) {
_sequenceLevels[combo] = 0;
function _increaseSequence(nextAction) {
return function() {
_nextExpectedAction = nextAction;
++_sequenceLevels[combo];
_resetSequenceTimer();
};
}
function _callbackAndReset(e5) {
_fireCallback(callback2, e5, combo);
if (action !== "keyup") {
_ignoreNextKeyup = _characterFromEvent(e5);
}
setTimeout(_resetSequences, 10);
}
for (var i6 = 0; i6 < keys2.length; ++i6) {
var isFinal = i6 + 1 === keys2.length;
var wrappedCallback = isFinal ? _callbackAndReset : _increaseSequence(action || _getKeyInfo(keys2[i6 + 1]).action);
_bindSingle(keys2[i6], wrappedCallback, action, combo, i6);
}
}
function _bindSingle(combination, callback2, action, sequenceName, level) {
self2._directMap[combination + ":" + action] = callback2;
combination = combination.replace(/\s+/g, " ");
var sequence = combination.split(" ");
var info;
if (sequence.length > 1) {
_bindSequence(combination, sequence, callback2, action);
return;
}
info = _getKeyInfo(combination, action);
self2._callbacks[info.key] = self2._callbacks[info.key] || [];
_getMatches(info.key, info.modifiers, { type: info.action }, sequenceName, combination, level);
self2._callbacks[info.key][sequenceName ? "unshift" : "push"]({
callback: callback2,
modifiers: info.modifiers,
action: info.action,
seq: sequenceName,
level,
combo: combination
});
}
self2._bindMultiple = function(combinations, callback2, action) {
for (var i6 = 0; i6 < combinations.length; ++i6) {
_bindSingle(combinations[i6], callback2, action);
}
};
_addEvent(targetElement, "keypress", _handleKeyEvent);
_addEvent(targetElement, "keydown", _handleKeyEvent);
_addEvent(targetElement, "keyup", _handleKeyEvent);
}
Mousetrap2.prototype.bind = function(keys2, callback2, action) {
var self2 = this;
keys2 = keys2 instanceof Array ? keys2 : [keys2];
self2._bindMultiple.call(self2, keys2, callback2, action);
return self2;
};
Mousetrap2.prototype.unbind = function(keys2, action) {
var self2 = this;
return self2.bind.call(self2, keys2, function() {
}, action);
};
Mousetrap2.prototype.trigger = function(keys2, action) {
var self2 = this;
if (self2._directMap[keys2 + ":" + action]) {
self2._directMap[keys2 + ":" + action]({}, keys2);
}
return self2;
};
Mousetrap2.prototype.reset = function() {
var self2 = this;
self2._callbacks = {};
self2._directMap = {};
return self2;
};
Mousetrap2.prototype.stopCallback = function(e5, element) {
var self2 = this;
if ((" " + element.className + " ").indexOf(" mousetrap ") > -1) {
return false;
}
if (_belongsTo(element, self2.target)) {
return false;
}
if ("composedPath" in e5 && typeof e5.composedPath === "function") {
var initialEventTarget = e5.composedPath()[0];
if (initialEventTarget !== e5.target) {
element = initialEventTarget;
}
}
return element.tagName == "INPUT" || element.tagName == "SELECT" || element.tagName == "TEXTAREA" || element.isContentEditable;
};
Mousetrap2.prototype.handleKey = function() {
var self2 = this;
return self2._handleKey.apply(self2, arguments);
};
Mousetrap2.addKeycodes = function(object) {
for (var key in object) {
if (object.hasOwnProperty(key)) {
_MAP[key] = object[key];
}
}
_REVERSE_MAP = null;
};
Mousetrap2.init = function() {
var documentMousetrap = Mousetrap2(document2);
for (var method in documentMousetrap) {
if (method.charAt(0) !== "_") {
Mousetrap2[method] = function(method2) {
return function() {
return documentMousetrap[method2].apply(documentMousetrap, arguments);
};
}(method);
}
}
};
Mousetrap2.init();
window2.Mousetrap = Mousetrap2;
if (typeof module2 !== "undefined" && module2.exports) {
module2.exports = Mousetrap2;
}
if (typeof define === "function" && define.amd) {
define(function() {
return Mousetrap2;
});
}
})(typeof window !== "undefined" ? window : null, typeof window !== "undefined" ? document : null);
}
});
// node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js
var turbo_es2017_esm_exports = {};
__export(turbo_es2017_esm_exports, {
FetchEnctype: () => FetchEnctype,
FetchMethod: () => FetchMethod,
FetchRequest: () => FetchRequest,
FetchResponse: () => FetchResponse,
FrameElement: () => FrameElement,
FrameLoadingStyle: () => FrameLoadingStyle,
FrameRenderer: () => FrameRenderer,
PageRenderer: () => PageRenderer,
PageSnapshot: () => PageSnapshot,
StreamActions: () => StreamActions,
StreamElement: () => StreamElement,
StreamSourceElement: () => StreamSourceElement,
cache: () => cache,
clearCache: () => clearCache,
config: () => config,
connectStreamSource: () => connectStreamSource,
disconnectStreamSource: () => disconnectStreamSource,
fetch: () => fetchWithTurboHeaders,
fetchEnctypeFromString: () => fetchEnctypeFromString,
fetchMethodFromString: () => fetchMethodFromString,
isSafe: () => isSafe,
navigator: () => navigator$1,
registerAdapter: () => registerAdapter,
renderStreamMessage: () => renderStreamMessage,
session: () => session,
setConfirmMethod: () => setConfirmMethod,
setFormMode: () => setFormMode,
setProgressBarDelay: () => setProgressBarDelay,
start: () => start,
visit: () => visit
});
function findSubmitterFromClickTarget(target) {
const element = target instanceof Element ? target : target instanceof Node ? target.parentElement : null;
const candidate = element ? element.closest("input, button") : null;
return candidate?.type == "submit" ? candidate : null;
}
function clickCaptured(event2) {
const submitter2 = findSubmitterFromClickTarget(event2.target);
if (submitter2 && submitter2.form) {
submittersByForm.set(submitter2.form, submitter2);
}
}
function frameLoadingStyleFromString(style2) {
switch (style2.toLowerCase()) {
case "lazy":
return FrameLoadingStyle.lazy;
default:
return FrameLoadingStyle.eager;
}
}
function activateScriptElement(element) {
if (element.getAttribute("data-turbo-eval") == "false") {
return element;
} else {
const createdScriptElement = document.createElement("script");
const cspNonce = getCspNonce();
if (cspNonce) {
createdScriptElement.nonce = cspNonce;
}
createdScriptElement.textContent = element.textContent;
createdScriptElement.async = false;
copyElementAttributes(createdScriptElement, element);
return createdScriptElement;
}
}
function copyElementAttributes(destinationElement, sourceElement) {
for (const { name, value } of sourceElement.attributes) {
destinationElement.setAttribute(name, value);
}
}
function createDocumentFragment(html) {
const template = document.createElement("template");
template.innerHTML = html;
return template.content;
}
function dispatch(eventName, { target, cancelable: cancelable2, detail } = {}) {
const event2 = new CustomEvent(eventName, {
cancelable: cancelable2,
bubbles: true,
composed: true,
detail
});
if (target && target.isConnected) {
target.dispatchEvent(event2);
} else {
document.documentElement.dispatchEvent(event2);
}
return event2;
}
function cancelEvent(event2) {
event2.preventDefault();
event2.stopImmediatePropagation();
}
function nextRepaint() {
if (document.visibilityState === "hidden") {
return nextEventLoopTick();
} else {
return nextAnimationFrame();
}
}
function nextAnimationFrame() {
return new Promise((resolve3) => requestAnimationFrame(() => resolve3()));
}
function nextEventLoopTick() {
return new Promise((resolve3) => setTimeout(() => resolve3(), 0));
}
function nextMicrotask() {
return Promise.resolve();
}
function parseHTMLDocument(html = "") {
return new DOMParser().parseFromString(html, "text/html");
}
function unindent(strings, ...values) {
const lines = interpolate2(strings, values).replace(/^\n/, "").split("\n");
const match3 = lines[0].match(/^\s+/);
const indent = match3 ? match3[0].length : 0;
return lines.map((line) => line.slice(indent)).join("\n");
}
function interpolate2(strings, values) {
return strings.reduce((result, string, i5) => {
const value = values[i5] == void 0 ? "" : values[i5];
return result + string + value;
}, "");
}
function uuid() {
return Array.from({ length: 36 }).map((_3, i5) => {
if (i5 == 8 || i5 == 13 || i5 == 18 || i5 == 23) {
return "-";
} else if (i5 == 14) {
return "4";
} else if (i5 == 19) {
return (Math.floor(Math.random() * 4) + 8).toString(16);
} else {
return Math.floor(Math.random() * 15).toString(16);
}
}).join("");
}
function getAttribute(attributeName, ...elements2) {
for (const value of elements2.map((element) => element?.getAttribute(attributeName))) {
if (typeof value == "string")
return value;
}
return null;
}
function hasAttribute(attributeName, ...elements2) {
return elements2.some((element) => element && element.hasAttribute(attributeName));
}
function markAsBusy(...elements2) {
for (const element of elements2) {
if (element.localName == "turbo-frame") {
element.setAttribute("busy", "");
}
element.setAttribute("aria-busy", "true");
}
}
function clearBusyState(...elements2) {
for (const element of elements2) {
if (element.localName == "turbo-frame") {
element.removeAttribute("busy");
}
element.removeAttribute("aria-busy");
}
}
function waitForLoad(element, timeoutInMilliseconds = 2e3) {
return new Promise((resolve3) => {
const onComplete = () => {
element.removeEventListener("error", onComplete);
element.removeEventListener("load", onComplete);
resolve3();
};
element.addEventListener("load", onComplete, { once: true });
element.addEventListener("error", onComplete, { once: true });
setTimeout(resolve3, timeoutInMilliseconds);
});
}
function getHistoryMethodForAction(action) {
switch (action) {
case "replace":
return history.replaceState;
case "advance":
case "restore":
return history.pushState;
}
}
function isAction(action) {
return action == "advance" || action == "replace" || action == "restore";
}
function getVisitAction(...elements2) {
const action = getAttribute("data-turbo-action", ...elements2);
return isAction(action) ? action : null;
}
function getMetaElement(name) {
return document.querySelector(`meta[name="${name}"]`);
}
function getMetaContent(name) {
const element = getMetaElement(name);
return element && element.content;
}
function getCspNonce() {
const element = getMetaElement("csp-nonce");
if (element) {
const { nonce, content } = element;
return nonce == "" ? content : nonce;
}
}
function setMetaContent(name, content) {
let element = getMetaElement(name);
if (!element) {
element = document.createElement("meta");
element.setAttribute("name", name);
document.head.appendChild(element);
}
element.setAttribute("content", content);
return element;
}
function findClosestRecursively(element, selector) {
if (element instanceof Element) {
return element.closest(selector) || findClosestRecursively(element.assignedSlot || element.getRootNode()?.host, selector);
}
}
function elementIsFocusable(element) {
const inertDisabledOrHidden = "[inert], :disabled, [hidden], details:not([open]), dialog:not([open])";
return !!element && element.closest(inertDisabledOrHidden) == null && typeof element.focus == "function";
}
function queryAutofocusableElement(elementOrDocumentFragment) {
return Array.from(elementOrDocumentFragment.querySelectorAll("[autofocus]")).find(elementIsFocusable);
}
async function around(callback2, reader) {
const before = reader();
callback2();
await nextAnimationFrame();
const after = reader();
return [before, after];
}
function doesNotTargetIFrame(name) {
if (name === "_blank") {
return false;
} else if (name) {
for (const element of document.getElementsByName(name)) {
if (element instanceof HTMLIFrameElement)
return false;
}
return true;
} else {
return true;
}
}
function findLinkFromClickTarget(target) {
return findClosestRecursively(target, "a[href]:not([target^=_]):not([download])");
}
function getLocationForLink(link) {
return expandURL(link.getAttribute("href") || "");
}
function debounce2(fn3, delay) {
let timeoutId = null;
return (...args) => {
const callback2 = () => fn3.apply(this, args);
clearTimeout(timeoutId);
timeoutId = setTimeout(callback2, delay);
};
}
function expandURL(locatable) {
return new URL(locatable.toString(), document.baseURI);
}
function getAnchor(url) {
let anchorMatch;
if (url.hash) {
return url.hash.slice(1);
} else if (anchorMatch = url.href.match(/#(.*)$/)) {
return anchorMatch[1];
}
}
function getAction$1(form, submitter2) {
const action = submitter2?.getAttribute("formaction") || form.getAttribute("action") || form.action;
return expandURL(action);
}
function getExtension(url) {
return (getLastPathComponent(url).match(/\.[^.]*$/) || [])[0] || "";
}
function isPrefixedBy(baseURL, url) {
const prefix = getPrefix(url);
return baseURL.href === expandURL(prefix).href || baseURL.href.startsWith(prefix);
}
function locationIsVisitable(location2, rootLocation) {
return isPrefixedBy(location2, rootLocation) && !config.drive.unvisitableExtensions.has(getExtension(location2));
}
function getRequestURL(url) {
const anchor = getAnchor(url);
return anchor != null ? url.href.slice(0, -(anchor.length + 1)) : url.href;
}
function toCacheKey(url) {
return getRequestURL(url);
}
function urlsAreEqual(left2, right2) {
return expandURL(left2).href == expandURL(right2).href;
}
function getPathComponents(url) {
return url.pathname.split("/").slice(1);
}
function getLastPathComponent(url) {
return getPathComponents(url).slice(-1)[0];
}
function getPrefix(url) {
return addTrailingSlash(url.origin + url.pathname);
}
function addTrailingSlash(value) {
return value.endsWith("/") ? value : value + "/";
}
function fetchWithTurboHeaders(url, options = {}) {
const modifiedHeaders = new Headers(options.headers || {});
const requestUID = uuid();
recentRequests.add(requestUID);
modifiedHeaders.append("X-Turbo-Request-Id", requestUID);
return nativeFetch(url, {
...options,
headers: modifiedHeaders
});
}
function fetchMethodFromString(method) {
switch (method.toLowerCase()) {
case "get":
return FetchMethod.get;
case "post":
return FetchMethod.post;
case "put":
return FetchMethod.put;
case "patch":
return FetchMethod.patch;
case "delete":
return FetchMethod.delete;
}
}
function fetchEnctypeFromString(encoding) {
switch (encoding.toLowerCase()) {
case FetchEnctype.multipart:
return FetchEnctype.multipart;
case FetchEnctype.plain:
return FetchEnctype.plain;
default:
return FetchEnctype.urlEncoded;
}
}
function isSafe(fetchMethod) {
return fetchMethodFromString(fetchMethod) == FetchMethod.get;
}
function buildResourceAndBody(resource, method, requestBody, enctype) {
const searchParams = Array.from(requestBody).length > 0 ? new URLSearchParams(entriesExcludingFiles(requestBody)) : resource.searchParams;
if (isSafe(method)) {
return [mergeIntoURLSearchParams(resource, searchParams), null];
} else if (enctype == FetchEnctype.urlEncoded) {
return [resource, searchParams];
} else {
return [resource, requestBody];
}
}
function entriesExcludingFiles(requestBody) {
const entries = [];
for (const [name, value] of requestBody) {
if (value instanceof File)
continue;
else
entries.push([name, value]);
}
return entries;
}
function mergeIntoURLSearchParams(url, requestBody) {
const searchParams = new URLSearchParams(entriesExcludingFiles(requestBody));
url.search = searchParams.toString();
return url;
}
function importStreamElements(fragment) {
for (const element of fragment.querySelectorAll("turbo-stream")) {
const streamElement = document.importNode(element, true);
for (const inertScriptElement of streamElement.templateElement.content.querySelectorAll("script")) {
inertScriptElement.replaceWith(activateScriptElement(inertScriptElement));
}
element.replaceWith(streamElement);
}
return fragment;
}
function buildFormData(formElement, submitter2) {
const formData = new FormData(formElement);
const name = submitter2?.getAttribute("name");
const value = submitter2?.getAttribute("value");
if (name) {
formData.append(name, value || "");
}
return formData;
}
function getCookieValue(cookieName) {
if (cookieName != null) {
const cookies = document.cookie ? document.cookie.split("; ") : [];
const cookie = cookies.find((cookie2) => cookie2.startsWith(cookieName));
if (cookie) {
const value = cookie.split("=").slice(1).join("=");
return value ? decodeURIComponent(value) : void 0;
}
}
}
function responseSucceededWithoutRedirect(response) {
return response.statusCode == 200 && !response.redirected;
}
function getFormAction(formElement, submitter2) {
const formElementAction = typeof formElement.action === "string" ? formElement.action : null;
if (submitter2?.hasAttribute("formaction")) {
return submitter2.getAttribute("formaction") || "";
} else {
return formElement.getAttribute("action") || formElementAction || "";
}
}
function getAction(formAction, fetchMethod) {
const action = expandURL(formAction);
if (isSafe(fetchMethod)) {
action.search = "";
}
return action;
}
function getMethod(formElement, submitter2) {
const method = submitter2?.getAttribute("formmethod") || formElement.getAttribute("method") || "";
return fetchMethodFromString(method.toLowerCase()) || FetchMethod.get;
}
function getEnctype(formElement, submitter2) {
return fetchEnctypeFromString(submitter2?.getAttribute("formenctype") || formElement.enctype);
}
function getPermanentElementById(node, id) {
return node.querySelector(`#${id}[data-turbo-permanent]`);
}
function queryPermanentElementsAll(node) {
return node.querySelectorAll("[id][data-turbo-permanent]");
}
function submissionDoesNotDismissDialog(form, submitter2) {
const method = submitter2?.getAttribute("formmethod") || form.getAttribute("method");
return method != "dialog";
}
function submissionDoesNotTargetIFrame(form, submitter2) {
const target = submitter2?.getAttribute("formtarget") || form.getAttribute("target");
return doesNotTargetIFrame(target);
}
function createPlaceholderForPermanentElement(permanentElement) {
const element = document.createElement("meta");
element.setAttribute("name", "turbo-permanent-placeholder");
element.setAttribute("content", permanentElement.id);
return element;
}
function readScrollLogicalPosition(value, defaultValue) {
if (value == "end" || value == "start" || value == "center" || value == "nearest") {
return value;
} else {
return defaultValue;
}
}
function readScrollBehavior(value, defaultValue) {
if (value == "auto" || value == "smooth") {
return value;
} else {
return defaultValue;
}
}
function morphElements(currentElement, newElement, { callbacks, ...options } = {}) {
Idiomorph.morph(currentElement, newElement, {
...options,
callbacks: new DefaultIdiomorphCallbacks(callbacks)
});
}
function morphChildren(currentElement, newElement) {
morphElements(currentElement, newElement.children, {
morphStyle: "innerHTML"
});
}
function elementType(element) {
if (elementIsScript(element)) {
return "script";
} else if (elementIsStylesheet(element)) {
return "stylesheet";
}
}
function elementIsTracked(element) {
return element.getAttribute("data-turbo-track") == "reload";
}
function elementIsScript(element) {
const tagName = element.localName;
return tagName == "script";
}
function elementIsNoscript(element) {
const tagName = element.localName;
return tagName == "noscript";
}
function elementIsStylesheet(element) {
const tagName = element.localName;
return tagName == "style" || tagName == "link" && element.getAttribute("rel") == "stylesheet";
}
function elementIsMetaElementWithName(element, name) {
const tagName = element.localName;
return tagName == "meta" && element.getAttribute("name") == name;
}
function elementWithoutNonce(element) {
if (element.hasAttribute("nonce")) {
element.setAttribute("nonce", "");
}
return element;
}
function isSuccessful(statusCode) {
return statusCode >= 200 && statusCode < 300;
}
function getPermanentElementMapForFragment(fragment) {
const permanentElementsInDocument = queryPermanentElementsAll(document.documentElement);
const permanentElementMap = {};
for (const permanentElementInDocument of permanentElementsInDocument) {
const { id } = permanentElementInDocument;
for (const streamElement of fragment.querySelectorAll("turbo-stream")) {
const elementInStream = getPermanentElementById(streamElement.templateElement.content, id);
if (elementInStream) {
permanentElementMap[id] = [permanentElementInDocument, elementInStream];
}
}
}
return permanentElementMap;
}
async function withAutofocusFromFragment(fragment, callback2) {
const generatedID = `turbo-stream-autofocus-${uuid()}`;
const turboStreams = fragment.querySelectorAll("turbo-stream");
const elementWithAutofocus = firstAutofocusableElementInStreams(turboStreams);
let willAutofocusId = null;
if (elementWithAutofocus) {
if (elementWithAutofocus.id) {
willAutofocusId = elementWithAutofocus.id;
} else {
willAutofocusId = generatedID;
}
elementWithAutofocus.id = willAutofocusId;
}
callback2();
await nextRepaint();
const hasNoActiveElement = document.activeElement == null || document.activeElement == document.body;
if (hasNoActiveElement && willAutofocusId) {
const elementToAutofocus = document.getElementById(willAutofocusId);
if (elementIsFocusable(elementToAutofocus)) {
elementToAutofocus.focus();
}
if (elementToAutofocus && elementToAutofocus.id == generatedID) {
elementToAutofocus.removeAttribute("id");
}
}
}
async function withPreservedFocus(callback2) {
const [activeElementBeforeRender, activeElementAfterRender] = await around(callback2, () => document.activeElement);
const restoreFocusTo = activeElementBeforeRender && activeElementBeforeRender.id;
if (restoreFocusTo) {
const elementToFocus = document.getElementById(restoreFocusTo);
if (elementIsFocusable(elementToFocus) && elementToFocus != activeElementAfterRender) {
elementToFocus.focus();
}
}
}
function firstAutofocusableElementInStreams(nodeListOfStreamElements) {
for (const streamElement of nodeListOfStreamElements) {
const elementWithAutofocus = queryAutofocusableElement(streamElement.templateElement.content);
if (elementWithAutofocus)
return elementWithAutofocus;
}
return null;
}
function fetchResponseFromEvent(event2) {
const fetchResponse = event2.detail?.fetchResponse;
if (fetchResponse instanceof FetchResponse) {
return fetchResponse;
}
}
function fetchResponseIsStream(response) {
const contentType = response.contentType ?? "";
return contentType.startsWith(StreamMessage.contentType);
}
function canRefreshFrame(frame) {
return frame instanceof FrameElement && frame.src && frame.refresh === "morph" && !frame.closest("[data-turbo-permanent]");
}
function extendURLWithDeprecatedProperties(url) {
Object.defineProperties(url, deprecatedLocationPropertyDescriptors);
}
function start() {
session.start();
}
function registerAdapter(adapter) {
session.registerAdapter(adapter);
}
function visit(location2, options) {
session.visit(location2, options);
}
function connectStreamSource(source) {
session.connectStreamSource(source);
}
function disconnectStreamSource(source) {
session.disconnectStreamSource(source);
}
function renderStreamMessage(message) {
session.renderStreamMessage(message);
}
function clearCache() {
console.warn(
"Please replace `Turbo.clearCache()` with `Turbo.cache.clear()`. The top-level function is deprecated and will be removed in a future version of Turbo.`"
);
session.clearCache();
}
function setProgressBarDelay(delay) {
console.warn(
"Please replace `Turbo.setProgressBarDelay(delay)` with `Turbo.config.drive.progressBarDelay = delay`. The top-level function is deprecated and will be removed in a future version of Turbo.`"
);
config.drive.progressBarDelay = delay;
}
function setConfirmMethod(confirmMethod) {
console.warn(
"Please replace `Turbo.setConfirmMethod(confirmMethod)` with `Turbo.config.forms.confirm = confirmMethod`. The top-level function is deprecated and will be removed in a future version of Turbo.`"
);
config.forms.confirm = confirmMethod;
}
function setFormMode(mode) {
console.warn(
"Please replace `Turbo.setFormMode(mode)` with `Turbo.config.forms.mode = mode`. The top-level function is deprecated and will be removed in a future version of Turbo.`"
);
config.forms.mode = mode;
}
function getFrameElementById(id) {
if (id != null) {
const element = document.getElementById(id);
if (element instanceof FrameElement) {
return element;
}
}
}
function activateElement(element, currentURL) {
if (element) {
const src = element.getAttribute("src");
if (src != null && currentURL != null && urlsAreEqual(src, currentURL)) {
throw new Error(`Matching element has a source URL which references itself`);
}
if (element.ownerDocument !== document) {
element = document.importNode(element, true);
}
if (element instanceof FrameElement) {
element.connectedCallback();
element.disconnectedCallback();
return element;
}
}
}
var submittersByForm, FrameLoadingStyle, _FrameElement, FrameElement, drive, submitter, Config2, forms, config, FetchResponse, LimitedSet, recentRequests, nativeFetch, FetchMethod, FetchEnctype, FetchRequest, AppearanceObserver, StreamMessage, PREFETCH_DELAY, PrefetchCache, cacheTtl, prefetchCache, FormSubmissionState, FormSubmission, Snapshot, FormSubmitObserver, View, FrameView, LinkInterceptor, LinkClickObserver, FormLinkClickObserver, Bardo, Renderer, FrameRenderer, Idiomorph, DefaultIdiomorphCallbacks, MorphingFrameRenderer, _ProgressBar, ProgressBar, HeadSnapshot, PageSnapshot, ViewTransitioner, defaultOptions, TimingMetric, VisitState, SystemStatusCode, Direction, Visit, BrowserAdapter, CacheObserver, FrameRedirector, History, LinkPrefetchObserver, unfetchableLink, linkToTheSamePage, linkOptsOut, nonSafeLink, isUJS, eventPrevented, Navigator, PageStage, PageObserver, ScrollObserver, StreamMessageRenderer, StreamObserver, ErrorRenderer, PageRenderer, MorphingPageRenderer, SnapshotCache, PageView, Preloader, Cache, Session, deprecatedLocationPropertyDescriptors, session, cache, navigator$1, Turbo, TurboFrameMissingError, FrameController, StreamActions, StreamElement, StreamSourceElement;
var init_turbo_es2017_esm = __esm({
"node_modules/@hotwired/turbo/dist/turbo.es2017-esm.js"() {
(function(prototype) {
if (typeof prototype.requestSubmit == "function")
return;
prototype.requestSubmit = function(submitter2) {
if (submitter2) {
validateSubmitter(submitter2, this);
submitter2.click();
} else {
submitter2 = document.createElement("input");
submitter2.type = "submit";
submitter2.hidden = true;
this.appendChild(submitter2);
submitter2.click();
this.removeChild(submitter2);
}
};
function validateSubmitter(submitter2, form) {
submitter2 instanceof HTMLElement || raise(TypeError, "parameter 1 is not of type 'HTMLElement'");
submitter2.type == "submit" || raise(TypeError, "The specified element is not a submit button");
submitter2.form == form || raise(DOMException, "The specified element is not owned by this form element", "NotFoundError");
}
function raise(errorConstructor, message, name) {
throw new errorConstructor("Failed to execute 'requestSubmit' on 'HTMLFormElement': " + message + ".", name);
}
})(HTMLFormElement.prototype);
submittersByForm = /* @__PURE__ */ new WeakMap();
(function() {
if ("submitter" in Event.prototype)
return;
let prototype = window.Event.prototype;
if ("SubmitEvent" in window) {
const prototypeOfSubmitEvent = window.SubmitEvent.prototype;
if (/Apple Computer/.test(navigator.vendor) && !("submitter" in prototypeOfSubmitEvent)) {
prototype = prototypeOfSubmitEvent;
} else {
return;
}
}
addEventListener("click", clickCaptured, true);
Object.defineProperty(prototype, "submitter", {
get() {
if (this.type == "submit" && this.target instanceof HTMLFormElement) {
return submittersByForm.get(this.target);
}
}
});
})();
FrameLoadingStyle = {
eager: "eager",
lazy: "lazy"
};
_FrameElement = class extends HTMLElement {
loaded = Promise.resolve();
static get observedAttributes() {
return ["disabled", "loading", "src"];
}
constructor() {
super();
this.delegate = new _FrameElement.delegateConstructor(this);
}
connectedCallback() {
this.delegate.connect();
}
disconnectedCallback() {
this.delegate.disconnect();
}
reload() {
return this.delegate.sourceURLReloaded();
}
attributeChangedCallback(name) {
if (name == "loading") {
this.delegate.loadingStyleChanged();
} else if (name == "src") {
this.delegate.sourceURLChanged();
} else if (name == "disabled") {
this.delegate.disabledChanged();
}
}
get src() {
return this.getAttribute("src");
}
set src(value) {
if (value) {
this.setAttribute("src", value);
} else {
this.removeAttribute("src");
}
}
get refresh() {
return this.getAttribute("refresh");
}
set refresh(value) {
if (value) {
this.setAttribute("refresh", value);
} else {
this.removeAttribute("refresh");
}
}
get shouldReloadWithMorph() {
return this.src && this.refresh === "morph";
}
get loading() {
return frameLoadingStyleFromString(this.getAttribute("loading") || "");
}
set loading(value) {
if (value) {
this.setAttribute("loading", value);
} else {
this.removeAttribute("loading");
}
}
get disabled() {
return this.hasAttribute("disabled");
}
set disabled(value) {
if (value) {
this.setAttribute("disabled", "");
} else {
this.removeAttribute("disabled");
}
}
get autoscroll() {
return this.hasAttribute("autoscroll");
}
set autoscroll(value) {
if (value) {
this.setAttribute("autoscroll", "");
} else {
this.removeAttribute("autoscroll");
}
}
get complete() {
return !this.delegate.isLoading;
}
get isActive() {
return this.ownerDocument === document && !this.isPreview;
}
get isPreview() {
return this.ownerDocument?.documentElement?.hasAttribute("data-turbo-preview");
}
};
FrameElement = _FrameElement;
__publicField(FrameElement, "delegateConstructor");
drive = {
enabled: true,
progressBarDelay: 500,
unvisitableExtensions: /* @__PURE__ */ new Set(
[
".7z",
".aac",
".apk",
".avi",
".bmp",
".bz2",
".css",
".csv",
".deb",
".dmg",
".doc",
".docx",
".exe",
".gif",
".gz",
".heic",
".heif",
".ico",
".iso",
".jpeg",
".jpg",
".js",
".json",
".m4a",
".mkv",
".mov",
".mp3",
".mp4",
".mpeg",
".mpg",
".msi",
".ogg",
".ogv",
".pdf",
".pkg",
".png",
".ppt",
".pptx",
".rar",
".rtf",
".svg",
".tar",
".tif",
".tiff",
".txt",
".wav",
".webm",
".webp",
".wma",
".wmv",
".xls",
".xlsx",
".xml",
".zip"
]
)
};
submitter = {
"aria-disabled": {
beforeSubmit: (submitter2) => {
submitter2.setAttribute("aria-disabled", "true");
submitter2.addEventListener("click", cancelEvent);
},
afterSubmit: (submitter2) => {
submitter2.removeAttribute("aria-disabled");
submitter2.removeEventListener("click", cancelEvent);
}
},
"disabled": {
beforeSubmit: (submitter2) => submitter2.disabled = true,
afterSubmit: (submitter2) => submitter2.disabled = false
}
};
Config2 = class {
#submitter = null;
constructor(config2) {
Object.assign(this, config2);
}
get submitter() {
return this.#submitter;
}
set submitter(value) {
this.#submitter = submitter[value] || value;
}
};
forms = new Config2({
mode: "on",
submitter: "disabled"
});
config = {
drive,
forms
};
FetchResponse = class {
constructor(response) {
this.response = response;
}
get succeeded() {
return this.response.ok;
}
get failed() {
return !this.succeeded;
}
get clientError() {
return this.statusCode >= 400 && this.statusCode <= 499;
}
get serverError() {
return this.statusCode >= 500 && this.statusCode <= 599;
}
get redirected() {
return this.response.redirected;
}
get location() {
return expandURL(this.response.url);
}
get isHTML() {
return this.contentType && this.contentType.match(/^(?:text\/([^\s;,]+\b)?html|application\/xhtml\+xml)\b/);
}
get statusCode() {
return this.response.status;
}
get contentType() {
return this.header("Content-Type");
}
get responseText() {
return this.response.clone().text();
}
get responseHTML() {
if (this.isHTML) {
return this.response.clone().text();
} else {
return Promise.resolve(void 0);
}
}
header(name) {
return this.response.headers.get(name);
}
};
LimitedSet = class extends Set {
constructor(maxSize) {
super();
this.maxSize = maxSize;
}
add(value) {
if (this.size >= this.maxSize) {
const iterator = this.values();
const oldestValue = iterator.next().value;
this.delete(oldestValue);
}
super.add(value);
}
};
recentRequests = new LimitedSet(20);
nativeFetch = window.fetch;
FetchMethod = {
get: "get",
post: "post",
put: "put",
patch: "patch",
delete: "delete"
};
FetchEnctype = {
urlEncoded: "application/x-www-form-urlencoded",
multipart: "multipart/form-data",
plain: "text/plain"
};
FetchRequest = class {
abortController = new AbortController();
#resolveRequestPromise = (_value) => {
};
constructor(delegate, method, location2, requestBody = new URLSearchParams(), target = null, enctype = FetchEnctype.urlEncoded) {
const [url, body] = buildResourceAndBody(expandURL(location2), method, requestBody, enctype);
this.delegate = delegate;
this.url = url;
this.target = target;
this.fetchOptions = {
credentials: "same-origin",
redirect: "follow",
method: method.toUpperCase(),
headers: { ...this.defaultHeaders },
body,
signal: this.abortSignal,
referrer: this.delegate.referrer?.href
};
this.enctype = enctype;
}
get method() {
return this.fetchOptions.method;
}
set method(value) {
const fetchBody = this.isSafe ? this.url.searchParams : this.fetchOptions.body || new FormData();
const fetchMethod = fetchMethodFromString(value) || FetchMethod.get;
this.url.search = "";
const [url, body] = buildResourceAndBody(this.url, fetchMethod, fetchBody, this.enctype);
this.url = url;
this.fetchOptions.body = body;
this.fetchOptions.method = fetchMethod.toUpperCase();
}
get headers() {
return this.fetchOptions.headers;
}
set headers(value) {
this.fetchOptions.headers = value;
}
get body() {
if (this.isSafe) {
return this.url.searchParams;
} else {
return this.fetchOptions.body;
}
}
set body(value) {
this.fetchOptions.body = value;
}
get location() {
return this.url;
}
get params() {
return this.url.searchParams;
}
get entries() {
return this.body ? Array.from(this.body.entries()) : [];
}
cancel() {
this.abortController.abort();
}
async perform() {
const { fetchOptions } = this;
this.delegate.prepareRequest(this);
const event2 = await this.#allowRequestToBeIntercepted(fetchOptions);
try {
this.delegate.requestStarted(this);
if (event2.detail.fetchRequest) {
this.response = event2.detail.fetchRequest.response;
} else {
this.response = fetchWithTurboHeaders(this.url.href, fetchOptions);
}
const response = await this.response;
return await this.receive(response);
} catch (error2) {
if (error2.name !== "AbortError") {
if (this.#willDelegateErrorHandling(error2)) {
this.delegate.requestErrored(this, error2);
}
throw error2;
}
} finally {
this.delegate.requestFinished(this);
}
}
async receive(response) {
const fetchResponse = new FetchResponse(response);
const event2 = dispatch("turbo:before-fetch-response", {
cancelable: true,
detail: { fetchResponse },
target: this.target
});
if (event2.defaultPrevented) {
this.delegate.requestPreventedHandlingResponse(this, fetchResponse);
} else if (fetchResponse.succeeded) {
this.delegate.requestSucceededWithResponse(this, fetchResponse);
} else {
this.delegate.requestFailedWithResponse(this, fetchResponse);
}
return fetchResponse;
}
get defaultHeaders() {
return {
Accept: "text/html, application/xhtml+xml"
};
}
get isSafe() {
return isSafe(this.method);
}
get abortSignal() {
return this.abortController.signal;
}
acceptResponseType(mimeType) {
this.headers["Accept"] = [mimeType, this.headers["Accept"]].join(", ");
}
async #allowRequestToBeIntercepted(fetchOptions) {
const requestInterception = new Promise((resolve3) => this.#resolveRequestPromise = resolve3);
const event2 = dispatch("turbo:before-fetch-request", {
cancelable: true,
detail: {
fetchOptions,
url: this.url,
resume: this.#resolveRequestPromise
},
target: this.target
});
this.url = event2.detail.url;
if (event2.defaultPrevented)
await requestInterception;
return event2;
}
#willDelegateErrorHandling(error2) {
const event2 = dispatch("turbo:fetch-request-error", {
target: this.target,
cancelable: true,
detail: { request: this, error: error2 }
});
return !event2.defaultPrevented;
}
};
AppearanceObserver = class {
started = false;
constructor(delegate, element) {
this.delegate = delegate;
this.element = element;
this.intersectionObserver = new IntersectionObserver(this.intersect);
}
start() {
if (!this.started) {
this.started = true;
this.intersectionObserver.observe(this.element);
}
}
stop() {
if (this.started) {
this.started = false;
this.intersectionObserver.unobserve(this.element);
}
}
intersect = (entries) => {
const lastEntry = entries.slice(-1)[0];
if (lastEntry?.isIntersecting) {
this.delegate.elementAppearedInViewport(this.element);
}
};
};
StreamMessage = class {
static wrap(message) {
if (typeof message == "string") {
return new this(createDocumentFragment(message));
} else {
return message;
}
}
constructor(fragment) {
this.fragment = importStreamElements(fragment);
}
};
__publicField(StreamMessage, "contentType", "text/vnd.turbo-stream.html");
PREFETCH_DELAY = 100;
PrefetchCache = class {
#prefetchTimeout = null;
#prefetched = null;
get(url) {
if (this.#prefetched && this.#prefetched.url === url && this.#prefetched.expire > Date.now()) {
return this.#prefetched.request;
}
}
setLater(url, request, ttl) {
this.clear();
this.#prefetchTimeout = setTimeout(() => {
request.perform();
this.set(url, request, ttl);
this.#prefetchTimeout = null;
}, PREFETCH_DELAY);
}
set(url, request, ttl) {
this.#prefetched = { url, request, expire: new Date(new Date().getTime() + ttl) };
}
clear() {
if (this.#prefetchTimeout)
clearTimeout(this.#prefetchTimeout);
this.#prefetched = null;
}
};
cacheTtl = 10 * 1e3;
prefetchCache = new PrefetchCache();
FormSubmissionState = {
initialized: "initialized",
requesting: "requesting",
waiting: "waiting",
receiving: "receiving",
stopping: "stopping",
stopped: "stopped"
};
FormSubmission = class {
state = FormSubmissionState.initialized;
static confirmMethod(message) {
return Promise.resolve(confirm(message));
}
constructor(delegate, formElement, submitter2, mustRedirect = false) {
const method = getMethod(formElement, submitter2);
const action = getAction(getFormAction(formElement, submitter2), method);
const body = buildFormData(formElement, submitter2);
const enctype = getEnctype(formElement, submitter2);
this.delegate = delegate;
this.formElement = formElement;
this.submitter = submitter2;
this.fetchRequest = new FetchRequest(this, method, action, body, formElement, enctype);
this.mustRedirect = mustRedirect;
}
get method() {
return this.fetchRequest.method;
}
set method(value) {
this.fetchRequest.method = value;
}
get action() {
return this.fetchRequest.url.toString();
}
set action(value) {
this.fetchRequest.url = expandURL(value);
}
get body() {
return this.fetchRequest.body;
}
get enctype() {
return this.fetchRequest.enctype;
}
get isSafe() {
return this.fetchRequest.isSafe;
}
get location() {
return this.fetchRequest.url;
}
async start() {
const { initialized, requesting } = FormSubmissionState;
const confirmationMessage = getAttribute("data-turbo-confirm", this.submitter, this.formElement);
if (typeof confirmationMessage === "string") {
const confirmMethod = typeof config.forms.confirm === "function" ? config.forms.confirm : FormSubmission.confirmMethod;
const answer = await confirmMethod(confirmationMessage, this.formElement, this.submitter);
if (!answer) {
return;
}
}
if (this.state == initialized) {
this.state = requesting;
return this.fetchRequest.perform();
}
}
stop() {
const { stopping, stopped } = FormSubmissionState;
if (this.state != stopping && this.state != stopped) {
this.state = stopping;
this.fetchRequest.cancel();
return true;
}
}
prepareRequest(request) {
if (!request.isSafe) {
const token = getCookieValue(getMetaContent("csrf-param")) || getMetaContent("csrf-token");
if (token) {
request.headers["X-CSRF-Token"] = token;
}
}
if (this.requestAcceptsTurboStreamResponse(request)) {
request.acceptResponseType(StreamMessage.contentType);
}
}
requestStarted(_request) {
this.state = FormSubmissionState.waiting;
if (this.submitter)
config.forms.submitter.beforeSubmit(this.submitter);
this.setSubmitsWith();
markAsBusy(this.formElement);
dispatch("turbo:submit-start", {
target: this.formElement,
detail: { formSubmission: this }
});
this.delegate.formSubmissionStarted(this);
}
requestPreventedHandlingResponse(request, response) {
prefetchCache.clear();
this.result = { success: response.succeeded, fetchResponse: response };
}
requestSucceededWithResponse(request, response) {
if (response.clientError || response.serverError) {
this.delegate.formSubmissionFailedWithResponse(this, response);
return;
}
prefetchCache.clear();
if (this.requestMustRedirect(request) && responseSucceededWithoutRedirect(response)) {
const error2 = new Error("Form responses must redirect to another location");
this.delegate.formSubmissionErrored(this, error2);
} else {
this.state = FormSubmissionState.receiving;
this.result = { success: true, fetchResponse: response };
this.delegate.formSubmissionSucceededWithResponse(this, response);
}
}
requestFailedWithResponse(request, response) {
this.result = { success: false, fetchResponse: response };
this.delegate.formSubmissionFailedWithResponse(this, response);
}
requestErrored(request, error2) {
this.result = { success: false, error: error2 };
this.delegate.formSubmissionErrored(this, error2);
}
requestFinished(_request) {
this.state = FormSubmissionState.stopped;
if (this.submitter)
config.forms.submitter.afterSubmit(this.submitter);
this.resetSubmitterText();
clearBusyState(this.formElement);
dispatch("turbo:submit-end", {
target: this.formElement,
detail: { formSubmission: this, ...this.result }
});
this.delegate.formSubmissionFinished(this);
}
setSubmitsWith() {
if (!this.submitter || !this.submitsWith)
return;
if (this.submitter.matches("button")) {
this.originalSubmitText = this.submitter.innerHTML;
this.submitter.innerHTML = this.submitsWith;
} else if (this.submitter.matches("input")) {
const input = this.submitter;
this.originalSubmitText = input.value;
input.value = this.submitsWith;
}
}
resetSubmitterText() {
if (!this.submitter || !this.originalSubmitText)
return;
if (this.submitter.matches("button")) {
this.submitter.innerHTML = this.originalSubmitText;
} else if (this.submitter.matches("input")) {
const input = this.submitter;
input.value = this.originalSubmitText;
}
}
requestMustRedirect(request) {
return !request.isSafe && this.mustRedirect;
}
requestAcceptsTurboStreamResponse(request) {
return !request.isSafe || hasAttribute("data-turbo-stream", this.submitter, this.formElement);
}
get submitsWith() {
return this.submitter?.getAttribute("data-turbo-submits-with");
}
};
Snapshot = class {
constructor(element) {
this.element = element;
}
get activeElement() {
return this.element.ownerDocument.activeElement;
}
get children() {
return [...this.element.children];
}
hasAnchor(anchor) {
return this.getElementForAnchor(anchor) != null;
}
getElementForAnchor(anchor) {
return anchor ? this.element.querySelector(`[id='${anchor}'], a[name='${anchor}']`) : null;
}
get isConnected() {
return this.element.isConnected;
}
get firstAutofocusableElement() {
return queryAutofocusableElement(this.element);
}
get permanentElements() {
return queryPermanentElementsAll(this.element);
}
getPermanentElementById(id) {
return getPermanentElementById(this.element, id);
}
getPermanentElementMapForSnapshot(snapshot) {
const permanentElementMap = {};
for (const currentPermanentElement of this.permanentElements) {
const { id } = currentPermanentElement;
const newPermanentElement = snapshot.getPermanentElementById(id);
if (newPermanentElement) {
permanentElementMap[id] = [currentPermanentElement, newPermanentElement];
}
}
return permanentElementMap;
}
};
FormSubmitObserver = class {
started = false;
constructor(delegate, eventTarget) {
this.delegate = delegate;
this.eventTarget = eventTarget;
}
start() {
if (!this.started) {
this.eventTarget.addEventListener("submit", this.submitCaptured, true);
this.started = true;
}
}
stop() {
if (this.started) {
this.eventTarget.removeEventListener("submit", this.submitCaptured, true);
this.started = false;
}
}
submitCaptured = () => {
this.eventTarget.removeEventListener("submit", this.submitBubbled, false);
this.eventTarget.addEventListener("submit", this.submitBubbled, false);
};
submitBubbled = (event2) => {
if (!event2.defaultPrevented) {
const form = event2.target instanceof HTMLFormElement ? event2.target : void 0;
const submitter2 = event2.submitter || void 0;
if (form && submissionDoesNotDismissDialog(form, submitter2) && submissionDoesNotTargetIFrame(form, submitter2) && this.delegate.willSubmitForm(form, submitter2)) {
event2.preventDefault();
event2.stopImmediatePropagation();
this.delegate.formSubmitted(form, submitter2);
}
}
};
};
View = class {
#resolveRenderPromise = (_value) => {
};
#resolveInterceptionPromise = (_value) => {
};
constructor(delegate, element) {
this.delegate = delegate;
this.element = element;
}
scrollToAnchor(anchor) {
const element = this.snapshot.getElementForAnchor(anchor);
if (element) {
this.scrollToElement(element);
this.focusElement(element);
} else {
this.scrollToPosition({ x: 0, y: 0 });
}
}
scrollToAnchorFromLocation(location2) {
this.scrollToAnchor(getAnchor(location2));
}
scrollToElement(element) {
element.scrollIntoView();
}
focusElement(element) {
if (element instanceof HTMLElement) {
if (element.hasAttribute("tabindex")) {
element.focus();
} else {
element.setAttribute("tabindex", "-1");
element.focus();
element.removeAttribute("tabindex");
}
}
}
scrollToPosition({ x: x4, y: y4 }) {
this.scrollRoot.scrollTo(x4, y4);
}
scrollToTop() {
this.scrollToPosition({ x: 0, y: 0 });
}
get scrollRoot() {
return window;
}
async render(renderer) {
const { isPreview, shouldRender, willRender, newSnapshot: snapshot } = renderer;
const shouldInvalidate = willRender;
if (shouldRender) {
try {
this.renderPromise = new Promise((resolve3) => this.#resolveRenderPromise = resolve3);
this.renderer = renderer;
await this.prepareToRenderSnapshot(renderer);
const renderInterception = new Promise((resolve3) => this.#resolveInterceptionPromise = resolve3);
const options = { resume: this.#resolveInterceptionPromise, render: this.renderer.renderElement, renderMethod: this.renderer.renderMethod };
const immediateRender = this.delegate.allowsImmediateRender(snapshot, options);
if (!immediateRender)
await renderInterception;
await this.renderSnapshot(renderer);
this.delegate.viewRenderedSnapshot(snapshot, isPreview, this.renderer.renderMethod);
this.delegate.preloadOnLoadLinksForView(this.element);
this.finishRenderingSnapshot(renderer);
} finally {
delete this.renderer;
this.#resolveRenderPromise(void 0);
delete this.renderPromise;
}
} else if (shouldInvalidate) {
this.invalidate(renderer.reloadReason);
}
}
invalidate(reason) {
this.delegate.viewInvalidated(reason);
}
async prepareToRenderSnapshot(renderer) {
this.markAsPreview(renderer.isPreview);
await renderer.prepareToRender();
}
markAsPreview(isPreview) {
if (isPreview) {
this.element.setAttribute("data-turbo-preview", "");
} else {
this.element.removeAttribute("data-turbo-preview");
}
}
markVisitDirection(direction) {
this.element.setAttribute("data-turbo-visit-direction", direction);
}
unmarkVisitDirection() {
this.element.removeAttribute("data-turbo-visit-direction");
}
async renderSnapshot(renderer) {
await renderer.render();
}
finishRenderingSnapshot(renderer) {
renderer.finishRendering();
}
};
FrameView = class extends View {
missing() {
this.element.innerHTML = `Content missing`;
}
get snapshot() {
return new Snapshot(this.element);
}
};
LinkInterceptor = class {
constructor(delegate, element) {
this.delegate = delegate;
this.element = element;
}
start() {
this.element.addEventListener("click", this.clickBubbled);
document.addEventListener("turbo:click", this.linkClicked);
document.addEventListener("turbo:before-visit", this.willVisit);
}
stop() {
this.element.removeEventListener("click", this.clickBubbled);
document.removeEventListener("turbo:click", this.linkClicked);
document.removeEventListener("turbo:before-visit", this.willVisit);
}
clickBubbled = (event2) => {
if (this.clickEventIsSignificant(event2)) {
this.clickEvent = event2;
} else {
delete this.clickEvent;
}
};
linkClicked = (event2) => {
if (this.clickEvent && this.clickEventIsSignificant(event2)) {
if (this.delegate.shouldInterceptLinkClick(event2.target, event2.detail.url, event2.detail.originalEvent)) {
this.clickEvent.preventDefault();
event2.preventDefault();
this.delegate.linkClickIntercepted(event2.target, event2.detail.url, event2.detail.originalEvent);
}
}
delete this.clickEvent;
};
willVisit = (_event) => {
delete this.clickEvent;
};
clickEventIsSignificant(event2) {
const target = event2.composed ? event2.target?.parentElement : event2.target;
const element = findLinkFromClickTarget(target) || target;
return element instanceof Element && element.closest("turbo-frame, html") == this.element;
}
};
LinkClickObserver = class {
started = false;
constructor(delegate, eventTarget) {
this.delegate = delegate;
this.eventTarget = eventTarget;
}
start() {
if (!this.started) {
this.eventTarget.addEventListener("click", this.clickCaptured, true);
this.started = true;
}
}
stop() {
if (this.started) {
this.eventTarget.removeEventListener("click", this.clickCaptured, true);
this.started = false;
}
}
clickCaptured = () => {
this.eventTarget.removeEventListener("click", this.clickBubbled, false);
this.eventTarget.addEventListener("click", this.clickBubbled, false);
};
clickBubbled = (event2) => {
if (event2 instanceof MouseEvent && this.clickEventIsSignificant(event2)) {
const target = event2.composedPath && event2.composedPath()[0] || event2.target;
const link = findLinkFromClickTarget(target);
if (link && doesNotTargetIFrame(link.target)) {
const location2 = getLocationForLink(link);
if (this.delegate.willFollowLinkToLocation(link, location2, event2)) {
event2.preventDefault();
this.delegate.followedLinkToLocation(link, location2);
}
}
}
};
clickEventIsSignificant(event2) {
return !(event2.target && event2.target.isContentEditable || event2.defaultPrevented || event2.which > 1 || event2.altKey || event2.ctrlKey || event2.metaKey || event2.shiftKey);
}
};
FormLinkClickObserver = class {
constructor(delegate, element) {
this.delegate = delegate;
this.linkInterceptor = new LinkClickObserver(this, element);
}
start() {
this.linkInterceptor.start();
}
stop() {
this.linkInterceptor.stop();
}
canPrefetchRequestToLocation(link, location2) {
return false;
}
prefetchAndCacheRequestToLocation(link, location2) {
return;
}
willFollowLinkToLocation(link, location2, originalEvent) {
return this.delegate.willSubmitFormLinkToLocation(link, location2, originalEvent) && (link.hasAttribute("data-turbo-method") || link.hasAttribute("data-turbo-stream"));
}
followedLinkToLocation(link, location2) {
const form = document.createElement("form");
const type = "hidden";
for (const [name, value] of location2.searchParams) {
form.append(Object.assign(document.createElement("input"), { type, name, value }));
}
const action = Object.assign(location2, { search: "" });
form.setAttribute("data-turbo", "true");
form.setAttribute("action", action.href);
form.setAttribute("hidden", "");
const method = link.getAttribute("data-turbo-method");
if (method)
form.setAttribute("method", method);
const turboFrame = link.getAttribute("data-turbo-frame");
if (turboFrame)
form.setAttribute("data-turbo-frame", turboFrame);
const turboAction = getVisitAction(link);
if (turboAction)
form.setAttribute("data-turbo-action", turboAction);
const turboConfirm = link.getAttribute("data-turbo-confirm");
if (turboConfirm)
form.setAttribute("data-turbo-confirm", turboConfirm);
const turboStream = link.hasAttribute("data-turbo-stream");
if (turboStream)
form.setAttribute("data-turbo-stream", "");
this.delegate.submittedFormLinkToLocation(link, location2, form);
document.body.appendChild(form);
form.addEventListener("turbo:submit-end", () => form.remove(), { once: true });
requestAnimationFrame(() => form.requestSubmit());
}
};
Bardo = class {
static async preservingPermanentElements(delegate, permanentElementMap, callback2) {
const bardo = new this(delegate, permanentElementMap);
bardo.enter();
await callback2();
bardo.leave();
}
constructor(delegate, permanentElementMap) {
this.delegate = delegate;
this.permanentElementMap = permanentElementMap;
}
enter() {
for (const id in this.permanentElementMap) {
const [currentPermanentElement, newPermanentElement] = this.permanentElementMap[id];
this.delegate.enteringBardo(currentPermanentElement, newPermanentElement);
this.replaceNewPermanentElementWithPlaceholder(newPermanentElement);
}
}
leave() {
for (const id in this.permanentElementMap) {
const [currentPermanentElement] = this.permanentElementMap[id];
this.replaceCurrentPermanentElementWithClone(currentPermanentElement);
this.replacePlaceholderWithPermanentElement(currentPermanentElement);
this.delegate.leavingBardo(currentPermanentElement);
}
}
replaceNewPermanentElementWithPlaceholder(permanentElement) {
const placeholder = createPlaceholderForPermanentElement(permanentElement);
permanentElement.replaceWith(placeholder);
}
replaceCurrentPermanentElementWithClone(permanentElement) {
const clone5 = permanentElement.cloneNode(true);
permanentElement.replaceWith(clone5);
}
replacePlaceholderWithPermanentElement(permanentElement) {
const placeholder = this.getPlaceholderById(permanentElement.id);
placeholder?.replaceWith(permanentElement);
}
getPlaceholderById(id) {
return this.placeholders.find((element) => element.content == id);
}
get placeholders() {
return [...document.querySelectorAll("meta[name=turbo-permanent-placeholder][content]")];
}
};
Renderer = class {
#activeElement = null;
static renderElement(currentElement, newElement) {
}
constructor(currentSnapshot, newSnapshot, isPreview, willRender = true) {
this.currentSnapshot = currentSnapshot;
this.newSnapshot = newSnapshot;
this.isPreview = isPreview;
this.willRender = willRender;
this.renderElement = this.constructor.renderElement;
this.promise = new Promise((resolve3, reject) => this.resolvingFunctions = { resolve: resolve3, reject });
}
get shouldRender() {
return true;
}
get shouldAutofocus() {
return true;
}
get reloadReason() {
return;
}
prepareToRender() {
return;
}
render() {
}
finishRendering() {
if (this.resolvingFunctions) {
this.resolvingFunctions.resolve();
delete this.resolvingFunctions;
}
}
async preservingPermanentElements(callback2) {
await Bardo.preservingPermanentElements(this, this.permanentElementMap, callback2);
}
focusFirstAutofocusableElement() {
if (this.shouldAutofocus) {
const element = this.connectedSnapshot.firstAutofocusableElement;
if (element) {
element.focus();
}
}
}
enteringBardo(currentPermanentElement) {
if (this.#activeElement)
return;
if (currentPermanentElement.contains(this.currentSnapshot.activeElement)) {
this.#activeElement = this.currentSnapshot.activeElement;
}
}
leavingBardo(currentPermanentElement) {
if (currentPermanentElement.contains(this.#activeElement) && this.#activeElement instanceof HTMLElement) {
this.#activeElement.focus();
this.#activeElement = null;
}
}
get connectedSnapshot() {
return this.newSnapshot.isConnected ? this.newSnapshot : this.currentSnapshot;
}
get currentElement() {
return this.currentSnapshot.element;
}
get newElement() {
return this.newSnapshot.element;
}
get permanentElementMap() {
return this.currentSnapshot.getPermanentElementMapForSnapshot(this.newSnapshot);
}
get renderMethod() {
return "replace";
}
};
FrameRenderer = class extends Renderer {
static renderElement(currentElement, newElement) {
const destinationRange = document.createRange();
destinationRange.selectNodeContents(currentElement);
destinationRange.deleteContents();
const frameElement = newElement;
const sourceRange = frameElement.ownerDocument?.createRange();
if (sourceRange) {
sourceRange.selectNodeContents(frameElement);
currentElement.appendChild(sourceRange.extractContents());
}
}
constructor(delegate, currentSnapshot, newSnapshot, renderElement, isPreview, willRender = true) {
super(currentSnapshot, newSnapshot, renderElement, isPreview, willRender);
this.delegate = delegate;
}
get shouldRender() {
return true;
}
async render() {
await nextRepaint();
this.preservingPermanentElements(() => {
this.loadFrameElement();
});
this.scrollFrameIntoView();
await nextRepaint();
this.focusFirstAutofocusableElement();
await nextRepaint();
this.activateScriptElements();
}
loadFrameElement() {
this.delegate.willRenderFrame(this.currentElement, this.newElement);
this.renderElement(this.currentElement, this.newElement);
}
scrollFrameIntoView() {
if (this.currentElement.autoscroll || this.newElement.autoscroll) {
const element = this.currentElement.firstElementChild;
const block = readScrollLogicalPosition(this.currentElement.getAttribute("data-autoscroll-block"), "end");
const behavior = readScrollBehavior(this.currentElement.getAttribute("data-autoscroll-behavior"), "auto");
if (element) {
element.scrollIntoView({ block, behavior });
return true;
}
}
return false;
}
activateScriptElements() {
for (const inertScriptElement of this.newScriptElements) {
const activatedScriptElement = activateScriptElement(inertScriptElement);
inertScriptElement.replaceWith(activatedScriptElement);
}
}
get newScriptElements() {
return this.currentElement.querySelectorAll("script");
}
};
Idiomorph = function() {
let EMPTY_SET = /* @__PURE__ */ new Set();
let defaults5 = {
morphStyle: "outerHTML",
callbacks: {
beforeNodeAdded: noOp,
afterNodeAdded: noOp,
beforeNodeMorphed: noOp,
afterNodeMorphed: noOp,
beforeNodeRemoved: noOp,
afterNodeRemoved: noOp,
beforeAttributeUpdated: noOp
},
head: {
style: "merge",
shouldPreserve: function(elt) {
return elt.getAttribute("im-preserve") === "true";
},
shouldReAppend: function(elt) {
return elt.getAttribute("im-re-append") === "true";
},
shouldRemove: noOp,
afterHeadMorphed: noOp
}
};
function morph2(oldNode, newContent, config2 = {}) {
if (oldNode instanceof Document) {
oldNode = oldNode.documentElement;
}
if (typeof newContent === "string") {
newContent = parseContent(newContent);
}
let normalizedContent = normalizeContent(newContent);
let ctx = createMorphContext(oldNode, normalizedContent, config2);
return morphNormalizedContent(oldNode, normalizedContent, ctx);
}
function morphNormalizedContent(oldNode, normalizedNewContent, ctx) {
if (ctx.head.block) {
let oldHead = oldNode.querySelector("head");
let newHead = normalizedNewContent.querySelector("head");
if (oldHead && newHead) {
let promises = handleHeadElement(newHead, oldHead, ctx);
Promise.all(promises).then(function() {
morphNormalizedContent(oldNode, normalizedNewContent, Object.assign(ctx, {
head: {
block: false,
ignore: true
}
}));
});
return;
}
}
if (ctx.morphStyle === "innerHTML") {
morphChildren2(normalizedNewContent, oldNode, ctx);
return oldNode.children;
} else if (ctx.morphStyle === "outerHTML" || ctx.morphStyle == null) {
let bestMatch = findBestNodeMatch(normalizedNewContent, oldNode, ctx);
let previousSibling = bestMatch?.previousSibling;
let nextSibling = bestMatch?.nextSibling;
let morphedNode = morphOldNodeTo(oldNode, bestMatch, ctx);
if (bestMatch) {
return insertSiblings(previousSibling, morphedNode, nextSibling);
} else {
return [];
}
} else {
throw "Do not understand how to morph style " + ctx.morphStyle;
}
}
function ignoreValueOfActiveElement(possibleActiveElement, ctx) {
return ctx.ignoreActiveValue && possibleActiveElement === document.activeElement && possibleActiveElement !== document.body;
}
function morphOldNodeTo(oldNode, newContent, ctx) {
if (ctx.ignoreActive && oldNode === document.activeElement)
;
else if (newContent == null) {
if (ctx.callbacks.beforeNodeRemoved(oldNode) === false)
return oldNode;
oldNode.remove();
ctx.callbacks.afterNodeRemoved(oldNode);
return null;
} else if (!isSoftMatch(oldNode, newContent)) {
if (ctx.callbacks.beforeNodeRemoved(oldNode) === false)
return oldNode;
if (ctx.callbacks.beforeNodeAdded(newContent) === false)
return oldNode;
oldNode.parentElement.replaceChild(newContent, oldNode);
ctx.callbacks.afterNodeAdded(newContent);
ctx.callbacks.afterNodeRemoved(oldNode);
return newContent;
} else {
if (ctx.callbacks.beforeNodeMorphed(oldNode, newContent) === false)
return oldNode;
if (oldNode instanceof HTMLHeadElement && ctx.head.ignore)
;
else if (oldNode instanceof HTMLHeadElement && ctx.head.style !== "morph") {
handleHeadElement(newContent, oldNode, ctx);
} else {
syncNodeFrom(newContent, oldNode, ctx);
if (!ignoreValueOfActiveElement(oldNode, ctx)) {
morphChildren2(newContent, oldNode, ctx);
}
}
ctx.callbacks.afterNodeMorphed(oldNode, newContent);
return oldNode;
}
}
function morphChildren2(newParent, oldParent, ctx) {
let nextNewChild = newParent.firstChild;
let insertionPoint = oldParent.firstChild;
let newChild;
while (nextNewChild) {
newChild = nextNewChild;
nextNewChild = newChild.nextSibling;
if (insertionPoint == null) {
if (ctx.callbacks.beforeNodeAdded(newChild) === false)
return;
oldParent.appendChild(newChild);
ctx.callbacks.afterNodeAdded(newChild);
removeIdsFromConsideration(ctx, newChild);
continue;
}
if (isIdSetMatch(newChild, insertionPoint, ctx)) {
morphOldNodeTo(insertionPoint, newChild, ctx);
insertionPoint = insertionPoint.nextSibling;
removeIdsFromConsideration(ctx, newChild);
continue;
}
let idSetMatch = findIdSetMatch(newParent, oldParent, newChild, insertionPoint, ctx);
if (idSetMatch) {
insertionPoint = removeNodesBetween(insertionPoint, idSetMatch, ctx);
morphOldNodeTo(idSetMatch, newChild, ctx);
removeIdsFromConsideration(ctx, newChild);
continue;
}
let softMatch = findSoftMatch(newParent, oldParent, newChild, insertionPoint, ctx);
if (softMatch) {
insertionPoint = removeNodesBetween(insertionPoint, softMatch, ctx);
morphOldNodeTo(softMatch, newChild, ctx);
removeIdsFromConsideration(ctx, newChild);
continue;
}
if (ctx.callbacks.beforeNodeAdded(newChild) === false)
return;
oldParent.insertBefore(newChild, insertionPoint);
ctx.callbacks.afterNodeAdded(newChild);
removeIdsFromConsideration(ctx, newChild);
}
while (insertionPoint !== null) {
let tempNode = insertionPoint;
insertionPoint = insertionPoint.nextSibling;
removeNode(tempNode, ctx);
}
}
function ignoreAttribute(attr, to, updateType, ctx) {
if (attr === "value" && ctx.ignoreActiveValue && to === document.activeElement) {
return true;
}
return ctx.callbacks.beforeAttributeUpdated(attr, to, updateType) === false;
}
function syncNodeFrom(from, to, ctx) {
let type = from.nodeType;
if (type === 1) {
const fromAttributes = from.attributes;
const toAttributes = to.attributes;
for (const fromAttribute of fromAttributes) {
if (ignoreAttribute(fromAttribute.name, to, "update", ctx)) {
continue;
}
if (to.getAttribute(fromAttribute.name) !== fromAttribute.value) {
to.setAttribute(fromAttribute.name, fromAttribute.value);
}
}
for (let i5 = toAttributes.length - 1; 0 <= i5; i5--) {
const toAttribute = toAttributes[i5];
if (ignoreAttribute(toAttribute.name, to, "remove", ctx)) {
continue;
}
if (!from.hasAttribute(toAttribute.name)) {
to.removeAttribute(toAttribute.name);
}
}
}
if (type === 8 || type === 3) {
if (to.nodeValue !== from.nodeValue) {
to.nodeValue = from.nodeValue;
}
}
if (!ignoreValueOfActiveElement(to, ctx)) {
syncInputValue(from, to, ctx);
}
}
function syncBooleanAttribute(from, to, attributeName, ctx) {
if (from[attributeName] !== to[attributeName]) {
let ignoreUpdate = ignoreAttribute(attributeName, to, "update", ctx);
if (!ignoreUpdate) {
to[attributeName] = from[attributeName];
}
if (from[attributeName]) {
if (!ignoreUpdate) {
to.setAttribute(attributeName, from[attributeName]);
}
} else {
if (!ignoreAttribute(attributeName, to, "remove", ctx)) {
to.removeAttribute(attributeName);
}
}
}
}
function syncInputValue(from, to, ctx) {
if (from instanceof HTMLInputElement && to instanceof HTMLInputElement && from.type !== "file") {
let fromValue = from.value;
let toValue = to.value;
syncBooleanAttribute(from, to, "checked", ctx);
syncBooleanAttribute(from, to, "disabled", ctx);
if (!from.hasAttribute("value")) {
if (!ignoreAttribute("value", to, "remove", ctx)) {
to.value = "";
to.removeAttribute("value");
}
} else if (fromValue !== toValue) {
if (!ignoreAttribute("value", to, "update", ctx)) {
to.setAttribute("value", fromValue);
to.value = fromValue;
}
}
} else if (from instanceof HTMLOptionElement) {
syncBooleanAttribute(from, to, "selected", ctx);
} else if (from instanceof HTMLTextAreaElement && to instanceof HTMLTextAreaElement) {
let fromValue = from.value;
let toValue = to.value;
if (ignoreAttribute("value", to, "update", ctx)) {
return;
}
if (fromValue !== toValue) {
to.value = fromValue;
}
if (to.firstChild && to.firstChild.nodeValue !== fromValue) {
to.firstChild.nodeValue = fromValue;
}
}
}
function handleHeadElement(newHeadTag, currentHead, ctx) {
let added = [];
let removed = [];
let preserved = [];
let nodesToAppend = [];
let headMergeStyle = ctx.head.style;
let srcToNewHeadNodes = /* @__PURE__ */ new Map();
for (const newHeadChild of newHeadTag.children) {
srcToNewHeadNodes.set(newHeadChild.outerHTML, newHeadChild);
}
for (const currentHeadElt of currentHead.children) {
let inNewContent = srcToNewHeadNodes.has(currentHeadElt.outerHTML);
let isReAppended = ctx.head.shouldReAppend(currentHeadElt);
let isPreserved = ctx.head.shouldPreserve(currentHeadElt);
if (inNewContent || isPreserved) {
if (isReAppended) {
removed.push(currentHeadElt);
} else {
srcToNewHeadNodes.delete(currentHeadElt.outerHTML);
preserved.push(currentHeadElt);
}
} else {
if (headMergeStyle === "append") {
if (isReAppended) {
removed.push(currentHeadElt);
nodesToAppend.push(currentHeadElt);
}
} else {
if (ctx.head.shouldRemove(currentHeadElt) !== false) {
removed.push(currentHeadElt);
}
}
}
}
nodesToAppend.push(...srcToNewHeadNodes.values());
let promises = [];
for (const newNode of nodesToAppend) {
let newElt = document.createRange().createContextualFragment(newNode.outerHTML).firstChild;
if (ctx.callbacks.beforeNodeAdded(newElt) !== false) {
if (newElt.href || newElt.src) {
let resolve3 = null;
let promise = new Promise(function(_resolve2) {
resolve3 = _resolve2;
});
newElt.addEventListener("load", function() {
resolve3();
});
promises.push(promise);
}
currentHead.appendChild(newElt);
ctx.callbacks.afterNodeAdded(newElt);
added.push(newElt);
}
}
for (const removedElement of removed) {
if (ctx.callbacks.beforeNodeRemoved(removedElement) !== false) {
currentHead.removeChild(removedElement);
ctx.callbacks.afterNodeRemoved(removedElement);
}
}
ctx.head.afterHeadMorphed(currentHead, { added, kept: preserved, removed });
return promises;
}
function noOp() {
}
function mergeDefaults(config2) {
let finalConfig = {};
Object.assign(finalConfig, defaults5);
Object.assign(finalConfig, config2);
finalConfig.callbacks = {};
Object.assign(finalConfig.callbacks, defaults5.callbacks);
Object.assign(finalConfig.callbacks, config2.callbacks);
finalConfig.head = {};
Object.assign(finalConfig.head, defaults5.head);
Object.assign(finalConfig.head, config2.head);
return finalConfig;
}
function createMorphContext(oldNode, newContent, config2) {
config2 = mergeDefaults(config2);
return {
target: oldNode,
newContent,
config: config2,
morphStyle: config2.morphStyle,
ignoreActive: config2.ignoreActive,
ignoreActiveValue: config2.ignoreActiveValue,
idMap: createIdMap(oldNode, newContent),
deadIds: /* @__PURE__ */ new Set(),
callbacks: config2.callbacks,
head: config2.head
};
}
function isIdSetMatch(node1, node2, ctx) {
if (node1 == null || node2 == null) {
return false;
}
if (node1.nodeType === node2.nodeType && node1.tagName === node2.tagName) {
if (node1.id !== "" && node1.id === node2.id) {
return true;
} else {
return getIdIntersectionCount(ctx, node1, node2) > 0;
}
}
return false;
}
function isSoftMatch(node1, node2) {
if (node1 == null || node2 == null) {
return false;
}
return node1.nodeType === node2.nodeType && node1.tagName === node2.tagName;
}
function removeNodesBetween(startInclusive, endExclusive, ctx) {
while (startInclusive !== endExclusive) {
let tempNode = startInclusive;
startInclusive = startInclusive.nextSibling;
removeNode(tempNode, ctx);
}
removeIdsFromConsideration(ctx, endExclusive);
return endExclusive.nextSibling;
}
function findIdSetMatch(newContent, oldParent, newChild, insertionPoint, ctx) {
let newChildPotentialIdCount = getIdIntersectionCount(ctx, newChild, oldParent);
let potentialMatch = null;
if (newChildPotentialIdCount > 0) {
let potentialMatch2 = insertionPoint;
let otherMatchCount = 0;
while (potentialMatch2 != null) {
if (isIdSetMatch(newChild, potentialMatch2, ctx)) {
return potentialMatch2;
}
otherMatchCount += getIdIntersectionCount(ctx, potentialMatch2, newContent);
if (otherMatchCount > newChildPotentialIdCount) {
return null;
}
potentialMatch2 = potentialMatch2.nextSibling;
}
}
return potentialMatch;
}
function findSoftMatch(newContent, oldParent, newChild, insertionPoint, ctx) {
let potentialSoftMatch = insertionPoint;
let nextSibling = newChild.nextSibling;
let siblingSoftMatchCount = 0;
while (potentialSoftMatch != null) {
if (getIdIntersectionCount(ctx, potentialSoftMatch, newContent) > 0) {
return null;
}
if (isSoftMatch(newChild, potentialSoftMatch)) {
return potentialSoftMatch;
}
if (isSoftMatch(nextSibling, potentialSoftMatch)) {
siblingSoftMatchCount++;
nextSibling = nextSibling.nextSibling;
if (siblingSoftMatchCount >= 2) {
return null;
}
}
potentialSoftMatch = potentialSoftMatch.nextSibling;
}
return potentialSoftMatch;
}
function parseContent(newContent) {
let parser = new DOMParser();
let contentWithSvgsRemoved = newContent.replace(/