From 493a4f7042bad7f883981b10cdc02fe0d36a5fb0 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Thu, 16 Mar 2023 20:22:02 -0700 Subject: [PATCH] =?UTF-8?q?fix(es/minifier):=20Remove=20wrong=20optimizati?= =?UTF-8?q?on=20of=20`new=20RegExp(=E2=80=A6)`=20(#7091)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/compress/pure/misc.rs | 45 +++++++++++++++++-- .../tests/benches-full/echarts.js | 2 +- .../tests/benches-full/jquery.js | 4 +- .../tests/benches-full/moment.js | 2 +- .../tests/benches-full/terser.js | 10 ++--- .../tests/fixture/issues/2257/full/output.js | 4 +- .../issues/firebase-firestore/1/output.js | 2 +- .../tests/fixture/issues/moment/1/output.js | 2 +- .../tests/fixture/next/chakra/output.js | 2 +- .../8a28b14e.d8fbda268ed281a1/output.js | 8 ++-- .../fixture/next/react-pdf-renderer/output.js | 8 ++-- .../syncfusion/933-e9f9a6bf671b96fc/output.js | 16 +++---- .../chunks/main-04b5934c26266542/output.js | 4 +- .../2c796e83-0724e2af5f19128a/output.js | 2 +- .../tests/projects/output/angular-1.2.5.js | 6 +-- .../tests/projects/output/jquery-1.9.1.js | 4 +- .../tests/projects/output/mootools-1.4.5.js | 2 +- 17 files changed, 81 insertions(+), 42 deletions(-) diff --git a/crates/swc_ecma_minifier/src/compress/pure/misc.rs b/crates/swc_ecma_minifier/src/compress/pure/misc.rs index 7c37d081034..9ab04642c05 100644 --- a/crates/swc_ecma_minifier/src/compress/pure/misc.rs +++ b/crates/swc_ecma_minifier/src/compress/pure/misc.rs @@ -16,6 +16,46 @@ use crate::compress::{ pure::strings::{convert_str_value_to_tpl_cooked, convert_str_value_to_tpl_raw}, util::is_pure_undefined, }; + +fn is_definitely_string(expr: &Expr) -> bool { + match expr { + Expr::Lit(Lit::Str(_)) => true, + Expr::Tpl(_) => true, + Expr::Bin(BinExpr { + op: BinaryOp::Add, + left, + right, + .. + }) => is_definitely_string(left) || is_definitely_string(right), + Expr::Paren(ParenExpr { expr, .. }) => is_definitely_string(expr), + _ => false, + } +} + +/// Check whether we can compress `new RegExp(…)` to `RegExp(…)`. That's sound +/// unless the first argument is already a RegExp object and the second is +/// undefined. We check for the common case where we can prove one of the first +/// two arguments is a string. +fn can_compress_new_regexp(args: Option<&[ExprOrSpread]>) -> bool { + if let Some(args) = args { + if let Some(first) = args.first() { + if first.spread.is_some() { + false + } else if is_definitely_string(&first.expr) { + true + } else if let Some(second) = args.get(1) { + second.spread.is_none() && is_definitely_string(&second.expr) + } else { + false + } + } else { + true + } + } else { + true + } +} + impl Pure<'_> { pub(super) fn remove_invalid(&mut self, e: &mut Expr) { match e { @@ -555,8 +595,6 @@ impl Pure<'_> { "Array", // https://262.ecma-international.org/12.0/#sec-function-constructor "Function", - // https://262.ecma-international.org/12.0/#sec-regexp-constructor - "RegExp", // https://262.ecma-international.org/12.0/#sec-error-constructor "Error", // https://262.ecma-international.org/12.0/#sec-aggregate-error-constructor @@ -569,7 +607,8 @@ impl Pure<'_> { "TypeError", "URIError", ], - ) => + ) || (callee.is_global_ref_to(&self.expr_ctx, "RegExp") + && can_compress_new_regexp(args.as_deref())) => { self.changed = true; report_change!( diff --git a/crates/swc_ecma_minifier/tests/benches-full/echarts.js b/crates/swc_ecma_minifier/tests/benches-full/echarts.js index 3d240b5fc38..691a3815e7a 100644 --- a/crates/swc_ecma_minifier/tests/benches-full/echarts.js +++ b/crates/swc_ecma_minifier/tests/benches-full/echarts.js @@ -40811,7 +40811,7 @@ '<>': 'ne' }, RegExpEvaluator = function() { function RegExpEvaluator(rVal) { - null == (this._condVal = isString(rVal) ? RegExp(rVal) : isRegExp(rVal) ? rVal : null) && throwError(makePrintable('Illegal regexp', rVal, 'in')); + null == (this._condVal = isString(rVal) ? new RegExp(rVal) : isRegExp(rVal) ? rVal : null) && throwError(makePrintable('Illegal regexp', rVal, 'in')); } return RegExpEvaluator.prototype.evaluate = function(lVal) { var type = typeof lVal; diff --git a/crates/swc_ecma_minifier/tests/benches-full/jquery.js b/crates/swc_ecma_minifier/tests/benches-full/jquery.js index 34a06f7e468..f98b732dc51 100644 --- a/crates/swc_ecma_minifier/tests/benches-full/jquery.js +++ b/crates/swc_ecma_minifier/tests/benches-full/jquery.js @@ -153,7 +153,7 @@ }, hasOwn = {}.hasOwnProperty, arr = [], pop = arr.pop, pushNative = arr.push, push = arr.push, slice = arr.slice, indexOf = function(list, elem) { for(var i = 0, len = list.length; i < len; i++)if (list[i] === elem) return i; return -1; - }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", whitespace = "[\\x20\\t\\r\\n\\f]", identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + "*([*^$|!~]?=)" + whitespace + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + identifier + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|.*)\\)|)", rwhitespace = RegExp(whitespace + "+", "g"), rtrim = RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"), rcomma = RegExp("^" + whitespace + "*," + whitespace + "*"), rcombinators = RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"), rdescend = RegExp(whitespace + "|>"), rpseudo = RegExp(pseudos), ridentifier = RegExp("^" + identifier + "$"), matchExpr = { + }, booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", whitespace = "[\\x20\\t\\r\\n\\f]", identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + "*([*^$|!~]?=)" + whitespace + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + "*\\]", pseudos = ":(" + identifier + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|.*)\\)|)", rwhitespace = RegExp(whitespace + "+", "g"), rtrim = RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"), rcomma = RegExp("^" + whitespace + "*," + whitespace + "*"), rcombinators = RegExp("^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*"), rdescend = RegExp(whitespace + "|>"), rpseudo = new RegExp(pseudos), ridentifier = RegExp("^" + identifier + "$"), matchExpr = { ID: RegExp("^#(" + identifier + ")"), CLASS: RegExp("^\\.(" + identifier + ")"), TAG: RegExp("^(" + identifier + "|[*])"), @@ -327,7 +327,7 @@ input.setAttribute("type", "hidden"), el.appendChild(input).setAttribute("name", "D"), el.querySelectorAll("[name=d]").length && rbuggyQSA.push("name" + whitespace + "*[*^$|!~]?="), 2 !== el.querySelectorAll(":enabled").length && rbuggyQSA.push(":enabled", ":disabled"), docElem.appendChild(el).disabled = !0, 2 !== el.querySelectorAll(":disabled").length && rbuggyQSA.push(":enabled", ":disabled"), el.querySelectorAll("*,:x"), rbuggyQSA.push(",.*:"); })), (support.matchesSelector = rnative.test(matches = docElem.matches || docElem.webkitMatchesSelector || docElem.mozMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector)) && assert(function(el) { support.disconnectedMatch = matches.call(el, "*"), matches.call(el, "[s!='']:x"), rbuggyMatches.push("!=", pseudos); - }), rbuggyQSA = rbuggyQSA.length && RegExp(rbuggyQSA.join("|")), rbuggyMatches = rbuggyMatches.length && RegExp(rbuggyMatches.join("|")), contains = (hasCompare = rnative.test(docElem.compareDocumentPosition)) || rnative.test(docElem.contains) ? function(a, b) { + }), rbuggyQSA = rbuggyQSA.length && new RegExp(rbuggyQSA.join("|")), rbuggyMatches = rbuggyMatches.length && new RegExp(rbuggyMatches.join("|")), contains = (hasCompare = rnative.test(docElem.compareDocumentPosition)) || rnative.test(docElem.contains) ? function(a, b) { var adown = 9 === a.nodeType ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!(bup && 1 === bup.nodeType && (adown.contains ? adown.contains(bup) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(bup))); } : function(a, b) { diff --git a/crates/swc_ecma_minifier/tests/benches-full/moment.js b/crates/swc_ecma_minifier/tests/benches-full/moment.js index bbb8045563a..cca88a011d7 100644 --- a/crates/swc_ecma_minifier/tests/benches-full/moment.js +++ b/crates/swc_ecma_minifier/tests/benches-full/moment.js @@ -784,7 +784,7 @@ } config._a = [], getParsingFlags(config).empty = !0; var locale, hour, meridiem, isPm, i, parsedInput, tokens1, token, skipped, era, string = '' + config._i, stringLength = string.length, totalParsedInputLength = 0; - for(i = 0, tokens1 = expandFormat(config._f, config._locale).match(formattingTokens) || []; i < tokens1.length; i++)(token = tokens1[i], (parsedInput = (string.match(hasOwnProp(regexes, token) ? regexes[token](config._strict, config._locale) : RegExp(regexEscape(token.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function(matched, p1, p2, p3, p4) { + for(i = 0, tokens1 = expandFormat(config._f, config._locale).match(formattingTokens) || []; i < tokens1.length; i++)(token = tokens1[i], (parsedInput = (string.match(hasOwnProp(regexes, token) ? regexes[token](config._strict, config._locale) : new RegExp(regexEscape(token.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function(matched, p1, p2, p3, p4) { return p1 || p2 || p3 || p4; })))) || [])[0]) && ((skipped = string.substr(0, string.indexOf(parsedInput))).length > 0 && getParsingFlags(config).unusedInput.push(skipped), string = string.slice(string.indexOf(parsedInput) + parsedInput.length), totalParsedInputLength += parsedInput.length), formatTokenFunctions[token]) ? (parsedInput ? getParsingFlags(config).empty = !1 : getParsingFlags(config).unusedTokens.push(token), null != parsedInput && hasOwnProp(tokens, token) && tokens[token](parsedInput, config._a, config, token)) : config._strict && !parsedInput && getParsingFlags(config).unusedTokens.push(token); getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength, string.length > 0 && getParsingFlags(config).unusedInput.push(string), config._a[3] <= 12 && !0 === getParsingFlags(config).bigHour && config._a[3] > 0 && (getParsingFlags(config).bigHour = void 0), getParsingFlags(config).parsedDateParts = config._a.slice(0), getParsingFlags(config).meridiem = config._meridiem, config._a[3] = (locale = config._locale, hour = config._a[3], null == (meridiem = config._meridiem) ? hour : null != locale.meridiemHour ? locale.meridiemHour(hour, meridiem) : (null != locale.isPM && ((isPm = locale.isPM(meridiem)) && hour < 12 && (hour += 12), isPm || 12 !== hour || (hour = 0)), hour)), null !== (era = getParsingFlags(config).era) && (config._a[0] = config._locale.erasConvertYear(era, config._a[0])), configFromArray(config), checkOverflow(config); diff --git a/crates/swc_ecma_minifier/tests/benches-full/terser.js b/crates/swc_ecma_minifier/tests/benches-full/terser.js index b6661b8c3bb..8298d4b8084 100644 --- a/crates/swc_ecma_minifier/tests/benches-full/terser.js +++ b/crates/swc_ecma_minifier/tests/benches-full/terser.js @@ -4174,7 +4174,7 @@ let comments = options.comments; if ("string" == typeof options.comments && /^\/.*\/[a-zA-Z]*$/.test(options.comments)) { var regex_pos = options.comments.lastIndexOf("/"); - comments = RegExp(options.comments.substr(1, regex_pos - 1), options.comments.substr(regex_pos + 1)); + comments = new RegExp(options.comments.substr(1, regex_pos - 1), options.comments.substr(regex_pos + 1)); } comment_filter = comments instanceof RegExp ? function(comment) { return "comment5" != comment.type && comments.test(comment.value); @@ -8393,7 +8393,7 @@ return params.push(value), arg !== value; })) { let [source, flags] = params; - source = regexp_source_fix(RegExp(source).source); + source = regexp_source_fix(new RegExp(source).source); const rx = make_node(AST_RegExp, self1, { value: { source, @@ -17715,7 +17715,7 @@ }(reserved); var cname = -1; cache = options.cache ? options.cache.props : new Map(); - var regex = options.regex && RegExp(options.regex), debug = !1 !== options.debug; + var regex = options.regex && new RegExp(options.regex), debug = !1 !== options.debug; debug && (debug_name_suffix = !0 === options.debug ? "" : options.debug); var names_to_mangle = new Set(), unmangleable = new Set(); cache.forEach((mangled_name)=>unmangleable.add(mangled_name)); @@ -17956,7 +17956,7 @@ }), (node)=>{ if (node instanceof AST_Assign) { var name = node.left.print_to_string(), value = node.right; - return flag ? options[name] = value : value instanceof AST_Array ? options[name] = value.elements.map(to_string) : value instanceof AST_RegExp ? (value = value.value, options[name] = RegExp(value.source, value.flags)) : options[name] = to_string(value), !0; + return flag ? options[name] = value : value instanceof AST_Array ? options[name] = value.elements.map(to_string) : value instanceof AST_RegExp ? (value = value.value, options[name] = new RegExp(value.source, value.flags)) : options[name] = to_string(value), !0; } if (node instanceof AST_Symbol || node instanceof AST_PropAccess) { var name = node.print_to_string(); @@ -18003,7 +18003,7 @@ var entries = fs.readdirSync(dir); } catch (ex) {} if (entries) { - var rx = RegExp("^" + path.basename(glob).replace(/[.+^$[\]\\(){}]/g, "\\$&").replace(/\*/g, "[^/\\\\]*").replace(/\?/g, "[^/\\\\]") + "$", "win32" === process.platform ? "i" : ""), results = entries.filter(function(name) { + var pattern = "^" + path.basename(glob).replace(/[.+^$[\]\\(){}]/g, "\\$&").replace(/\*/g, "[^/\\\\]*").replace(/\?/g, "[^/\\\\]") + "$", mod = "win32" === process.platform ? "i" : "", rx = new RegExp(pattern, mod), results = entries.filter(function(name) { return rx.test(name); }).map(function(name) { return path.join(dir, name); diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/2257/full/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/2257/full/output.js index a8959458ce8..25ee300ff8c 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/2257/full/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/2257/full/output.js @@ -7324,7 +7324,7 @@ return [ function(regexp) { var O = requireObjectCoercible(this), matcher = void 0 == regexp ? void 0 : getMethod(regexp, MATCH); - return matcher ? matcher.call(regexp, O) : RegExp(regexp)[MATCH](toString1(O)); + return matcher ? matcher.call(regexp, O) : new RegExp(regexp)[MATCH](toString1(O)); }, function(string) { var result, rx = anObject(this), S = toString1(string), res = maybeCallNative(nativeMatch, rx, S); @@ -7468,7 +7468,7 @@ return [ function(regexp) { var O = requireObjectCoercible(this), searcher = void 0 == regexp ? void 0 : getMethod(regexp, SEARCH); - return searcher ? searcher.call(regexp, O) : RegExp(regexp)[SEARCH](toString1(O)); + return searcher ? searcher.call(regexp, O) : new RegExp(regexp)[SEARCH](toString1(O)); }, function(string) { var rx = anObject(this), S = toString1(string), res = maybeCallNative(nativeSearch, rx, S); diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/firebase-firestore/1/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/firebase-firestore/1/output.js index f3f5703f684..4e775b0dd3d 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/firebase-firestore/1/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/firebase-firestore/1/output.js @@ -457,7 +457,7 @@ } } _t.EMPTY_BYTE_STRING = new _t(""); - const mt = RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/); + const mt = new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/); function gt(t) { if (t || L(), "string" == typeof t) { let e = 0; diff --git a/crates/swc_ecma_minifier/tests/fixture/issues/moment/1/output.js b/crates/swc_ecma_minifier/tests/fixture/issues/moment/1/output.js index 9e4bb063cd9..1f18fd4baf1 100644 --- a/crates/swc_ecma_minifier/tests/fixture/issues/moment/1/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/issues/moment/1/output.js @@ -784,7 +784,7 @@ } config._a = [], getParsingFlags(config).empty = !0; var locale, hour, meridiem, isPm, i, parsedInput, tokens1, token, skipped, era, string = "" + config._i, stringLength = string.length, totalParsedInputLength = 0; - for(i = 0, tokens1 = expandFormat(config._f, config._locale).match(formattingTokens) || []; i < tokens1.length; i++)(token = tokens1[i], (parsedInput = (string.match(hasOwnProp(regexes, token) ? regexes[token](config._strict, config._locale) : RegExp(regexEscape(token.replace("\\", "").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function(matched, p1, p2, p3, p4) { + for(i = 0, tokens1 = expandFormat(config._f, config._locale).match(formattingTokens) || []; i < tokens1.length; i++)(token = tokens1[i], (parsedInput = (string.match(hasOwnProp(regexes, token) ? regexes[token](config._strict, config._locale) : new RegExp(regexEscape(token.replace("\\", "").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function(matched, p1, p2, p3, p4) { return p1 || p2 || p3 || p4; })))) || [])[0]) && ((skipped = string.substr(0, string.indexOf(parsedInput))).length > 0 && getParsingFlags(config).unusedInput.push(skipped), string = string.slice(string.indexOf(parsedInput) + parsedInput.length), totalParsedInputLength += parsedInput.length), formatTokenFunctions[token]) ? (parsedInput ? getParsingFlags(config).empty = !1 : getParsingFlags(config).unusedTokens.push(token), null != parsedInput && hasOwnProp(tokens, token) && tokens[token](parsedInput, config._a, config, token)) : config._strict && !parsedInput && getParsingFlags(config).unusedTokens.push(token); getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength, string.length > 0 && getParsingFlags(config).unusedInput.push(string), config._a[3] <= 12 && !0 === getParsingFlags(config).bigHour && config._a[3] > 0 && (getParsingFlags(config).bigHour = void 0), getParsingFlags(config).parsedDateParts = config._a.slice(0), getParsingFlags(config).meridiem = config._meridiem, config._a[3] = (locale = config._locale, hour = config._a[3], null == (meridiem = config._meridiem) ? hour : null != locale.meridiemHour ? locale.meridiemHour(hour, meridiem) : (null != locale.isPM && ((isPm = locale.isPM(meridiem)) && hour < 12 && (hour += 12), isPm || 12 !== hour || (hour = 0)), hour)), null !== (era = getParsingFlags(config).era) && (config._a[0] = config._locale.erasConvertYear(era, config._a[0])), configFromArray(config), checkOverflow(config); diff --git a/crates/swc_ecma_minifier/tests/fixture/next/chakra/output.js b/crates/swc_ecma_minifier/tests/fixture/next/chakra/output.js index 2895484fbad..3489495bdd8 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/chakra/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/chakra/output.js @@ -524,7 +524,7 @@ yellow: "#ffff00", yellowgreen: "#9acd32" }, CSS_UNIT = "(?:".concat("[-\\+]?\\d*\\.\\d+%?", ")|(?:").concat("[-\\+]?\\d+%?", ")"), PERMISSIVE_MATCH3 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?"), PERMISSIVE_MATCH4 = "[\\s|\\(]+(".concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")[,|\\s]+(").concat(CSS_UNIT, ")\\s*\\)?"), matchers = { - CSS_UNIT: RegExp(CSS_UNIT), + CSS_UNIT: new RegExp(CSS_UNIT), rgb: RegExp("rgb" + PERMISSIVE_MATCH3), rgba: RegExp("rgba" + PERMISSIVE_MATCH4), hsl: RegExp("hsl" + PERMISSIVE_MATCH3), diff --git a/crates/swc_ecma_minifier/tests/fixture/next/react-ace/chunks/8a28b14e.d8fbda268ed281a1/output.js b/crates/swc_ecma_minifier/tests/fixture/next/react-ace/chunks/8a28b14e.d8fbda268ed281a1/output.js index 86d851ccec0..540ccb6b5cd 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/react-ace/chunks/8a28b14e.d8fbda268ed281a1/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/react-ace/chunks/8a28b14e.d8fbda268ed281a1/output.js @@ -2958,7 +2958,7 @@ return inChClass ? inChClass = "]" != square : square ? inChClass = !0 : parenClose ? (stack == lastCapture.stack && (lastCapture.end = index + 1, lastCapture.stack = -1), stack--) : parenOpen && (stack++, 1 != parenOpen.length && (lastCapture.stack = stack, lastCapture.start = index)), m; }), null != lastCapture.end && /^\)*$/.test(src.substr(lastCapture.end)) && (src = src.substring(0, lastCapture.start) + src.substr(lastCapture.end)); } - return "^" != src.charAt(0) && (src = "^" + src), "$" != src.charAt(src.length - 1) && (src += "$"), RegExp(src, (flag || "").replace("g", "")); + return "^" != src.charAt(0) && (src = "^" + src), "$" != src.charAt(src.length - 1) && (src += "$"), new RegExp(src, (flag || "").replace("g", "")); }, this.getLineTokens = function(line, startState) { if (startState && "string" != typeof startState) { var stack = startState.slice(0); @@ -5361,7 +5361,7 @@ var iterator = new TokenIterator(this, row, column), token = iterator.getCurrentToken(), type = token && token.type; if (token && /^comment|string/.test(type)) { "comment" == (type = type.match(/comment|string/)[0]) && (type += "|doc-start"); - var re = RegExp(type), range = new Range(); + var re = new RegExp(type), range = new Range(); if (1 != dir) { do token = iterator.stepBackward(); while (token && re.test(token.type)) @@ -6419,14 +6419,14 @@ var modifier = options.caseSensitive ? "gm" : "gmi"; if (options.$isMultiLine = !$disableFakeMultiline && /[\n\r]/.test(needle), options.$isMultiLine) return options.re = this.$assembleMultilineRegExp(needle, modifier); try { - var re = RegExp(needle, modifier); + var re = new RegExp(needle, modifier); } catch (e) { re = !1; } return options.re = re; }, this.$assembleMultilineRegExp = function(needle, modifier) { for(var parts = needle.replace(/\r\n|\r|\n/g, "$\n^").split("\n"), re = [], i = 0; i < parts.length; i++)try { - re.push(RegExp(parts[i], modifier)); + re.push(new RegExp(parts[i], modifier)); } catch (e) { return !1; } diff --git a/crates/swc_ecma_minifier/tests/fixture/next/react-pdf-renderer/output.js b/crates/swc_ecma_minifier/tests/fixture/next/react-pdf-renderer/output.js index a60e3707404..9b35c43c933 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/react-pdf-renderer/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/react-pdf-renderer/output.js @@ -2071,13 +2071,13 @@ ], tb = [ function(e) { return e.map(function(e) { - var t, r = RegExp((t = e.attributes.font, tv.reduce(function(e, r) { + var t, r = (t = e.attributes.font, tv.reduce(function(e, r) { return t && t.hasGlyphForCodePoint && t.hasGlyphForCodePoint(r) ? e : [].concat(e, [ String.fromCharCode(r) ]); - }, [])).join("|")); + }, [])), n = new RegExp(r.join("|")); return { - string: e.string.replace(r, ""), + string: e.string.replace(n, ""), attributes: e.attributes }; }); @@ -7343,7 +7343,7 @@ if (null === o) return null; if (0 == c || "object" != typeof o) return o; if (e.__isArray(o)) f = []; - else if (e.__isRegExp(o)) f = RegExp(o.source, r(o)), o.lastIndex && (f.lastIndex = o.lastIndex); + else if (e.__isRegExp(o)) f = new RegExp(o.source, r(o)), o.lastIndex && (f.lastIndex = o.lastIndex); else if (e.__isDate(o)) f = new Date(o.getTime()); else { if (s && n.isBuffer(o)) return f = n.allocUnsafe ? n.allocUnsafe(o.length) : new n(o.length), o.copy(f), f; diff --git a/crates/swc_ecma_minifier/tests/fixture/next/syncfusion/933-e9f9a6bf671b96fc/output.js b/crates/swc_ecma_minifier/tests/fixture/next/syncfusion/933-e9f9a6bf671b96fc/output.js index 8700e5c6702..b0972a05337 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/syncfusion/933-e9f9a6bf671b96fc/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/syncfusion/933-e9f9a6bf671b96fc/output.js @@ -5483,7 +5483,7 @@ ], Touch.prototype, "swipeSettings", void 0), Touch = touch_decorate([ NotifyPropertyChanges ], Touch); - }(Base), LINES = RegExp('\\n|\\r|\\s\\s+', 'g'), QUOTES = RegExp(/'|"/g), IF_STMT = RegExp('if ?\\('), ELSEIF_STMT = RegExp('else if ?\\('), ELSE_STMT = /else/, FOR_STMT = RegExp('for ?\\('), IF_OR_FOR = RegExp('(/if|/for)'), CALL_FUNCTION = RegExp('\\((.*)\\)', ''), NOT_NUMBER = RegExp('^[0-9]+$', 'g'), WORD = RegExp('[\\w"\'.\\s+]+', 'g'), DBL_QUOTED_STR = RegExp('"(.*?)"', 'g'), WORDIF = RegExp('[\\w"\'@#$.\\s-+]+', 'g'), exp = RegExp('\\${([^}]*)}', 'g'), ARR_OBJ = /^\..*/gm, SINGLE_SLASH = /\\/gi, DOUBLE_SLASH = /\\\\/gi, WORDFUNC = RegExp('[\\w"\'@#$.\\s+]+', 'g'), WINDOWFUNC = /\window\./gm; + }(Base), LINES = RegExp('\\n|\\r|\\s\\s+', 'g'), QUOTES = new RegExp(/'|"/g), IF_STMT = RegExp('if ?\\('), ELSEIF_STMT = RegExp('else if ?\\('), ELSE_STMT = /else/, FOR_STMT = RegExp('for ?\\('), IF_OR_FOR = RegExp('(/if|/for)'), CALL_FUNCTION = RegExp('\\((.*)\\)', ''), NOT_NUMBER = RegExp('^[0-9]+$', 'g'), WORD = RegExp('[\\w"\'.\\s+]+', 'g'), DBL_QUOTED_STR = RegExp('"(.*?)"', 'g'), WORDIF = RegExp('[\\w"\'@#$.\\s-+]+', 'g'), exp = RegExp('\\${([^}]*)}', 'g'), ARR_OBJ = /^\..*/gm, SINGLE_SLASH = /\\/gi, DOUBLE_SLASH = /\\\\/gi, WORDFUNC = RegExp('[\\w"\'@#$.\\s+]+', 'g'), WINDOWFUNC = /\window\./gm; function addNameSpace(str, addNS, nameSpace, ignoreList, ignorePrefix) { return !addNS || NOT_NUMBER.test(str) || -1 !== ignoreList.indexOf(str.split('.')[0]) || ignorePrefix ? str : nameSpace + '.' + str; } @@ -11174,7 +11174,7 @@ return styleEle.rel = 'stylesheet', styleEle; }, RichTextEditor.prototype.setValue = function() { if (this.valueTemplate) { - if (RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i).test(this.valueTemplate)) this.setProperties({ + if (new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i).test(this.valueTemplate)) this.setProperties({ value: this.valueTemplate }); else { @@ -14562,7 +14562,7 @@ this.checkVShape(elm); for(var imgElem = elm.querySelectorAll('img'), i = 0; i < imgElem.length; i++)!(0, ej2_base.le)(imgElem[i].getAttribute('v:shapes')) && 0 > imgElem[i].getAttribute('v:shapes').indexOf('Picture') && 0 > imgElem[i].getAttribute('v:shapes').indexOf('Image') && (0, ej2_base.og)(imgElem[i]); imgElem = elm.querySelectorAll('img'); - var imgSrc = [], base64Src = [], imgName = [], linkRegex = RegExp(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi); + var imgSrc = [], base64Src = [], imgName = [], linkRegex = new RegExp(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi); if (imgElem.length > 0) { for(var i = 0; i < imgElem.length; i++)imgSrc.push(imgElem[i].getAttribute('src')), imgName.push(imgElem[i].getAttribute('src').split('/')[imgElem[i].getAttribute('src').split('/').length - 1].split('.')[0]); for(var hexValue = this.hexConversion(rtfData), i = 0; i < hexValue.length; i++)base64Src.push(this.convertToBase64(hexValue[i])); @@ -15623,13 +15623,13 @@ for(var node = rangeLiNode.parentElement; node !== this.parent.inputElement && (1 !== node.nodeType || 'LI' !== node.tagName);)node = node.parentElement; return node; }, HtmlEditor.prototype.onPaste = function(e) { - var regex = RegExp(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi); + var regex = new RegExp(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi); if (e.text.match(regex)) { if (e.isWordPaste) return; e.args.preventDefault(); var range = this.parent.formatter.editorManager.nodeSelection.getRange(this.parent.contentModule.getDocument()); this.parent.formatter.editorManager.nodeSelection.save(range, this.parent.contentModule.getDocument()); - for(var httpRegex = RegExp(/([^\S]|^)(((https?\:\/\/)))/gi), wwwRegex = RegExp(/([^\S]|^)(((www\.))(\S+))/gi), enterSplitText = e.text.split('\n'), contentInnerElem = '', i = 0; i < enterSplitText.length; i++)if ('' === enterSplitText[i].trim()) contentInnerElem += (0, util.oG)(this.parent); + for(var httpRegex = new RegExp(/([^\S]|^)(((https?\:\/\/)))/gi), wwwRegex = new RegExp(/([^\S]|^)(((www\.))(\S+))/gi), enterSplitText = e.text.split('\n'), contentInnerElem = '', i = 0; i < enterSplitText.length; i++)if ('' === enterSplitText[i].trim()) contentInnerElem += (0, util.oG)(this.parent); else { for(var contentWithSpace = '', spaceBetweenContent = !0, spaceSplit = enterSplitText[i].split(' '), j = 0; j < spaceSplit.length; j++)'' === spaceSplit[j].trim() ? contentWithSpace += spaceBetweenContent ? ' ' : ' ' : (spaceBetweenContent = !1, contentWithSpace += spaceSplit[j] + ' '); 0 === i ? contentInnerElem += '' + contentWithSpace.trim() + '' : contentInnerElem += '

' + contentWithSpace.trim() + '

'; @@ -15645,7 +15645,7 @@ }, HtmlEditor.prototype.spaceLink = function(e) { var range = this.nodeSelectionObj.getRange(this.contentRenderer.getDocument()), selectNodeEle = this.nodeSelectionObj.getParentNodeCollection(range), text = range.startContainer.textContent.substr(0, range.endOffset), splitText = text.split(' '), urlText = splitText[splitText.length - 1], urlTextRange = range.startOffset - (text.length - splitText[splitText.length - 1].length); urlText = urlText.slice(0, urlTextRange); - var regex = RegExp(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi); + var regex = new RegExp(/([^\S]|^)(((https?\:\/\/)|(www\.))(\S+))/gi); if ('A' !== selectNodeEle[0].nodeName && urlText.match(regex)) { var selection = this.nodeSelectionObj.save(range, this.parent.contentModule.getDocument()), value = { url: urlText.indexOf('http') > -1 ? urlText : 'http://' + urlText, @@ -18058,7 +18058,7 @@ value: value }), e.args && null !== value && 'HTML' === this.parent.editorMode) { if (0 === value.length) { - var htmlRegex = RegExp(/<\/[a-z][\s\S]*>/i); + var htmlRegex = new RegExp(/<\/[a-z][\s\S]*>/i); value = e.args.clipboardData.getData('text/plain'), this.isNotFromHtml = '' !== value, value = (value = value.replace(//g, '>'), this.containsHtml = htmlRegex.test(value); var file = e && e.args.clipboardData && e.args.clipboardData.items.length > 0 ? null === e.args.clipboardData.items[0].getAsFile() ? (0, ej2_base.le)(e.args.clipboardData.items[1]) ? null : e.args.clipboardData.items[1].getAsFile() : e.args.clipboardData.items[0].getAsFile() : null; if (this.parent.notify(constant.RE, { @@ -19641,7 +19641,7 @@ item.id ? ele.id = item.id : ele.id = (0, ej2_base.QI)('tbr-ipt'), innerEle.appendChild(ele), templateProp.appendTo(ele); } } else { - var templateFn = void 0, val = templateProp, regEx = RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i); + var templateFn = void 0, val = templateProp, regEx = new RegExp(/<(?=.*? .*?\/ ?>|br|hr|input|!--|wbr)[a-z]+.*?>|<([a-z]+).*?<\/\1>/i); val = 'string' == typeof templateProp ? templateProp.trim() : templateProp; try { if ('object' != typeof templateProp || (0, ej2_base.le)(templateProp.tagName)) { diff --git a/crates/swc_ecma_minifier/tests/fixture/next/target-es2015/static/chunks/main-04b5934c26266542/output.js b/crates/swc_ecma_minifier/tests/fixture/next/target-es2015/static/chunks/main-04b5934c26266542/output.js index 1673b5cdbaf..01313c51109 100644 --- a/crates/swc_ecma_minifier/tests/fixture/next/target-es2015/static/chunks/main-04b5934c26266542/output.js +++ b/crates/swc_ecma_minifier/tests/fixture/next/target-es2015/static/chunks/main-04b5934c26266542/output.js @@ -1545,7 +1545,7 @@ const matchers = yield Promise.resolve(options.router.pageLoader.getMiddleware()); if (!matchers) return !1; const { pathname: asPathname } = _parsePath.parsePath(options.asPath), cleanedAs = _hasBasePath.hasBasePath(asPathname) ? _removeBasePath.removeBasePath(asPathname) : asPathname, asWithBasePathAndLocale = _addBasePath.addBasePath(_addLocale.addLocale(cleanedAs, options.locale)); - return matchers.some((m)=>RegExp(m.regexp).test(asWithBasePathAndLocale)); + return matchers.some((m)=>new RegExp(m.regexp).test(asWithBasePathAndLocale)); })).apply(this, arguments); } function stripOrigin(url) { @@ -2682,7 +2682,7 @@ function getRouteRegex(normalizedRoute) { const { parameterizedRoute , groups } = getParametrizedRoute(normalizedRoute); return { - re: RegExp("^".concat(parameterizedRoute, "(?:/)?$")), + re: new RegExp("^".concat(parameterizedRoute, "(?:/)?$")), groups: groups }; } diff --git a/crates/swc_ecma_minifier/tests/full/feedback-mapbox/2c796e83-0724e2af5f19128a/output.js b/crates/swc_ecma_minifier/tests/full/feedback-mapbox/2c796e83-0724e2af5f19128a/output.js index 47bd3570ea1..33db858323c 100644 --- a/crates/swc_ecma_minifier/tests/full/feedback-mapbox/2c796e83-0724e2af5f19128a/output.js +++ b/crates/swc_ecma_minifier/tests/full/feedback-mapbox/2c796e83-0724e2af5f19128a/output.js @@ -1,4 +1,4 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[634],{6158:function(i,r,n){var o=n(3454);i.exports=function(){"use strict";var i,r,n;function s(o,s){if(i){if(r){var a="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+i+")(sharedChunk); ("+r+")(sharedChunk); self.onerror = null;",l={};i(l),n=s(l),"undefined"!=typeof window&&window&&window.URL&&window.URL.createObjectURL&&(n.workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"})))}else r=s}else i=s}return s(["exports"],function(i){let r,n,s;var a,l,c="2.7.0";function h(i,r,n,o){this.cx=3*i,this.bx=3*(n-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(o-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=o,this.p2x=n,this.p2y=o}h.prototype.sampleCurveX=function(i){return((this.ax*i+this.bx)*i+this.cx)*i},h.prototype.sampleCurveY=function(i){return((this.ay*i+this.by)*i+this.cy)*i},h.prototype.sampleCurveDerivativeX=function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},h.prototype.solveCurveX=function(i,r){var n,o,s,a,l;for(void 0===r&&(r=1e-6),s=i,l=0;l<8;l++){if(Math.abs(a=this.sampleCurveX(s)-i)Math.abs(c))break;s-=a/c}if((s=i)<(n=0))return n;if(s>(o=1))return o;for(;na?n=s:o=s,s=.5*(o-n)+n;return s},h.prototype.solve=function(i,r){return this.sampleCurveY(this.solveCurveX(i,r))};var u=d;function d(i,r){this.x=i,this.y=r}d.prototype={clone:function(){return new d(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,r){return this.clone()._rotateAround(i,r)},matMult:function(i){return this.clone()._matMult(i)},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(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var r=i.x-this.x,n=i.y-this.y;return r*r+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,r){return Math.atan2(this.x*r-this.y*i,this.x*i+this.y*r)},_matMult:function(i){var r=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=r,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var r=Math.cos(i),n=Math.sin(i),o=n*this.x+r*this.y;return this.x=r*this.x-n*this.y,this.y=o,this},_rotateAround:function(i,r){var n=Math.cos(i),o=Math.sin(i),s=r.y+o*(this.x-r.x)+n*(this.y-r.y);return this.x=r.x+n*(this.x-r.x)-o*(this.y-r.y),this.y=s,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},d.convert=function(i){return i instanceof d?i:Array.isArray(i)?new d(i[0],i[1]):i};var p="undefined"!=typeof self?self:{},f="undefined"!=typeof Float32Array?Float32Array:Array;function m(){var i=new f(9);return f!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[5]=0,i[6]=0,i[7]=0),i[0]=1,i[4]=1,i[8]=1,i}function _(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function g(i,r,n){var o=r[0],s=r[1],a=r[2],l=r[3],c=r[4],h=r[5],u=r[6],d=r[7],p=r[8],f=r[9],m=r[10],_=r[11],g=r[12],y=r[13],x=r[14],v=r[15],b=n[0],w=n[1],T=n[2],E=n[3];return i[0]=b*o+w*c+T*p+E*g,i[1]=b*s+w*h+T*f+E*y,i[2]=b*a+w*u+T*m+E*x,i[3]=b*l+w*d+T*_+E*v,i[4]=(b=n[4])*o+(w=n[5])*c+(T=n[6])*p+(E=n[7])*g,i[5]=b*s+w*h+T*f+E*y,i[6]=b*a+w*u+T*m+E*x,i[7]=b*l+w*d+T*_+E*v,i[8]=(b=n[8])*o+(w=n[9])*c+(T=n[10])*p+(E=n[11])*g,i[9]=b*s+w*h+T*f+E*y,i[10]=b*a+w*u+T*m+E*x,i[11]=b*l+w*d+T*_+E*v,i[12]=(b=n[12])*o+(w=n[13])*c+(T=n[14])*p+(E=n[15])*g,i[13]=b*s+w*h+T*f+E*y,i[14]=b*a+w*u+T*m+E*x,i[15]=b*l+w*d+T*_+E*v,i}function y(i,r,n){var o,s,a,l,c,h,u,d,p,f,m,_,g=n[0],y=n[1],x=n[2];return r===i?(i[12]=r[0]*g+r[4]*y+r[8]*x+r[12],i[13]=r[1]*g+r[5]*y+r[9]*x+r[13],i[14]=r[2]*g+r[6]*y+r[10]*x+r[14],i[15]=r[3]*g+r[7]*y+r[11]*x+r[15]):(s=r[1],a=r[2],l=r[3],c=r[4],h=r[5],u=r[6],d=r[7],p=r[8],f=r[9],m=r[10],_=r[11],i[0]=o=r[0],i[1]=s,i[2]=a,i[3]=l,i[4]=c,i[5]=h,i[6]=u,i[7]=d,i[8]=p,i[9]=f,i[10]=m,i[11]=_,i[12]=o*g+c*y+p*x+r[12],i[13]=s*g+h*y+f*x+r[13],i[14]=a*g+u*y+m*x+r[14],i[15]=l*g+d*y+_*x+r[15]),i}function x(i,r,n){var o=n[0],s=n[1],a=n[2];return i[0]=r[0]*o,i[1]=r[1]*o,i[2]=r[2]*o,i[3]=r[3]*o,i[4]=r[4]*s,i[5]=r[5]*s,i[6]=r[6]*s,i[7]=r[7]*s,i[8]=r[8]*a,i[9]=r[9]*a,i[10]=r[10]*a,i[11]=r[11]*a,i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],i}function v(i,r,n){var o=Math.sin(n),s=Math.cos(n),a=r[4],l=r[5],c=r[6],h=r[7],u=r[8],d=r[9],p=r[10],f=r[11];return r!==i&&(i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15]),i[4]=a*s+u*o,i[5]=l*s+d*o,i[6]=c*s+p*o,i[7]=h*s+f*o,i[8]=u*s-a*o,i[9]=d*s-l*o,i[10]=p*s-c*o,i[11]=f*s-h*o,i}function b(i,r,n){var o=Math.sin(n),s=Math.cos(n),a=r[0],l=r[1],c=r[2],h=r[3],u=r[8],d=r[9],p=r[10],f=r[11];return r!==i&&(i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15]),i[0]=a*s-u*o,i[1]=l*s-d*o,i[2]=c*s-p*o,i[3]=h*s-f*o,i[8]=a*o+u*s,i[9]=l*o+d*s,i[10]=c*o+p*s,i[11]=h*o+f*s,i}function w(){var i=new f(3);return f!=Float32Array&&(i[0]=0,i[1]=0,i[2]=0),i}function T(i){var r=new f(3);return r[0]=i[0],r[1]=i[1],r[2]=i[2],r}function E(i){return Math.hypot(i[0],i[1],i[2])}function S(i,r,n){var o=new f(3);return o[0]=i,o[1]=r,o[2]=n,o}function I(i,r,n){return i[0]=r[0]+n[0],i[1]=r[1]+n[1],i[2]=r[2]+n[2],i}function M(i,r,n){return i[0]=r[0]-n[0],i[1]=r[1]-n[1],i[2]=r[2]-n[2],i}function A(i,r,n){return i[0]=r[0]*n[0],i[1]=r[1]*n[1],i[2]=r[2]*n[2],i}function C(i,r,n){return i[0]=r[0]*n,i[1]=r[1]*n,i[2]=r[2]*n,i}function z(i,r,n,o){return i[0]=r[0]+n[0]*o,i[1]=r[1]+n[1]*o,i[2]=r[2]+n[2]*o,i}function k(i,r){var n=r[0],o=r[1],s=r[2],a=n*n+o*o+s*s;return a>0&&(a=1/Math.sqrt(a)),i[0]=r[0]*a,i[1]=r[1]*a,i[2]=r[2]*a,i}function P(i,r){return i[0]*r[0]+i[1]*r[1]+i[2]*r[2]}function D(i,r,n){var o=r[0],s=r[1],a=r[2],l=n[0],c=n[1],h=n[2];return i[0]=s*h-a*c,i[1]=a*l-o*h,i[2]=o*c-s*l,i}function L(i,r,n){var o=r[0],s=r[1],a=r[2],l=n[3]*o+n[7]*s+n[11]*a+n[15];return i[0]=(n[0]*o+n[4]*s+n[8]*a+n[12])/(l=l||1),i[1]=(n[1]*o+n[5]*s+n[9]*a+n[13])/l,i[2]=(n[2]*o+n[6]*s+n[10]*a+n[14])/l,i}function B(i,r,n){var o=n[0],s=n[1],a=n[2],l=r[0],c=r[1],h=r[2],u=s*h-a*c,d=a*l-o*h,p=o*c-s*l,f=s*p-a*d,m=a*u-o*p,_=o*d-s*u,g=2*n[3];return d*=g,p*=g,m*=2,_*=2,i[0]=l+(u*=g)+(f*=2),i[1]=c+d+m,i[2]=h+p+_,i}function R(i,r,n){var o=r[0],s=r[1],a=r[2],l=r[3];return i[0]=n[0]*o+n[4]*s+n[8]*a+n[12]*l,i[1]=n[1]*o+n[5]*s+n[9]*a+n[13]*l,i[2]=n[2]*o+n[6]*s+n[10]*a+n[14]*l,i[3]=n[3]*o+n[7]*s+n[11]*a+n[15]*l,i}function F(){var i=new f(4);return f!=Float32Array&&(i[0]=0,i[1]=0,i[2]=0),i[3]=1,i}function O(i){return i[0]=0,i[1]=0,i[2]=0,i[3]=1,i}function U(i,r,n){n*=.5;var o=r[0],s=r[1],a=r[2],l=r[3],c=Math.sin(n),h=Math.cos(n);return i[0]=o*h+l*c,i[1]=s*h+a*c,i[2]=a*h-s*c,i[3]=l*h-o*c,i}function V(i,r){return i[0]===r[0]&&i[1]===r[1]}Math.hypot||(Math.hypot=function(){for(var i=0,r=arguments.length;r--;)i+=arguments[r]*arguments[r];return Math.sqrt(i)}),w(),a=new f(4),f!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0,a[3]=0),w(),S(1,0,0),S(0,1,0),F(),F(),m(),l=new f(2),f!=Float32Array&&(l[0]=0,l[1]=0);const N=Math.PI/180,j=180/Math.PI,G=[[0,0],[1,0],[1,1],[0,1]];function Z(i){if(i<=0)return 0;if(i>=1)return 1;const r=i*i,n=r*i;return 4*(i<.5?n:3*(i-r)+n-.75)}function $(i,r,n,o){const s=new h(i,r,n,o);return function(i){return s.solve(i)}}const q=$(.25,.1,.25,1);function X(i,r,n){return Math.min(n,Math.max(r,i))}function W(i,r,n){return(n=X((n-i)/(r-i),0,1))*n*(3-2*n)}function H(i,r,n){const o=n-r,s=((i-r)%o+o)%o+r;return s===r?n:s}function K(i,r,n){if(!i.length)return n(null,[]);let o=i.length;const s=Array(i.length);let a=null;i.forEach((i,l)=>{r(i,(i,r)=>{i&&(a=i),s[l]=r,0==--o&&n(a,s)})})}function Y(i){const r=[];for(const n in i)r.push(i[n]);return r}function J(i,...r){for(const n of r)for(const r in n)i[r]=n[r];return i}let Q=1;function ee(){return Q++}function et(){return function i(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,i)}()}function ei(i){return i<=1?1:Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function er(i){return!!i&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(i)}function en(i,r){i.forEach(i=>{r[i]&&(r[i]=r[i].bind(r))})}function eo(i,r){return -1!==i.indexOf(r,i.length-r.length)}function es(i,r,n){const o={};for(const s in i)o[s]=r.call(n||this,i[s],s,i);return o}function ea(i,r,n){const o={};for(const s in i)r.call(n||this,i[s],s,i)&&(o[s]=i[s]);return o}function el(i){return Array.isArray(i)?i.map(el):"object"==typeof i&&i?es(i,el):i}const ec={};function eh(i){ec[i]||("undefined"!=typeof console&&console.warn(i),ec[i]=!0)}function eu(i,r,n){return(n.y-i.y)*(r.x-i.x)>(r.y-i.y)*(n.x-i.x)}function ed(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function ep(i){const r={};if(i.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,n,o,s)=>{const a=o||s;return r[n]=!a||a.toLowerCase(),""}),r["max-age"]){const i=parseInt(r["max-age"],10);isNaN(i)?delete r["max-age"]:r["max-age"]=i}return r}let ef,em,e_,eg=null;function ey(i){if(null==eg){const r=i.navigator?i.navigator.userAgent:null;eg=!!i.safari||!(!r||!(/\b(iPad|iPhone|iPod)\b/.test(r)||r.match("Safari")&&!r.match("Chrome")))}return eg}function ex(i){try{const r=p[i];return r.setItem("_mapbox_test_",1),r.removeItem("_mapbox_test_"),!0}catch(i){return!1}}const ev={now:()=>void 0!==e_?e_:p.performance.now(),setNow(i){e_=i},restoreNow(){e_=void 0},frame(i){const r=p.requestAnimationFrame(i);return{cancel:()=>p.cancelAnimationFrame(r)}},getImageData(i,r=0){const n=p.document.createElement("canvas"),o=n.getContext("2d");if(!o)throw Error("failed to create canvas 2d context");return n.width=i.width,n.height=i.height,o.drawImage(i,0,0,i.width,i.height),o.getImageData(-r,-r,i.width+2*r,i.height+2*r)},resolveURL:i=>(ef||(ef=p.document.createElement("a")),ef.href=i,ef.href),get devicePixelRatio(){return p.devicePixelRatio},get prefersReducedMotion(){return!!p.matchMedia&&(null==em&&(em=p.matchMedia("(prefers-reduced-motion: reduce)")),em.matches)}},eb={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==r){const i=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{r=null!=o.env.API_URL_REGEX?RegExp(o.env.API_URL_REGEX):i}catch(n){r=i}}return r},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},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},ew={supported:!1,testSupport:function(i){!eS&&eE&&(eI?eM(i):eT=i)}};let eT,eE,eS=!1,eI=!1;function eM(i){const r=i.createTexture();i.bindTexture(i.TEXTURE_2D,r);try{if(i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,eE),i.isContextLost())return;ew.supported=!0}catch(i){}i.deleteTexture(r),eS=!0}p.document&&((eE=p.document.createElement("img")).onload=function(){eT&&eM(eT),eT=null,eI=!0},eE.onerror=function(){eS=!0,eT=null},eE.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const eA="NO_ACCESS_TOKEN";function eC(i){return 0===i.indexOf("mapbox:")}function ez(i){return eb.API_URL_REGEX.test(i)}const ek=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function eP(i){const r=i.match(ek);if(!r)throw Error("Unable to parse URL object");return{protocol:r[1],authority:r[2],path:r[3]||"/",params:r[4]?r[4].split("&"):[]}}function eD(i){const r=i.params.length?`?${i.params.join("&")}`:"";return`${i.protocol}://${i.authority}${i.path}${r}`}function eL(i){if(!i)return null;const r=i.split(".");if(!r||3!==r.length)return null;try{return JSON.parse(decodeURIComponent(p.atob(r[1]).split("").map(i=>"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch(i){return null}}class eB{constructor(i){this.type=i,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(i){const r=eL(eb.ACCESS_TOKEN);let n="";return n=r&&r.u?p.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(i,r)=>String.fromCharCode(Number("0x"+r)))):eb.ACCESS_TOKEN||"",i?`mapbox.eventData.${i}:${n}`:`mapbox.eventData:${n}`}fetchEventData(){const i=ex("localStorage"),r=this.getStorageKey(),n=this.getStorageKey("uuid");if(i)try{const i=p.localStorage.getItem(r);i&&(this.eventData=JSON.parse(i));const o=p.localStorage.getItem(n);o&&(this.anonId=o)}catch(i){eh("Unable to read from LocalStorage")}}saveEventData(){const i=ex("localStorage"),r=this.getStorageKey(),n=this.getStorageKey("uuid");if(i)try{p.localStorage.setItem(n,this.anonId),Object.keys(this.eventData).length>=1&&p.localStorage.setItem(r,JSON.stringify(this.eventData))}catch(i){eh("Unable to write to LocalStorage")}}processRequests(i){}postEvent(i,r,n,o){if(!eb.EVENTS_URL)return;const s=eP(eb.EVENTS_URL);s.params.push(`access_token=${o||eb.ACCESS_TOKEN||""}`);const a={event:this.type,created:new Date(i).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:c,skuId:"01",userId:this.anonId},l=r?J(a,r):a,h={url:eD(s),headers:{"Content-Type":"text/plain"},body:JSON.stringify([l])};this.pendingRequest=e2(h,i=>{this.pendingRequest=null,n(i),this.saveEventData(),this.processRequests(o)})}queueRequest(i,r){this.queue.push(i),this.processRequests(r)}}const eR=new class extends eB{constructor(i){super("appUserTurnstile"),this._customAccessToken=i}postTurnstileEvent(i,r){eb.EVENTS_URL&&eb.ACCESS_TOKEN&&Array.isArray(i)&&i.some(i=>eC(i)||ez(i))&&this.queueRequest(Date.now(),r)}processRequests(i){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const r=eL(eb.ACCESS_TOKEN),n=r?r.u:eb.ACCESS_TOKEN;let o=n!==this.eventData.tokenU;er(this.anonId)||(this.anonId=et(),o=!0);const s=this.queue.shift();if(this.eventData.lastSuccess){const i=new Date(this.eventData.lastSuccess),r=new Date(s),n=(s-this.eventData.lastSuccess)/864e5;o=o||n>=1||n<-1||i.getDate()!==r.getDate()}else o=!0;if(!o)return this.processRequests();this.postEvent(s,{"enabled.telemetry":!1},i=>{i||(this.eventData.lastSuccess=s,this.eventData.tokenU=n)},i)}},eF=eR.postTurnstileEvent.bind(eR),eO=new class extends eB{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(i,r,n,o){this.skuToken=r,this.errorCb=o,eb.EVENTS_URL&&(n||eb.ACCESS_TOKEN?this.queueRequest({id:i,timestamp:Date.now()},n):this.errorCb(Error(eA)))}processRequests(i){if(this.pendingRequest||0===this.queue.length)return;const{id:r,timestamp:n}=this.queue.shift();r&&this.success[r]||(this.anonId||this.fetchEventData(),er(this.anonId)||(this.anonId=et()),this.postEvent(n,{skuToken:this.skuToken},i=>{i?this.errorCb(i):r&&(this.success[r]=!0)},i))}},eU=eO.postMapLoadEvent.bind(eO),eV=new class extends eB{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(i,r,n,o){if(!eb.API_URL||!eb.SESSION_PATH)return;const s=eP(eb.API_URL+eb.SESSION_PATH);s.params.push(`sku=${r||""}`),s.params.push(`access_token=${o||eb.ACCESS_TOKEN||""}`);const a={url:eD(s),headers:{"Content-Type":"text/plain"}};this.pendingRequest=e3(a,i=>{this.pendingRequest=null,n(i),this.saveEventData(),this.processRequests(o)})}getSessionAPI(i,r,n,o){this.skuToken=r,this.errorCb=o,eb.SESSION_PATH&&eb.API_URL&&(n||eb.ACCESS_TOKEN?this.queueRequest({id:i,timestamp:Date.now()},n):this.errorCb(Error(eA)))}processRequests(i){if(this.pendingRequest||0===this.queue.length)return;const{id:r,timestamp:n}=this.queue.shift();r&&this.success[r]||this.getSession(n,this.skuToken,i=>{i?this.errorCb(i):r&&(this.success[r]=!0)},i)}},eN=eV.getSessionAPI.bind(eV),ej=new Set,eG="mapbox-tiles";let eZ,e$,eq=500,eX=50;function eW(){p.caches&&!eZ&&(eZ=p.caches.open(eG))}function eH(i){const r=i.indexOf("?");return r<0?i:i.slice(0,r)}let eK=1/0;const eY={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(eY);class eJ extends Error{constructor(i,r,n){401===r&&ez(n)&&(i+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),super(i),this.status=r,this.url=n}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const eQ=ed()?()=>self.worker&&self.worker.referrer:()=>("blob:"===p.location.protocol?p.parent:p).location.href,e0=function(i,r){var n;if(!(/^file:/.test(n=i.url)||/^file:/.test(eQ())&&!/^\w+:/.test(n))){if(p.fetch&&p.Request&&p.AbortController&&p.Request.prototype.hasOwnProperty("signal"))return function(i,r){var n;const o=new p.AbortController,s=new p.Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,referrer:eQ(),signal:o.signal});let a=!1,l=!1;const c=(n=s.url).indexOf("sku=")>0&&ez(n);"json"===i.type&&s.headers.set("Accept","application/json");const h=(n,o,a)=>{if(l)return;if(n&&"SecurityError"!==n.message&&eh(n),o&&a)return u(o);const h=Date.now();p.fetch(s).then(n=>{if(n.ok){const i=c?n.clone():null;return u(n,i,h)}return r(new eJ(n.statusText,n.status,i.url))}).catch(i=>{20!==i.code&&r(Error(i.message))})},u=(n,o,c)=>{("arrayBuffer"===i.type?n.arrayBuffer():"json"===i.type?n.json():n.text()).then(i=>{l||(o&&c&&function(i,r,n){if(eW(),!eZ)return;const o={status:r.status,statusText:r.statusText,headers:new p.Headers};r.headers.forEach((i,r)=>o.headers.set(r,i));const s=ep(r.headers.get("Cache-Control")||"");s["no-store"]||(s["max-age"]&&o.headers.set("Expires",new Date(n+1e3*s["max-age"]).toUTCString()),new Date(o.headers.get("Expires")).getTime()-n<42e4||function(i,r){if(void 0===e$)try{new Response(new ReadableStream),e$=!0}catch(i){e$=!1}e$?r(i.body):i.blob().then(r)}(r,r=>{const n=new p.Response(r,o);eW(),eZ&&eZ.then(r=>r.put(eH(i.url),n)).catch(i=>eh(i.message))}))}(s,o,c),a=!0,r(null,i,n.headers.get("Cache-Control"),n.headers.get("Expires")))}).catch(i=>{l||r(Error(i.message))})};return c?function(i,r){if(eW(),!eZ)return r(null);const n=eH(i.url);eZ.then(i=>{i.match(n).then(o=>{const s=function(i){if(!i)return!1;const r=new Date(i.headers.get("Expires")||0),n=ep(i.headers.get("Cache-Control")||"");return r>Date.now()&&!n["no-cache"]}(o);i.delete(n),s&&i.put(n,o.clone()),r(null,o,s)}).catch(r)}).catch(r)}(s,h):h(null,null),{cancel:()=>{l=!0,a||o.abort()}}}(i,r);if(ed()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,r,void 0,!0)}return function(i,r){const n=new p.XMLHttpRequest;for(const r in n.open(i.method||"GET",i.url,!0),"arrayBuffer"===i.type&&(n.responseType="arraybuffer"),i.headers)n.setRequestHeader(r,i.headers[r]);return"json"===i.type&&(n.responseType="text",n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===i.credentials,n.onerror=()=>{r(Error(n.statusText))},n.onload=()=>{if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let o=n.response;if("json"===i.type)try{o=JSON.parse(n.response)}catch(i){return r(i)}r(null,o,n.getResponseHeader("Cache-Control"),n.getResponseHeader("Expires"))}else r(new eJ(n.statusText,n.status,i.url))},n.send(i.body),{cancel:()=>n.abort()}}(i,r)},e1=function(i,r){return e0(J(i,{type:"arrayBuffer"}),r)},e2=function(i,r){return e0(J(i,{method:"POST"}),r)},e3=function(i,r){return e0(J(i,{method:"GET"}),r)},e5="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";n=[],s=0;const e4=function(i,r){if(ew.supported&&(i.headers||(i.headers={}),i.headers.accept="image/webp,*/*"),s>=eb.MAX_PARALLEL_IMAGE_REQUESTS){const o={requestParameters:i,callback:r,cancelled:!1,cancel(){this.cancelled=!0}};return n.push(o),o}s++;let o=!1;const a=()=>{if(!o)for(o=!0,s--;n.length&&s{a(),i?r(i):n&&(p.createImageBitmap?function(i,r){const n=new p.Blob([new Uint8Array(i)],{type:"image/png"});p.createImageBitmap(n).then(i=>{r(null,i)}).catch(i=>{r(Error(`Could not load image because of ${i.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(n,(i,n)=>r(i,n,o,s)):function(i,r){const n=new p.Image,o=p.URL;n.onload=()=>{r(null,n),o.revokeObjectURL(n.src),n.onload=null,p.requestAnimationFrame(()=>{n.src=e5})},n.onerror=()=>r(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."));const s=new p.Blob([new Uint8Array(i)],{type:"image/png"});n.src=i.byteLength?o.createObjectURL(s):e5}(n,(i,n)=>r(i,n,o,s)))});return{cancel:()=>{l.cancel(),a()}}};function e6(i,r,n){n[i]&&-1!==n[i].indexOf(r)||(n[i]=n[i]||[],n[i].push(r))}function e8(i,r,n){if(n&&n[i]){const o=n[i].indexOf(r);-1!==o&&n[i].splice(o,1)}}class e9{constructor(i,r={}){J(this,r),this.type=i}}class e7 extends e9{constructor(i,r={}){super("error",J({error:i},r))}}class te{on(i,r){return this._listeners=this._listeners||{},e6(i,r,this._listeners),this}off(i,r){return e8(i,r,this._listeners),e8(i,r,this._oneTimeListeners),this}once(i,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},e6(i,r,this._oneTimeListeners),this):new Promise(r=>this.once(i,r))}fire(i,r){"string"==typeof i&&(i=new e9(i,r||{}));const n=i.type;if(this.listens(n)){i.target=this;const r=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(const n of r)n.call(this,i);const o=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(const r of o)e8(n,r,this._oneTimeListeners),r.call(this,i);const s=this._eventedParent;s&&(J(i,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),s.fire(i))}else i instanceof e7&&console.error(i.error);return this}listens(i){return!!(this._listeners&&this._listeners[i]&&this._listeners[i].length>0||this._oneTimeListeners&&this._oneTimeListeners[i]&&this._oneTimeListeners[i].length>0||this._eventedParent&&this._eventedParent.listens(i))}setEventedParent(i,r){return this._eventedParent=i,this._eventedParentData=r,this}}var tt=JSON.parse('{"$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"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"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":{},"sky":{}},"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_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"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","feature"]},"property-type":"data-driven"},"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",{"symbol-placement":["point"]}],"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","feature"]},"property-type":"data-driven"},"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"],"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_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"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},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"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},"horizon-blend":{"type":"number","property-type":"data-constant","default":0.1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"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}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"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_sky"],"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","feature"]},"property-type":"cross-faded-data-driven"},"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-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"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-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"}}}');class ti{constructor(i,r,n,o){this.message=(i?`${i}: `:"")+n,o&&(this.identifier=o),null!=r&&r.__line__&&(this.line=r.__line__)}}function tr(i){const r=i.value;return r?[new ti(i.key,r,"constants have been deprecated as of v8")]:[]}function tn(i,...r){for(const n of r)for(const r in n)i[r]=n[r];return i}function to(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function ts(i){if(Array.isArray(i))return i.map(ts);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){const r={};for(const n in i)r[n]=ts(i[n]);return r}return to(i)}class ta extends Error{constructor(i,r){super(r),this.message=r,this.key=i}}class tl{constructor(i,r=[]){for(const[n,o]of(this.parent=i,this.bindings={},r))this.bindings[n]=o}concat(i){return new tl(this,i)}get(i){if(this.bindings[i])return this.bindings[i];if(this.parent)return this.parent.get(i);throw Error(`${i} not found in scope.`)}has(i){return!!this.bindings[i]||!!this.parent&&this.parent.has(i)}}const tc={kind:"null"},th={kind:"number"},tu={kind:"string"},td={kind:"boolean"},tp={kind:"color"},tf={kind:"object"},tm={kind:"value"},t_={kind:"collator"},tg={kind:"formatted"},ty={kind:"resolvedImage"};function tx(i,r){return{kind:"array",itemType:i,N:r}}function tv(i){if("array"===i.kind){const r=tv(i.itemType);return"number"==typeof i.N?`array<${r}, ${i.N}>`:"value"===i.itemType.kind?"array":`array<${r}>`}return i.kind}const tb=[tc,th,tu,td,tp,tg,tf,tx(tm),ty];function tw(i,r){if("error"===r.kind)return null;if("array"===i.kind){if("array"===r.kind&&(0===r.N&&"value"===r.itemType.kind||!tw(i.itemType,r.itemType))&&("number"!=typeof i.N||i.N===r.N))return null}else{if(i.kind===r.kind)return null;if("value"===i.kind){for(const i of tb)if(!tw(i,r))return null}}return`Expected ${tv(i)} but found ${tv(r)} instead.`}function tT(i,r){return r.some(r=>r.kind===i.kind)}function tE(i,r){return r.some(r=>"null"===r?null===i:"array"===r?Array.isArray(i):"object"===r?i&&!Array.isArray(i)&&"object"==typeof i:r===typeof i)}function tS(i){var r={exports:{}};return i(r,r.exports),r.exports}var tI=tS(function(i,r){var n={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 o(i){return(i=Math.round(i))<0?0:i>255?255:i}function s(i){return o("%"===i[i.length-1]?parseFloat(i)/100*255:parseInt(i))}function a(i){var r;return(r="%"===i[i.length-1]?parseFloat(i)/100:parseFloat(i))<0?0:r>1?1:r}function l(i,r,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?i+(r-i)*n*6:2*n<1?r:3*n<2?i+(r-i)*(2/3-n)*6:i}try{r.parseCSSColor=function(i){var r,c=i.replace(/ /g,"").toLowerCase();if(c in n)return n[c].slice();if("#"===c[0])return 4===c.length?(r=parseInt(c.substr(1),16))>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null:7===c.length&&(r=parseInt(c.substr(1),16))>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null;var h=c.indexOf("("),u=c.indexOf(")");if(-1!==h&&u+1===c.length){var d=c.substr(0,h),p=c.substr(h+1,u-(h+1)).split(","),f=1;switch(d){case"rgba":if(4!==p.length)break;f=a(p.pop());case"rgb":return 3!==p.length?null:[s(p[0]),s(p[1]),s(p[2]),f];case"hsla":if(4!==p.length)break;f=a(p.pop());case"hsl":if(3!==p.length)break;var m=(parseFloat(p[0])%360+360)%360/360,_=a(p[1]),g=a(p[2]),y=g<=.5?g*(_+1):g+_-g*_,x=2*g-y;return[o(255*l(x,y,m+1/3)),o(255*l(x,y,m)),o(255*l(x,y,m-1/3)),f]}}return null}}catch(i){}});class tM{constructor(i,r,n,o=1){this.r=i,this.g=r,this.b=n,this.a=o}static parse(i){if(!i)return;if(i instanceof tM)return i;if("string"!=typeof i)return;const r=tI.parseCSSColor(i);return r?new tM(r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]):void 0}toString(){const[i,r,n,o]=this.toArray();return`rgba(${Math.round(i)},${Math.round(r)},${Math.round(n)},${o})`}toArray(){const{r:i,g:r,b:n,a:o}=this;return 0===o?[0,0,0,0]:[255*i/o,255*r/o,255*n/o,o]}}tM.black=new tM(0,0,0,1),tM.white=new tM(1,1,1,1),tM.transparent=new tM(0,0,0,0),tM.red=new tM(1,0,0,1),tM.blue=new tM(0,0,1,1);class tA{constructor(i,r,n){this.sensitivity=i?r?"variant":"case":r?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(i,r){return this.collator.compare(i,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class tC{constructor(i,r,n,o,s){this.text=i.normalize?i.normalize():i,this.image=r,this.scale=n,this.fontStack=o,this.textColor=s}}class tz{constructor(i){this.sections=i}static fromString(i){return new tz([new tC(i,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(i=>0!==i.text.length||i.image&&0!==i.image.name.length)}static factory(i){return i instanceof tz?i:tz.fromString(i)}toString(){return 0===this.sections.length?"":this.sections.map(i=>i.text).join("")}serialize(){const i=["format"];for(const r of this.sections){if(r.image){i.push(["image",r.image.name]);continue}i.push(r.text);const n={};r.fontStack&&(n["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(n["font-scale"]=r.scale),r.textColor&&(n["text-color"]=["rgba"].concat(r.textColor.toArray())),i.push(n)}return i}}class tk{constructor(i){this.name=i.name,this.available=i.available}toString(){return this.name}static fromString(i){return i?new tk({name:i,available:!1}):null}serialize(){return["image",this.name]}}function tP(i,r,n,o){return"number"==typeof i&&i>=0&&i<=255&&"number"==typeof r&&r>=0&&r<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===o||"number"==typeof o&&o>=0&&o<=1?null:`Invalid rgba value [${[i,r,n,o].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof o?[i,r,n,o]:[i,r,n]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function tD(i){if(null===i||"string"==typeof i||"boolean"==typeof i||"number"==typeof i||i instanceof tM||i instanceof tA||i instanceof tz||i instanceof tk)return!0;if(Array.isArray(i)){for(const r of i)if(!tD(r))return!1;return!0}if("object"==typeof i){for(const r in i)if(!tD(i[r]))return!1;return!0}return!1}function tL(i){if(null===i)return tc;if("string"==typeof i)return tu;if("boolean"==typeof i)return td;if("number"==typeof i)return th;if(i instanceof tM)return tp;if(i instanceof tA)return t_;if(i instanceof tz)return tg;if(i instanceof tk)return ty;if(Array.isArray(i)){let r;const n=i.length;for(const n of i){const i=tL(n);if(r){if(r===i)continue;r=tm;break}r=i}return tx(r||tm,n)}return tf}function tB(i){const r=typeof i;return null===i?"":"string"===r||"number"===r||"boolean"===r?String(i):i instanceof tM||i instanceof tz||i instanceof tk?i.toString():JSON.stringify(i)}class tR{constructor(i,r){this.type=i,this.value=r}static parse(i,r){if(2!==i.length)return r.error(`'literal' expression requires exactly one argument, but found ${i.length-1} instead.`);if(!tD(i[1]))return r.error("invalid value");const n=i[1];let o=tL(n);const s=r.expectedType;return"array"===o.kind&&0===o.N&&s&&"array"===s.kind&&("number"!=typeof s.N||0===s.N)&&(o=s),new tR(o,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof tM?["rgba"].concat(this.value.toArray()):this.value instanceof tz?this.value.serialize():this.value}}class tF{constructor(i){this.name="ExpressionEvaluationError",this.message=i}toJSON(){return this.message}}const tO={string:tu,number:th,boolean:td,object:tf};class tU{constructor(i,r){this.type=i,this.args=r}static parse(i,r){if(i.length<2)return r.error("Expected at least one argument.");let n,o=1;const s=i[0];if("array"===s){let s,a;if(i.length>2){const n=i[1];if("string"!=typeof n||!(n in tO)||"object"===n)return r.error('The item type argument of "array" must be one of string, number, boolean',1);s=tO[n],o++}else s=tm;if(i.length>3){if(null!==i[2]&&("number"!=typeof i[2]||i[2]<0||i[2]!==Math.floor(i[2])))return r.error('The length argument to "array" must be a positive integer literal',2);a=i[2],o++}n=tx(s,a)}else n=tO[s];const a=[];for(;oi.outputDefined())}serialize(){const i=this.type,r=[i.kind];if("array"===i.kind){const n=i.itemType;if("string"===n.kind||"number"===n.kind||"boolean"===n.kind){r.push(n.kind);const o=i.N;("number"==typeof o||this.args.length>1)&&r.push(o)}}return r.concat(this.args.map(i=>i.serialize()))}}class tV{constructor(i){this.type=tg,this.sections=i}static parse(i,r){if(i.length<2)return r.error("Expected at least one argument.");const n=i[1];if(!Array.isArray(n)&&"object"==typeof n)return r.error("First argument must be an image or text section.");const o=[];let s=!1;for(let n=1;n<=i.length-1;++n){const a=i[n];if(s&&"object"==typeof a&&!Array.isArray(a)){s=!1;let i=null;if(a["font-scale"]&&!(i=r.parse(a["font-scale"],1,th)))return null;let n=null;if(a["text-font"]&&!(n=r.parse(a["text-font"],1,tx(tu))))return null;let l=null;if(a["text-color"]&&!(l=r.parse(a["text-color"],1,tp)))return null;const c=o[o.length-1];c.scale=i,c.font=n,c.textColor=l}else{const a=r.parse(i[n],1,tm);if(!a)return null;const l=a.type.kind;if("string"!==l&&"value"!==l&&"null"!==l&&"resolvedImage"!==l)return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");s=!0,o.push({content:a,scale:null,font:null,textColor:null})}}return new tV(o)}evaluate(i){return new tz(this.sections.map(r=>{const n=r.content.evaluate(i);return tL(n)===ty?new tC("",n,null,null,null):new tC(tB(n),null,r.scale?r.scale.evaluate(i):null,r.font?r.font.evaluate(i).join(","):null,r.textColor?r.textColor.evaluate(i):null)}))}eachChild(i){for(const r of this.sections)i(r.content),r.scale&&i(r.scale),r.font&&i(r.font),r.textColor&&i(r.textColor)}outputDefined(){return!1}serialize(){const i=["format"];for(const r of this.sections){i.push(r.content.serialize());const n={};r.scale&&(n["font-scale"]=r.scale.serialize()),r.font&&(n["text-font"]=r.font.serialize()),r.textColor&&(n["text-color"]=r.textColor.serialize()),i.push(n)}return i}}class tN{constructor(i){this.type=ty,this.input=i}static parse(i,r){if(2!==i.length)return r.error("Expected two arguments.");const n=r.parse(i[1],1,tu);return n?new tN(n):r.error("No image name provided.")}evaluate(i){const r=this.input.evaluate(i),n=tk.fromString(r);return n&&i.availableImages&&(n.available=i.availableImages.indexOf(r)>-1),n}eachChild(i){i(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const tj={"to-boolean":td,"to-color":tp,"to-number":th,"to-string":tu};class tG{constructor(i,r){this.type=i,this.args=r}static parse(i,r){if(i.length<2)return r.error("Expected at least one argument.");const n=i[0];if(("to-boolean"===n||"to-string"===n)&&2!==i.length)return r.error("Expected one argument.");const o=tj[n],s=[];for(let n=1;n4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:tP(r[0],r[1],r[2],r[3])))return new tM(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new tF(n||`Could not parse color from value '${"string"==typeof r?r:String(JSON.stringify(r))}'`)}if("number"===this.type.kind){let r=null;for(const n of this.args){if(null===(r=n.evaluate(i)))return 0;const o=Number(r);if(!isNaN(o))return o}throw new tF(`Could not convert ${JSON.stringify(r)} to number.`)}return"formatted"===this.type.kind?tz.fromString(tB(this.args[0].evaluate(i))):"resolvedImage"===this.type.kind?tk.fromString(tB(this.args[0].evaluate(i))):tB(this.args[0].evaluate(i))}eachChild(i){this.args.forEach(i)}outputDefined(){return this.args.every(i=>i.outputDefined())}serialize(){if("formatted"===this.type.kind)return new tV([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new tN(this.args[0]).serialize();const i=[`to-${this.type.kind}`];return this.eachChild(r=>{i.push(r.serialize())}),i}}const tZ=["Unknown","Point","LineString","Polygon"];class t${constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?tZ[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const i=this.featureDistanceData.center,r=this.featureDistanceData.scale,{x:n,y:o}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(n*r-i[0])+this.featureDistanceData.bearing[1]*(o*r-i[1])}return 0}parseColor(i){let r=this._parseColorCache[i];return r||(r=this._parseColorCache[i]=tM.parse(i)),r}}class tq{constructor(i,r,n,o){this.name=i,this.type=r,this._evaluate=n,this.args=o}evaluate(i){return this._evaluate(i,this.args)}eachChild(i){this.args.forEach(i)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(i=>i.serialize()))}static parse(i,r){const n=i[0],o=tq.definitions[n];if(!o)return r.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);const s=Array.isArray(o)?o[0]:o.type,a=Array.isArray(o)?[[o[1],o[2]]]:o.overloads,l=a.filter(([r])=>!Array.isArray(r)||r.length===i.length-1);let c=null;for(const[o,a]of l){c=new t7(r.registry,r.path,null,r.scope);const l=[];let h=!1;for(let r=1;rArray.isArray(i)?`(${i.map(tv).join(", ")})`:`(${tv(i.type)}...)`).join(" | "),o=[];for(let n=1;n=r[2]||i[1]<=r[1]||i[3]>=r[3])}function tK(i,r){var n,o;let s=!1;for(let a=0,l=r.length;ai[1]!=(o=l[r+1])[1]>i[1]&&i[0]<(o[0]-n[0])*(i[1]-n[1])/(o[1]-n[1])+n[0]&&(s=!s)}}return s}function tY(i,r,n,o){const s=o[0]-n[0],a=o[1]-n[1],l=(i[0]-n[0])*a-s*(i[1]-n[1]),c=(r[0]-n[0])*a-s*(r[1]-n[1]);return l>0&&c<0||l<0&&c>0}function tJ(i,r){for(let n=0;nn[2]){const r=.5*o;let s=i[0]-n[0]>r?-o:n[0]-i[0]>r?o:0;0===s&&(s=i[0]-n[2]>r?-o:n[2]-i[0]>r?o:0),i[0]+=s}tW(r,i)}function t2(i,r,n,o){const s=8192*Math.pow(2,o.z),a=[8192*o.x,8192*o.y],l=[];for(const o of i)for(const i of o){const o=[i.x+a[0],i.y+a[1]];t1(o,r,n,s),l.push(o)}return l}function t3(i,r,n,o){var s;const a=8192*Math.pow(2,o.z),l=[8192*o.x,8192*o.y],c=[];for(const n of i){const i=[];for(const o of n){const n=[o.x+l[0],o.y+l[1]];tW(r,n),i.push(n)}c.push(i)}if(r[2]-r[0]<=a/2)for(const i of((s=r)[0]=s[1]=1/0,s[2]=s[3]=-1/0,c))for(const o of i)t1(o,r,n,a);return c}class t5{constructor(i,r){this.type=td,this.geojson=i,this.geometries=r}static parse(i,r){if(2!==i.length)return r.error(`'within' expression requires exactly one argument, but found ${i.length-1} instead.`);if(tD(i[1])){const r=i[1];if("FeatureCollection"===r.type)for(let i=0;i{r&&!t4(i)&&(r=!1)}),r}function t6(i){if(i instanceof tq&&"feature-state"===i.name)return!1;let r=!0;return i.eachChild(i=>{r&&!t6(i)&&(r=!1)}),r}function t8(i,r){if(i instanceof tq&&r.indexOf(i.name)>=0)return!1;let n=!0;return i.eachChild(i=>{n&&!t8(i,r)&&(n=!1)}),n}class t9{constructor(i,r){this.type=r.type,this.name=i,this.boundExpression=r}static parse(i,r){if(2!==i.length||"string"!=typeof i[1])return r.error("'var' expression requires exactly one string literal argument.");const n=i[1];return r.scope.has(n)?new t9(n,r.scope.get(n)):r.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(i){return this.boundExpression.evaluate(i)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class t7{constructor(i,r=[],n,o=new tl,s=[]){this.registry=i,this.path=r,this.key=r.map(i=>`[${i}]`).join(""),this.scope=o,this.errors=s,this.expectedType=n}parse(i,r,n,o,s={}){return r?this.concat(r,n,o)._parse(i,s):this._parse(i,s)}_parse(i,r){function n(i,r,n){return"assert"===n?new tU(r,[i]):"coerce"===n?new tG(r,[i]):i}if(null!==i&&"string"!=typeof i&&"boolean"!=typeof i&&"number"!=typeof i||(i=["literal",i]),Array.isArray(i)){if(0===i.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const o=i[0];if("string"!=typeof o)return this.error(`Expression name must be a string, but found ${typeof o} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const s=this.registry[o];if(s){let o=s.parse(i,this);if(!o)return null;if(this.expectedType){const i=this.expectedType,s=o.type;if("string"!==i.kind&&"number"!==i.kind&&"boolean"!==i.kind&&"object"!==i.kind&&"array"!==i.kind||"value"!==s.kind){if("color"!==i.kind&&"formatted"!==i.kind&&"resolvedImage"!==i.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(i,s))return null}else o=n(o,i,r.typeAnnotation||"coerce")}else o=n(o,i,r.typeAnnotation||"assert")}if(!(o instanceof tR)&&"resolvedImage"!==o.type.kind&&function i(r){if(r instanceof t9)return i(r.boundExpression);if(r instanceof tq&&"error"===r.name||r instanceof tX||r instanceof t5)return!1;const n=r instanceof tG||r instanceof tU;let o=!0;return r.eachChild(r=>{o=n?o&&i(r):o&&r instanceof tR}),!!o&&t4(r)&&t8(r,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}(o)){const i=new t$;try{o=new tR(o.type,o.evaluate(i))}catch(i){return this.error(i.message),null}}return o}return this.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===i?"'undefined' value invalid. Use null instead.":"object"==typeof i?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof i} instead.`)}concat(i,r,n){const o="number"==typeof i?this.path.concat(i):this.path,s=n?this.scope.concat(n):this.scope;return new t7(this.registry,o,r||null,s,this.errors)}error(i,...r){const n=`${this.key}${r.map(i=>`[${i}]`).join("")}`;this.errors.push(new ta(n,i))}checkSubtype(i,r){const n=tw(i,r);return n&&this.error(n),n}}function ie(i,r){const n=i.length-1;let o,s,a=0,l=n,c=0;for(;a<=l;)if(o=i[c=Math.floor((a+l)/2)],s=i[c+1],o<=r){if(c===n||rr))throw new tF("Input is not a number.");l=c-1}return 0}class it{constructor(i,r,n){for(const[o,s]of(this.type=i,this.input=r,this.labels=[],this.outputs=[],n))this.labels.push(o),this.outputs.push(s)}static parse(i,r){if(i.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if((i.length-1)%2!=0)return r.error("Expected an even number of arguments.");const n=r.parse(i[1],1,th);if(!n)return null;const o=[];let s=null;r.expectedType&&"value"!==r.expectedType.kind&&(s=r.expectedType);for(let n=1;n=a)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',c);const u=r.parse(l,h,s);if(!u)return null;s=s||u.type,o.push([a,u])}return new it(s,n,o)}evaluate(i){const r=this.labels,n=this.outputs;if(1===r.length)return n[0].evaluate(i);const o=this.input.evaluate(i);if(o<=r[0])return n[0].evaluate(i);const s=r.length;return o>=r[s-1]?n[s-1].evaluate(i):n[ie(r,o)].evaluate(i)}eachChild(i){for(const r of(i(this.input),this.outputs))i(r)}outputDefined(){return this.outputs.every(i=>i.outputDefined())}serialize(){const i=["step",this.input.serialize()];for(let r=0;r0&&i.push(this.labels[r]),i.push(this.outputs[r].serialize());return i}}function ii(i,r,n){return i*(1-n)+r*n}var ir=Object.freeze({__proto__:null,number:ii,color:function(i,r,n){return new tM(ii(i.r,r.r,n),ii(i.g,r.g,n),ii(i.b,r.b,n),ii(i.a,r.a,n))},array:function(i,r,n){return i.map((i,o)=>ii(i,r[o],n))}});const io=4/29,is=6/29,ia=3*is*is,il=Math.PI/180,ic=180/Math.PI;function ih(i){return i>.008856451679035631?Math.pow(i,1/3):i/ia+io}function iu(i){return i>is?i*i*i:ia*(i-io)}function id(i){return 255*(i<=.0031308?12.92*i:1.055*Math.pow(i,1/2.4)-.055)}function ip(i){return(i/=255)<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function im(i){const r=ip(i.r),n=ip(i.g),o=ip(i.b),s=ih((.4124564*r+.3575761*n+.1804375*o)/.95047),a=ih((.2126729*r+.7151522*n+.072175*o)/1);return{l:116*a-16,a:500*(s-a),b:200*(a-ih((.0193339*r+.119192*n+.9503041*o)/1.08883)),alpha:i.a}}function i_(i){let r=(i.l+16)/116,n=isNaN(i.a)?r:r+i.a/500,o=isNaN(i.b)?r:r-i.b/200;return r=1*iu(r),n=.95047*iu(n),o=1.08883*iu(o),new tM(id(3.2404542*n-1.5371385*r-.4985314*o),id(-.969266*n+1.8760108*r+.041556*o),id(.0556434*n-.2040259*r+1.0572252*o),i.alpha)}const ig={forward:im,reverse:i_,interpolate:function(i,r,n){return{l:ii(i.l,r.l,n),a:ii(i.a,r.a,n),b:ii(i.b,r.b,n),alpha:ii(i.alpha,r.alpha,n)}}},iy={forward:function(i){const{l:r,a:n,b:o}=im(i),s=Math.atan2(o,n)*ic;return{h:s<0?s+360:s,c:Math.sqrt(n*n+o*o),l:r,alpha:i.a}},reverse:function(i){const r=i.h*il,n=i.c;return i_({l:i.l,a:Math.cos(r)*n,b:Math.sin(r)*n,alpha:i.alpha})},interpolate:function(i,r,n){return{h:function(i,r,n){const o=r-i;return i+n*(o>180||o<-180?o-360*Math.round(o/360):o)}(i.h,r.h,n),c:ii(i.c,r.c,n),l:ii(i.l,r.l,n),alpha:ii(i.alpha,r.alpha,n)}}};var ix=Object.freeze({__proto__:null,lab:ig,hcl:iy});class iv{constructor(i,r,n,o,s){for(const[a,l]of(this.type=i,this.operator=r,this.interpolation=n,this.input=o,this.labels=[],this.outputs=[],s))this.labels.push(a),this.outputs.push(l)}static interpolationFactor(i,r,n,o){let s=0;if("exponential"===i.name)s=ib(r,i.base,n,o);else if("linear"===i.name)s=ib(r,1,n,o);else if("cubic-bezier"===i.name){const a=i.controlPoints;s=new h(a[0],a[1],a[2],a[3]).solve(ib(r,1,n,o))}return s}static parse(i,r){let[n,o,s,...a]=i;if(!Array.isArray(o)||0===o.length)return r.error("Expected an interpolation type expression.",1);if("linear"===o[0])o={name:"linear"};else if("exponential"===o[0]){const i=o[1];if("number"!=typeof i)return r.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:i}}else{if("cubic-bezier"!==o[0])return r.error(`Unknown interpolation type ${String(o[0])}`,1,0);{const i=o.slice(1);if(4!==i.length||i.some(i=>"number"!=typeof i||i<0||i>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:i}}}if(i.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if((i.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(!(s=r.parse(s,2,th)))return null;const l=[];let c=null;"interpolate-hcl"===n||"interpolate-lab"===n?c=tp:r.expectedType&&"value"!==r.expectedType.kind&&(c=r.expectedType);for(let i=0;i=n)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',s);const u=r.parse(o,h,c);if(!u)return null;c=c||u.type,l.push([n,u])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new iv(c,n,o,s,l):r.error(`Type ${tv(c)} is not interpolatable.`)}evaluate(i){const r=this.labels,n=this.outputs;if(1===r.length)return n[0].evaluate(i);const o=this.input.evaluate(i);if(o<=r[0])return n[0].evaluate(i);const s=r.length;if(o>=r[s-1])return n[s-1].evaluate(i);const a=ie(r,o),l=iv.interpolationFactor(this.interpolation,o,r[a],r[a+1]),c=n[a].evaluate(i),h=n[a+1].evaluate(i);return"interpolate"===this.operator?ir[this.type.kind.toLowerCase()](c,h,l):"interpolate-hcl"===this.operator?iy.reverse(iy.interpolate(iy.forward(c),iy.forward(h),l)):ig.reverse(ig.interpolate(ig.forward(c),ig.forward(h),l))}eachChild(i){for(const r of(i(this.input),this.outputs))i(r)}outputDefined(){return this.outputs.every(i=>i.outputDefined())}serialize(){let i;i="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const r=[this.operator,i,this.input.serialize()];for(let i=0;itw(o,i.type));return new iw(a?tm:n,s)}evaluate(i){let r,n=null,o=0;for(const s of this.args){if(o++,(n=s.evaluate(i))&&n instanceof tk&&!n.available&&(r||(r=n),n=null,o===this.args.length))return r;if(null!==n)break}return n}eachChild(i){this.args.forEach(i)}outputDefined(){return this.args.every(i=>i.outputDefined())}serialize(){const i=["coalesce"];return this.eachChild(r=>{i.push(r.serialize())}),i}}class iT{constructor(i,r){this.type=r.type,this.bindings=[].concat(i),this.result=r}evaluate(i){return this.result.evaluate(i)}eachChild(i){for(const r of this.bindings)i(r[1]);i(this.result)}static parse(i,r){if(i.length<4)return r.error(`Expected at least 3 arguments, but found ${i.length-1} instead.`);const n=[];for(let o=1;o=n.length)throw new tF(`Array index out of bounds: ${r} > ${n.length-1}.`);if(r!==Math.floor(r))throw new tF(`Array index must be an integer, but found ${r} instead.`);return n[r]}eachChild(i){i(this.index),i(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class iS{constructor(i,r){this.type=td,this.needle=i,this.haystack=r}static parse(i,r){if(3!==i.length)return r.error(`Expected 2 arguments, but found ${i.length-1} instead.`);const n=r.parse(i[1],1,tm),o=r.parse(i[2],2,tm);return n&&o?tT(n.type,[td,tu,th,tc,tm])?new iS(n,o):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${tv(n.type)} instead`):null}evaluate(i){const r=this.needle.evaluate(i),n=this.haystack.evaluate(i);if(!n)return!1;if(!tE(r,["boolean","string","number","null"]))throw new tF(`Expected first argument to be of type boolean, string, number or null, but found ${tv(tL(r))} instead.`);if(!tE(n,["string","array"]))throw new tF(`Expected second argument to be of type array or string, but found ${tv(tL(n))} instead.`);return n.indexOf(r)>=0}eachChild(i){i(this.needle),i(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class iI{constructor(i,r,n){this.type=th,this.needle=i,this.haystack=r,this.fromIndex=n}static parse(i,r){if(i.length<=2||i.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${i.length-1} instead.`);const n=r.parse(i[1],1,tm),o=r.parse(i[2],2,tm);if(!n||!o)return null;if(!tT(n.type,[td,tu,th,tc,tm]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${tv(n.type)} instead`);if(4===i.length){const s=r.parse(i[3],3,th);return s?new iI(n,o,s):null}return new iI(n,o)}evaluate(i){const r=this.needle.evaluate(i),n=this.haystack.evaluate(i);if(!tE(r,["boolean","string","number","null"]))throw new tF(`Expected first argument to be of type boolean, string, number or null, but found ${tv(tL(r))} instead.`);if(!tE(n,["string","array"]))throw new tF(`Expected second argument to be of type array or string, but found ${tv(tL(n))} instead.`);if(this.fromIndex){const o=this.fromIndex.evaluate(i);return n.indexOf(r,o)}return n.indexOf(r)}eachChild(i){i(this.needle),i(this.haystack),this.fromIndex&&i(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const i=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),i]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class iM{constructor(i,r,n,o,s,a){this.inputType=i,this.type=r,this.input=n,this.cases=o,this.outputs=s,this.otherwise=a}static parse(i,r){let n,o;if(i.length<5)return r.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if(i.length%2!=1)return r.error("Expected an even number of arguments.");r.expectedType&&"value"!==r.expectedType.kind&&(o=r.expectedType);const s={},a=[];for(let l=2;lNumber.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof i&&Math.floor(i)!==i)return u.error("Numeric branch labels must be integer values.");if(n){if(u.checkSubtype(n,tL(i)))return null}else n=tL(i);if(void 0!==s[String(i)])return u.error("Branch labels must be unique.");s[String(i)]=a.length}const d=r.parse(h,l,o);if(!d)return null;o=o||d.type,a.push(d)}const l=r.parse(i[1],1,tm);if(!l)return null;const c=r.parse(i[i.length-1],i.length-1,o);return c?"value"!==l.type.kind&&r.concat(1).checkSubtype(n,l.type)?null:new iM(n,o,l,s,a,c):null}evaluate(i){const r=this.input.evaluate(i);return(tL(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(i)}eachChild(i){i(this.input),this.outputs.forEach(i),i(this.otherwise)}outputDefined(){return this.outputs.every(i=>i.outputDefined())&&this.otherwise.outputDefined()}serialize(){const i=["match",this.input.serialize()],r=Object.keys(this.cases).sort(),n=[],o={};for(const i of r){const r=o[this.cases[i]];void 0===r?(o[this.cases[i]]=n.length,n.push([this.cases[i],[i]])):n[r][1].push(i)}const s=i=>"number"===this.inputType.kind?Number(i):i;for(const[r,o]of n)i.push(1===o.length?s(o[0]):o.map(s)),i.push(this.outputs[r].serialize());return i.push(this.otherwise.serialize()),i}}class iA{constructor(i,r,n){this.type=i,this.branches=r,this.otherwise=n}static parse(i,r){let n;if(i.length<4)return r.error(`Expected at least 3 arguments, but found only ${i.length-1}.`);if(i.length%2!=0)return r.error("Expected an odd number of arguments.");r.expectedType&&"value"!==r.expectedType.kind&&(n=r.expectedType);const o=[];for(let s=1;sr.outputDefined())&&this.otherwise.outputDefined()}serialize(){const i=["case"];return this.eachChild(r=>{i.push(r.serialize())}),i}}class iC{constructor(i,r,n,o){this.type=i,this.input=r,this.beginIndex=n,this.endIndex=o}static parse(i,r){if(i.length<=2||i.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${i.length-1} instead.`);const n=r.parse(i[1],1,tm),o=r.parse(i[2],2,th);if(!n||!o)return null;if(!tT(n.type,[tx(tm),tu,tm]))return r.error(`Expected first argument to be of type array or string, but found ${tv(n.type)} instead`);if(4===i.length){const s=r.parse(i[3],3,th);return s?new iC(n.type,n,o,s):null}return new iC(n.type,n,o)}evaluate(i){const r=this.input.evaluate(i),n=this.beginIndex.evaluate(i);if(!tE(r,["string","array"]))throw new tF(`Expected first argument to be of type array or string, but found ${tv(tL(r))} instead.`);if(this.endIndex){const o=this.endIndex.evaluate(i);return r.slice(n,o)}return r.slice(n)}eachChild(i){i(this.input),i(this.beginIndex),this.endIndex&&i(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const i=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),i]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function iz(i,r){return"=="===i||"!="===i?"boolean"===r.kind||"string"===r.kind||"number"===r.kind||"null"===r.kind||"value"===r.kind:"string"===r.kind||"number"===r.kind||"value"===r.kind}function ik(i,r,n,o){return 0===o.compare(r,n)}function iP(i,r,n){const o="=="!==i&&"!="!==i;return class s{constructor(i,r,n){this.type=td,this.lhs=i,this.rhs=r,this.collator=n,this.hasUntypedArgument="value"===i.type.kind||"value"===r.type.kind}static parse(i,r){if(3!==i.length&&4!==i.length)return r.error("Expected two or three arguments.");const n=i[0];let a=r.parse(i[1],1,tm);if(!a)return null;if(!iz(n,a.type))return r.concat(1).error(`"${n}" comparisons are not supported for type '${tv(a.type)}'.`);let l=r.parse(i[2],2,tm);if(!l)return null;if(!iz(n,l.type))return r.concat(2).error(`"${n}" comparisons are not supported for type '${tv(l.type)}'.`);if(a.type.kind!==l.type.kind&&"value"!==a.type.kind&&"value"!==l.type.kind)return r.error(`Cannot compare types '${tv(a.type)}' and '${tv(l.type)}'.`);o&&("value"===a.type.kind&&"value"!==l.type.kind?a=new tU(l.type,[a]):"value"!==a.type.kind&&"value"===l.type.kind&&(l=new tU(a.type,[l])));let c=null;if(4===i.length){if("string"!==a.type.kind&&"string"!==l.type.kind&&"value"!==a.type.kind&&"value"!==l.type.kind)return r.error("Cannot use collator to compare non-string types.");if(!(c=r.parse(i[3],3,t_)))return null}return new s(a,l,c)}evaluate(s){const a=this.lhs.evaluate(s),l=this.rhs.evaluate(s);if(o&&this.hasUntypedArgument){const r=tL(a),n=tL(l);if(r.kind!==n.kind||"string"!==r.kind&&"number"!==r.kind)throw new tF(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${r.kind}, ${n.kind}) instead.`)}if(this.collator&&!o&&this.hasUntypedArgument){const i=tL(a),n=tL(l);if("string"!==i.kind||"string"!==n.kind)return r(s,a,l)}return this.collator?n(s,a,l,this.collator.evaluate(s)):r(s,a,l)}eachChild(i){i(this.lhs),i(this.rhs),this.collator&&i(this.collator)}outputDefined(){return!0}serialize(){const r=[i];return this.eachChild(i=>{r.push(i.serialize())}),r}}}const iD=iP("==",function(i,r,n){return r===n},ik),iL=iP("!=",function(i,r,n){return r!==n},function(i,r,n,o){return!ik(0,r,n,o)}),iB=iP("<",function(i,r,n){return ro.compare(r,n)}),iR=iP(">",function(i,r,n){return r>n},function(i,r,n,o){return o.compare(r,n)>0}),iF=iP("<=",function(i,r,n){return r<=n},function(i,r,n,o){return 0>=o.compare(r,n)}),iO=iP(">=",function(i,r,n){return r>=n},function(i,r,n,o){return o.compare(r,n)>=0});class iU{constructor(i,r,n,o,s){this.type=tu,this.number=i,this.locale=r,this.currency=n,this.minFractionDigits=o,this.maxFractionDigits=s}static parse(i,r){if(3!==i.length)return r.error("Expected two arguments.");const n=r.parse(i[1],1,th);if(!n)return null;const o=i[2];if("object"!=typeof o||Array.isArray(o))return r.error("NumberFormat options argument must be an object.");let s=null;if(o.locale&&!(s=r.parse(o.locale,1,tu)))return null;let a=null;if(o.currency&&!(a=r.parse(o.currency,1,tu)))return null;let l=null;if(o["min-fraction-digits"]&&!(l=r.parse(o["min-fraction-digits"],1,th)))return null;let c=null;return!o["max-fraction-digits"]||(c=r.parse(o["max-fraction-digits"],1,th))?new iU(n,s,a,l,c):null}evaluate(i){return new Intl.NumberFormat(this.locale?this.locale.evaluate(i):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(i):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(i):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(i):void 0}).format(this.number.evaluate(i))}eachChild(i){i(this.number),this.locale&&i(this.locale),this.currency&&i(this.currency),this.minFractionDigits&&i(this.minFractionDigits),this.maxFractionDigits&&i(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const i={};return this.locale&&(i.locale=this.locale.serialize()),this.currency&&(i.currency=this.currency.serialize()),this.minFractionDigits&&(i["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(i["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),i]}}class iV{constructor(i){this.type=th,this.input=i}static parse(i,r){if(2!==i.length)return r.error(`Expected 1 argument, but found ${i.length-1} instead.`);const n=r.parse(i[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?r.error(`Expected argument of type string or array, but found ${tv(n.type)} instead.`):new iV(n):null}evaluate(i){const r=this.input.evaluate(i);if("string"==typeof r||Array.isArray(r))return r.length;throw new tF(`Expected value to be of type string or array, but found ${tv(tL(r))} instead.`)}eachChild(i){i(this.input)}outputDefined(){return!1}serialize(){const i=["length"];return this.eachChild(r=>{i.push(r.serialize())}),i}}const iN={"==":iD,"!=":iL,">":iR,"<":iB,">=":iO,"<=":iF,array:tU,at:iE,boolean:tU,case:iA,coalesce:iw,collator:tX,format:tV,image:tN,in:iS,"index-of":iI,interpolate:iv,"interpolate-hcl":iv,"interpolate-lab":iv,length:iV,let:iT,literal:tR,match:iM,number:tU,"number-format":iU,object:tU,slice:iC,step:it,string:tU,"to-boolean":tG,"to-color":tG,"to-number":tG,"to-string":tG,var:t9,within:t5};function ij(i,[r,n,o,s]){r=r.evaluate(i),n=n.evaluate(i),o=o.evaluate(i);const a=s?s.evaluate(i):1,l=tP(r,n,o,a);if(l)throw new tF(l);return new tM(r/255*a,n/255*a,o/255*a,a)}function iG(i,r){const n=r[i];return void 0===n?null:n}function iZ(i){return{type:i}}function i$(i){return{result:"success",value:i}}function iq(i){return{result:"error",value:i}}function iX(i){return"data-driven"===i["property-type"]||"cross-faded-data-driven"===i["property-type"]}function iW(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function iH(i){return!!i.expression&&i.expression.interpolated}function iK(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":null===i?"null":typeof i}function iY(i){return"object"==typeof i&&null!==i&&!Array.isArray(i)}function iJ(i){return i}function iQ(i,r,n){return void 0!==i?i:void 0!==r?r:void 0!==n?n:void 0}function i0(i,r,n,o,s){return iQ(typeof n===s?o[n]:void 0,i.default,r.default)}function i1(i,r,n){if("number"!==iK(n))return iQ(i.default,r.default);const o=i.stops.length;if(1===o||n<=i.stops[0][0])return i.stops[0][1];if(n>=i.stops[o-1][0])return i.stops[o-1][1];const s=ie(i.stops.map(i=>i[0]),n);return i.stops[s][1]}function i2(i,r,n){const o=void 0!==i.base?i.base:1;if("number"!==iK(n))return iQ(i.default,r.default);const s=i.stops.length;if(1===s||n<=i.stops[0][0])return i.stops[0][1];if(n>=i.stops[s-1][0])return i.stops[s-1][1];const a=ie(i.stops.map(i=>i[0]),n),l=function(i,r,n,o){const s=o-n,a=i-n;return 0===s?0:1===r?a/s:(Math.pow(r,a)-1)/(Math.pow(r,s)-1)}(n,o,i.stops[a][0],i.stops[a+1][0]),c=i.stops[a][1],h=i.stops[a+1][1];let u=ir[r.type]||iJ;if(i.colorSpace&&"rgb"!==i.colorSpace){const r=ix[i.colorSpace];u=(i,n)=>r.reverse(r.interpolate(r.forward(i),r.forward(n),l))}return"function"==typeof c.evaluate?{evaluate(...i){const r=c.evaluate.apply(void 0,i),n=h.evaluate.apply(void 0,i);if(void 0!==r&&void 0!==n)return u(r,n,l)}}:u(c,h,l)}function i3(i,r,n){return"color"===r.type?n=tM.parse(n):"formatted"===r.type?n=tz.fromString(n.toString()):"resolvedImage"===r.type?n=tk.fromString(n.toString()):iK(n)===r.type||"enum"===r.type&&r.values[n]||(n=void 0),iQ(n,i.default,r.default)}tq.register(iN,{error:[{kind:"error"},[tu],(i,[r])=>{throw new tF(r.evaluate(i))}],typeof:[tu,[tm],(i,[r])=>tv(tL(r.evaluate(i)))],"to-rgba":[tx(th,4),[tp],(i,[r])=>r.evaluate(i).toArray()],rgb:[tp,[th,th,th],ij],rgba:[tp,[th,th,th,th],ij],has:{type:td,overloads:[[[tu],(i,[r])=>r.evaluate(i) in i.properties()],[[tu,tf],(i,[r,n])=>r.evaluate(i) in n.evaluate(i)]]},get:{type:tm,overloads:[[[tu],(i,[r])=>iG(r.evaluate(i),i.properties())],[[tu,tf],(i,[r,n])=>iG(r.evaluate(i),n.evaluate(i))]]},"feature-state":[tm,[tu],(i,[r])=>iG(r.evaluate(i),i.featureState||{})],properties:[tf,[],i=>i.properties()],"geometry-type":[tu,[],i=>i.geometryType()],id:[tm,[],i=>i.id()],zoom:[th,[],i=>i.globals.zoom],pitch:[th,[],i=>i.globals.pitch||0],"distance-from-center":[th,[],i=>i.distanceFromCenter()],"heatmap-density":[th,[],i=>i.globals.heatmapDensity||0],"line-progress":[th,[],i=>i.globals.lineProgress||0],"sky-radial-progress":[th,[],i=>i.globals.skyRadialProgress||0],accumulated:[tm,[],i=>void 0===i.globals.accumulated?null:i.globals.accumulated],"+":[th,iZ(th),(i,r)=>{let n=0;for(const o of r)n+=o.evaluate(i);return n}],"*":[th,iZ(th),(i,r)=>{let n=1;for(const o of r)n*=o.evaluate(i);return n}],"-":{type:th,overloads:[[[th,th],(i,[r,n])=>r.evaluate(i)-n.evaluate(i)],[[th],(i,[r])=>-r.evaluate(i)]]},"/":[th,[th,th],(i,[r,n])=>r.evaluate(i)/n.evaluate(i)],"%":[th,[th,th],(i,[r,n])=>r.evaluate(i)%n.evaluate(i)],ln2:[th,[],()=>Math.LN2],pi:[th,[],()=>Math.PI],e:[th,[],()=>Math.E],"^":[th,[th,th],(i,[r,n])=>Math.pow(r.evaluate(i),n.evaluate(i))],sqrt:[th,[th],(i,[r])=>Math.sqrt(r.evaluate(i))],log10:[th,[th],(i,[r])=>Math.log(r.evaluate(i))/Math.LN10],ln:[th,[th],(i,[r])=>Math.log(r.evaluate(i))],log2:[th,[th],(i,[r])=>Math.log(r.evaluate(i))/Math.LN2],sin:[th,[th],(i,[r])=>Math.sin(r.evaluate(i))],cos:[th,[th],(i,[r])=>Math.cos(r.evaluate(i))],tan:[th,[th],(i,[r])=>Math.tan(r.evaluate(i))],asin:[th,[th],(i,[r])=>Math.asin(r.evaluate(i))],acos:[th,[th],(i,[r])=>Math.acos(r.evaluate(i))],atan:[th,[th],(i,[r])=>Math.atan(r.evaluate(i))],min:[th,iZ(th),(i,r)=>Math.min(...r.map(r=>r.evaluate(i)))],max:[th,iZ(th),(i,r)=>Math.max(...r.map(r=>r.evaluate(i)))],abs:[th,[th],(i,[r])=>Math.abs(r.evaluate(i))],round:[th,[th],(i,[r])=>{const n=r.evaluate(i);return n<0?-Math.round(-n):Math.round(n)}],floor:[th,[th],(i,[r])=>Math.floor(r.evaluate(i))],ceil:[th,[th],(i,[r])=>Math.ceil(r.evaluate(i))],"filter-==":[td,[tu,tm],(i,[r,n])=>i.properties()[r.value]===n.value],"filter-id-==":[td,[tm],(i,[r])=>i.id()===r.value],"filter-type-==":[td,[tu],(i,[r])=>i.geometryType()===r.value],"filter-<":[td,[tu,tm],(i,[r,n])=>{const o=i.properties()[r.value],s=n.value;return typeof o==typeof s&&o{const n=i.id(),o=r.value;return typeof n==typeof o&&n":[td,[tu,tm],(i,[r,n])=>{const o=i.properties()[r.value],s=n.value;return typeof o==typeof s&&o>s}],"filter-id->":[td,[tm],(i,[r])=>{const n=i.id(),o=r.value;return typeof n==typeof o&&n>o}],"filter-<=":[td,[tu,tm],(i,[r,n])=>{const o=i.properties()[r.value],s=n.value;return typeof o==typeof s&&o<=s}],"filter-id-<=":[td,[tm],(i,[r])=>{const n=i.id(),o=r.value;return typeof n==typeof o&&n<=o}],"filter->=":[td,[tu,tm],(i,[r,n])=>{const o=i.properties()[r.value],s=n.value;return typeof o==typeof s&&o>=s}],"filter-id->=":[td,[tm],(i,[r])=>{const n=i.id(),o=r.value;return typeof n==typeof o&&n>=o}],"filter-has":[td,[tm],(i,[r])=>r.value in i.properties()],"filter-has-id":[td,[],i=>null!==i.id()&&void 0!==i.id()],"filter-type-in":[td,[tx(tu)],(i,[r])=>r.value.indexOf(i.geometryType())>=0],"filter-id-in":[td,[tx(tm)],(i,[r])=>r.value.indexOf(i.id())>=0],"filter-in-small":[td,[tu,tx(tm)],(i,[r,n])=>n.value.indexOf(i.properties()[r.value])>=0],"filter-in-large":[td,[tu,tx(tm)],(i,[r,n])=>(function(i,r,n,o){for(;n<=o;){const s=n+o>>1;if(r[s]===i)return!0;r[s]>i?o=s-1:n=s+1}return!1})(i.properties()[r.value],n.value,0,n.value.length-1)],all:{type:td,overloads:[[[td,td],(i,[r,n])=>r.evaluate(i)&&n.evaluate(i)],[iZ(td),(i,r)=>{for(const n of r)if(!n.evaluate(i))return!1;return!0}]]},any:{type:td,overloads:[[[td,td],(i,[r,n])=>r.evaluate(i)||n.evaluate(i)],[iZ(td),(i,r)=>{for(const n of r)if(n.evaluate(i))return!0;return!1}]]},"!":[td,[td],(i,[r])=>!r.evaluate(i)],"is-supported-script":[td,[tu],(i,[r])=>{const n=i.globals&&i.globals.isSupportedScript;return!n||n(r.evaluate(i))}],upcase:[tu,[tu],(i,[r])=>r.evaluate(i).toUpperCase()],downcase:[tu,[tu],(i,[r])=>r.evaluate(i).toLowerCase()],concat:[tu,iZ(tm),(i,r)=>r.map(r=>tB(r.evaluate(i))).join("")],"resolved-locale":[tu,[t_],(i,[r])=>r.evaluate(i).resolvedLocale()]});class i5{constructor(i,r){this.expression=i,this._warningHistory={},this._evaluator=new t$,this._defaultValue=r?"color"===r.type&&iY(r.default)?new tM(0,0,0,0):"color"===r.type?tM.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=r&&"enum"===r.type?r.values:null}evaluateWithoutErrorHandling(i,r,n,o,s,a,l,c){return this._evaluator.globals=i,this._evaluator.feature=r,this._evaluator.featureState=n,this._evaluator.canonical=o,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=a,this._evaluator.featureTileCoord=l||null,this._evaluator.featureDistanceData=c||null,this.expression.evaluate(this._evaluator)}evaluate(i,r,n,o,s,a,l,c){this._evaluator.globals=i,this._evaluator.feature=r||null,this._evaluator.featureState=n||null,this._evaluator.canonical=o,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=a||null,this._evaluator.featureTileCoord=l||null,this._evaluator.featureDistanceData=c||null;try{const i=this.expression.evaluate(this._evaluator);if(null==i||"number"==typeof i&&i!=i)return this._defaultValue;if(this._enumValues&&!(i in this._enumValues))throw new tF(`Expected value to be one of ${Object.keys(this._enumValues).map(i=>JSON.stringify(i)).join(", ")}, but found ${JSON.stringify(i)} instead.`);return i}catch(i){return this._warningHistory[i.message]||(this._warningHistory[i.message]=!0,"undefined"!=typeof console&&console.warn(i.message)),this._defaultValue}}}function i4(i){return Array.isArray(i)&&i.length>0&&"string"==typeof i[0]&&i[0]in iN}function i6(i,r){const n=new t7(iN,[],r?function(i){const r={color:tp,string:tu,number:th,enum:tu,boolean:td,formatted:tg,resolvedImage:ty};return"array"===i.type?tx(r[i.value]||tm,i.length):r[i.type]}(r):void 0),o=n.parse(i,void 0,void 0,void 0,r&&"string"===r.type?{typeAnnotation:"coerce"}:void 0);return o?i$(new i5(o,r)):iq(n.errors)}class i8{constructor(i,r){this.kind=i,this._styleExpression=r,this.isStateDependent="constant"!==i&&!t6(r.expression)}evaluateWithoutErrorHandling(i,r,n,o,s,a){return this._styleExpression.evaluateWithoutErrorHandling(i,r,n,o,s,a)}evaluate(i,r,n,o,s,a){return this._styleExpression.evaluate(i,r,n,o,s,a)}}class i9{constructor(i,r,n,o){this.kind=i,this.zoomStops=n,this._styleExpression=r,this.isStateDependent="camera"!==i&&!t6(r.expression),this.interpolationType=o}evaluateWithoutErrorHandling(i,r,n,o,s,a){return this._styleExpression.evaluateWithoutErrorHandling(i,r,n,o,s,a)}evaluate(i,r,n,o,s,a){return this._styleExpression.evaluate(i,r,n,o,s,a)}interpolationFactor(i,r,n){return this.interpolationType?iv.interpolationFactor(this.interpolationType,i,r,n):0}}function i7(i,r){if("error"===(i=i6(i,r)).result)return i;const n=i.value.expression,o=t4(n);if(!o&&!iX(r))return iq([new ta("","data expressions not supported")]);const s=t8(n,["zoom","pitch","distance-from-center"]);if(!s&&!iW(r))return iq([new ta("","zoom expressions not supported")]);const a=function i(r){let n=null;if(r instanceof iT)n=i(r.result);else if(r instanceof iw){for(const o of r.args)if(n=i(o))break}else(r instanceof it||r instanceof iv)&&r.input instanceof tq&&"zoom"===r.input.name&&(n=r);return n instanceof ta||r.eachChild(r=>{const o=i(r);o instanceof ta?n=o:!n&&o?n=new ta("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):n&&o&&n!==o&&(n=new ta("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),n}(n);return a||s?a instanceof ta?iq([a]):a instanceof iv&&!iH(r)?iq([new ta("",'"interpolate" expressions cannot be used with this property')]):i$(a?new i9(o?"camera":"composite",i.value,a.labels,a instanceof iv?a.interpolation:void 0):new i8(o?"constant":"source",i.value)):iq([new ta("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class re{constructor(i,r){this._parameters=i,this._specification=r,tn(this,function i(r,n){let o,s,a;const l="color"===n.type,c=r.stops&&"object"==typeof r.stops[0][0],h=c||!(c||void 0!==r.property),u=r.type||(iH(n)?"exponential":"interval");if(l&&((r=tn({},r)).stops&&(r.stops=r.stops.map(i=>[i[0],tM.parse(i[1])])),r.default=tM.parse(r.default?r.default:n.default)),r.colorSpace&&"rgb"!==r.colorSpace&&!ix[r.colorSpace])throw Error(`Unknown color space: ${r.colorSpace}`);if("exponential"===u)o=i2;else if("interval"===u)o=i1;else if("categorical"===u){for(const i of(o=i0,s=Object.create(null),r.stops))s[i[0]]=i[1];a=typeof r.stops[0][0]}else{if("identity"!==u)throw Error(`Unknown function type "${u}"`);o=i3}if(c){const o={},s=[];for(let i=0;ii[0]),evaluate:({zoom:i},o)=>i2({stops:a,base:r.base},n,i).evaluate(i,o)}}if(h){const i="exponential"===u?{name:"exponential",base:void 0!==r.base?r.base:1}:null;return{kind:"camera",interpolationType:i,interpolationFactor:iv.interpolationFactor.bind(void 0,i),zoomStops:r.stops.map(i=>i[0]),evaluate:({zoom:i})=>o(r,n,i,s,a)}}return{kind:"source",evaluate(i,l){const c=l&&l.properties?l.properties[r.property]:void 0;return void 0===c?iQ(r.default,n.default):o(r,n,c,s,a)}}}(this._parameters,this._specification))}static deserialize(i){return new re(i._parameters,i._specification)}static serialize(i){return{_parameters:i._parameters,_specification:i._specification}}}function rt(i){const r=i.key,n=i.value,o=i.valueSpec||{},s=i.objectElementValidators||{},a=i.style,l=i.styleSpec;let c=[];const h=iK(n);if("object"!==h)return[new ti(r,n,`object expected, ${h} found`)];for(const i in n){let h;const u=i.split(".")[0],d=o[u]||o["*"];if(s[u])h=s[u];else if(o[u])h=rA;else if(s["*"])h=s["*"];else{if(!o["*"]){c.push(new ti(r,n[i],`unknown property "${i}"`));continue}h=rA}c=c.concat(h({key:(r?`${r}.`:r)+i,value:n[i],valueSpec:d,style:a,styleSpec:l,object:n,objectKey:i},n))}for(const i in o)s[i]||o[i].required&&void 0===o[i].default&&void 0===n[i]&&c.push(new ti(r,n,`missing required property "${i}"`));return c}function ri(i){const r=i.value,n=i.valueSpec,o=i.style,s=i.styleSpec,a=i.key,l=i.arrayElementValidator||rA;if("array"!==iK(r))return[new ti(a,r,`array expected, ${iK(r)} found`)];if(n.length&&r.length!==n.length)return[new ti(a,r,`array length ${n.length} expected, length ${r.length} found`)];if(n["min-length"]&&r.lengths)return[new ti(r,n,`${n} is greater than the maximum value ${s}`)]}return[]}function rn(i){const r=i.valueSpec,n=to(i.value.type);let o,s,a,l={};const c="categorical"!==n&&void 0===i.value.property,h="array"===iK(i.value.stops)&&"array"===iK(i.value.stops[0])&&"object"===iK(i.value.stops[0][0]),u=rt({key:i.key,value:i.value,valueSpec:i.styleSpec.function,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(i){if("identity"===n)return[new ti(i.key,i.value,'identity function may not have a "stops" property')];let r=[];const o=i.value;return r=r.concat(ri({key:i.key,value:o,valueSpec:i.valueSpec,style:i.style,styleSpec:i.styleSpec,arrayElementValidator:d})),"array"===iK(o)&&0===o.length&&r.push(new ti(i.key,o,"array must have at least one stop")),r},default:function(i){return rA({key:i.key,value:i.value,valueSpec:r,style:i.style,styleSpec:i.styleSpec})}}});return"identity"===n&&c&&u.push(new ti(i.key,i.value,'missing required property "property"')),"identity"===n||i.value.stops||u.push(new ti(i.key,i.value,'missing required property "stops"')),"exponential"===n&&i.valueSpec.expression&&!iH(i.valueSpec)&&u.push(new ti(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(c||iX(i.valueSpec)?c&&!iW(i.valueSpec)&&u.push(new ti(i.key,i.value,"zoom functions not supported")):u.push(new ti(i.key,i.value,"property functions not supported"))),("categorical"===n||h)&&void 0===i.value.property&&u.push(new ti(i.key,i.value,'"property" property is required')),u;function d(i){let n=[];const o=i.value,c=i.key;if("array"!==iK(o))return[new ti(c,o,`array expected, ${iK(o)} found`)];if(2!==o.length)return[new ti(c,o,`array length 2 expected, length ${o.length} found`)];if(h){if("object"!==iK(o[0]))return[new ti(c,o,`object expected, ${iK(o[0])} found`)];if(void 0===o[0].zoom)return[new ti(c,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new ti(c,o,"object stop key must have value")];if(a&&a>to(o[0].zoom))return[new ti(c,o[0].zoom,"stop zoom values must appear in ascending order")];to(o[0].zoom)!==a&&(a=to(o[0].zoom),s=void 0,l={}),n=n.concat(rt({key:`${c}[0]`,value:o[0],valueSpec:{zoom:{}},style:i.style,styleSpec:i.styleSpec,objectElementValidators:{zoom:rr,value:p}}))}else n=n.concat(p({key:`${c}[0]`,value:o[0],valueSpec:{},style:i.style,styleSpec:i.styleSpec},o));return i4(ts(o[1]))?n.concat([new ti(`${c}[1]`,o[1],"expressions are not allowed in function stops.")]):n.concat(rA({key:`${c}[1]`,value:o[1],valueSpec:r,style:i.style,styleSpec:i.styleSpec}))}function p(i,a){const c=iK(i.value),h=to(i.value),u=null!==i.value?i.value:a;if(o){if(c!==o)return[new ti(i.key,u,`${c} stop domain type must match previous stop domain type ${o}`)]}else o=c;if("number"!==c&&"string"!==c&&"boolean"!==c)return[new ti(i.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==c&&"categorical"!==n){let o=`number expected, ${c} found`;return iX(r)&&void 0===n&&(o+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ti(i.key,u,o)]}return"categorical"!==n||"number"!==c||isFinite(h)&&Math.floor(h)===h?"categorical"!==n&&"number"===c&&void 0!==s&&hnew ti(`${i.key}${r.key}`,i.value,r.message));const n=r.value.expression||r.value._styleExpression.expression;if("property"===i.expressionContext&&"text-font"===i.propertyKey&&!n.outputDefined())return[new ti(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===i.expressionContext&&"layout"===i.propertyType&&!t6(n))return[new ti(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===i.expressionContext)return function i(r,n){const o=new Set(["zoom","feature-state","pitch","distance-from-center"]);for(const i of n.valueSpec.expression.parameters)o.delete(i);if(0===o.size)return[];const s=[];return r instanceof tq&&o.has(r.name)?[new ti(n.key,n.value,`["${r.name}"] expression is not supported in a filter for a ${n.object.type} layer with id: ${n.object.id}`)]:(r.eachChild(r=>{s.push(...i(r,n))}),s)}(n,i);if(i.expressionContext&&0===i.expressionContext.indexOf("cluster")){if(!t8(n,["zoom","feature-state"]))return[new ti(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===i.expressionContext&&!t4(n))return[new ti(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function rs(i){const r=i.key,n=i.value,o=i.valueSpec,s=[];return Array.isArray(o.values)?-1===o.values.indexOf(to(n))&&s.push(new ti(r,n,`expected one of [${o.values.join(", ")}], ${JSON.stringify(n)} found`)):-1===Object.keys(o.values).indexOf(to(n))&&s.push(new ti(r,n,`expected one of [${Object.keys(o.values).join(", ")}], ${JSON.stringify(n)} found`)),s}function ra(i){if(!0===i||!1===i)return!0;if(!Array.isArray(i)||0===i.length)return!1;switch(i[0]){case"has":return i.length>=2&&"$id"!==i[1]&&"$type"!==i[1];case"in":return i.length>=3&&("string"!=typeof i[1]||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==i.length||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const r of i.slice(1))if(!ra(r)&&"boolean"!=typeof r)return!1;return!0;default:return!0}}function rl(i,r="fill"){if(null==i)return{filter:()=>!0,needGeometry:!1,needFeature:!1};ra(i)||(i=function i(r){if(!r)return!0;const n=r[0];return r.length<=1?"any"!==n:"=="===n?rd(r[1],r[2],"=="):"!="===n?rm(rd(r[1],r[2],"==")):"<"===n||">"===n||"<="===n||">="===n?rd(r[1],r[2],n):"any"===n?["any"].concat(r.slice(1).map(i)):"all"===n?["all"].concat(r.slice(1).map(i)):"none"===n?["all"].concat(r.slice(1).map(i).map(rm)):"in"===n?rp(r[1],r.slice(2)):"!in"===n?rm(rp(r[1],r.slice(2))):"has"===n?rf(r[1]):"!has"===n?rm(rf(r[1])):"within"!==n||r}(i));const n=i;let o=!0;try{o=function(i){if(!rc(i))return i;let r=ts(i);return function i(r){let n=!1;const o=[];if("case"===r[0]){for(let i=1;ii(r))}(r)}(n)}catch(i){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate. +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[634],{6158:function(i,r,n){var o=n(3454);i.exports=function(){"use strict";var i,r,n;function s(o,s){if(i){if(r){var a="self.onerror = function() { console.error('An error occurred while parsing the WebWorker bundle. This is most likely due to improper transpilation by Babel; please see https://docs.mapbox.com/mapbox-gl-js/guides/install/#transpiling'); }; var sharedChunk = {}; ("+i+")(sharedChunk); ("+r+")(sharedChunk); self.onerror = null;",l={};i(l),n=s(l),"undefined"!=typeof window&&window&&window.URL&&window.URL.createObjectURL&&(n.workerUrl=window.URL.createObjectURL(new Blob([a],{type:"text/javascript"})))}else r=s}else i=s}return s(["exports"],function(i){let r,n,s;var a,l,c="2.7.0";function h(i,r,n,o){this.cx=3*i,this.bx=3*(n-i)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*r,this.by=3*(o-r)-this.cy,this.ay=1-this.cy-this.by,this.p1x=i,this.p1y=o,this.p2x=n,this.p2y=o}h.prototype.sampleCurveX=function(i){return((this.ax*i+this.bx)*i+this.cx)*i},h.prototype.sampleCurveY=function(i){return((this.ay*i+this.by)*i+this.cy)*i},h.prototype.sampleCurveDerivativeX=function(i){return(3*this.ax*i+2*this.bx)*i+this.cx},h.prototype.solveCurveX=function(i,r){var n,o,s,a,l;for(void 0===r&&(r=1e-6),s=i,l=0;l<8;l++){if(Math.abs(a=this.sampleCurveX(s)-i)Math.abs(c))break;s-=a/c}if((s=i)<(n=0))return n;if(s>(o=1))return o;for(;na?n=s:o=s,s=.5*(o-n)+n;return s},h.prototype.solve=function(i,r){return this.sampleCurveY(this.solveCurveX(i,r))};var u=d;function d(i,r){this.x=i,this.y=r}d.prototype={clone:function(){return new d(this.x,this.y)},add:function(i){return this.clone()._add(i)},sub:function(i){return this.clone()._sub(i)},multByPoint:function(i){return this.clone()._multByPoint(i)},divByPoint:function(i){return this.clone()._divByPoint(i)},mult:function(i){return this.clone()._mult(i)},div:function(i){return this.clone()._div(i)},rotate:function(i){return this.clone()._rotate(i)},rotateAround:function(i,r){return this.clone()._rotateAround(i,r)},matMult:function(i){return this.clone()._matMult(i)},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(i){return this.x===i.x&&this.y===i.y},dist:function(i){return Math.sqrt(this.distSqr(i))},distSqr:function(i){var r=i.x-this.x,n=i.y-this.y;return r*r+n*n},angle:function(){return Math.atan2(this.y,this.x)},angleTo:function(i){return Math.atan2(this.y-i.y,this.x-i.x)},angleWith:function(i){return this.angleWithSep(i.x,i.y)},angleWithSep:function(i,r){return Math.atan2(this.x*r-this.y*i,this.x*i+this.y*r)},_matMult:function(i){var r=i[2]*this.x+i[3]*this.y;return this.x=i[0]*this.x+i[1]*this.y,this.y=r,this},_add:function(i){return this.x+=i.x,this.y+=i.y,this},_sub:function(i){return this.x-=i.x,this.y-=i.y,this},_mult:function(i){return this.x*=i,this.y*=i,this},_div:function(i){return this.x/=i,this.y/=i,this},_multByPoint:function(i){return this.x*=i.x,this.y*=i.y,this},_divByPoint:function(i){return this.x/=i.x,this.y/=i.y,this},_unit:function(){return this._div(this.mag()),this},_perp:function(){var i=this.y;return this.y=this.x,this.x=-i,this},_rotate:function(i){var r=Math.cos(i),n=Math.sin(i),o=n*this.x+r*this.y;return this.x=r*this.x-n*this.y,this.y=o,this},_rotateAround:function(i,r){var n=Math.cos(i),o=Math.sin(i),s=r.y+o*(this.x-r.x)+n*(this.y-r.y);return this.x=r.x+n*(this.x-r.x)-o*(this.y-r.y),this.y=s,this},_round:function(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}},d.convert=function(i){return i instanceof d?i:Array.isArray(i)?new d(i[0],i[1]):i};var p="undefined"!=typeof self?self:{},f="undefined"!=typeof Float32Array?Float32Array:Array;function m(){var i=new f(9);return f!=Float32Array&&(i[1]=0,i[2]=0,i[3]=0,i[5]=0,i[6]=0,i[7]=0),i[0]=1,i[4]=1,i[8]=1,i}function _(i){return i[0]=1,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=1,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=1,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=1,i}function g(i,r,n){var o=r[0],s=r[1],a=r[2],l=r[3],c=r[4],h=r[5],u=r[6],d=r[7],p=r[8],f=r[9],m=r[10],_=r[11],g=r[12],y=r[13],x=r[14],v=r[15],b=n[0],w=n[1],T=n[2],E=n[3];return i[0]=b*o+w*c+T*p+E*g,i[1]=b*s+w*h+T*f+E*y,i[2]=b*a+w*u+T*m+E*x,i[3]=b*l+w*d+T*_+E*v,i[4]=(b=n[4])*o+(w=n[5])*c+(T=n[6])*p+(E=n[7])*g,i[5]=b*s+w*h+T*f+E*y,i[6]=b*a+w*u+T*m+E*x,i[7]=b*l+w*d+T*_+E*v,i[8]=(b=n[8])*o+(w=n[9])*c+(T=n[10])*p+(E=n[11])*g,i[9]=b*s+w*h+T*f+E*y,i[10]=b*a+w*u+T*m+E*x,i[11]=b*l+w*d+T*_+E*v,i[12]=(b=n[12])*o+(w=n[13])*c+(T=n[14])*p+(E=n[15])*g,i[13]=b*s+w*h+T*f+E*y,i[14]=b*a+w*u+T*m+E*x,i[15]=b*l+w*d+T*_+E*v,i}function y(i,r,n){var o,s,a,l,c,h,u,d,p,f,m,_,g=n[0],y=n[1],x=n[2];return r===i?(i[12]=r[0]*g+r[4]*y+r[8]*x+r[12],i[13]=r[1]*g+r[5]*y+r[9]*x+r[13],i[14]=r[2]*g+r[6]*y+r[10]*x+r[14],i[15]=r[3]*g+r[7]*y+r[11]*x+r[15]):(s=r[1],a=r[2],l=r[3],c=r[4],h=r[5],u=r[6],d=r[7],p=r[8],f=r[9],m=r[10],_=r[11],i[0]=o=r[0],i[1]=s,i[2]=a,i[3]=l,i[4]=c,i[5]=h,i[6]=u,i[7]=d,i[8]=p,i[9]=f,i[10]=m,i[11]=_,i[12]=o*g+c*y+p*x+r[12],i[13]=s*g+h*y+f*x+r[13],i[14]=a*g+u*y+m*x+r[14],i[15]=l*g+d*y+_*x+r[15]),i}function x(i,r,n){var o=n[0],s=n[1],a=n[2];return i[0]=r[0]*o,i[1]=r[1]*o,i[2]=r[2]*o,i[3]=r[3]*o,i[4]=r[4]*s,i[5]=r[5]*s,i[6]=r[6]*s,i[7]=r[7]*s,i[8]=r[8]*a,i[9]=r[9]*a,i[10]=r[10]*a,i[11]=r[11]*a,i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15],i}function v(i,r,n){var o=Math.sin(n),s=Math.cos(n),a=r[4],l=r[5],c=r[6],h=r[7],u=r[8],d=r[9],p=r[10],f=r[11];return r!==i&&(i[0]=r[0],i[1]=r[1],i[2]=r[2],i[3]=r[3],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15]),i[4]=a*s+u*o,i[5]=l*s+d*o,i[6]=c*s+p*o,i[7]=h*s+f*o,i[8]=u*s-a*o,i[9]=d*s-l*o,i[10]=p*s-c*o,i[11]=f*s-h*o,i}function b(i,r,n){var o=Math.sin(n),s=Math.cos(n),a=r[0],l=r[1],c=r[2],h=r[3],u=r[8],d=r[9],p=r[10],f=r[11];return r!==i&&(i[4]=r[4],i[5]=r[5],i[6]=r[6],i[7]=r[7],i[12]=r[12],i[13]=r[13],i[14]=r[14],i[15]=r[15]),i[0]=a*s-u*o,i[1]=l*s-d*o,i[2]=c*s-p*o,i[3]=h*s-f*o,i[8]=a*o+u*s,i[9]=l*o+d*s,i[10]=c*o+p*s,i[11]=h*o+f*s,i}function w(){var i=new f(3);return f!=Float32Array&&(i[0]=0,i[1]=0,i[2]=0),i}function T(i){var r=new f(3);return r[0]=i[0],r[1]=i[1],r[2]=i[2],r}function E(i){return Math.hypot(i[0],i[1],i[2])}function S(i,r,n){var o=new f(3);return o[0]=i,o[1]=r,o[2]=n,o}function I(i,r,n){return i[0]=r[0]+n[0],i[1]=r[1]+n[1],i[2]=r[2]+n[2],i}function M(i,r,n){return i[0]=r[0]-n[0],i[1]=r[1]-n[1],i[2]=r[2]-n[2],i}function A(i,r,n){return i[0]=r[0]*n[0],i[1]=r[1]*n[1],i[2]=r[2]*n[2],i}function C(i,r,n){return i[0]=r[0]*n,i[1]=r[1]*n,i[2]=r[2]*n,i}function z(i,r,n,o){return i[0]=r[0]+n[0]*o,i[1]=r[1]+n[1]*o,i[2]=r[2]+n[2]*o,i}function k(i,r){var n=r[0],o=r[1],s=r[2],a=n*n+o*o+s*s;return a>0&&(a=1/Math.sqrt(a)),i[0]=r[0]*a,i[1]=r[1]*a,i[2]=r[2]*a,i}function P(i,r){return i[0]*r[0]+i[1]*r[1]+i[2]*r[2]}function D(i,r,n){var o=r[0],s=r[1],a=r[2],l=n[0],c=n[1],h=n[2];return i[0]=s*h-a*c,i[1]=a*l-o*h,i[2]=o*c-s*l,i}function L(i,r,n){var o=r[0],s=r[1],a=r[2],l=n[3]*o+n[7]*s+n[11]*a+n[15];return i[0]=(n[0]*o+n[4]*s+n[8]*a+n[12])/(l=l||1),i[1]=(n[1]*o+n[5]*s+n[9]*a+n[13])/l,i[2]=(n[2]*o+n[6]*s+n[10]*a+n[14])/l,i}function B(i,r,n){var o=n[0],s=n[1],a=n[2],l=r[0],c=r[1],h=r[2],u=s*h-a*c,d=a*l-o*h,p=o*c-s*l,f=s*p-a*d,m=a*u-o*p,_=o*d-s*u,g=2*n[3];return d*=g,p*=g,m*=2,_*=2,i[0]=l+(u*=g)+(f*=2),i[1]=c+d+m,i[2]=h+p+_,i}function R(i,r,n){var o=r[0],s=r[1],a=r[2],l=r[3];return i[0]=n[0]*o+n[4]*s+n[8]*a+n[12]*l,i[1]=n[1]*o+n[5]*s+n[9]*a+n[13]*l,i[2]=n[2]*o+n[6]*s+n[10]*a+n[14]*l,i[3]=n[3]*o+n[7]*s+n[11]*a+n[15]*l,i}function F(){var i=new f(4);return f!=Float32Array&&(i[0]=0,i[1]=0,i[2]=0),i[3]=1,i}function O(i){return i[0]=0,i[1]=0,i[2]=0,i[3]=1,i}function U(i,r,n){n*=.5;var o=r[0],s=r[1],a=r[2],l=r[3],c=Math.sin(n),h=Math.cos(n);return i[0]=o*h+l*c,i[1]=s*h+a*c,i[2]=a*h-s*c,i[3]=l*h-o*c,i}function V(i,r){return i[0]===r[0]&&i[1]===r[1]}Math.hypot||(Math.hypot=function(){for(var i=0,r=arguments.length;r--;)i+=arguments[r]*arguments[r];return Math.sqrt(i)}),w(),a=new f(4),f!=Float32Array&&(a[0]=0,a[1]=0,a[2]=0,a[3]=0),w(),S(1,0,0),S(0,1,0),F(),F(),m(),l=new f(2),f!=Float32Array&&(l[0]=0,l[1]=0);const N=Math.PI/180,j=180/Math.PI,G=[[0,0],[1,0],[1,1],[0,1]];function Z(i){if(i<=0)return 0;if(i>=1)return 1;const r=i*i,n=r*i;return 4*(i<.5?n:3*(i-r)+n-.75)}function $(i,r,n,o){const s=new h(i,r,n,o);return function(i){return s.solve(i)}}const q=$(.25,.1,.25,1);function X(i,r,n){return Math.min(n,Math.max(r,i))}function W(i,r,n){return(n=X((n-i)/(r-i),0,1))*n*(3-2*n)}function H(i,r,n){const o=n-r,s=((i-r)%o+o)%o+r;return s===r?n:s}function K(i,r,n){if(!i.length)return n(null,[]);let o=i.length;const s=Array(i.length);let a=null;i.forEach((i,l)=>{r(i,(i,r)=>{i&&(a=i),s[l]=r,0==--o&&n(a,s)})})}function Y(i){const r=[];for(const n in i)r.push(i[n]);return r}function J(i,...r){for(const n of r)for(const r in n)i[r]=n[r];return i}let Q=1;function ee(){return Q++}function et(){return function i(r){return r?(r^16*Math.random()>>r/4).toString(16):([1e7]+-[1e3]+-4e3+-8e3+-1e11).replace(/[018]/g,i)}()}function ei(i){return i<=1?1:Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function er(i){return!!i&&/^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test(i)}function en(i,r){i.forEach(i=>{r[i]&&(r[i]=r[i].bind(r))})}function eo(i,r){return -1!==i.indexOf(r,i.length-r.length)}function es(i,r,n){const o={};for(const s in i)o[s]=r.call(n||this,i[s],s,i);return o}function ea(i,r,n){const o={};for(const s in i)r.call(n||this,i[s],s,i)&&(o[s]=i[s]);return o}function el(i){return Array.isArray(i)?i.map(el):"object"==typeof i&&i?es(i,el):i}const ec={};function eh(i){ec[i]||("undefined"!=typeof console&&console.warn(i),ec[i]=!0)}function eu(i,r,n){return(n.y-i.y)*(r.x-i.x)>(r.y-i.y)*(n.x-i.x)}function ed(){return"undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof self&&self instanceof WorkerGlobalScope}function ep(i){const r={};if(i.replace(/(?:^|(?:\s*\,\s*))([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)(?:\=(?:([^\x00-\x20\(\)<>@\,;\:\\"\/\[\]\?\=\{\}\x7F]+)|(?:\"((?:[^"\\]|\\.)*)\")))?/g,(i,n,o,s)=>{const a=o||s;return r[n]=!a||a.toLowerCase(),""}),r["max-age"]){const i=parseInt(r["max-age"],10);isNaN(i)?delete r["max-age"]:r["max-age"]=i}return r}let ef,em,e_,eg=null;function ey(i){if(null==eg){const r=i.navigator?i.navigator.userAgent:null;eg=!!i.safari||!(!r||!(/\b(iPad|iPhone|iPod)\b/.test(r)||r.match("Safari")&&!r.match("Chrome")))}return eg}function ex(i){try{const r=p[i];return r.setItem("_mapbox_test_",1),r.removeItem("_mapbox_test_"),!0}catch(i){return!1}}const ev={now:()=>void 0!==e_?e_:p.performance.now(),setNow(i){e_=i},restoreNow(){e_=void 0},frame(i){const r=p.requestAnimationFrame(i);return{cancel:()=>p.cancelAnimationFrame(r)}},getImageData(i,r=0){const n=p.document.createElement("canvas"),o=n.getContext("2d");if(!o)throw Error("failed to create canvas 2d context");return n.width=i.width,n.height=i.height,o.drawImage(i,0,0,i.width,i.height),o.getImageData(-r,-r,i.width+2*r,i.height+2*r)},resolveURL:i=>(ef||(ef=p.document.createElement("a")),ef.href=i,ef.href),get devicePixelRatio(){return p.devicePixelRatio},get prefersReducedMotion(){return!!p.matchMedia&&(null==em&&(em=p.matchMedia("(prefers-reduced-motion: reduce)")),em.matches)}},eb={API_URL:"https://api.mapbox.com",get API_URL_REGEX(){if(null==r){const i=/^((https?:)?\/\/)?([^\/]+\.)?mapbox\.c(n|om)(\/|\?|$)/i;try{r=null!=o.env.API_URL_REGEX?new RegExp(o.env.API_URL_REGEX):i}catch(n){r=i}}return r},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},SESSION_PATH:"/map-sessions/v1",FEEDBACK_URL:"https://apps.mapbox.com/feedback",TILE_URL_VERSION:"v4",RASTER_URL_PREFIX:"raster/v1",REQUIRE_ACCESS_TOKEN:!0,ACCESS_TOKEN:null,MAX_PARALLEL_IMAGE_REQUESTS:16},ew={supported:!1,testSupport:function(i){!eS&&eE&&(eI?eM(i):eT=i)}};let eT,eE,eS=!1,eI=!1;function eM(i){const r=i.createTexture();i.bindTexture(i.TEXTURE_2D,r);try{if(i.texImage2D(i.TEXTURE_2D,0,i.RGBA,i.RGBA,i.UNSIGNED_BYTE,eE),i.isContextLost())return;ew.supported=!0}catch(i){}i.deleteTexture(r),eS=!0}p.document&&((eE=p.document.createElement("img")).onload=function(){eT&&eM(eT),eT=null,eI=!0},eE.onerror=function(){eS=!0,eT=null},eE.src="data:image/webp;base64,UklGRh4AAABXRUJQVlA4TBEAAAAvAQAAAAfQ//73v/+BiOh/AAA=");const eA="NO_ACCESS_TOKEN";function eC(i){return 0===i.indexOf("mapbox:")}function ez(i){return eb.API_URL_REGEX.test(i)}const ek=/^(\w+):\/\/([^/?]*)(\/[^?]+)?\??(.+)?/;function eP(i){const r=i.match(ek);if(!r)throw Error("Unable to parse URL object");return{protocol:r[1],authority:r[2],path:r[3]||"/",params:r[4]?r[4].split("&"):[]}}function eD(i){const r=i.params.length?`?${i.params.join("&")}`:"";return`${i.protocol}://${i.authority}${i.path}${r}`}function eL(i){if(!i)return null;const r=i.split(".");if(!r||3!==r.length)return null;try{return JSON.parse(decodeURIComponent(p.atob(r[1]).split("").map(i=>"%"+("00"+i.charCodeAt(0).toString(16)).slice(-2)).join("")))}catch(i){return null}}class eB{constructor(i){this.type=i,this.anonId=null,this.eventData={},this.queue=[],this.pendingRequest=null}getStorageKey(i){const r=eL(eb.ACCESS_TOKEN);let n="";return n=r&&r.u?p.btoa(encodeURIComponent(r.u).replace(/%([0-9A-F]{2})/g,(i,r)=>String.fromCharCode(Number("0x"+r)))):eb.ACCESS_TOKEN||"",i?`mapbox.eventData.${i}:${n}`:`mapbox.eventData:${n}`}fetchEventData(){const i=ex("localStorage"),r=this.getStorageKey(),n=this.getStorageKey("uuid");if(i)try{const i=p.localStorage.getItem(r);i&&(this.eventData=JSON.parse(i));const o=p.localStorage.getItem(n);o&&(this.anonId=o)}catch(i){eh("Unable to read from LocalStorage")}}saveEventData(){const i=ex("localStorage"),r=this.getStorageKey(),n=this.getStorageKey("uuid");if(i)try{p.localStorage.setItem(n,this.anonId),Object.keys(this.eventData).length>=1&&p.localStorage.setItem(r,JSON.stringify(this.eventData))}catch(i){eh("Unable to write to LocalStorage")}}processRequests(i){}postEvent(i,r,n,o){if(!eb.EVENTS_URL)return;const s=eP(eb.EVENTS_URL);s.params.push(`access_token=${o||eb.ACCESS_TOKEN||""}`);const a={event:this.type,created:new Date(i).toISOString(),sdkIdentifier:"mapbox-gl-js",sdkVersion:c,skuId:"01",userId:this.anonId},l=r?J(a,r):a,h={url:eD(s),headers:{"Content-Type":"text/plain"},body:JSON.stringify([l])};this.pendingRequest=e2(h,i=>{this.pendingRequest=null,n(i),this.saveEventData(),this.processRequests(o)})}queueRequest(i,r){this.queue.push(i),this.processRequests(r)}}const eR=new class extends eB{constructor(i){super("appUserTurnstile"),this._customAccessToken=i}postTurnstileEvent(i,r){eb.EVENTS_URL&&eb.ACCESS_TOKEN&&Array.isArray(i)&&i.some(i=>eC(i)||ez(i))&&this.queueRequest(Date.now(),r)}processRequests(i){if(this.pendingRequest||0===this.queue.length)return;this.anonId&&this.eventData.lastSuccess&&this.eventData.tokenU||this.fetchEventData();const r=eL(eb.ACCESS_TOKEN),n=r?r.u:eb.ACCESS_TOKEN;let o=n!==this.eventData.tokenU;er(this.anonId)||(this.anonId=et(),o=!0);const s=this.queue.shift();if(this.eventData.lastSuccess){const i=new Date(this.eventData.lastSuccess),r=new Date(s),n=(s-this.eventData.lastSuccess)/864e5;o=o||n>=1||n<-1||i.getDate()!==r.getDate()}else o=!0;if(!o)return this.processRequests();this.postEvent(s,{"enabled.telemetry":!1},i=>{i||(this.eventData.lastSuccess=s,this.eventData.tokenU=n)},i)}},eF=eR.postTurnstileEvent.bind(eR),eO=new class extends eB{constructor(){super("map.load"),this.success={},this.skuToken=""}postMapLoadEvent(i,r,n,o){this.skuToken=r,this.errorCb=o,eb.EVENTS_URL&&(n||eb.ACCESS_TOKEN?this.queueRequest({id:i,timestamp:Date.now()},n):this.errorCb(Error(eA)))}processRequests(i){if(this.pendingRequest||0===this.queue.length)return;const{id:r,timestamp:n}=this.queue.shift();r&&this.success[r]||(this.anonId||this.fetchEventData(),er(this.anonId)||(this.anonId=et()),this.postEvent(n,{skuToken:this.skuToken},i=>{i?this.errorCb(i):r&&(this.success[r]=!0)},i))}},eU=eO.postMapLoadEvent.bind(eO),eV=new class extends eB{constructor(){super("map.auth"),this.success={},this.skuToken=""}getSession(i,r,n,o){if(!eb.API_URL||!eb.SESSION_PATH)return;const s=eP(eb.API_URL+eb.SESSION_PATH);s.params.push(`sku=${r||""}`),s.params.push(`access_token=${o||eb.ACCESS_TOKEN||""}`);const a={url:eD(s),headers:{"Content-Type":"text/plain"}};this.pendingRequest=e3(a,i=>{this.pendingRequest=null,n(i),this.saveEventData(),this.processRequests(o)})}getSessionAPI(i,r,n,o){this.skuToken=r,this.errorCb=o,eb.SESSION_PATH&&eb.API_URL&&(n||eb.ACCESS_TOKEN?this.queueRequest({id:i,timestamp:Date.now()},n):this.errorCb(Error(eA)))}processRequests(i){if(this.pendingRequest||0===this.queue.length)return;const{id:r,timestamp:n}=this.queue.shift();r&&this.success[r]||this.getSession(n,this.skuToken,i=>{i?this.errorCb(i):r&&(this.success[r]=!0)},i)}},eN=eV.getSessionAPI.bind(eV),ej=new Set,eG="mapbox-tiles";let eZ,e$,eq=500,eX=50;function eW(){p.caches&&!eZ&&(eZ=p.caches.open(eG))}function eH(i){const r=i.indexOf("?");return r<0?i:i.slice(0,r)}let eK=1/0;const eY={Unknown:"Unknown",Style:"Style",Source:"Source",Tile:"Tile",Glyphs:"Glyphs",SpriteImage:"SpriteImage",SpriteJSON:"SpriteJSON",Image:"Image"};"function"==typeof Object.freeze&&Object.freeze(eY);class eJ extends Error{constructor(i,r,n){401===r&&ez(n)&&(i+=": you may have provided an invalid Mapbox access token. See https://www.mapbox.com/api-documentation/#access-tokens-and-token-scopes"),super(i),this.status=r,this.url=n}toString(){return`${this.name}: ${this.message} (${this.status}): ${this.url}`}}const eQ=ed()?()=>self.worker&&self.worker.referrer:()=>("blob:"===p.location.protocol?p.parent:p).location.href,e0=function(i,r){var n;if(!(/^file:/.test(n=i.url)||/^file:/.test(eQ())&&!/^\w+:/.test(n))){if(p.fetch&&p.Request&&p.AbortController&&p.Request.prototype.hasOwnProperty("signal"))return function(i,r){var n;const o=new p.AbortController,s=new p.Request(i.url,{method:i.method||"GET",body:i.body,credentials:i.credentials,headers:i.headers,referrer:eQ(),signal:o.signal});let a=!1,l=!1;const c=(n=s.url).indexOf("sku=")>0&&ez(n);"json"===i.type&&s.headers.set("Accept","application/json");const h=(n,o,a)=>{if(l)return;if(n&&"SecurityError"!==n.message&&eh(n),o&&a)return u(o);const h=Date.now();p.fetch(s).then(n=>{if(n.ok){const i=c?n.clone():null;return u(n,i,h)}return r(new eJ(n.statusText,n.status,i.url))}).catch(i=>{20!==i.code&&r(Error(i.message))})},u=(n,o,c)=>{("arrayBuffer"===i.type?n.arrayBuffer():"json"===i.type?n.json():n.text()).then(i=>{l||(o&&c&&function(i,r,n){if(eW(),!eZ)return;const o={status:r.status,statusText:r.statusText,headers:new p.Headers};r.headers.forEach((i,r)=>o.headers.set(r,i));const s=ep(r.headers.get("Cache-Control")||"");s["no-store"]||(s["max-age"]&&o.headers.set("Expires",new Date(n+1e3*s["max-age"]).toUTCString()),new Date(o.headers.get("Expires")).getTime()-n<42e4||function(i,r){if(void 0===e$)try{new Response(new ReadableStream),e$=!0}catch(i){e$=!1}e$?r(i.body):i.blob().then(r)}(r,r=>{const n=new p.Response(r,o);eW(),eZ&&eZ.then(r=>r.put(eH(i.url),n)).catch(i=>eh(i.message))}))}(s,o,c),a=!0,r(null,i,n.headers.get("Cache-Control"),n.headers.get("Expires")))}).catch(i=>{l||r(Error(i.message))})};return c?function(i,r){if(eW(),!eZ)return r(null);const n=eH(i.url);eZ.then(i=>{i.match(n).then(o=>{const s=function(i){if(!i)return!1;const r=new Date(i.headers.get("Expires")||0),n=ep(i.headers.get("Cache-Control")||"");return r>Date.now()&&!n["no-cache"]}(o);i.delete(n),s&&i.put(n,o.clone()),r(null,o,s)}).catch(r)}).catch(r)}(s,h):h(null,null),{cancel:()=>{l=!0,a||o.abort()}}}(i,r);if(ed()&&self.worker&&self.worker.actor)return self.worker.actor.send("getResource",i,r,void 0,!0)}return function(i,r){const n=new p.XMLHttpRequest;for(const r in n.open(i.method||"GET",i.url,!0),"arrayBuffer"===i.type&&(n.responseType="arraybuffer"),i.headers)n.setRequestHeader(r,i.headers[r]);return"json"===i.type&&(n.responseType="text",n.setRequestHeader("Accept","application/json")),n.withCredentials="include"===i.credentials,n.onerror=()=>{r(Error(n.statusText))},n.onload=()=>{if((n.status>=200&&n.status<300||0===n.status)&&null!==n.response){let o=n.response;if("json"===i.type)try{o=JSON.parse(n.response)}catch(i){return r(i)}r(null,o,n.getResponseHeader("Cache-Control"),n.getResponseHeader("Expires"))}else r(new eJ(n.statusText,n.status,i.url))},n.send(i.body),{cancel:()=>n.abort()}}(i,r)},e1=function(i,r){return e0(J(i,{type:"arrayBuffer"}),r)},e2=function(i,r){return e0(J(i,{method:"POST"}),r)},e3=function(i,r){return e0(J(i,{method:"GET"}),r)},e5="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=";n=[],s=0;const e4=function(i,r){if(ew.supported&&(i.headers||(i.headers={}),i.headers.accept="image/webp,*/*"),s>=eb.MAX_PARALLEL_IMAGE_REQUESTS){const o={requestParameters:i,callback:r,cancelled:!1,cancel(){this.cancelled=!0}};return n.push(o),o}s++;let o=!1;const a=()=>{if(!o)for(o=!0,s--;n.length&&s{a(),i?r(i):n&&(p.createImageBitmap?function(i,r){const n=new p.Blob([new Uint8Array(i)],{type:"image/png"});p.createImageBitmap(n).then(i=>{r(null,i)}).catch(i=>{r(Error(`Could not load image because of ${i.message}. Please make sure to use a supported image type such as PNG or JPEG. Note that SVGs are not supported.`))})}(n,(i,n)=>r(i,n,o,s)):function(i,r){const n=new p.Image,o=p.URL;n.onload=()=>{r(null,n),o.revokeObjectURL(n.src),n.onload=null,p.requestAnimationFrame(()=>{n.src=e5})},n.onerror=()=>r(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."));const s=new p.Blob([new Uint8Array(i)],{type:"image/png"});n.src=i.byteLength?o.createObjectURL(s):e5}(n,(i,n)=>r(i,n,o,s)))});return{cancel:()=>{l.cancel(),a()}}};function e6(i,r,n){n[i]&&-1!==n[i].indexOf(r)||(n[i]=n[i]||[],n[i].push(r))}function e8(i,r,n){if(n&&n[i]){const o=n[i].indexOf(r);-1!==o&&n[i].splice(o,1)}}class e9{constructor(i,r={}){J(this,r),this.type=i}}class e7 extends e9{constructor(i,r={}){super("error",J({error:i},r))}}class te{on(i,r){return this._listeners=this._listeners||{},e6(i,r,this._listeners),this}off(i,r){return e8(i,r,this._listeners),e8(i,r,this._oneTimeListeners),this}once(i,r){return r?(this._oneTimeListeners=this._oneTimeListeners||{},e6(i,r,this._oneTimeListeners),this):new Promise(r=>this.once(i,r))}fire(i,r){"string"==typeof i&&(i=new e9(i,r||{}));const n=i.type;if(this.listens(n)){i.target=this;const r=this._listeners&&this._listeners[n]?this._listeners[n].slice():[];for(const n of r)n.call(this,i);const o=this._oneTimeListeners&&this._oneTimeListeners[n]?this._oneTimeListeners[n].slice():[];for(const r of o)e8(n,r,this._oneTimeListeners),r.call(this,i);const s=this._eventedParent;s&&(J(i,"function"==typeof this._eventedParentData?this._eventedParentData():this._eventedParentData),s.fire(i))}else i instanceof e7&&console.error(i.error);return this}listens(i){return!!(this._listeners&&this._listeners[i]&&this._listeners[i].length>0||this._oneTimeListeners&&this._oneTimeListeners[i]&&this._oneTimeListeners[i].length>0||this._eventedParent&&this._eventedParent.listens(i))}setEventedParent(i,r){return this._eventedParent=i,this._eventedParentData=r,this}}var tt=JSON.parse('{"$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"},"terrain":{"type":"terrain"},"fog":{"type":"fog"},"sources":{"required":true,"type":"sources"},"sprite":{"type":"string"},"glyphs":{"type":"string"},"transition":{"type":"transition"},"projection":{"type":"projection"},"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":{},"sky":{}},"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_sky"],"layout_background":{"visibility":{"type":"enum","values":{"visible":{},"none":{}},"default":"visible","property-type":"constant"}},"layout_sky":{"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","feature"]},"property-type":"data-driven"},"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",{"symbol-placement":["point"]}],"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","feature"]},"property-type":"data-driven"},"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"],"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_symbol":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature","pitch","distance-from-center"]}},"filter_fill":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_line":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_circle":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_fill-extrusion":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"filter_heatmap":{"type":"boolean","default":false,"transition":false,"property-type":"data-driven","expression":{"interpolated":false,"parameters":["zoom","feature"]}},"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},"fog":{"range":{"type":"array","default":[0.5,10],"minimum":-20,"maximum":20,"length":2,"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},"horizon-blend":{"type":"number","property-type":"data-constant","default":0.1,"minimum":0,"maximum":1,"expression":{"interpolated":true,"parameters":["zoom"]},"transition":true}},"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}},"projection":{"name":{"type":"enum","values":{"albers":{},"equalEarth":{},"equirectangular":{},"lambertConformalConic":{},"mercator":{},"naturalEarth":{},"winkelTripel":{}},"default":"mercator","required":true},"center":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]},"parallels":{"type":"array","length":2,"value":"number","property-type":"data-constant","transition":false,"requires":[{"name":["albers","lambertConformalConic"]}]}},"terrain":{"source":{"type":"string","required":true},"exaggeration":{"type":"number","property-type":"data-constant","default":1,"minimum":0,"maximum":1000,"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_sky"],"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","feature"]},"property-type":"cross-faded-data-driven"},"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-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"}},"paint_sky":{"sky-type":{"type":"enum","values":{"gradient":{},"atmosphere":{}},"default":"atmosphere","expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun":{"type":"array","value":"number","length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"requires":[{"sky-type":"atmosphere"}],"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-atmosphere-sun-intensity":{"type":"number","requires":[{"sky-type":"atmosphere"}],"default":10,"minimum":0,"maximum":100,"transition":false,"property-type":"data-constant"},"sky-gradient-center":{"type":"array","requires":[{"sky-type":"gradient"}],"value":"number","default":[0,0],"length":2,"units":"degrees","minimum":[0,0],"maximum":[360,180],"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient-radius":{"type":"number","requires":[{"sky-type":"gradient"}],"default":90,"minimum":0,"maximum":180,"transition":false,"expression":{"interpolated":false,"parameters":["zoom"]},"property-type":"data-constant"},"sky-gradient":{"type":"color","default":["interpolate",["linear"],["sky-radial-progress"],0.8,"#87ceeb",1,"white"],"transition":false,"requires":[{"sky-type":"gradient"}],"expression":{"interpolated":true,"parameters":["sky-radial-progress"]},"property-type":"color-ramp"},"sky-atmosphere-halo-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-atmosphere-color":{"type":"color","default":"white","transition":false,"requires":[{"sky-type":"atmosphere"}],"property-type":"data-constant"},"sky-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"}}}');class ti{constructor(i,r,n,o){this.message=(i?`${i}: `:"")+n,o&&(this.identifier=o),null!=r&&r.__line__&&(this.line=r.__line__)}}function tr(i){const r=i.value;return r?[new ti(i.key,r,"constants have been deprecated as of v8")]:[]}function tn(i,...r){for(const n of r)for(const r in n)i[r]=n[r];return i}function to(i){return i instanceof Number||i instanceof String||i instanceof Boolean?i.valueOf():i}function ts(i){if(Array.isArray(i))return i.map(ts);if(i instanceof Object&&!(i instanceof Number||i instanceof String||i instanceof Boolean)){const r={};for(const n in i)r[n]=ts(i[n]);return r}return to(i)}class ta extends Error{constructor(i,r){super(r),this.message=r,this.key=i}}class tl{constructor(i,r=[]){for(const[n,o]of(this.parent=i,this.bindings={},r))this.bindings[n]=o}concat(i){return new tl(this,i)}get(i){if(this.bindings[i])return this.bindings[i];if(this.parent)return this.parent.get(i);throw Error(`${i} not found in scope.`)}has(i){return!!this.bindings[i]||!!this.parent&&this.parent.has(i)}}const tc={kind:"null"},th={kind:"number"},tu={kind:"string"},td={kind:"boolean"},tp={kind:"color"},tf={kind:"object"},tm={kind:"value"},t_={kind:"collator"},tg={kind:"formatted"},ty={kind:"resolvedImage"};function tx(i,r){return{kind:"array",itemType:i,N:r}}function tv(i){if("array"===i.kind){const r=tv(i.itemType);return"number"==typeof i.N?`array<${r}, ${i.N}>`:"value"===i.itemType.kind?"array":`array<${r}>`}return i.kind}const tb=[tc,th,tu,td,tp,tg,tf,tx(tm),ty];function tw(i,r){if("error"===r.kind)return null;if("array"===i.kind){if("array"===r.kind&&(0===r.N&&"value"===r.itemType.kind||!tw(i.itemType,r.itemType))&&("number"!=typeof i.N||i.N===r.N))return null}else{if(i.kind===r.kind)return null;if("value"===i.kind){for(const i of tb)if(!tw(i,r))return null}}return`Expected ${tv(i)} but found ${tv(r)} instead.`}function tT(i,r){return r.some(r=>r.kind===i.kind)}function tE(i,r){return r.some(r=>"null"===r?null===i:"array"===r?Array.isArray(i):"object"===r?i&&!Array.isArray(i)&&"object"==typeof i:r===typeof i)}function tS(i){var r={exports:{}};return i(r,r.exports),r.exports}var tI=tS(function(i,r){var n={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 o(i){return(i=Math.round(i))<0?0:i>255?255:i}function s(i){return o("%"===i[i.length-1]?parseFloat(i)/100*255:parseInt(i))}function a(i){var r;return(r="%"===i[i.length-1]?parseFloat(i)/100:parseFloat(i))<0?0:r>1?1:r}function l(i,r,n){return n<0?n+=1:n>1&&(n-=1),6*n<1?i+(r-i)*n*6:2*n<1?r:3*n<2?i+(r-i)*(2/3-n)*6:i}try{r.parseCSSColor=function(i){var r,c=i.replace(/ /g,"").toLowerCase();if(c in n)return n[c].slice();if("#"===c[0])return 4===c.length?(r=parseInt(c.substr(1),16))>=0&&r<=4095?[(3840&r)>>4|(3840&r)>>8,240&r|(240&r)>>4,15&r|(15&r)<<4,1]:null:7===c.length&&(r=parseInt(c.substr(1),16))>=0&&r<=16777215?[(16711680&r)>>16,(65280&r)>>8,255&r,1]:null;var h=c.indexOf("("),u=c.indexOf(")");if(-1!==h&&u+1===c.length){var d=c.substr(0,h),p=c.substr(h+1,u-(h+1)).split(","),f=1;switch(d){case"rgba":if(4!==p.length)break;f=a(p.pop());case"rgb":return 3!==p.length?null:[s(p[0]),s(p[1]),s(p[2]),f];case"hsla":if(4!==p.length)break;f=a(p.pop());case"hsl":if(3!==p.length)break;var m=(parseFloat(p[0])%360+360)%360/360,_=a(p[1]),g=a(p[2]),y=g<=.5?g*(_+1):g+_-g*_,x=2*g-y;return[o(255*l(x,y,m+1/3)),o(255*l(x,y,m)),o(255*l(x,y,m-1/3)),f]}}return null}}catch(i){}});class tM{constructor(i,r,n,o=1){this.r=i,this.g=r,this.b=n,this.a=o}static parse(i){if(!i)return;if(i instanceof tM)return i;if("string"!=typeof i)return;const r=tI.parseCSSColor(i);return r?new tM(r[0]/255*r[3],r[1]/255*r[3],r[2]/255*r[3],r[3]):void 0}toString(){const[i,r,n,o]=this.toArray();return`rgba(${Math.round(i)},${Math.round(r)},${Math.round(n)},${o})`}toArray(){const{r:i,g:r,b:n,a:o}=this;return 0===o?[0,0,0,0]:[255*i/o,255*r/o,255*n/o,o]}}tM.black=new tM(0,0,0,1),tM.white=new tM(1,1,1,1),tM.transparent=new tM(0,0,0,0),tM.red=new tM(1,0,0,1),tM.blue=new tM(0,0,1,1);class tA{constructor(i,r,n){this.sensitivity=i?r?"variant":"case":r?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(i,r){return this.collator.compare(i,r)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}class tC{constructor(i,r,n,o,s){this.text=i.normalize?i.normalize():i,this.image=r,this.scale=n,this.fontStack=o,this.textColor=s}}class tz{constructor(i){this.sections=i}static fromString(i){return new tz([new tC(i,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(i=>0!==i.text.length||i.image&&0!==i.image.name.length)}static factory(i){return i instanceof tz?i:tz.fromString(i)}toString(){return 0===this.sections.length?"":this.sections.map(i=>i.text).join("")}serialize(){const i=["format"];for(const r of this.sections){if(r.image){i.push(["image",r.image.name]);continue}i.push(r.text);const n={};r.fontStack&&(n["text-font"]=["literal",r.fontStack.split(",")]),r.scale&&(n["font-scale"]=r.scale),r.textColor&&(n["text-color"]=["rgba"].concat(r.textColor.toArray())),i.push(n)}return i}}class tk{constructor(i){this.name=i.name,this.available=i.available}toString(){return this.name}static fromString(i){return i?new tk({name:i,available:!1}):null}serialize(){return["image",this.name]}}function tP(i,r,n,o){return"number"==typeof i&&i>=0&&i<=255&&"number"==typeof r&&r>=0&&r<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===o||"number"==typeof o&&o>=0&&o<=1?null:`Invalid rgba value [${[i,r,n,o].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof o?[i,r,n,o]:[i,r,n]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function tD(i){if(null===i||"string"==typeof i||"boolean"==typeof i||"number"==typeof i||i instanceof tM||i instanceof tA||i instanceof tz||i instanceof tk)return!0;if(Array.isArray(i)){for(const r of i)if(!tD(r))return!1;return!0}if("object"==typeof i){for(const r in i)if(!tD(i[r]))return!1;return!0}return!1}function tL(i){if(null===i)return tc;if("string"==typeof i)return tu;if("boolean"==typeof i)return td;if("number"==typeof i)return th;if(i instanceof tM)return tp;if(i instanceof tA)return t_;if(i instanceof tz)return tg;if(i instanceof tk)return ty;if(Array.isArray(i)){let r;const n=i.length;for(const n of i){const i=tL(n);if(r){if(r===i)continue;r=tm;break}r=i}return tx(r||tm,n)}return tf}function tB(i){const r=typeof i;return null===i?"":"string"===r||"number"===r||"boolean"===r?String(i):i instanceof tM||i instanceof tz||i instanceof tk?i.toString():JSON.stringify(i)}class tR{constructor(i,r){this.type=i,this.value=r}static parse(i,r){if(2!==i.length)return r.error(`'literal' expression requires exactly one argument, but found ${i.length-1} instead.`);if(!tD(i[1]))return r.error("invalid value");const n=i[1];let o=tL(n);const s=r.expectedType;return"array"===o.kind&&0===o.N&&s&&"array"===s.kind&&("number"!=typeof s.N||0===s.N)&&(o=s),new tR(o,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}serialize(){return"array"===this.type.kind||"object"===this.type.kind?["literal",this.value]:this.value instanceof tM?["rgba"].concat(this.value.toArray()):this.value instanceof tz?this.value.serialize():this.value}}class tF{constructor(i){this.name="ExpressionEvaluationError",this.message=i}toJSON(){return this.message}}const tO={string:tu,number:th,boolean:td,object:tf};class tU{constructor(i,r){this.type=i,this.args=r}static parse(i,r){if(i.length<2)return r.error("Expected at least one argument.");let n,o=1;const s=i[0];if("array"===s){let s,a;if(i.length>2){const n=i[1];if("string"!=typeof n||!(n in tO)||"object"===n)return r.error('The item type argument of "array" must be one of string, number, boolean',1);s=tO[n],o++}else s=tm;if(i.length>3){if(null!==i[2]&&("number"!=typeof i[2]||i[2]<0||i[2]!==Math.floor(i[2])))return r.error('The length argument to "array" must be a positive integer literal',2);a=i[2],o++}n=tx(s,a)}else n=tO[s];const a=[];for(;oi.outputDefined())}serialize(){const i=this.type,r=[i.kind];if("array"===i.kind){const n=i.itemType;if("string"===n.kind||"number"===n.kind||"boolean"===n.kind){r.push(n.kind);const o=i.N;("number"==typeof o||this.args.length>1)&&r.push(o)}}return r.concat(this.args.map(i=>i.serialize()))}}class tV{constructor(i){this.type=tg,this.sections=i}static parse(i,r){if(i.length<2)return r.error("Expected at least one argument.");const n=i[1];if(!Array.isArray(n)&&"object"==typeof n)return r.error("First argument must be an image or text section.");const o=[];let s=!1;for(let n=1;n<=i.length-1;++n){const a=i[n];if(s&&"object"==typeof a&&!Array.isArray(a)){s=!1;let i=null;if(a["font-scale"]&&!(i=r.parse(a["font-scale"],1,th)))return null;let n=null;if(a["text-font"]&&!(n=r.parse(a["text-font"],1,tx(tu))))return null;let l=null;if(a["text-color"]&&!(l=r.parse(a["text-color"],1,tp)))return null;const c=o[o.length-1];c.scale=i,c.font=n,c.textColor=l}else{const a=r.parse(i[n],1,tm);if(!a)return null;const l=a.type.kind;if("string"!==l&&"value"!==l&&"null"!==l&&"resolvedImage"!==l)return r.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");s=!0,o.push({content:a,scale:null,font:null,textColor:null})}}return new tV(o)}evaluate(i){return new tz(this.sections.map(r=>{const n=r.content.evaluate(i);return tL(n)===ty?new tC("",n,null,null,null):new tC(tB(n),null,r.scale?r.scale.evaluate(i):null,r.font?r.font.evaluate(i).join(","):null,r.textColor?r.textColor.evaluate(i):null)}))}eachChild(i){for(const r of this.sections)i(r.content),r.scale&&i(r.scale),r.font&&i(r.font),r.textColor&&i(r.textColor)}outputDefined(){return!1}serialize(){const i=["format"];for(const r of this.sections){i.push(r.content.serialize());const n={};r.scale&&(n["font-scale"]=r.scale.serialize()),r.font&&(n["text-font"]=r.font.serialize()),r.textColor&&(n["text-color"]=r.textColor.serialize()),i.push(n)}return i}}class tN{constructor(i){this.type=ty,this.input=i}static parse(i,r){if(2!==i.length)return r.error("Expected two arguments.");const n=r.parse(i[1],1,tu);return n?new tN(n):r.error("No image name provided.")}evaluate(i){const r=this.input.evaluate(i),n=tk.fromString(r);return n&&i.availableImages&&(n.available=i.availableImages.indexOf(r)>-1),n}eachChild(i){i(this.input)}outputDefined(){return!1}serialize(){return["image",this.input.serialize()]}}const tj={"to-boolean":td,"to-color":tp,"to-number":th,"to-string":tu};class tG{constructor(i,r){this.type=i,this.args=r}static parse(i,r){if(i.length<2)return r.error("Expected at least one argument.");const n=i[0];if(("to-boolean"===n||"to-string"===n)&&2!==i.length)return r.error("Expected one argument.");const o=tj[n],s=[];for(let n=1;n4?`Invalid rbga value ${JSON.stringify(r)}: expected an array containing either three or four numeric values.`:tP(r[0],r[1],r[2],r[3])))return new tM(r[0]/255,r[1]/255,r[2]/255,r[3])}throw new tF(n||`Could not parse color from value '${"string"==typeof r?r:String(JSON.stringify(r))}'`)}if("number"===this.type.kind){let r=null;for(const n of this.args){if(null===(r=n.evaluate(i)))return 0;const o=Number(r);if(!isNaN(o))return o}throw new tF(`Could not convert ${JSON.stringify(r)} to number.`)}return"formatted"===this.type.kind?tz.fromString(tB(this.args[0].evaluate(i))):"resolvedImage"===this.type.kind?tk.fromString(tB(this.args[0].evaluate(i))):tB(this.args[0].evaluate(i))}eachChild(i){this.args.forEach(i)}outputDefined(){return this.args.every(i=>i.outputDefined())}serialize(){if("formatted"===this.type.kind)return new tV([{content:this.args[0],scale:null,font:null,textColor:null}]).serialize();if("resolvedImage"===this.type.kind)return new tN(this.args[0]).serialize();const i=[`to-${this.type.kind}`];return this.eachChild(r=>{i.push(r.serialize())}),i}}const tZ=["Unknown","Point","LineString","Polygon"];class t${constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache={},this.availableImages=null,this.canonical=null,this.featureTileCoord=null,this.featureDistanceData=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?tZ[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}distanceFromCenter(){if(this.featureTileCoord&&this.featureDistanceData){const i=this.featureDistanceData.center,r=this.featureDistanceData.scale,{x:n,y:o}=this.featureTileCoord;return this.featureDistanceData.bearing[0]*(n*r-i[0])+this.featureDistanceData.bearing[1]*(o*r-i[1])}return 0}parseColor(i){let r=this._parseColorCache[i];return r||(r=this._parseColorCache[i]=tM.parse(i)),r}}class tq{constructor(i,r,n,o){this.name=i,this.type=r,this._evaluate=n,this.args=o}evaluate(i){return this._evaluate(i,this.args)}eachChild(i){this.args.forEach(i)}outputDefined(){return!1}serialize(){return[this.name].concat(this.args.map(i=>i.serialize()))}static parse(i,r){const n=i[0],o=tq.definitions[n];if(!o)return r.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);const s=Array.isArray(o)?o[0]:o.type,a=Array.isArray(o)?[[o[1],o[2]]]:o.overloads,l=a.filter(([r])=>!Array.isArray(r)||r.length===i.length-1);let c=null;for(const[o,a]of l){c=new t7(r.registry,r.path,null,r.scope);const l=[];let h=!1;for(let r=1;rArray.isArray(i)?`(${i.map(tv).join(", ")})`:`(${tv(i.type)}...)`).join(" | "),o=[];for(let n=1;n=r[2]||i[1]<=r[1]||i[3]>=r[3])}function tK(i,r){var n,o;let s=!1;for(let a=0,l=r.length;ai[1]!=(o=l[r+1])[1]>i[1]&&i[0]<(o[0]-n[0])*(i[1]-n[1])/(o[1]-n[1])+n[0]&&(s=!s)}}return s}function tY(i,r,n,o){const s=o[0]-n[0],a=o[1]-n[1],l=(i[0]-n[0])*a-s*(i[1]-n[1]),c=(r[0]-n[0])*a-s*(r[1]-n[1]);return l>0&&c<0||l<0&&c>0}function tJ(i,r){for(let n=0;nn[2]){const r=.5*o;let s=i[0]-n[0]>r?-o:n[0]-i[0]>r?o:0;0===s&&(s=i[0]-n[2]>r?-o:n[2]-i[0]>r?o:0),i[0]+=s}tW(r,i)}function t2(i,r,n,o){const s=8192*Math.pow(2,o.z),a=[8192*o.x,8192*o.y],l=[];for(const o of i)for(const i of o){const o=[i.x+a[0],i.y+a[1]];t1(o,r,n,s),l.push(o)}return l}function t3(i,r,n,o){var s;const a=8192*Math.pow(2,o.z),l=[8192*o.x,8192*o.y],c=[];for(const n of i){const i=[];for(const o of n){const n=[o.x+l[0],o.y+l[1]];tW(r,n),i.push(n)}c.push(i)}if(r[2]-r[0]<=a/2)for(const i of((s=r)[0]=s[1]=1/0,s[2]=s[3]=-1/0,c))for(const o of i)t1(o,r,n,a);return c}class t5{constructor(i,r){this.type=td,this.geojson=i,this.geometries=r}static parse(i,r){if(2!==i.length)return r.error(`'within' expression requires exactly one argument, but found ${i.length-1} instead.`);if(tD(i[1])){const r=i[1];if("FeatureCollection"===r.type)for(let i=0;i{r&&!t4(i)&&(r=!1)}),r}function t6(i){if(i instanceof tq&&"feature-state"===i.name)return!1;let r=!0;return i.eachChild(i=>{r&&!t6(i)&&(r=!1)}),r}function t8(i,r){if(i instanceof tq&&r.indexOf(i.name)>=0)return!1;let n=!0;return i.eachChild(i=>{n&&!t8(i,r)&&(n=!1)}),n}class t9{constructor(i,r){this.type=r.type,this.name=i,this.boundExpression=r}static parse(i,r){if(2!==i.length||"string"!=typeof i[1])return r.error("'var' expression requires exactly one string literal argument.");const n=i[1];return r.scope.has(n)?new t9(n,r.scope.get(n)):r.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(i){return this.boundExpression.evaluate(i)}eachChild(){}outputDefined(){return!1}serialize(){return["var",this.name]}}class t7{constructor(i,r=[],n,o=new tl,s=[]){this.registry=i,this.path=r,this.key=r.map(i=>`[${i}]`).join(""),this.scope=o,this.errors=s,this.expectedType=n}parse(i,r,n,o,s={}){return r?this.concat(r,n,o)._parse(i,s):this._parse(i,s)}_parse(i,r){function n(i,r,n){return"assert"===n?new tU(r,[i]):"coerce"===n?new tG(r,[i]):i}if(null!==i&&"string"!=typeof i&&"boolean"!=typeof i&&"number"!=typeof i||(i=["literal",i]),Array.isArray(i)){if(0===i.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const o=i[0];if("string"!=typeof o)return this.error(`Expression name must be a string, but found ${typeof o} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const s=this.registry[o];if(s){let o=s.parse(i,this);if(!o)return null;if(this.expectedType){const i=this.expectedType,s=o.type;if("string"!==i.kind&&"number"!==i.kind&&"boolean"!==i.kind&&"object"!==i.kind&&"array"!==i.kind||"value"!==s.kind){if("color"!==i.kind&&"formatted"!==i.kind&&"resolvedImage"!==i.kind||"value"!==s.kind&&"string"!==s.kind){if(this.checkSubtype(i,s))return null}else o=n(o,i,r.typeAnnotation||"coerce")}else o=n(o,i,r.typeAnnotation||"assert")}if(!(o instanceof tR)&&"resolvedImage"!==o.type.kind&&function i(r){if(r instanceof t9)return i(r.boundExpression);if(r instanceof tq&&"error"===r.name||r instanceof tX||r instanceof t5)return!1;const n=r instanceof tG||r instanceof tU;let o=!0;return r.eachChild(r=>{o=n?o&&i(r):o&&r instanceof tR}),!!o&&t4(r)&&t8(r,["zoom","heatmap-density","line-progress","sky-radial-progress","accumulated","is-supported-script","pitch","distance-from-center"])}(o)){const i=new t$;try{o=new tR(o.type,o.evaluate(i))}catch(i){return this.error(i.message),null}}return o}return this.error(`Unknown expression "${o}". If you wanted a literal array, use ["literal", [...]].`,0)}return this.error(void 0===i?"'undefined' value invalid. Use null instead.":"object"==typeof i?'Bare objects invalid. Use ["literal", {...}] instead.':`Expected an array, but found ${typeof i} instead.`)}concat(i,r,n){const o="number"==typeof i?this.path.concat(i):this.path,s=n?this.scope.concat(n):this.scope;return new t7(this.registry,o,r||null,s,this.errors)}error(i,...r){const n=`${this.key}${r.map(i=>`[${i}]`).join("")}`;this.errors.push(new ta(n,i))}checkSubtype(i,r){const n=tw(i,r);return n&&this.error(n),n}}function ie(i,r){const n=i.length-1;let o,s,a=0,l=n,c=0;for(;a<=l;)if(o=i[c=Math.floor((a+l)/2)],s=i[c+1],o<=r){if(c===n||rr))throw new tF("Input is not a number.");l=c-1}return 0}class it{constructor(i,r,n){for(const[o,s]of(this.type=i,this.input=r,this.labels=[],this.outputs=[],n))this.labels.push(o),this.outputs.push(s)}static parse(i,r){if(i.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if((i.length-1)%2!=0)return r.error("Expected an even number of arguments.");const n=r.parse(i[1],1,th);if(!n)return null;const o=[];let s=null;r.expectedType&&"value"!==r.expectedType.kind&&(s=r.expectedType);for(let n=1;n=a)return r.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',c);const u=r.parse(l,h,s);if(!u)return null;s=s||u.type,o.push([a,u])}return new it(s,n,o)}evaluate(i){const r=this.labels,n=this.outputs;if(1===r.length)return n[0].evaluate(i);const o=this.input.evaluate(i);if(o<=r[0])return n[0].evaluate(i);const s=r.length;return o>=r[s-1]?n[s-1].evaluate(i):n[ie(r,o)].evaluate(i)}eachChild(i){for(const r of(i(this.input),this.outputs))i(r)}outputDefined(){return this.outputs.every(i=>i.outputDefined())}serialize(){const i=["step",this.input.serialize()];for(let r=0;r0&&i.push(this.labels[r]),i.push(this.outputs[r].serialize());return i}}function ii(i,r,n){return i*(1-n)+r*n}var ir=Object.freeze({__proto__:null,number:ii,color:function(i,r,n){return new tM(ii(i.r,r.r,n),ii(i.g,r.g,n),ii(i.b,r.b,n),ii(i.a,r.a,n))},array:function(i,r,n){return i.map((i,o)=>ii(i,r[o],n))}});const io=4/29,is=6/29,ia=3*is*is,il=Math.PI/180,ic=180/Math.PI;function ih(i){return i>.008856451679035631?Math.pow(i,1/3):i/ia+io}function iu(i){return i>is?i*i*i:ia*(i-io)}function id(i){return 255*(i<=.0031308?12.92*i:1.055*Math.pow(i,1/2.4)-.055)}function ip(i){return(i/=255)<=.04045?i/12.92:Math.pow((i+.055)/1.055,2.4)}function im(i){const r=ip(i.r),n=ip(i.g),o=ip(i.b),s=ih((.4124564*r+.3575761*n+.1804375*o)/.95047),a=ih((.2126729*r+.7151522*n+.072175*o)/1);return{l:116*a-16,a:500*(s-a),b:200*(a-ih((.0193339*r+.119192*n+.9503041*o)/1.08883)),alpha:i.a}}function i_(i){let r=(i.l+16)/116,n=isNaN(i.a)?r:r+i.a/500,o=isNaN(i.b)?r:r-i.b/200;return r=1*iu(r),n=.95047*iu(n),o=1.08883*iu(o),new tM(id(3.2404542*n-1.5371385*r-.4985314*o),id(-.969266*n+1.8760108*r+.041556*o),id(.0556434*n-.2040259*r+1.0572252*o),i.alpha)}const ig={forward:im,reverse:i_,interpolate:function(i,r,n){return{l:ii(i.l,r.l,n),a:ii(i.a,r.a,n),b:ii(i.b,r.b,n),alpha:ii(i.alpha,r.alpha,n)}}},iy={forward:function(i){const{l:r,a:n,b:o}=im(i),s=Math.atan2(o,n)*ic;return{h:s<0?s+360:s,c:Math.sqrt(n*n+o*o),l:r,alpha:i.a}},reverse:function(i){const r=i.h*il,n=i.c;return i_({l:i.l,a:Math.cos(r)*n,b:Math.sin(r)*n,alpha:i.alpha})},interpolate:function(i,r,n){return{h:function(i,r,n){const o=r-i;return i+n*(o>180||o<-180?o-360*Math.round(o/360):o)}(i.h,r.h,n),c:ii(i.c,r.c,n),l:ii(i.l,r.l,n),alpha:ii(i.alpha,r.alpha,n)}}};var ix=Object.freeze({__proto__:null,lab:ig,hcl:iy});class iv{constructor(i,r,n,o,s){for(const[a,l]of(this.type=i,this.operator=r,this.interpolation=n,this.input=o,this.labels=[],this.outputs=[],s))this.labels.push(a),this.outputs.push(l)}static interpolationFactor(i,r,n,o){let s=0;if("exponential"===i.name)s=ib(r,i.base,n,o);else if("linear"===i.name)s=ib(r,1,n,o);else if("cubic-bezier"===i.name){const a=i.controlPoints;s=new h(a[0],a[1],a[2],a[3]).solve(ib(r,1,n,o))}return s}static parse(i,r){let[n,o,s,...a]=i;if(!Array.isArray(o)||0===o.length)return r.error("Expected an interpolation type expression.",1);if("linear"===o[0])o={name:"linear"};else if("exponential"===o[0]){const i=o[1];if("number"!=typeof i)return r.error("Exponential interpolation requires a numeric base.",1,1);o={name:"exponential",base:i}}else{if("cubic-bezier"!==o[0])return r.error(`Unknown interpolation type ${String(o[0])}`,1,0);{const i=o.slice(1);if(4!==i.length||i.some(i=>"number"!=typeof i||i<0||i>1))return r.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);o={name:"cubic-bezier",controlPoints:i}}}if(i.length-1<4)return r.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if((i.length-1)%2!=0)return r.error("Expected an even number of arguments.");if(!(s=r.parse(s,2,th)))return null;const l=[];let c=null;"interpolate-hcl"===n||"interpolate-lab"===n?c=tp:r.expectedType&&"value"!==r.expectedType.kind&&(c=r.expectedType);for(let i=0;i=n)return r.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',s);const u=r.parse(o,h,c);if(!u)return null;c=c||u.type,l.push([n,u])}return"number"===c.kind||"color"===c.kind||"array"===c.kind&&"number"===c.itemType.kind&&"number"==typeof c.N?new iv(c,n,o,s,l):r.error(`Type ${tv(c)} is not interpolatable.`)}evaluate(i){const r=this.labels,n=this.outputs;if(1===r.length)return n[0].evaluate(i);const o=this.input.evaluate(i);if(o<=r[0])return n[0].evaluate(i);const s=r.length;if(o>=r[s-1])return n[s-1].evaluate(i);const a=ie(r,o),l=iv.interpolationFactor(this.interpolation,o,r[a],r[a+1]),c=n[a].evaluate(i),h=n[a+1].evaluate(i);return"interpolate"===this.operator?ir[this.type.kind.toLowerCase()](c,h,l):"interpolate-hcl"===this.operator?iy.reverse(iy.interpolate(iy.forward(c),iy.forward(h),l)):ig.reverse(ig.interpolate(ig.forward(c),ig.forward(h),l))}eachChild(i){for(const r of(i(this.input),this.outputs))i(r)}outputDefined(){return this.outputs.every(i=>i.outputDefined())}serialize(){let i;i="linear"===this.interpolation.name?["linear"]:"exponential"===this.interpolation.name?1===this.interpolation.base?["linear"]:["exponential",this.interpolation.base]:["cubic-bezier"].concat(this.interpolation.controlPoints);const r=[this.operator,i,this.input.serialize()];for(let i=0;itw(o,i.type));return new iw(a?tm:n,s)}evaluate(i){let r,n=null,o=0;for(const s of this.args){if(o++,(n=s.evaluate(i))&&n instanceof tk&&!n.available&&(r||(r=n),n=null,o===this.args.length))return r;if(null!==n)break}return n}eachChild(i){this.args.forEach(i)}outputDefined(){return this.args.every(i=>i.outputDefined())}serialize(){const i=["coalesce"];return this.eachChild(r=>{i.push(r.serialize())}),i}}class iT{constructor(i,r){this.type=r.type,this.bindings=[].concat(i),this.result=r}evaluate(i){return this.result.evaluate(i)}eachChild(i){for(const r of this.bindings)i(r[1]);i(this.result)}static parse(i,r){if(i.length<4)return r.error(`Expected at least 3 arguments, but found ${i.length-1} instead.`);const n=[];for(let o=1;o=n.length)throw new tF(`Array index out of bounds: ${r} > ${n.length-1}.`);if(r!==Math.floor(r))throw new tF(`Array index must be an integer, but found ${r} instead.`);return n[r]}eachChild(i){i(this.index),i(this.input)}outputDefined(){return!1}serialize(){return["at",this.index.serialize(),this.input.serialize()]}}class iS{constructor(i,r){this.type=td,this.needle=i,this.haystack=r}static parse(i,r){if(3!==i.length)return r.error(`Expected 2 arguments, but found ${i.length-1} instead.`);const n=r.parse(i[1],1,tm),o=r.parse(i[2],2,tm);return n&&o?tT(n.type,[td,tu,th,tc,tm])?new iS(n,o):r.error(`Expected first argument to be of type boolean, string, number or null, but found ${tv(n.type)} instead`):null}evaluate(i){const r=this.needle.evaluate(i),n=this.haystack.evaluate(i);if(!n)return!1;if(!tE(r,["boolean","string","number","null"]))throw new tF(`Expected first argument to be of type boolean, string, number or null, but found ${tv(tL(r))} instead.`);if(!tE(n,["string","array"]))throw new tF(`Expected second argument to be of type array or string, but found ${tv(tL(n))} instead.`);return n.indexOf(r)>=0}eachChild(i){i(this.needle),i(this.haystack)}outputDefined(){return!0}serialize(){return["in",this.needle.serialize(),this.haystack.serialize()]}}class iI{constructor(i,r,n){this.type=th,this.needle=i,this.haystack=r,this.fromIndex=n}static parse(i,r){if(i.length<=2||i.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${i.length-1} instead.`);const n=r.parse(i[1],1,tm),o=r.parse(i[2],2,tm);if(!n||!o)return null;if(!tT(n.type,[td,tu,th,tc,tm]))return r.error(`Expected first argument to be of type boolean, string, number or null, but found ${tv(n.type)} instead`);if(4===i.length){const s=r.parse(i[3],3,th);return s?new iI(n,o,s):null}return new iI(n,o)}evaluate(i){const r=this.needle.evaluate(i),n=this.haystack.evaluate(i);if(!tE(r,["boolean","string","number","null"]))throw new tF(`Expected first argument to be of type boolean, string, number or null, but found ${tv(tL(r))} instead.`);if(!tE(n,["string","array"]))throw new tF(`Expected second argument to be of type array or string, but found ${tv(tL(n))} instead.`);if(this.fromIndex){const o=this.fromIndex.evaluate(i);return n.indexOf(r,o)}return n.indexOf(r)}eachChild(i){i(this.needle),i(this.haystack),this.fromIndex&&i(this.fromIndex)}outputDefined(){return!1}serialize(){if(null!=this.fromIndex&&void 0!==this.fromIndex){const i=this.fromIndex.serialize();return["index-of",this.needle.serialize(),this.haystack.serialize(),i]}return["index-of",this.needle.serialize(),this.haystack.serialize()]}}class iM{constructor(i,r,n,o,s,a){this.inputType=i,this.type=r,this.input=n,this.cases=o,this.outputs=s,this.otherwise=a}static parse(i,r){let n,o;if(i.length<5)return r.error(`Expected at least 4 arguments, but found only ${i.length-1}.`);if(i.length%2!=1)return r.error("Expected an even number of arguments.");r.expectedType&&"value"!==r.expectedType.kind&&(o=r.expectedType);const s={},a=[];for(let l=2;lNumber.MAX_SAFE_INTEGER)return u.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof i&&Math.floor(i)!==i)return u.error("Numeric branch labels must be integer values.");if(n){if(u.checkSubtype(n,tL(i)))return null}else n=tL(i);if(void 0!==s[String(i)])return u.error("Branch labels must be unique.");s[String(i)]=a.length}const d=r.parse(h,l,o);if(!d)return null;o=o||d.type,a.push(d)}const l=r.parse(i[1],1,tm);if(!l)return null;const c=r.parse(i[i.length-1],i.length-1,o);return c?"value"!==l.type.kind&&r.concat(1).checkSubtype(n,l.type)?null:new iM(n,o,l,s,a,c):null}evaluate(i){const r=this.input.evaluate(i);return(tL(r)===this.inputType&&this.outputs[this.cases[r]]||this.otherwise).evaluate(i)}eachChild(i){i(this.input),this.outputs.forEach(i),i(this.otherwise)}outputDefined(){return this.outputs.every(i=>i.outputDefined())&&this.otherwise.outputDefined()}serialize(){const i=["match",this.input.serialize()],r=Object.keys(this.cases).sort(),n=[],o={};for(const i of r){const r=o[this.cases[i]];void 0===r?(o[this.cases[i]]=n.length,n.push([this.cases[i],[i]])):n[r][1].push(i)}const s=i=>"number"===this.inputType.kind?Number(i):i;for(const[r,o]of n)i.push(1===o.length?s(o[0]):o.map(s)),i.push(this.outputs[r].serialize());return i.push(this.otherwise.serialize()),i}}class iA{constructor(i,r,n){this.type=i,this.branches=r,this.otherwise=n}static parse(i,r){let n;if(i.length<4)return r.error(`Expected at least 3 arguments, but found only ${i.length-1}.`);if(i.length%2!=0)return r.error("Expected an odd number of arguments.");r.expectedType&&"value"!==r.expectedType.kind&&(n=r.expectedType);const o=[];for(let s=1;sr.outputDefined())&&this.otherwise.outputDefined()}serialize(){const i=["case"];return this.eachChild(r=>{i.push(r.serialize())}),i}}class iC{constructor(i,r,n,o){this.type=i,this.input=r,this.beginIndex=n,this.endIndex=o}static parse(i,r){if(i.length<=2||i.length>=5)return r.error(`Expected 3 or 4 arguments, but found ${i.length-1} instead.`);const n=r.parse(i[1],1,tm),o=r.parse(i[2],2,th);if(!n||!o)return null;if(!tT(n.type,[tx(tm),tu,tm]))return r.error(`Expected first argument to be of type array or string, but found ${tv(n.type)} instead`);if(4===i.length){const s=r.parse(i[3],3,th);return s?new iC(n.type,n,o,s):null}return new iC(n.type,n,o)}evaluate(i){const r=this.input.evaluate(i),n=this.beginIndex.evaluate(i);if(!tE(r,["string","array"]))throw new tF(`Expected first argument to be of type array or string, but found ${tv(tL(r))} instead.`);if(this.endIndex){const o=this.endIndex.evaluate(i);return r.slice(n,o)}return r.slice(n)}eachChild(i){i(this.input),i(this.beginIndex),this.endIndex&&i(this.endIndex)}outputDefined(){return!1}serialize(){if(null!=this.endIndex&&void 0!==this.endIndex){const i=this.endIndex.serialize();return["slice",this.input.serialize(),this.beginIndex.serialize(),i]}return["slice",this.input.serialize(),this.beginIndex.serialize()]}}function iz(i,r){return"=="===i||"!="===i?"boolean"===r.kind||"string"===r.kind||"number"===r.kind||"null"===r.kind||"value"===r.kind:"string"===r.kind||"number"===r.kind||"value"===r.kind}function ik(i,r,n,o){return 0===o.compare(r,n)}function iP(i,r,n){const o="=="!==i&&"!="!==i;return class s{constructor(i,r,n){this.type=td,this.lhs=i,this.rhs=r,this.collator=n,this.hasUntypedArgument="value"===i.type.kind||"value"===r.type.kind}static parse(i,r){if(3!==i.length&&4!==i.length)return r.error("Expected two or three arguments.");const n=i[0];let a=r.parse(i[1],1,tm);if(!a)return null;if(!iz(n,a.type))return r.concat(1).error(`"${n}" comparisons are not supported for type '${tv(a.type)}'.`);let l=r.parse(i[2],2,tm);if(!l)return null;if(!iz(n,l.type))return r.concat(2).error(`"${n}" comparisons are not supported for type '${tv(l.type)}'.`);if(a.type.kind!==l.type.kind&&"value"!==a.type.kind&&"value"!==l.type.kind)return r.error(`Cannot compare types '${tv(a.type)}' and '${tv(l.type)}'.`);o&&("value"===a.type.kind&&"value"!==l.type.kind?a=new tU(l.type,[a]):"value"!==a.type.kind&&"value"===l.type.kind&&(l=new tU(a.type,[l])));let c=null;if(4===i.length){if("string"!==a.type.kind&&"string"!==l.type.kind&&"value"!==a.type.kind&&"value"!==l.type.kind)return r.error("Cannot use collator to compare non-string types.");if(!(c=r.parse(i[3],3,t_)))return null}return new s(a,l,c)}evaluate(s){const a=this.lhs.evaluate(s),l=this.rhs.evaluate(s);if(o&&this.hasUntypedArgument){const r=tL(a),n=tL(l);if(r.kind!==n.kind||"string"!==r.kind&&"number"!==r.kind)throw new tF(`Expected arguments for "${i}" to be (string, string) or (number, number), but found (${r.kind}, ${n.kind}) instead.`)}if(this.collator&&!o&&this.hasUntypedArgument){const i=tL(a),n=tL(l);if("string"!==i.kind||"string"!==n.kind)return r(s,a,l)}return this.collator?n(s,a,l,this.collator.evaluate(s)):r(s,a,l)}eachChild(i){i(this.lhs),i(this.rhs),this.collator&&i(this.collator)}outputDefined(){return!0}serialize(){const r=[i];return this.eachChild(i=>{r.push(i.serialize())}),r}}}const iD=iP("==",function(i,r,n){return r===n},ik),iL=iP("!=",function(i,r,n){return r!==n},function(i,r,n,o){return!ik(0,r,n,o)}),iB=iP("<",function(i,r,n){return ro.compare(r,n)}),iR=iP(">",function(i,r,n){return r>n},function(i,r,n,o){return o.compare(r,n)>0}),iF=iP("<=",function(i,r,n){return r<=n},function(i,r,n,o){return 0>=o.compare(r,n)}),iO=iP(">=",function(i,r,n){return r>=n},function(i,r,n,o){return o.compare(r,n)>=0});class iU{constructor(i,r,n,o,s){this.type=tu,this.number=i,this.locale=r,this.currency=n,this.minFractionDigits=o,this.maxFractionDigits=s}static parse(i,r){if(3!==i.length)return r.error("Expected two arguments.");const n=r.parse(i[1],1,th);if(!n)return null;const o=i[2];if("object"!=typeof o||Array.isArray(o))return r.error("NumberFormat options argument must be an object.");let s=null;if(o.locale&&!(s=r.parse(o.locale,1,tu)))return null;let a=null;if(o.currency&&!(a=r.parse(o.currency,1,tu)))return null;let l=null;if(o["min-fraction-digits"]&&!(l=r.parse(o["min-fraction-digits"],1,th)))return null;let c=null;return!o["max-fraction-digits"]||(c=r.parse(o["max-fraction-digits"],1,th))?new iU(n,s,a,l,c):null}evaluate(i){return new Intl.NumberFormat(this.locale?this.locale.evaluate(i):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(i):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(i):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(i):void 0}).format(this.number.evaluate(i))}eachChild(i){i(this.number),this.locale&&i(this.locale),this.currency&&i(this.currency),this.minFractionDigits&&i(this.minFractionDigits),this.maxFractionDigits&&i(this.maxFractionDigits)}outputDefined(){return!1}serialize(){const i={};return this.locale&&(i.locale=this.locale.serialize()),this.currency&&(i.currency=this.currency.serialize()),this.minFractionDigits&&(i["min-fraction-digits"]=this.minFractionDigits.serialize()),this.maxFractionDigits&&(i["max-fraction-digits"]=this.maxFractionDigits.serialize()),["number-format",this.number.serialize(),i]}}class iV{constructor(i){this.type=th,this.input=i}static parse(i,r){if(2!==i.length)return r.error(`Expected 1 argument, but found ${i.length-1} instead.`);const n=r.parse(i[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?r.error(`Expected argument of type string or array, but found ${tv(n.type)} instead.`):new iV(n):null}evaluate(i){const r=this.input.evaluate(i);if("string"==typeof r||Array.isArray(r))return r.length;throw new tF(`Expected value to be of type string or array, but found ${tv(tL(r))} instead.`)}eachChild(i){i(this.input)}outputDefined(){return!1}serialize(){const i=["length"];return this.eachChild(r=>{i.push(r.serialize())}),i}}const iN={"==":iD,"!=":iL,">":iR,"<":iB,">=":iO,"<=":iF,array:tU,at:iE,boolean:tU,case:iA,coalesce:iw,collator:tX,format:tV,image:tN,in:iS,"index-of":iI,interpolate:iv,"interpolate-hcl":iv,"interpolate-lab":iv,length:iV,let:iT,literal:tR,match:iM,number:tU,"number-format":iU,object:tU,slice:iC,step:it,string:tU,"to-boolean":tG,"to-color":tG,"to-number":tG,"to-string":tG,var:t9,within:t5};function ij(i,[r,n,o,s]){r=r.evaluate(i),n=n.evaluate(i),o=o.evaluate(i);const a=s?s.evaluate(i):1,l=tP(r,n,o,a);if(l)throw new tF(l);return new tM(r/255*a,n/255*a,o/255*a,a)}function iG(i,r){const n=r[i];return void 0===n?null:n}function iZ(i){return{type:i}}function i$(i){return{result:"success",value:i}}function iq(i){return{result:"error",value:i}}function iX(i){return"data-driven"===i["property-type"]||"cross-faded-data-driven"===i["property-type"]}function iW(i){return!!i.expression&&i.expression.parameters.indexOf("zoom")>-1}function iH(i){return!!i.expression&&i.expression.interpolated}function iK(i){return i instanceof Number?"number":i instanceof String?"string":i instanceof Boolean?"boolean":Array.isArray(i)?"array":null===i?"null":typeof i}function iY(i){return"object"==typeof i&&null!==i&&!Array.isArray(i)}function iJ(i){return i}function iQ(i,r,n){return void 0!==i?i:void 0!==r?r:void 0!==n?n:void 0}function i0(i,r,n,o,s){return iQ(typeof n===s?o[n]:void 0,i.default,r.default)}function i1(i,r,n){if("number"!==iK(n))return iQ(i.default,r.default);const o=i.stops.length;if(1===o||n<=i.stops[0][0])return i.stops[0][1];if(n>=i.stops[o-1][0])return i.stops[o-1][1];const s=ie(i.stops.map(i=>i[0]),n);return i.stops[s][1]}function i2(i,r,n){const o=void 0!==i.base?i.base:1;if("number"!==iK(n))return iQ(i.default,r.default);const s=i.stops.length;if(1===s||n<=i.stops[0][0])return i.stops[0][1];if(n>=i.stops[s-1][0])return i.stops[s-1][1];const a=ie(i.stops.map(i=>i[0]),n),l=function(i,r,n,o){const s=o-n,a=i-n;return 0===s?0:1===r?a/s:(Math.pow(r,a)-1)/(Math.pow(r,s)-1)}(n,o,i.stops[a][0],i.stops[a+1][0]),c=i.stops[a][1],h=i.stops[a+1][1];let u=ir[r.type]||iJ;if(i.colorSpace&&"rgb"!==i.colorSpace){const r=ix[i.colorSpace];u=(i,n)=>r.reverse(r.interpolate(r.forward(i),r.forward(n),l))}return"function"==typeof c.evaluate?{evaluate(...i){const r=c.evaluate.apply(void 0,i),n=h.evaluate.apply(void 0,i);if(void 0!==r&&void 0!==n)return u(r,n,l)}}:u(c,h,l)}function i3(i,r,n){return"color"===r.type?n=tM.parse(n):"formatted"===r.type?n=tz.fromString(n.toString()):"resolvedImage"===r.type?n=tk.fromString(n.toString()):iK(n)===r.type||"enum"===r.type&&r.values[n]||(n=void 0),iQ(n,i.default,r.default)}tq.register(iN,{error:[{kind:"error"},[tu],(i,[r])=>{throw new tF(r.evaluate(i))}],typeof:[tu,[tm],(i,[r])=>tv(tL(r.evaluate(i)))],"to-rgba":[tx(th,4),[tp],(i,[r])=>r.evaluate(i).toArray()],rgb:[tp,[th,th,th],ij],rgba:[tp,[th,th,th,th],ij],has:{type:td,overloads:[[[tu],(i,[r])=>r.evaluate(i) in i.properties()],[[tu,tf],(i,[r,n])=>r.evaluate(i) in n.evaluate(i)]]},get:{type:tm,overloads:[[[tu],(i,[r])=>iG(r.evaluate(i),i.properties())],[[tu,tf],(i,[r,n])=>iG(r.evaluate(i),n.evaluate(i))]]},"feature-state":[tm,[tu],(i,[r])=>iG(r.evaluate(i),i.featureState||{})],properties:[tf,[],i=>i.properties()],"geometry-type":[tu,[],i=>i.geometryType()],id:[tm,[],i=>i.id()],zoom:[th,[],i=>i.globals.zoom],pitch:[th,[],i=>i.globals.pitch||0],"distance-from-center":[th,[],i=>i.distanceFromCenter()],"heatmap-density":[th,[],i=>i.globals.heatmapDensity||0],"line-progress":[th,[],i=>i.globals.lineProgress||0],"sky-radial-progress":[th,[],i=>i.globals.skyRadialProgress||0],accumulated:[tm,[],i=>void 0===i.globals.accumulated?null:i.globals.accumulated],"+":[th,iZ(th),(i,r)=>{let n=0;for(const o of r)n+=o.evaluate(i);return n}],"*":[th,iZ(th),(i,r)=>{let n=1;for(const o of r)n*=o.evaluate(i);return n}],"-":{type:th,overloads:[[[th,th],(i,[r,n])=>r.evaluate(i)-n.evaluate(i)],[[th],(i,[r])=>-r.evaluate(i)]]},"/":[th,[th,th],(i,[r,n])=>r.evaluate(i)/n.evaluate(i)],"%":[th,[th,th],(i,[r,n])=>r.evaluate(i)%n.evaluate(i)],ln2:[th,[],()=>Math.LN2],pi:[th,[],()=>Math.PI],e:[th,[],()=>Math.E],"^":[th,[th,th],(i,[r,n])=>Math.pow(r.evaluate(i),n.evaluate(i))],sqrt:[th,[th],(i,[r])=>Math.sqrt(r.evaluate(i))],log10:[th,[th],(i,[r])=>Math.log(r.evaluate(i))/Math.LN10],ln:[th,[th],(i,[r])=>Math.log(r.evaluate(i))],log2:[th,[th],(i,[r])=>Math.log(r.evaluate(i))/Math.LN2],sin:[th,[th],(i,[r])=>Math.sin(r.evaluate(i))],cos:[th,[th],(i,[r])=>Math.cos(r.evaluate(i))],tan:[th,[th],(i,[r])=>Math.tan(r.evaluate(i))],asin:[th,[th],(i,[r])=>Math.asin(r.evaluate(i))],acos:[th,[th],(i,[r])=>Math.acos(r.evaluate(i))],atan:[th,[th],(i,[r])=>Math.atan(r.evaluate(i))],min:[th,iZ(th),(i,r)=>Math.min(...r.map(r=>r.evaluate(i)))],max:[th,iZ(th),(i,r)=>Math.max(...r.map(r=>r.evaluate(i)))],abs:[th,[th],(i,[r])=>Math.abs(r.evaluate(i))],round:[th,[th],(i,[r])=>{const n=r.evaluate(i);return n<0?-Math.round(-n):Math.round(n)}],floor:[th,[th],(i,[r])=>Math.floor(r.evaluate(i))],ceil:[th,[th],(i,[r])=>Math.ceil(r.evaluate(i))],"filter-==":[td,[tu,tm],(i,[r,n])=>i.properties()[r.value]===n.value],"filter-id-==":[td,[tm],(i,[r])=>i.id()===r.value],"filter-type-==":[td,[tu],(i,[r])=>i.geometryType()===r.value],"filter-<":[td,[tu,tm],(i,[r,n])=>{const o=i.properties()[r.value],s=n.value;return typeof o==typeof s&&o{const n=i.id(),o=r.value;return typeof n==typeof o&&n":[td,[tu,tm],(i,[r,n])=>{const o=i.properties()[r.value],s=n.value;return typeof o==typeof s&&o>s}],"filter-id->":[td,[tm],(i,[r])=>{const n=i.id(),o=r.value;return typeof n==typeof o&&n>o}],"filter-<=":[td,[tu,tm],(i,[r,n])=>{const o=i.properties()[r.value],s=n.value;return typeof o==typeof s&&o<=s}],"filter-id-<=":[td,[tm],(i,[r])=>{const n=i.id(),o=r.value;return typeof n==typeof o&&n<=o}],"filter->=":[td,[tu,tm],(i,[r,n])=>{const o=i.properties()[r.value],s=n.value;return typeof o==typeof s&&o>=s}],"filter-id->=":[td,[tm],(i,[r])=>{const n=i.id(),o=r.value;return typeof n==typeof o&&n>=o}],"filter-has":[td,[tm],(i,[r])=>r.value in i.properties()],"filter-has-id":[td,[],i=>null!==i.id()&&void 0!==i.id()],"filter-type-in":[td,[tx(tu)],(i,[r])=>r.value.indexOf(i.geometryType())>=0],"filter-id-in":[td,[tx(tm)],(i,[r])=>r.value.indexOf(i.id())>=0],"filter-in-small":[td,[tu,tx(tm)],(i,[r,n])=>n.value.indexOf(i.properties()[r.value])>=0],"filter-in-large":[td,[tu,tx(tm)],(i,[r,n])=>(function(i,r,n,o){for(;n<=o;){const s=n+o>>1;if(r[s]===i)return!0;r[s]>i?o=s-1:n=s+1}return!1})(i.properties()[r.value],n.value,0,n.value.length-1)],all:{type:td,overloads:[[[td,td],(i,[r,n])=>r.evaluate(i)&&n.evaluate(i)],[iZ(td),(i,r)=>{for(const n of r)if(!n.evaluate(i))return!1;return!0}]]},any:{type:td,overloads:[[[td,td],(i,[r,n])=>r.evaluate(i)||n.evaluate(i)],[iZ(td),(i,r)=>{for(const n of r)if(n.evaluate(i))return!0;return!1}]]},"!":[td,[td],(i,[r])=>!r.evaluate(i)],"is-supported-script":[td,[tu],(i,[r])=>{const n=i.globals&&i.globals.isSupportedScript;return!n||n(r.evaluate(i))}],upcase:[tu,[tu],(i,[r])=>r.evaluate(i).toUpperCase()],downcase:[tu,[tu],(i,[r])=>r.evaluate(i).toLowerCase()],concat:[tu,iZ(tm),(i,r)=>r.map(r=>tB(r.evaluate(i))).join("")],"resolved-locale":[tu,[t_],(i,[r])=>r.evaluate(i).resolvedLocale()]});class i5{constructor(i,r){this.expression=i,this._warningHistory={},this._evaluator=new t$,this._defaultValue=r?"color"===r.type&&iY(r.default)?new tM(0,0,0,0):"color"===r.type?tM.parse(r.default)||null:void 0===r.default?null:r.default:null,this._enumValues=r&&"enum"===r.type?r.values:null}evaluateWithoutErrorHandling(i,r,n,o,s,a,l,c){return this._evaluator.globals=i,this._evaluator.feature=r,this._evaluator.featureState=n,this._evaluator.canonical=o,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=a,this._evaluator.featureTileCoord=l||null,this._evaluator.featureDistanceData=c||null,this.expression.evaluate(this._evaluator)}evaluate(i,r,n,o,s,a,l,c){this._evaluator.globals=i,this._evaluator.feature=r||null,this._evaluator.featureState=n||null,this._evaluator.canonical=o,this._evaluator.availableImages=s||null,this._evaluator.formattedSection=a||null,this._evaluator.featureTileCoord=l||null,this._evaluator.featureDistanceData=c||null;try{const i=this.expression.evaluate(this._evaluator);if(null==i||"number"==typeof i&&i!=i)return this._defaultValue;if(this._enumValues&&!(i in this._enumValues))throw new tF(`Expected value to be one of ${Object.keys(this._enumValues).map(i=>JSON.stringify(i)).join(", ")}, but found ${JSON.stringify(i)} instead.`);return i}catch(i){return this._warningHistory[i.message]||(this._warningHistory[i.message]=!0,"undefined"!=typeof console&&console.warn(i.message)),this._defaultValue}}}function i4(i){return Array.isArray(i)&&i.length>0&&"string"==typeof i[0]&&i[0]in iN}function i6(i,r){const n=new t7(iN,[],r?function(i){const r={color:tp,string:tu,number:th,enum:tu,boolean:td,formatted:tg,resolvedImage:ty};return"array"===i.type?tx(r[i.value]||tm,i.length):r[i.type]}(r):void 0),o=n.parse(i,void 0,void 0,void 0,r&&"string"===r.type?{typeAnnotation:"coerce"}:void 0);return o?i$(new i5(o,r)):iq(n.errors)}class i8{constructor(i,r){this.kind=i,this._styleExpression=r,this.isStateDependent="constant"!==i&&!t6(r.expression)}evaluateWithoutErrorHandling(i,r,n,o,s,a){return this._styleExpression.evaluateWithoutErrorHandling(i,r,n,o,s,a)}evaluate(i,r,n,o,s,a){return this._styleExpression.evaluate(i,r,n,o,s,a)}}class i9{constructor(i,r,n,o){this.kind=i,this.zoomStops=n,this._styleExpression=r,this.isStateDependent="camera"!==i&&!t6(r.expression),this.interpolationType=o}evaluateWithoutErrorHandling(i,r,n,o,s,a){return this._styleExpression.evaluateWithoutErrorHandling(i,r,n,o,s,a)}evaluate(i,r,n,o,s,a){return this._styleExpression.evaluate(i,r,n,o,s,a)}interpolationFactor(i,r,n){return this.interpolationType?iv.interpolationFactor(this.interpolationType,i,r,n):0}}function i7(i,r){if("error"===(i=i6(i,r)).result)return i;const n=i.value.expression,o=t4(n);if(!o&&!iX(r))return iq([new ta("","data expressions not supported")]);const s=t8(n,["zoom","pitch","distance-from-center"]);if(!s&&!iW(r))return iq([new ta("","zoom expressions not supported")]);const a=function i(r){let n=null;if(r instanceof iT)n=i(r.result);else if(r instanceof iw){for(const o of r.args)if(n=i(o))break}else(r instanceof it||r instanceof iv)&&r.input instanceof tq&&"zoom"===r.input.name&&(n=r);return n instanceof ta||r.eachChild(r=>{const o=i(r);o instanceof ta?n=o:!n&&o?n=new ta("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):n&&o&&n!==o&&(n=new ta("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),n}(n);return a||s?a instanceof ta?iq([a]):a instanceof iv&&!iH(r)?iq([new ta("",'"interpolate" expressions cannot be used with this property')]):i$(a?new i9(o?"camera":"composite",i.value,a.labels,a instanceof iv?a.interpolation:void 0):new i8(o?"constant":"source",i.value)):iq([new ta("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')])}class re{constructor(i,r){this._parameters=i,this._specification=r,tn(this,function i(r,n){let o,s,a;const l="color"===n.type,c=r.stops&&"object"==typeof r.stops[0][0],h=c||!(c||void 0!==r.property),u=r.type||(iH(n)?"exponential":"interval");if(l&&((r=tn({},r)).stops&&(r.stops=r.stops.map(i=>[i[0],tM.parse(i[1])])),r.default=tM.parse(r.default?r.default:n.default)),r.colorSpace&&"rgb"!==r.colorSpace&&!ix[r.colorSpace])throw Error(`Unknown color space: ${r.colorSpace}`);if("exponential"===u)o=i2;else if("interval"===u)o=i1;else if("categorical"===u){for(const i of(o=i0,s=Object.create(null),r.stops))s[i[0]]=i[1];a=typeof r.stops[0][0]}else{if("identity"!==u)throw Error(`Unknown function type "${u}"`);o=i3}if(c){const o={},s=[];for(let i=0;ii[0]),evaluate:({zoom:i},o)=>i2({stops:a,base:r.base},n,i).evaluate(i,o)}}if(h){const i="exponential"===u?{name:"exponential",base:void 0!==r.base?r.base:1}:null;return{kind:"camera",interpolationType:i,interpolationFactor:iv.interpolationFactor.bind(void 0,i),zoomStops:r.stops.map(i=>i[0]),evaluate:({zoom:i})=>o(r,n,i,s,a)}}return{kind:"source",evaluate(i,l){const c=l&&l.properties?l.properties[r.property]:void 0;return void 0===c?iQ(r.default,n.default):o(r,n,c,s,a)}}}(this._parameters,this._specification))}static deserialize(i){return new re(i._parameters,i._specification)}static serialize(i){return{_parameters:i._parameters,_specification:i._specification}}}function rt(i){const r=i.key,n=i.value,o=i.valueSpec||{},s=i.objectElementValidators||{},a=i.style,l=i.styleSpec;let c=[];const h=iK(n);if("object"!==h)return[new ti(r,n,`object expected, ${h} found`)];for(const i in n){let h;const u=i.split(".")[0],d=o[u]||o["*"];if(s[u])h=s[u];else if(o[u])h=rA;else if(s["*"])h=s["*"];else{if(!o["*"]){c.push(new ti(r,n[i],`unknown property "${i}"`));continue}h=rA}c=c.concat(h({key:(r?`${r}.`:r)+i,value:n[i],valueSpec:d,style:a,styleSpec:l,object:n,objectKey:i},n))}for(const i in o)s[i]||o[i].required&&void 0===o[i].default&&void 0===n[i]&&c.push(new ti(r,n,`missing required property "${i}"`));return c}function ri(i){const r=i.value,n=i.valueSpec,o=i.style,s=i.styleSpec,a=i.key,l=i.arrayElementValidator||rA;if("array"!==iK(r))return[new ti(a,r,`array expected, ${iK(r)} found`)];if(n.length&&r.length!==n.length)return[new ti(a,r,`array length ${n.length} expected, length ${r.length} found`)];if(n["min-length"]&&r.lengths)return[new ti(r,n,`${n} is greater than the maximum value ${s}`)]}return[]}function rn(i){const r=i.valueSpec,n=to(i.value.type);let o,s,a,l={};const c="categorical"!==n&&void 0===i.value.property,h="array"===iK(i.value.stops)&&"array"===iK(i.value.stops[0])&&"object"===iK(i.value.stops[0][0]),u=rt({key:i.key,value:i.value,valueSpec:i.styleSpec.function,style:i.style,styleSpec:i.styleSpec,objectElementValidators:{stops:function(i){if("identity"===n)return[new ti(i.key,i.value,'identity function may not have a "stops" property')];let r=[];const o=i.value;return r=r.concat(ri({key:i.key,value:o,valueSpec:i.valueSpec,style:i.style,styleSpec:i.styleSpec,arrayElementValidator:d})),"array"===iK(o)&&0===o.length&&r.push(new ti(i.key,o,"array must have at least one stop")),r},default:function(i){return rA({key:i.key,value:i.value,valueSpec:r,style:i.style,styleSpec:i.styleSpec})}}});return"identity"===n&&c&&u.push(new ti(i.key,i.value,'missing required property "property"')),"identity"===n||i.value.stops||u.push(new ti(i.key,i.value,'missing required property "stops"')),"exponential"===n&&i.valueSpec.expression&&!iH(i.valueSpec)&&u.push(new ti(i.key,i.value,"exponential functions not supported")),i.styleSpec.$version>=8&&(c||iX(i.valueSpec)?c&&!iW(i.valueSpec)&&u.push(new ti(i.key,i.value,"zoom functions not supported")):u.push(new ti(i.key,i.value,"property functions not supported"))),("categorical"===n||h)&&void 0===i.value.property&&u.push(new ti(i.key,i.value,'"property" property is required')),u;function d(i){let n=[];const o=i.value,c=i.key;if("array"!==iK(o))return[new ti(c,o,`array expected, ${iK(o)} found`)];if(2!==o.length)return[new ti(c,o,`array length 2 expected, length ${o.length} found`)];if(h){if("object"!==iK(o[0]))return[new ti(c,o,`object expected, ${iK(o[0])} found`)];if(void 0===o[0].zoom)return[new ti(c,o,"object stop key must have zoom")];if(void 0===o[0].value)return[new ti(c,o,"object stop key must have value")];if(a&&a>to(o[0].zoom))return[new ti(c,o[0].zoom,"stop zoom values must appear in ascending order")];to(o[0].zoom)!==a&&(a=to(o[0].zoom),s=void 0,l={}),n=n.concat(rt({key:`${c}[0]`,value:o[0],valueSpec:{zoom:{}},style:i.style,styleSpec:i.styleSpec,objectElementValidators:{zoom:rr,value:p}}))}else n=n.concat(p({key:`${c}[0]`,value:o[0],valueSpec:{},style:i.style,styleSpec:i.styleSpec},o));return i4(ts(o[1]))?n.concat([new ti(`${c}[1]`,o[1],"expressions are not allowed in function stops.")]):n.concat(rA({key:`${c}[1]`,value:o[1],valueSpec:r,style:i.style,styleSpec:i.styleSpec}))}function p(i,a){const c=iK(i.value),h=to(i.value),u=null!==i.value?i.value:a;if(o){if(c!==o)return[new ti(i.key,u,`${c} stop domain type must match previous stop domain type ${o}`)]}else o=c;if("number"!==c&&"string"!==c&&"boolean"!==c)return[new ti(i.key,u,"stop domain value must be a number, string, or boolean")];if("number"!==c&&"categorical"!==n){let o=`number expected, ${c} found`;return iX(r)&&void 0===n&&(o+='\nIf you intended to use a categorical function, specify `"type": "categorical"`.'),[new ti(i.key,u,o)]}return"categorical"!==n||"number"!==c||isFinite(h)&&Math.floor(h)===h?"categorical"!==n&&"number"===c&&void 0!==s&&hnew ti(`${i.key}${r.key}`,i.value,r.message));const n=r.value.expression||r.value._styleExpression.expression;if("property"===i.expressionContext&&"text-font"===i.propertyKey&&!n.outputDefined())return[new ti(i.key,i.value,`Invalid data expression for "${i.propertyKey}". Output values must be contained as literals within the expression.`)];if("property"===i.expressionContext&&"layout"===i.propertyType&&!t6(n))return[new ti(i.key,i.value,'"feature-state" data expressions are not supported with layout properties.')];if("filter"===i.expressionContext)return function i(r,n){const o=new Set(["zoom","feature-state","pitch","distance-from-center"]);for(const i of n.valueSpec.expression.parameters)o.delete(i);if(0===o.size)return[];const s=[];return r instanceof tq&&o.has(r.name)?[new ti(n.key,n.value,`["${r.name}"] expression is not supported in a filter for a ${n.object.type} layer with id: ${n.object.id}`)]:(r.eachChild(r=>{s.push(...i(r,n))}),s)}(n,i);if(i.expressionContext&&0===i.expressionContext.indexOf("cluster")){if(!t8(n,["zoom","feature-state"]))return[new ti(i.key,i.value,'"zoom" and "feature-state" expressions are not supported with cluster properties.')];if("cluster-initial"===i.expressionContext&&!t4(n))return[new ti(i.key,i.value,"Feature data expressions are not supported with initial expression part of cluster properties.")]}return[]}function rs(i){const r=i.key,n=i.value,o=i.valueSpec,s=[];return Array.isArray(o.values)?-1===o.values.indexOf(to(n))&&s.push(new ti(r,n,`expected one of [${o.values.join(", ")}], ${JSON.stringify(n)} found`)):-1===Object.keys(o.values).indexOf(to(n))&&s.push(new ti(r,n,`expected one of [${Object.keys(o.values).join(", ")}], ${JSON.stringify(n)} found`)),s}function ra(i){if(!0===i||!1===i)return!0;if(!Array.isArray(i)||0===i.length)return!1;switch(i[0]){case"has":return i.length>=2&&"$id"!==i[1]&&"$type"!==i[1];case"in":return i.length>=3&&("string"!=typeof i[1]||Array.isArray(i[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==i.length||Array.isArray(i[1])||Array.isArray(i[2]);case"any":case"all":for(const r of i.slice(1))if(!ra(r)&&"boolean"!=typeof r)return!1;return!0;default:return!0}}function rl(i,r="fill"){if(null==i)return{filter:()=>!0,needGeometry:!1,needFeature:!1};ra(i)||(i=function i(r){if(!r)return!0;const n=r[0];return r.length<=1?"any"!==n:"=="===n?rd(r[1],r[2],"=="):"!="===n?rm(rd(r[1],r[2],"==")):"<"===n||">"===n||"<="===n||">="===n?rd(r[1],r[2],n):"any"===n?["any"].concat(r.slice(1).map(i)):"all"===n?["all"].concat(r.slice(1).map(i)):"none"===n?["all"].concat(r.slice(1).map(i).map(rm)):"in"===n?rp(r[1],r.slice(2)):"!in"===n?rm(rp(r[1],r.slice(2))):"has"===n?rf(r[1]):"!has"===n?rm(rf(r[1])):"within"!==n||r}(i));const n=i;let o=!0;try{o=function(i){if(!rc(i))return i;let r=ts(i);return function i(r){let n=!1;const o=[];if("case"===r[0]){for(let i=1;ii(r))}(r)}(n)}catch(i){console.warn(`Failed to extract static filter. Filter will continue working, but at higher memory usage and slower framerate. This is most likely a bug, please report this via https://github.com/mapbox/mapbox-gl-js/issues/new?assignees=&labels=&template=Bug_report.md and paste the contents of this message in the report. Thank you! diff --git a/crates/swc_ecma_minifier/tests/projects/output/angular-1.2.5.js b/crates/swc_ecma_minifier/tests/projects/output/angular-1.2.5.js index e9b8280b75a..f481f6a3cf5 100644 --- a/crates/swc_ecma_minifier/tests/projects/output/angular-1.2.5.js +++ b/crates/swc_ecma_minifier/tests/projects/output/angular-1.2.5.js @@ -148,7 +148,7 @@ }), source)destination[key] = copy(source[key]); setHashKey(destination, h); } - } else destination = source, source && (isArray(source) ? destination = copy(source, []) : isDate(source) ? destination = new Date(source.getTime()) : isRegExp(source) ? destination = RegExp(source.source) : isObject(source) && (destination = copy(source, {}))); + } else destination = source, source && (isArray(source) ? destination = copy(source, []) : isDate(source) ? destination = new Date(source.getTime()) : isRegExp(source) ? destination = new RegExp(source.source) : isObject(source) && (destination = copy(source, {}))); return destination; } function equals(o1, o2) { @@ -3605,7 +3605,7 @@ if (ctrl.$isEmpty(value) || regexp.test(value)) return ctrl.$setValidity("pattern", !0), value; ctrl.$setValidity("pattern", !1); }; - if (pattern && ((match = pattern.match(/^\/(.*)\/([gim]*)$/)) ? (pattern = RegExp(match[1], match[2]), patternValidator = function(value) { + if (pattern && ((match = pattern.match(/^\/(.*)\/([gim]*)$/)) ? (pattern = new RegExp(match[1], match[2]), patternValidator = function(value) { return validate(pattern, value); }) : patternValidator = function(value) { var patternObj = scope.$eval(pattern); @@ -3722,7 +3722,7 @@ return { require: "ngModel", link: function(scope, element, attr, ctrl) { - var match = /\/(.*)\//.exec(attr.ngList), separator = match && RegExp(match[1]) || attr.ngList || ","; + var match = /\/(.*)\//.exec(attr.ngList), separator = match && new RegExp(match[1]) || attr.ngList || ","; ctrl.$parsers.push(function(viewValue) { if (!isUndefined(viewValue)) { var list = []; diff --git a/crates/swc_ecma_minifier/tests/projects/output/jquery-1.9.1.js b/crates/swc_ecma_minifier/tests/projects/output/jquery-1.9.1.js index ee62767a671..65f242062fc 100644 --- a/crates/swc_ecma_minifier/tests/projects/output/jquery-1.9.1.js +++ b/crates/swc_ecma_minifier/tests/projects/output/jquery-1.9.1.js @@ -1114,7 +1114,7 @@ var i, cachedruns, Expr, getText, isXML, compile, hasDuplicate, outermostContext, setDocument, document, docElem, documentIsXML, rbuggyQSA, rbuggyMatches, matches, contains, sortOrder, expando = "sizzle" + -new Date(), preferredDoc = window1.document, support = {}, dirruns = 0, done = 0, classCache = createCache(), tokenCache = createCache(), compilerCache = createCache(), strundefined = "undefined", arr = [], pop = arr.pop, push = arr.push, slice = arr.slice, indexOf = arr.indexOf || function(elem) { for(var i = 0, len = this.length; i < len; i++)if (this[i] === elem) return i; return -1; - }, whitespace = "[\\x20\\t\\r\\n\\f]", characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", identifier = characterEncoding.replace("w", "w#"), attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace(3, 8) + ")*)|.*)\\)|)", rtrim = RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"), rcomma = RegExp("^" + whitespace + "*," + whitespace + "*"), rcombinators = RegExp("^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*"), rpseudo = RegExp(pseudos), ridentifier = RegExp("^" + identifier + "$"), matchExpr = { + }, whitespace = "[\\x20\\t\\r\\n\\f]", characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", identifier = characterEncoding.replace("w", "w#"), attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace(3, 8) + ")*)|.*)\\)|)", rtrim = RegExp("^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g"), rcomma = RegExp("^" + whitespace + "*," + whitespace + "*"), rcombinators = RegExp("^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*"), rpseudo = new RegExp(pseudos), ridentifier = RegExp("^" + identifier + "$"), matchExpr = { ID: RegExp("^#(" + characterEncoding + ")"), CLASS: RegExp("^\\.(" + characterEncoding + ")"), NAME: RegExp("^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]"), @@ -1285,7 +1285,7 @@ div.innerHTML = "", div.querySelectorAll("[i^='']").length && rbuggyQSA.push("[*^$]=" + whitespace + "*(?:\"\"|'')"), div.querySelectorAll(":enabled").length || rbuggyQSA.push(":enabled", ":disabled"), div.querySelectorAll("*,:x"), rbuggyQSA.push(",.*:"); })), (support.matchesSelector = isNative(matches = docElem.matchesSelector || docElem.mozMatchesSelector || docElem.webkitMatchesSelector || docElem.oMatchesSelector || docElem.msMatchesSelector)) && assert(function(div) { support.disconnectedMatch = matches.call(div, "div"), matches.call(div, "[s!='']:x"), rbuggyMatches.push("!=", pseudos); - }), rbuggyQSA = RegExp(rbuggyQSA.join("|")), rbuggyMatches = RegExp(rbuggyMatches.join("|")), contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? function(a, b) { + }), rbuggyQSA = new RegExp(rbuggyQSA.join("|")), rbuggyMatches = new RegExp(rbuggyMatches.join("|")), contains = isNative(docElem.contains) || docElem.compareDocumentPosition ? function(a, b) { var adown = 9 === a.nodeType ? a.documentElement : a, bup = b && b.parentNode; return a === bup || !!(bup && 1 === bup.nodeType && (adown.contains ? adown.contains(bup) : a.compareDocumentPosition && 16 & a.compareDocumentPosition(bup))); } : function(a, b) { diff --git a/crates/swc_ecma_minifier/tests/projects/output/mootools-1.4.5.js b/crates/swc_ecma_minifier/tests/projects/output/mootools-1.4.5.js index 9bf2e7f43f7..2ca1f37a2f4 100644 --- a/crates/swc_ecma_minifier/tests/projects/output/mootools-1.4.5.js +++ b/crates/swc_ecma_minifier/tests/projects/output/mootools-1.4.5.js @@ -1108,7 +1108,7 @@ Event.Keys = {}, Event.Keys = new Hash(Event.Keys), function() { return string.replace(/[-[\]{}()*+?.\\^$|,#\s]/g, function(match) { return "\\" + match; }); - }, regexp = RegExp("^(?:\\s*(,)\\s*|\\s*(+)\\s*|(\\s+)|(+|\\*)|\\#(+)|\\.(+)|\\[\\s*(+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(//, "[" + escapeRegExp(">+~`!@$%^&={}\\;/g, "(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(//g, "(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")); + }, regexp = new RegExp("^(?:\\s*(,)\\s*|\\s*(+)\\s*|(\\s+)|(+|\\*)|\\#(+)|\\.(+)|\\[\\s*(+)(?:\\s*([*^$!~|]?=)(?:\\s*(?:([\"']?)(.*?)\\9)))?\\s*\\](?!\\])|(:+)(+)(?:\\((?:(?:([\"'])([^\\13]*)\\13)|((?:\\([^)]+\\)|[^()]*)+))\\))?)".replace(//, "[" + escapeRegExp(">+~`!@$%^&={}\\;/g, "(?:[\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])").replace(//g, "(?:[:\\w\\u00a1-\\uFFFF-]|\\\\[^\\s0-9a-f])")); function parser(rawMatch, separator, combinator, combinatorChildren, tagName, id, className1, attributeKey, attributeOperator, attributeQuote, attributeValue, pseudoMarker, pseudoClass, pseudoQuote, pseudoClassQuotedValue, pseudoClassValue) { if ((separator || -1 === separatorIndex) && (parsed.expressions[++separatorIndex] = [], combinatorIndex = -1, separator)) return ""; if (combinator || combinatorChildren || -1 === combinatorIndex) {